| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687123688123689123690123691123692123693123694123695123696123697123698123699123700123701123702123703123704123705123706123707123708123709123710123711123712123713123714123715123716123717123718123719123720123721123722123723123724123725123726123727123728123729123730123731123732123733123734123735123736123737123738123739123740123741123742123743123744123745123746123747123748123749123750123751123752123753123754123755123756123757123758123759123760123761123762123763123764123765123766123767123768123769123770123771123772123773123774123775123776123777123778123779123780123781123782123783123784123785123786123787123788123789123790123791123792123793123794123795123796123797123798123799123800123801123802123803123804123805123806123807123808123809123810123811123812123813123814123815123816123817123818123819123820123821123822123823123824123825123826123827123828123829123830123831123832123833123834123835123836123837123838123839123840123841123842123843123844123845123846123847123848123849123850123851123852123853123854123855123856123857123858123859123860123861123862123863123864123865123866123867123868123869123870123871123872123873123874123875123876123877123878123879123880123881123882123883123884123885123886123887123888123889123890123891123892123893123894123895123896123897123898123899123900123901123902123903123904123905123906123907123908123909123910123911123912123913123914123915123916123917123918123919123920123921123922123923123924123925123926123927123928123929123930123931123932123933123934123935123936123937123938123939123940123941123942123943123944123945123946123947123948123949123950123951123952123953123954123955123956123957123958123959123960123961123962123963123964123965123966123967123968123969123970123971123972123973123974123975123976123977123978123979123980123981123982123983123984123985123986123987123988123989123990123991123992123993123994123995123996123997123998123999124000124001124002124003124004124005124006124007124008124009124010124011124012124013124014124015124016124017124018124019124020124021124022124023124024124025124026124027124028124029124030124031124032124033124034124035124036124037124038124039124040124041124042124043124044124045124046124047124048124049124050124051124052124053124054124055124056124057124058124059124060124061124062124063124064124065124066124067124068124069124070124071124072124073124074124075124076124077124078124079124080124081124082124083124084124085124086124087124088124089124090124091124092124093124094124095124096124097124098124099124100124101124102124103124104124105124106124107124108124109124110124111124112124113124114124115124116124117124118124119124120124121124122124123124124124125124126124127124128124129124130124131124132124133124134124135124136124137124138124139124140124141124142124143124144124145124146124147124148124149124150124151124152124153124154124155124156124157124158124159124160124161124162124163124164124165124166124167124168124169124170124171124172124173124174124175124176124177124178124179124180124181124182124183124184124185124186124187124188124189124190124191124192124193124194124195124196124197124198124199124200124201124202124203124204124205124206124207124208124209124210124211124212124213124214124215124216124217124218124219124220124221124222124223124224124225124226124227124228124229124230124231124232124233124234124235124236124237124238124239124240124241124242124243124244124245124246124247124248124249124250124251124252124253124254124255124256124257124258124259124260124261124262124263124264124265124266124267124268124269124270124271124272124273124274124275124276124277124278124279124280124281124282124283124284124285124286124287124288124289124290124291124292124293124294124295124296124297124298124299124300124301124302124303124304124305124306124307124308124309124310124311124312124313124314124315124316124317124318124319124320124321124322124323124324124325124326124327124328124329124330124331124332124333124334124335124336124337124338124339124340124341124342124343124344124345124346124347124348124349124350124351124352124353124354124355124356124357124358124359124360124361124362124363124364124365124366124367124368124369124370124371124372124373124374124375124376124377124378124379124380124381124382124383124384124385124386124387124388124389124390124391124392124393124394124395124396124397124398124399124400124401124402124403124404124405124406124407124408124409124410124411124412124413124414124415124416124417124418124419124420124421124422124423124424124425124426124427124428124429124430124431124432124433124434124435124436124437124438124439124440124441124442124443124444124445124446124447124448124449124450124451124452124453124454124455124456124457124458124459124460124461124462124463124464124465124466124467124468124469124470124471124472124473124474124475124476124477124478124479124480124481124482124483124484124485124486124487124488124489124490124491124492124493124494124495124496124497124498124499124500124501124502124503124504124505124506124507124508124509124510124511124512124513124514124515124516124517124518124519124520124521124522124523124524124525124526124527124528124529124530124531124532124533124534124535124536124537124538124539124540124541124542124543124544124545124546124547124548124549124550124551124552124553124554124555124556124557124558124559124560124561124562124563124564124565124566124567124568124569124570124571124572124573124574124575124576124577124578124579124580124581124582124583124584124585124586124587124588124589124590124591124592124593124594124595124596124597124598124599124600124601124602124603124604124605124606124607124608124609124610124611124612124613124614124615124616124617124618124619124620124621124622124623124624124625124626124627124628124629124630124631124632124633124634124635124636124637124638124639124640124641124642124643124644124645124646124647124648124649124650124651124652124653124654124655124656124657124658124659124660124661124662124663124664124665124666124667124668124669124670124671124672124673124674124675124676124677124678124679124680124681124682124683124684124685124686124687124688124689124690124691124692124693124694124695124696124697124698124699124700124701124702124703124704124705124706124707124708124709124710124711124712124713124714124715124716124717124718124719124720124721124722124723124724124725124726124727124728124729124730124731124732124733124734124735124736124737124738124739124740124741124742124743124744124745124746124747124748124749124750124751124752124753124754124755124756124757124758124759124760124761124762124763124764124765124766124767124768124769124770124771124772124773124774124775124776124777124778124779124780124781124782124783124784124785124786124787124788124789124790124791124792124793124794124795124796124797124798124799124800124801124802124803124804124805124806124807124808124809124810124811124812124813124814124815124816124817124818124819124820124821124822124823124824124825124826124827124828124829124830124831124832124833124834124835124836124837124838124839124840124841124842124843124844124845124846124847124848124849124850124851124852124853124854124855124856124857124858124859124860124861124862124863124864124865124866124867124868124869124870124871124872124873124874124875124876124877124878124879124880124881124882124883124884124885124886124887124888124889124890124891124892124893124894124895124896124897124898124899124900124901124902124903124904124905124906124907124908124909124910124911124912124913124914124915124916124917124918124919124920124921124922124923124924124925124926124927124928124929124930124931124932124933124934124935124936124937124938124939124940124941124942124943124944124945124946124947124948124949124950124951124952124953124954124955124956124957124958124959124960124961124962124963124964124965124966124967124968124969124970124971124972124973124974124975124976124977124978124979124980124981124982124983124984124985124986124987124988124989124990124991124992124993124994124995124996124997124998124999125000125001125002125003125004125005125006125007125008125009125010125011125012125013125014125015125016125017125018125019125020125021125022125023125024125025125026125027125028125029125030125031125032125033125034125035125036125037125038125039125040125041125042125043125044125045125046125047125048125049125050125051125052125053125054125055125056125057125058125059125060125061125062125063125064125065125066125067125068125069125070125071125072125073125074125075125076125077125078125079125080125081125082125083125084125085125086125087125088125089125090125091125092125093125094125095125096125097125098125099125100125101125102125103125104125105125106125107125108125109125110125111125112125113125114125115125116125117125118125119125120125121125122125123125124125125125126125127125128125129125130125131125132125133125134125135125136125137125138125139125140125141125142125143125144125145125146125147125148125149125150125151125152125153125154125155125156125157125158125159125160125161125162125163125164125165125166125167125168125169125170125171125172125173125174125175125176125177125178125179125180125181125182125183125184125185125186125187125188125189125190125191125192125193125194125195125196125197125198125199125200125201125202125203125204125205125206125207125208125209125210125211125212125213125214125215125216125217125218125219125220125221125222125223125224125225125226125227125228125229125230125231125232125233125234125235125236125237125238125239125240125241125242125243125244125245125246125247125248125249125250125251125252125253125254125255125256125257125258125259125260125261125262125263125264125265125266125267125268125269125270125271125272125273125274125275125276125277125278125279125280125281125282125283125284125285125286125287125288125289125290125291125292125293125294125295125296125297125298125299125300125301125302125303125304125305125306125307125308125309125310125311125312125313125314125315125316125317125318125319125320125321125322125323125324125325125326125327125328125329125330125331125332125333125334125335125336125337125338125339125340125341125342125343125344125345125346125347125348125349125350125351125352125353125354125355125356125357125358125359125360125361125362125363125364125365125366125367125368125369125370125371125372125373125374125375125376125377125378125379125380125381125382125383125384125385125386125387125388125389125390125391125392125393125394125395125396125397125398125399125400125401125402125403125404125405125406125407125408125409125410125411125412125413125414125415125416125417125418125419125420125421125422125423125424125425125426125427125428125429125430125431125432125433125434125435125436125437125438125439125440125441125442125443125444125445125446125447125448125449125450125451125452125453125454125455125456125457125458125459125460125461125462125463125464125465125466125467125468125469125470125471125472125473125474125475125476125477125478125479125480125481125482125483125484125485125486125487125488125489125490125491125492125493125494125495125496125497125498125499125500125501125502125503125504125505125506125507125508125509125510125511125512125513125514125515125516125517125518125519125520125521125522125523125524125525125526125527125528125529125530125531125532125533125534125535125536125537125538125539125540125541125542125543125544125545125546125547125548125549125550125551125552125553125554125555125556125557125558125559125560125561125562125563125564125565125566125567125568125569125570125571125572125573125574125575125576125577125578125579125580125581125582125583125584125585125586125587125588125589125590125591125592125593125594125595125596125597125598125599125600125601125602125603125604125605125606125607125608125609125610125611125612125613125614125615125616125617125618125619125620125621125622125623125624125625125626125627125628125629125630125631125632125633125634125635125636125637125638125639125640125641125642125643125644125645125646125647125648125649125650125651125652125653125654125655125656125657125658125659125660125661125662125663125664125665125666125667125668125669125670125671125672125673125674125675125676125677125678125679125680125681125682125683125684125685125686125687125688125689125690125691125692125693125694125695125696125697125698125699125700125701125702125703125704125705125706125707125708125709125710125711125712125713125714125715125716125717125718125719125720125721125722125723125724125725125726125727125728125729125730125731125732125733125734125735125736125737125738125739125740125741125742125743125744125745125746125747125748125749125750125751125752125753125754125755125756125757125758125759125760125761125762125763125764125765125766125767125768125769125770125771125772125773125774125775125776125777125778125779125780125781125782125783125784125785125786125787125788125789125790125791125792125793125794125795125796125797125798125799125800125801125802125803125804125805125806125807125808125809125810125811125812125813125814125815125816125817125818125819125820125821125822125823125824125825125826125827125828125829125830125831125832125833125834125835125836125837125838125839125840125841125842125843125844125845125846125847125848125849125850125851125852125853125854125855125856125857125858125859125860125861125862125863125864125865125866125867125868125869125870125871125872125873125874125875125876125877125878125879125880125881125882125883125884125885125886125887125888125889125890125891125892125893125894125895125896125897125898125899125900125901125902125903125904125905125906125907125908125909125910125911125912125913125914125915125916125917125918125919125920125921125922125923125924125925125926125927125928125929125930125931125932125933125934125935125936125937125938125939125940125941125942125943125944125945125946125947125948125949125950125951125952125953125954125955125956125957125958125959125960125961125962125963125964125965125966125967125968125969125970125971125972125973125974125975125976125977125978125979125980125981125982125983125984125985125986125987125988125989125990125991125992125993125994125995125996125997125998125999126000126001126002126003126004126005126006126007126008126009126010126011126012126013126014126015126016126017126018126019126020126021126022126023126024126025126026126027126028126029126030126031126032126033126034126035126036126037126038126039126040126041126042126043126044126045126046126047126048126049126050126051126052126053126054126055126056126057126058126059126060126061126062126063126064126065126066126067126068126069126070126071126072126073126074126075126076126077126078126079126080126081126082126083126084126085126086126087126088126089126090126091126092126093126094126095126096126097126098126099126100126101126102126103126104126105126106126107126108126109126110126111126112126113126114126115126116126117126118126119126120126121126122126123126124126125126126126127126128126129126130126131126132126133126134126135126136126137126138126139126140126141126142126143126144126145126146126147126148126149126150126151126152126153126154126155126156126157126158126159126160126161126162126163126164126165126166126167126168126169126170126171126172126173126174126175126176126177126178126179126180126181126182126183126184126185126186126187126188126189126190126191126192126193126194126195126196126197126198126199126200126201126202126203126204126205126206126207126208126209126210126211126212126213126214126215126216126217126218126219126220126221126222126223126224126225126226126227126228126229126230126231126232126233126234126235126236126237126238126239126240126241126242126243126244126245126246126247126248126249126250126251126252126253126254126255126256126257126258126259126260126261126262126263126264126265126266126267126268126269126270126271126272126273126274126275126276126277126278126279126280126281126282126283126284126285126286126287126288126289126290126291126292126293126294126295126296126297126298126299126300126301126302126303126304126305126306126307126308126309126310126311126312126313126314126315126316126317126318126319126320126321126322126323126324126325126326126327126328126329126330126331126332126333126334126335126336126337126338126339126340126341126342126343126344126345126346126347126348126349126350126351126352126353126354126355126356126357126358126359126360126361126362126363126364126365126366126367126368126369126370126371126372126373126374126375126376126377126378126379126380126381126382126383126384126385126386126387126388126389126390126391126392126393126394126395126396126397126398126399126400126401126402126403126404126405126406126407126408126409126410126411126412126413126414126415126416126417126418126419126420126421126422126423126424126425126426126427126428126429126430126431126432126433126434126435126436126437126438126439126440126441126442126443126444126445126446126447126448126449126450126451126452126453126454126455126456126457126458126459126460126461126462126463126464126465126466126467126468126469126470126471126472126473126474126475126476126477126478126479126480126481126482126483126484126485126486126487126488126489126490126491126492126493126494126495126496126497126498126499126500126501126502126503126504126505126506126507126508126509126510126511126512126513126514126515126516126517126518126519126520126521126522126523126524126525126526126527126528126529126530126531126532126533126534126535126536126537126538126539126540126541126542126543126544126545126546126547126548126549126550126551126552126553126554126555126556126557126558126559126560126561126562126563126564126565126566126567126568126569126570126571126572126573126574126575126576126577126578126579126580126581126582126583126584126585126586126587126588126589126590126591126592126593126594126595126596126597126598126599126600126601126602126603126604126605126606126607126608126609126610126611126612126613126614126615126616126617126618126619126620126621126622126623126624126625126626126627126628126629126630126631126632126633126634126635126636126637126638126639126640126641126642126643126644126645126646126647126648126649126650126651126652126653126654126655126656126657126658126659126660126661126662126663126664126665126666126667126668126669126670126671126672126673126674126675126676126677126678126679126680126681126682126683126684126685126686126687126688126689126690126691126692126693126694126695126696126697126698126699126700126701126702126703126704126705126706126707126708126709126710126711126712126713126714126715126716126717126718126719126720126721126722126723126724126725126726126727126728126729126730126731126732126733126734126735126736126737126738126739126740126741126742126743126744126745126746126747126748126749126750126751126752126753126754126755126756126757126758126759126760126761126762126763126764126765126766126767126768126769126770126771126772126773126774126775126776126777126778126779126780126781126782126783126784126785126786126787126788126789126790126791126792126793126794126795126796126797126798126799126800126801126802126803126804126805126806126807126808126809126810126811126812126813126814126815126816126817126818126819126820126821126822126823126824126825126826126827126828126829126830126831126832126833126834126835126836126837126838126839126840126841126842126843126844126845126846126847126848126849126850126851126852126853126854126855126856126857126858126859126860126861126862126863126864126865126866126867126868126869126870126871126872126873126874126875126876126877126878126879126880126881126882126883126884126885126886126887126888126889126890126891126892126893126894126895126896126897126898126899126900126901126902126903126904126905126906126907126908126909126910126911126912126913126914126915126916126917126918126919126920126921126922126923126924126925126926126927126928126929126930126931126932126933126934126935126936126937126938126939126940126941126942126943126944126945126946126947126948126949126950126951126952126953126954126955126956126957126958126959126960126961126962126963126964126965126966126967126968126969126970126971126972126973126974126975126976126977126978126979126980126981126982126983126984126985126986126987126988126989126990126991126992126993126994126995126996126997126998126999127000127001127002127003127004127005127006127007127008127009127010127011127012127013127014127015127016127017127018127019127020127021127022127023127024127025127026127027127028127029127030127031127032127033127034127035127036127037127038127039127040127041127042127043127044127045127046127047127048127049127050127051127052127053127054127055127056127057127058127059127060127061127062127063127064127065127066127067127068127069127070127071127072127073127074127075127076127077127078127079127080127081127082127083127084127085127086127087127088127089127090127091127092127093127094127095127096127097127098127099127100127101127102127103127104127105127106127107127108127109127110127111127112127113127114127115127116127117127118127119127120127121127122127123127124127125127126127127127128127129127130127131127132127133127134127135127136127137127138127139127140127141127142127143127144127145127146127147127148127149127150127151127152127153127154127155127156127157127158127159127160127161127162127163127164127165127166127167127168127169127170127171127172127173127174127175127176127177127178127179127180127181127182127183127184127185127186127187127188127189127190127191127192127193127194127195127196127197127198127199127200127201127202127203127204127205127206127207127208127209127210127211127212127213127214127215127216127217127218127219127220127221127222127223127224127225127226127227127228127229127230127231127232127233127234127235127236127237127238127239127240127241127242127243127244127245127246127247127248127249127250127251127252127253127254127255127256127257127258127259127260127261127262127263127264127265127266127267127268127269127270127271127272127273127274127275127276127277127278127279127280127281127282127283127284127285127286127287127288127289127290127291127292127293127294127295127296127297127298127299127300127301127302127303127304127305127306127307127308127309127310127311127312127313127314127315127316127317127318127319127320127321127322127323127324127325127326127327127328127329127330127331127332127333127334127335127336127337127338127339127340127341127342127343127344127345127346127347127348127349127350127351127352127353127354127355127356127357127358127359127360127361127362127363127364127365127366127367127368127369127370127371127372127373127374127375127376127377127378127379127380127381127382127383127384127385127386127387127388127389127390127391127392127393127394127395127396127397127398127399127400127401127402127403127404127405127406127407127408127409127410127411127412127413127414127415127416127417127418127419127420127421127422127423127424127425127426127427127428127429127430127431127432127433127434127435127436127437127438127439127440127441127442127443127444127445127446127447127448127449127450127451127452127453127454127455127456127457127458127459127460127461127462127463127464127465127466127467127468127469127470127471127472127473127474127475127476127477127478127479127480127481127482127483127484127485127486127487127488127489127490127491127492127493127494127495127496127497127498127499127500127501127502127503127504127505127506127507127508127509127510127511127512127513127514127515127516127517127518127519127520127521127522127523127524127525127526127527127528127529127530127531127532127533127534127535127536127537127538127539127540127541127542127543127544127545127546127547127548127549127550127551127552127553127554127555127556127557127558127559127560127561127562127563127564127565127566127567127568127569127570127571127572127573127574127575127576127577127578127579127580127581127582127583127584127585127586127587127588127589127590127591127592127593127594127595127596127597127598127599127600127601127602127603127604127605127606127607127608127609127610127611127612127613127614127615127616127617127618127619127620127621127622127623127624127625127626127627127628127629127630127631127632127633127634127635127636127637127638127639127640127641127642127643127644127645127646127647127648127649127650127651127652127653127654127655127656127657127658127659127660127661127662127663127664127665127666127667127668127669127670127671127672127673127674127675127676127677127678127679127680127681127682127683127684127685127686127687127688127689127690127691127692127693127694127695127696127697127698127699127700127701127702127703127704127705127706127707127708127709127710127711127712127713127714127715127716127717127718127719127720127721127722127723127724127725127726127727127728127729127730127731127732127733127734127735127736127737127738127739127740127741127742127743127744127745127746127747127748127749127750127751127752127753127754127755127756127757127758127759127760127761127762127763127764127765127766127767127768127769127770127771127772127773127774127775127776127777127778127779127780127781127782127783127784127785127786127787127788127789127790127791127792127793127794127795127796127797127798127799127800127801127802127803127804127805127806127807127808127809127810127811127812127813127814127815127816127817127818127819127820127821127822127823127824127825127826127827127828127829127830127831127832127833127834127835127836127837127838127839127840127841127842127843127844127845127846127847127848127849127850127851127852127853127854127855127856127857127858127859127860127861127862127863127864127865127866127867127868127869127870127871127872127873127874127875127876127877127878127879127880127881127882127883127884127885127886127887127888127889127890127891127892127893127894127895127896127897127898127899127900127901127902127903127904127905127906127907127908127909127910127911127912127913127914127915127916127917127918127919127920127921127922127923127924127925127926127927127928127929127930127931127932127933127934127935127936127937127938127939127940127941127942127943127944127945127946127947127948127949127950127951127952127953127954127955127956127957127958127959127960127961127962127963127964127965127966127967127968127969127970127971127972127973127974127975127976127977127978127979127980127981127982127983127984127985127986127987127988127989127990127991127992127993127994127995127996127997127998127999128000128001128002128003128004128005128006128007128008128009128010128011128012128013128014128015128016128017128018128019128020128021128022128023128024128025128026128027128028128029128030128031128032128033128034128035128036128037128038128039128040128041128042128043128044128045128046128047128048128049128050128051128052128053128054128055128056128057128058128059128060128061128062128063128064128065128066128067128068128069128070128071128072128073128074128075128076128077128078128079128080128081128082128083128084128085128086128087128088128089128090128091128092128093128094128095128096128097128098128099128100128101128102128103128104128105128106128107128108128109128110128111128112128113128114128115128116128117128118128119128120128121128122128123128124128125128126128127128128128129128130128131128132128133128134128135128136128137128138128139128140128141128142128143128144128145128146128147128148128149128150128151128152128153128154128155128156128157128158128159128160128161128162128163128164128165128166128167128168128169128170128171128172128173128174128175128176128177128178128179128180128181128182128183128184128185128186128187128188128189128190128191128192128193128194128195128196128197128198128199128200128201128202128203128204128205128206128207128208128209128210128211128212128213128214128215128216128217128218128219128220128221128222128223128224128225128226128227128228128229128230128231128232128233128234128235128236128237128238128239128240128241128242128243128244128245128246128247128248128249128250128251128252128253128254128255128256128257128258128259128260128261128262128263128264128265128266128267128268128269128270128271128272128273128274128275128276128277128278128279128280128281128282128283128284128285128286128287128288128289128290128291128292128293128294128295128296128297128298128299128300128301128302128303128304128305128306128307128308128309128310128311128312128313128314128315128316128317128318128319128320128321128322128323128324128325128326128327128328128329128330128331128332128333128334128335128336128337128338128339128340128341128342128343128344128345128346128347128348128349128350128351128352128353128354128355128356128357128358128359128360128361128362128363128364128365128366128367128368128369128370128371128372128373128374128375128376128377128378128379128380128381128382128383128384128385128386128387128388128389128390128391128392128393128394128395128396128397128398128399128400128401128402128403128404128405128406128407128408128409128410128411128412128413128414128415128416128417128418128419128420128421128422128423128424128425128426128427128428128429128430128431128432128433128434128435128436128437128438128439128440128441128442128443128444128445128446128447128448128449128450128451128452128453128454128455128456128457128458128459128460128461128462128463128464128465128466128467128468128469128470128471128472128473128474128475128476128477128478128479128480128481128482128483128484128485128486128487128488128489128490128491128492128493128494128495128496128497128498128499128500128501128502128503128504128505128506128507128508128509128510128511128512128513128514128515128516128517128518128519128520128521128522128523128524128525128526128527128528128529128530128531128532128533128534128535128536128537128538128539128540128541128542128543128544128545128546128547128548128549128550128551128552128553128554128555128556128557128558128559128560128561128562128563128564128565128566128567128568128569128570128571128572128573128574128575128576128577128578128579128580128581128582128583128584128585128586128587128588128589128590128591128592128593128594128595128596128597128598128599128600128601128602128603128604128605128606128607128608128609128610128611128612128613128614128615128616128617128618128619128620128621128622128623128624128625128626128627128628128629128630128631128632128633128634128635128636128637128638128639128640128641128642128643128644128645128646128647128648128649128650128651128652128653128654128655128656128657128658128659128660128661128662128663128664128665128666128667128668128669128670128671128672128673128674128675128676128677128678128679128680128681128682128683128684128685128686128687128688128689128690128691128692128693128694128695128696128697128698128699128700128701128702128703128704128705128706128707128708128709128710128711128712128713128714128715128716128717128718128719128720128721128722128723128724128725128726128727128728128729128730128731128732128733128734128735128736128737128738128739128740128741128742128743128744128745128746128747128748128749128750128751128752128753128754128755128756128757128758128759128760128761128762128763128764128765128766128767128768128769128770128771128772128773128774128775128776128777128778128779128780128781128782128783128784128785128786128787128788128789128790128791128792128793128794128795128796128797128798128799128800128801128802128803128804128805128806128807128808128809128810128811128812128813128814128815128816128817128818128819128820128821128822128823128824128825128826128827128828128829128830128831128832128833128834128835128836128837128838128839128840128841128842128843128844128845128846128847128848128849128850128851128852128853128854128855128856128857128858128859128860128861128862128863128864128865128866128867128868128869128870128871128872128873128874128875128876128877128878128879128880128881128882128883128884128885128886128887128888128889128890128891128892128893128894128895128896128897128898128899128900128901128902128903128904128905128906128907128908128909128910128911128912128913128914128915128916128917128918128919128920128921128922128923128924128925128926128927128928128929128930128931128932128933128934128935128936128937128938128939128940128941128942128943128944128945128946128947128948128949128950128951128952128953128954128955128956128957128958128959128960128961128962128963128964128965128966128967128968128969128970128971128972128973128974128975128976128977128978128979128980128981128982128983128984128985128986128987128988128989128990128991128992128993128994128995128996128997128998128999129000129001129002129003129004129005129006129007129008129009129010129011129012129013129014129015129016129017129018129019129020129021129022129023129024129025129026129027129028129029129030129031129032129033129034129035129036129037129038129039129040129041129042129043129044129045129046129047129048129049129050129051129052129053129054129055129056129057129058129059129060129061129062129063129064129065129066129067129068129069129070129071129072129073129074129075129076129077129078129079129080129081129082129083129084129085129086129087129088129089129090129091129092129093129094129095129096129097129098129099129100129101129102129103129104129105129106129107129108129109129110129111129112129113129114129115129116129117129118129119129120129121129122129123129124129125129126129127129128129129129130129131129132129133129134129135129136129137129138129139129140129141129142129143129144129145129146129147129148129149129150129151129152129153129154129155129156129157129158129159129160129161129162129163129164129165129166129167129168129169129170129171129172129173129174129175129176129177129178129179129180129181129182129183129184129185129186129187129188129189129190129191129192129193129194129195129196129197129198129199129200129201129202129203129204129205129206129207129208129209129210129211129212129213129214129215129216129217129218129219129220129221129222129223129224129225129226129227129228129229129230129231129232129233129234129235129236129237129238129239129240129241129242129243129244129245129246129247129248129249129250129251129252129253129254129255129256129257129258129259129260129261129262129263129264129265129266129267129268129269129270129271129272129273129274129275129276129277129278129279129280129281129282129283129284129285129286129287129288129289129290129291129292129293129294129295129296129297129298129299129300129301129302129303129304129305129306129307129308129309129310129311129312129313129314129315129316129317129318129319129320129321129322129323129324129325129326129327129328129329129330129331129332129333129334129335129336129337129338129339129340129341129342129343129344129345129346129347129348129349129350129351129352129353129354129355129356129357129358129359129360129361129362129363129364129365129366129367129368129369129370129371129372129373129374129375129376129377129378129379129380129381129382129383129384129385129386129387129388129389129390129391129392129393129394129395129396129397129398129399129400129401129402129403129404129405129406129407129408129409129410129411129412129413129414129415129416129417129418129419129420129421129422129423129424129425129426129427129428129429129430129431129432129433129434129435129436129437129438129439129440129441129442129443129444129445129446129447129448129449129450129451129452129453129454129455129456129457129458129459129460129461129462129463129464129465129466129467129468129469129470129471129472129473129474129475129476129477129478129479129480129481129482129483129484129485129486129487129488129489129490129491129492129493129494129495129496129497129498129499129500129501129502129503129504129505129506129507129508129509129510129511129512129513129514129515129516129517129518129519129520129521129522129523129524129525129526129527129528129529129530129531129532129533129534129535129536129537129538129539129540129541129542129543129544129545129546129547129548129549129550129551129552129553129554129555129556129557129558129559129560129561129562129563129564129565129566129567129568129569129570129571129572129573129574129575129576129577129578129579129580129581129582129583129584129585129586129587129588129589129590129591129592129593129594129595129596129597129598129599129600129601129602129603129604129605129606129607129608129609129610129611129612129613129614129615129616129617129618129619129620129621129622129623129624129625129626129627129628129629129630129631129632129633129634129635129636129637129638129639129640129641129642129643129644129645129646129647129648129649129650129651129652129653129654129655129656129657129658129659129660129661129662129663129664129665129666129667129668129669129670129671129672129673129674129675129676129677129678129679129680129681129682129683129684129685129686129687129688129689129690129691129692129693129694129695129696129697129698129699129700129701129702129703129704129705129706129707129708129709129710129711129712129713129714129715129716129717129718129719129720129721129722129723129724129725129726129727129728129729129730129731129732129733129734129735129736129737129738129739129740129741129742129743129744129745129746129747129748129749129750129751129752129753129754129755129756129757129758129759129760129761129762129763129764129765129766129767129768129769129770129771129772129773129774129775129776129777129778129779129780129781129782129783129784129785129786129787129788129789129790129791129792129793129794129795129796129797129798129799129800129801129802129803129804129805129806129807129808129809129810129811129812129813129814129815129816129817129818129819129820129821129822129823129824129825129826129827129828129829129830129831129832129833129834129835129836129837129838129839129840129841129842129843129844129845129846129847129848129849129850129851129852129853129854129855129856129857129858129859129860129861129862129863129864129865129866129867129868129869129870129871129872129873129874129875129876129877129878129879129880129881129882129883129884129885129886129887129888129889129890129891129892129893129894129895129896129897129898129899129900129901129902129903129904129905129906129907129908129909129910129911129912129913129914129915129916129917129918129919129920129921129922129923129924129925129926129927129928129929129930129931129932129933129934129935129936129937129938129939129940129941129942129943129944129945129946129947129948129949129950129951129952129953129954129955129956129957129958129959129960129961129962129963129964129965129966129967129968129969129970129971129972129973129974129975129976129977129978129979129980129981129982129983129984129985129986129987129988129989129990129991129992129993129994129995129996129997129998129999130000130001130002130003130004130005130006130007130008130009130010130011130012130013130014130015130016130017130018130019130020130021130022130023130024130025130026130027130028130029130030130031130032130033130034130035130036130037130038130039130040130041130042130043130044130045130046130047130048130049130050130051130052130053130054130055130056130057130058130059130060130061130062130063130064130065130066130067130068130069130070130071130072130073130074130075130076130077130078130079130080130081130082130083130084130085130086130087130088130089130090130091130092130093130094130095130096130097130098130099130100130101130102130103130104130105130106130107130108130109130110130111130112130113130114130115130116130117130118130119130120130121130122130123130124130125130126130127130128130129130130130131130132130133130134130135130136130137130138130139130140130141130142130143130144130145130146130147130148130149130150130151130152130153130154130155130156130157130158130159130160130161130162130163130164130165130166130167130168130169130170130171130172130173130174130175130176130177130178130179130180130181130182130183130184130185130186130187130188130189130190130191130192130193130194130195130196130197130198130199130200130201130202130203130204130205130206130207130208130209130210130211130212130213130214130215130216130217130218130219130220130221130222130223130224130225130226130227130228130229130230130231130232130233130234130235130236130237130238130239130240130241130242130243130244130245130246130247130248130249130250130251130252130253130254130255130256130257130258130259130260130261130262130263130264130265130266130267130268130269130270130271130272130273130274130275130276130277130278130279130280130281130282130283130284130285130286130287130288130289130290130291130292130293130294130295130296130297130298130299130300130301130302130303130304130305130306130307130308130309130310130311130312130313130314130315130316130317130318130319130320130321130322130323130324130325130326130327130328130329130330130331130332130333130334130335130336130337130338130339130340130341130342130343130344130345130346130347130348130349130350130351130352130353130354130355130356130357130358130359130360130361130362130363130364130365130366130367130368130369130370130371130372130373130374130375130376130377130378130379130380130381130382130383130384130385130386130387130388130389130390130391130392130393130394130395130396130397130398130399130400130401130402130403130404130405130406130407130408130409130410130411130412130413130414130415130416130417130418130419130420130421130422130423130424130425130426130427130428130429130430130431130432130433130434130435130436130437130438130439130440130441130442130443130444130445130446130447130448130449130450130451130452130453130454130455130456130457130458130459130460130461130462130463130464130465130466130467130468130469130470130471130472130473130474130475130476130477130478130479130480130481130482130483130484130485130486130487130488130489130490130491130492130493130494130495130496130497130498130499130500130501130502130503130504130505130506130507130508130509130510130511130512130513130514130515130516130517130518130519130520130521130522130523130524130525130526130527130528130529130530130531130532130533130534130535130536130537130538130539130540130541130542130543130544130545130546130547130548130549130550130551130552130553130554130555130556130557130558130559130560130561130562130563130564130565130566130567130568130569130570130571130572130573130574130575130576130577130578130579130580130581130582130583130584130585130586130587130588130589130590130591130592130593130594130595130596130597130598130599130600130601130602130603130604130605130606130607130608130609130610130611130612130613130614130615130616130617130618130619130620130621130622130623130624130625130626130627130628130629130630130631130632130633130634130635130636130637130638130639130640130641130642130643130644130645130646130647130648130649130650130651130652130653130654130655130656130657130658130659130660130661130662130663130664130665130666130667130668130669130670130671130672130673130674130675130676130677130678130679130680130681130682130683130684130685130686130687130688130689130690130691130692130693130694130695130696130697130698130699130700130701130702130703130704130705130706130707130708130709130710130711130712130713130714130715130716130717130718130719130720130721130722130723130724130725130726130727130728130729130730130731130732130733130734130735130736130737130738130739130740130741130742130743130744130745130746130747130748130749130750130751130752130753130754130755130756130757130758130759130760130761130762130763130764130765130766130767130768130769130770130771130772130773130774130775130776130777130778130779130780130781130782130783130784130785130786130787130788130789130790130791130792130793130794130795130796130797130798130799130800130801130802130803130804130805130806130807130808130809130810130811130812130813130814130815130816130817130818130819130820130821130822130823130824130825130826130827130828130829130830130831130832130833130834130835130836130837130838130839130840130841130842130843130844130845130846130847130848130849130850130851130852130853130854130855130856130857130858130859130860130861130862130863130864130865130866130867130868130869130870130871130872130873130874130875130876130877130878130879130880130881130882130883130884130885130886130887130888130889130890130891130892130893130894130895130896130897130898130899130900130901130902130903130904130905130906130907130908130909130910130911130912130913130914130915130916130917130918130919130920130921130922130923130924130925130926130927130928130929130930130931130932130933130934130935130936130937130938130939130940130941130942130943130944130945130946130947130948130949130950130951130952130953130954130955130956130957130958130959130960130961130962130963130964130965130966130967130968130969130970130971130972130973130974130975130976130977130978130979130980130981130982130983130984130985130986130987130988130989130990130991130992130993130994130995130996130997130998130999131000131001131002131003131004131005131006131007131008131009131010131011131012131013131014131015131016131017131018131019131020131021131022131023131024131025131026131027131028131029131030131031131032131033131034131035131036131037131038131039131040131041131042131043131044131045131046131047131048131049131050131051131052131053131054131055131056131057131058131059131060131061131062131063131064131065131066131067131068131069131070131071131072131073131074131075131076131077131078131079131080131081131082131083131084131085131086131087131088131089131090131091131092131093131094131095131096131097131098131099131100131101131102131103131104131105131106131107131108131109131110131111131112131113131114131115131116131117131118131119131120131121131122131123131124131125131126131127131128131129131130131131131132131133131134131135131136131137131138131139131140131141131142131143131144131145131146131147131148131149131150131151131152131153131154131155131156131157131158131159131160131161131162131163131164131165131166131167131168131169131170131171131172131173131174131175131176131177131178131179131180131181131182131183131184131185131186131187131188131189131190131191131192131193131194131195131196131197131198131199131200131201131202131203131204131205131206131207131208131209131210131211131212131213131214131215131216131217131218131219131220131221131222131223131224131225131226131227131228131229131230131231131232131233131234131235131236131237131238131239131240131241131242131243131244131245131246131247131248131249131250131251131252131253131254131255131256131257131258131259131260131261131262131263131264131265131266131267131268131269131270131271131272131273131274131275131276131277131278131279131280131281131282131283131284131285131286131287131288131289131290131291131292131293131294131295131296131297131298131299131300131301131302131303131304131305131306131307131308131309131310131311131312131313131314131315131316131317131318131319131320131321131322131323131324131325131326131327131328131329131330131331131332131333131334131335131336131337131338131339131340131341131342131343131344131345131346131347131348131349131350131351131352131353131354131355131356131357131358131359131360131361131362131363131364131365131366131367131368131369131370131371131372131373131374131375131376131377131378131379131380131381131382131383131384131385131386131387131388131389131390131391131392131393131394131395131396131397131398131399131400131401131402131403131404131405131406131407131408131409131410131411131412131413131414131415131416131417131418131419131420131421131422131423131424131425131426131427131428131429131430131431131432131433131434131435131436131437131438131439131440131441131442131443131444131445131446131447131448131449131450131451131452131453131454131455131456131457131458131459131460131461131462131463131464131465131466131467131468131469131470131471131472131473131474131475131476131477131478131479131480131481131482131483131484131485131486131487131488131489131490131491131492131493131494131495131496131497131498131499131500131501131502131503131504131505131506131507131508131509131510131511131512131513131514131515131516131517131518131519131520131521131522131523131524131525131526131527131528131529131530131531131532131533131534131535131536131537131538131539131540131541131542131543131544131545131546131547131548131549131550131551131552131553131554131555131556131557131558131559131560131561131562131563131564131565131566131567131568131569131570131571131572131573131574131575131576131577131578131579131580131581131582131583131584131585131586131587131588131589131590131591131592131593131594131595131596131597131598131599131600131601131602131603131604131605131606131607131608131609131610131611131612131613131614131615131616131617131618131619131620131621131622131623131624131625131626131627131628131629131630131631131632131633131634131635131636131637131638131639131640131641131642131643131644131645131646131647131648131649131650131651131652131653131654131655131656131657131658131659131660131661131662131663131664131665131666131667131668131669131670131671131672131673131674131675131676131677131678131679131680131681131682131683131684131685131686131687131688131689131690131691131692131693131694131695131696131697131698131699131700131701131702131703131704131705131706131707131708131709131710131711131712131713131714131715131716131717131718131719131720131721131722131723131724131725131726131727131728131729131730131731131732131733131734131735131736131737131738131739131740131741131742131743131744131745131746131747131748131749131750131751131752131753131754131755131756131757131758131759131760131761131762131763131764131765131766131767131768131769131770131771131772131773131774131775131776131777131778131779131780131781131782131783131784131785131786131787131788131789131790131791131792131793131794131795131796131797131798131799131800131801131802131803131804131805131806131807131808131809131810131811131812131813131814131815131816131817131818131819131820131821131822131823131824131825131826131827131828131829131830131831131832131833131834131835131836131837131838131839131840131841131842131843131844131845131846131847131848131849131850131851131852131853131854131855131856131857131858131859131860131861131862131863131864131865131866131867131868131869131870131871131872131873131874131875131876131877131878131879131880131881131882131883131884131885131886131887131888131889131890131891131892131893131894131895131896131897131898131899131900131901131902131903131904131905131906131907131908131909131910131911131912131913131914131915131916131917131918131919131920131921131922131923131924131925131926131927131928131929131930131931131932131933131934131935131936131937131938131939131940131941131942131943131944131945131946131947131948131949131950131951131952131953131954131955131956131957131958131959131960131961131962131963131964131965131966131967131968131969131970131971131972131973131974131975131976131977131978131979131980131981131982131983131984131985131986131987131988131989131990131991131992131993131994131995131996131997131998131999132000132001132002132003132004132005132006132007132008132009132010132011132012132013132014132015132016132017132018132019132020132021132022132023132024132025132026132027132028132029132030132031132032132033132034132035132036132037132038132039132040132041132042132043132044132045132046132047132048132049132050132051132052132053132054132055132056132057132058132059132060132061132062132063132064132065132066132067132068132069132070132071132072132073132074132075132076132077132078132079132080132081132082132083132084132085132086132087132088132089132090132091132092132093132094132095132096132097132098132099132100132101132102132103132104132105132106132107132108132109132110132111132112132113132114132115132116132117132118132119132120132121132122132123132124132125132126132127132128132129132130132131132132132133132134132135132136132137132138132139132140132141132142132143132144132145132146132147132148132149132150132151132152132153132154132155132156132157132158132159132160132161132162132163132164132165132166132167132168132169132170132171132172132173132174132175132176132177132178132179132180132181132182132183132184132185132186132187132188132189132190132191132192132193132194132195132196132197132198132199132200132201132202132203132204132205132206132207132208132209132210132211132212132213132214132215132216132217132218132219132220132221132222132223132224132225132226132227132228132229132230132231132232132233132234132235132236132237132238132239132240132241132242132243132244132245132246132247132248132249132250132251132252132253132254132255132256132257132258132259132260132261132262132263132264132265132266132267132268132269132270132271132272132273132274132275132276132277132278132279132280132281132282132283132284132285132286132287132288132289132290132291132292132293132294132295132296132297132298132299132300132301132302132303132304132305132306132307132308132309132310132311132312132313132314132315132316132317132318132319132320132321132322132323132324132325132326132327132328132329132330132331132332132333132334132335132336132337132338132339132340132341132342132343132344132345132346132347132348132349132350132351132352132353132354132355132356132357132358132359132360132361132362132363132364132365132366132367132368132369132370132371132372132373132374132375132376132377132378132379132380132381132382132383132384132385132386132387132388132389132390132391132392132393132394132395132396132397132398132399132400132401132402132403132404132405132406132407132408132409132410132411132412132413132414132415132416132417132418132419132420132421132422132423132424132425132426132427132428132429132430132431132432132433132434132435132436132437132438132439132440132441132442132443132444132445132446132447132448132449132450132451132452132453132454132455132456132457132458132459132460132461132462132463132464132465132466132467132468132469132470132471132472132473132474132475132476132477132478132479132480132481132482132483132484132485132486132487132488132489132490132491132492132493132494132495132496132497132498132499132500132501132502132503132504132505132506132507132508132509132510132511132512132513132514132515132516132517132518132519132520132521132522132523132524132525132526132527132528132529132530132531132532132533132534132535132536132537132538132539132540132541132542132543132544132545132546132547132548132549132550132551132552132553132554132555132556132557132558132559132560132561132562132563132564132565132566132567132568132569132570132571132572132573132574132575132576132577132578132579132580132581132582132583132584132585132586132587132588132589132590132591132592132593132594132595132596132597132598132599132600132601132602132603132604132605132606132607132608132609132610132611132612132613132614132615132616132617132618132619132620132621132622132623132624132625132626132627132628132629132630132631132632132633132634132635132636132637132638132639132640132641132642132643132644132645132646132647132648132649132650132651132652132653132654132655132656132657132658132659132660132661132662132663132664132665132666132667132668132669132670132671132672132673132674132675132676132677132678132679132680132681132682132683132684132685132686132687132688132689132690132691132692132693132694132695132696132697132698132699132700132701132702132703132704132705132706132707132708132709132710132711132712132713132714132715132716132717132718132719132720132721132722132723132724132725132726132727132728132729132730132731132732132733132734132735132736132737132738132739132740132741132742132743132744132745132746132747132748132749132750132751132752132753132754132755132756132757132758132759132760132761132762132763132764132765132766132767132768132769132770132771132772132773132774132775132776132777132778132779132780132781132782132783132784132785132786132787132788132789132790132791132792132793132794132795132796132797132798132799132800132801132802132803132804132805132806132807132808132809132810132811132812132813132814132815132816132817132818132819132820132821132822132823132824132825132826132827132828132829132830132831132832132833132834132835132836132837132838132839132840132841132842132843132844132845132846132847132848132849132850132851132852132853132854132855132856132857132858132859132860132861132862132863132864132865132866132867132868132869132870132871132872132873132874132875132876132877132878132879132880132881132882132883132884132885132886132887132888132889132890132891132892132893132894132895132896132897132898132899132900132901132902132903132904132905132906132907132908132909132910132911132912132913132914132915132916132917132918132919132920132921132922132923132924132925132926132927132928132929132930132931132932132933132934132935132936132937132938132939132940132941132942132943132944132945132946132947132948132949132950132951132952132953132954132955132956132957132958132959132960132961132962132963132964132965132966132967132968132969132970132971132972132973132974132975132976132977132978132979132980132981132982132983132984132985132986132987132988132989132990132991132992132993132994132995132996132997132998132999133000133001133002133003133004133005133006133007133008133009133010133011133012133013133014133015133016133017133018133019133020133021133022133023133024133025133026133027133028133029133030133031133032133033133034133035133036133037133038133039133040133041133042133043133044133045133046133047133048133049133050133051133052133053133054133055133056133057133058133059133060133061133062133063133064133065133066133067133068133069133070133071133072133073133074133075133076133077133078133079133080133081133082133083133084133085133086133087133088133089133090133091133092133093133094133095133096133097133098133099133100133101133102133103133104133105133106133107133108133109133110133111133112133113133114133115133116133117133118133119133120133121133122133123133124133125133126133127133128133129133130133131133132133133133134133135133136133137133138133139133140133141133142133143133144133145133146133147133148133149133150133151133152133153133154133155133156133157133158133159133160133161133162133163133164133165133166133167133168133169133170133171133172133173133174133175133176133177133178133179133180133181133182133183133184133185133186133187133188133189133190133191133192133193133194133195133196133197133198133199133200133201133202133203133204133205133206133207133208133209133210133211133212133213133214133215133216133217133218133219133220133221133222133223133224133225133226133227133228133229133230133231133232133233133234133235133236133237133238133239133240133241133242133243133244133245133246133247133248133249133250133251133252133253133254133255133256133257133258133259133260133261133262133263133264133265133266133267133268133269133270133271133272133273133274133275133276133277133278133279133280133281133282133283133284133285133286133287133288133289133290133291133292133293133294133295133296133297133298133299133300133301133302133303133304133305133306133307133308133309133310133311133312133313133314133315133316133317133318133319133320133321133322133323133324133325133326133327133328133329133330133331133332133333133334133335133336133337133338133339133340133341133342133343133344133345133346133347133348133349133350133351133352133353133354133355133356133357133358133359133360133361133362133363133364133365133366133367133368133369133370133371133372133373133374133375133376133377133378133379133380133381133382133383133384133385133386133387133388133389133390133391133392133393133394133395133396133397133398133399133400133401133402133403133404133405133406133407133408133409133410133411133412133413133414133415133416133417133418133419133420133421133422133423133424133425133426133427133428133429133430133431133432133433133434133435133436133437133438133439133440133441133442133443133444133445133446133447133448133449133450133451133452133453133454133455133456133457133458133459133460133461133462133463133464133465133466133467133468133469133470133471133472133473133474133475133476133477133478133479133480133481133482133483133484133485133486133487133488133489133490133491133492133493133494133495133496133497133498133499133500133501133502133503133504133505133506133507133508133509133510133511133512133513133514133515133516133517133518133519133520133521133522133523133524133525133526133527133528133529133530133531133532133533133534133535133536133537133538133539133540133541133542133543133544133545133546133547133548133549133550133551133552133553133554133555133556133557133558133559133560133561133562133563133564133565133566133567133568133569133570133571133572133573133574133575133576133577133578133579133580133581133582133583133584133585133586133587133588133589133590133591133592133593133594133595133596133597133598133599133600133601133602133603133604133605133606133607133608133609133610133611133612133613133614133615133616133617133618133619133620133621133622133623133624133625133626133627133628133629133630133631133632133633133634133635133636133637133638133639133640133641133642133643133644133645133646133647133648133649133650133651133652133653133654133655133656133657133658133659133660133661133662133663133664133665133666133667133668133669133670133671133672133673133674133675133676133677133678133679133680133681133682133683133684133685133686133687133688133689133690133691133692133693133694133695133696133697133698133699133700133701133702133703133704133705133706133707133708133709133710133711133712133713133714133715133716133717133718133719133720133721133722133723133724133725133726133727133728133729133730133731133732133733133734133735133736133737133738133739133740133741133742133743133744133745133746133747133748133749133750133751133752133753133754133755133756133757133758133759133760133761133762133763133764133765133766133767133768133769133770133771133772133773133774133775133776133777133778133779133780133781133782133783133784133785133786133787133788133789133790133791133792133793133794133795133796133797133798133799133800133801133802133803133804133805133806133807133808133809133810133811133812133813133814133815133816133817133818133819133820133821133822133823133824133825133826133827133828133829133830133831133832133833133834133835133836133837133838133839133840133841133842133843133844133845133846133847133848133849133850133851133852133853133854133855133856133857133858133859133860133861133862133863133864133865133866133867133868133869133870133871133872133873133874133875133876133877133878133879133880133881133882133883133884133885133886133887133888133889133890133891133892133893133894133895133896133897133898133899133900133901133902133903133904133905133906133907133908133909133910133911133912133913133914133915133916133917133918133919133920133921133922133923133924133925133926133927133928133929133930133931133932133933133934133935133936133937133938133939133940133941133942133943133944133945133946133947133948133949133950133951133952133953133954133955133956133957133958133959133960133961133962133963133964133965133966133967133968133969133970133971133972133973133974133975133976133977133978133979133980133981133982133983133984133985133986133987133988133989133990133991133992133993133994133995133996133997133998133999134000134001134002134003134004134005134006134007134008134009134010134011134012134013134014134015134016134017134018134019134020134021134022134023134024134025134026134027134028134029134030134031134032134033134034134035134036134037134038134039134040134041134042134043134044134045134046134047134048134049134050134051134052134053134054134055134056134057134058134059134060134061134062134063134064134065134066134067134068134069134070134071134072134073134074134075134076134077134078134079134080134081134082134083134084134085134086134087134088134089134090134091134092134093134094134095134096134097134098134099134100134101134102134103134104134105134106134107134108134109134110134111134112134113134114134115134116134117134118134119134120134121134122134123134124134125134126134127134128134129134130134131134132134133134134134135134136134137134138134139134140134141134142134143134144134145134146134147134148134149134150134151134152134153134154134155134156134157134158134159134160134161134162134163134164134165134166134167134168134169134170134171134172134173134174134175134176134177134178134179134180134181134182134183134184134185134186134187134188134189134190134191134192134193134194134195134196134197134198134199134200134201134202134203134204134205134206134207134208134209134210134211134212134213134214134215134216134217134218134219134220134221134222134223134224134225134226134227134228134229134230134231134232134233134234134235134236134237134238134239134240134241134242134243134244134245134246134247134248134249134250134251134252134253134254134255134256134257134258134259134260134261134262134263134264134265134266134267134268134269134270134271134272134273134274134275134276134277134278134279134280134281134282134283134284134285134286134287134288134289134290134291134292134293134294134295134296134297134298134299134300134301134302134303134304134305134306134307134308134309134310134311134312134313134314134315134316134317134318134319134320134321134322134323134324134325134326134327134328134329134330134331134332134333134334134335134336134337134338134339134340134341134342134343134344134345134346134347134348134349134350134351134352134353134354134355134356134357134358134359134360134361134362134363134364134365134366134367134368134369134370134371134372134373134374134375134376134377134378134379134380134381134382134383134384134385134386134387134388134389134390134391134392134393134394134395134396134397134398134399134400134401134402134403134404134405134406134407134408134409134410134411134412134413134414134415134416134417134418134419134420134421134422134423134424134425134426134427134428134429134430134431134432134433134434134435134436134437134438134439134440134441134442134443134444134445134446134447134448134449134450134451134452134453134454134455134456134457134458134459134460134461134462134463134464134465134466134467134468134469134470134471134472134473134474134475134476134477134478134479134480134481134482134483134484134485134486134487134488134489134490134491134492134493134494134495134496134497134498134499134500134501134502134503134504134505134506134507134508134509134510134511134512134513134514134515134516134517134518134519134520134521134522134523134524134525134526134527134528134529134530134531134532134533134534134535134536134537134538134539134540134541134542134543134544134545134546134547134548134549134550134551134552134553134554134555134556134557134558134559134560134561134562134563134564134565134566134567134568134569134570134571134572134573134574134575134576134577134578134579134580134581134582134583134584134585134586134587134588134589134590134591134592134593134594134595134596134597134598134599134600134601134602134603134604134605134606134607134608134609134610134611134612134613134614134615134616134617134618134619134620134621134622134623134624134625134626134627134628134629134630134631134632134633134634134635134636134637134638134639134640134641134642134643134644134645134646134647134648134649134650134651134652134653134654134655134656134657134658134659134660134661134662134663134664134665134666134667134668134669134670134671134672134673134674134675134676134677134678134679134680134681134682134683134684134685134686134687134688134689134690134691134692134693134694134695134696134697134698134699134700134701134702134703134704134705134706134707134708134709134710134711134712134713134714134715134716134717134718134719134720134721134722134723134724134725134726134727134728134729134730134731134732134733134734134735134736134737134738134739134740134741134742134743134744134745134746134747134748134749134750134751134752134753134754134755134756134757134758134759134760134761134762134763134764134765134766134767134768134769134770134771134772134773134774134775134776134777134778134779134780134781134782134783134784134785134786134787134788134789134790134791134792134793134794134795134796134797134798134799134800134801134802134803134804134805134806134807134808134809134810134811134812134813134814134815134816134817134818134819134820134821134822134823134824134825134826134827134828134829134830134831134832134833134834134835134836134837134838134839134840134841134842134843134844134845134846134847134848134849134850134851134852134853134854134855134856134857134858134859134860134861134862134863134864134865134866134867134868134869134870134871134872134873134874134875134876134877134878134879134880134881134882134883134884134885134886134887134888134889134890134891134892134893134894134895134896134897134898134899134900134901134902134903134904134905134906134907134908134909134910134911134912134913134914134915134916134917134918134919134920134921134922134923134924134925134926134927134928134929134930134931134932134933134934134935134936134937134938134939134940134941134942134943134944134945134946134947134948134949134950134951134952134953134954134955134956134957134958134959134960134961134962134963134964134965134966134967134968134969134970134971134972134973134974134975134976134977134978134979134980134981134982134983134984134985134986134987134988134989134990134991134992134993134994134995134996134997134998134999135000135001135002135003135004135005135006135007135008135009135010135011135012135013135014135015135016135017135018135019135020135021135022135023135024135025135026135027135028135029135030135031135032135033135034135035135036135037135038135039135040135041135042135043135044135045135046135047135048135049135050135051135052135053135054135055135056135057135058135059135060135061135062135063135064135065135066135067135068135069135070135071135072135073135074135075135076135077135078135079135080135081135082135083135084135085135086135087135088135089135090135091135092135093135094135095135096135097135098135099135100135101135102135103135104135105135106135107135108135109135110135111135112135113135114135115135116135117135118135119135120135121135122135123135124135125135126135127135128135129135130135131135132135133135134135135135136135137135138135139135140135141135142135143135144135145135146135147135148135149135150135151135152135153135154135155135156135157135158135159135160135161135162135163135164135165135166135167135168135169135170135171135172135173135174135175135176135177135178135179135180135181135182135183135184135185135186135187135188135189135190135191135192135193135194135195135196135197135198135199135200135201135202135203135204135205135206135207135208135209135210135211135212135213135214135215135216135217135218135219135220135221135222135223135224135225135226135227135228135229135230135231135232135233135234135235135236135237135238135239135240135241135242135243135244135245135246135247135248135249135250135251135252135253135254135255135256135257135258135259135260135261135262135263135264135265135266135267135268135269135270135271135272135273135274135275135276135277135278135279135280135281135282135283135284135285135286135287135288135289135290135291135292135293135294135295135296135297135298135299135300135301135302135303135304135305135306135307135308135309135310135311135312135313135314135315135316135317135318135319135320135321135322135323135324135325135326135327135328135329135330135331135332135333135334135335135336135337135338135339135340135341135342135343135344135345135346135347135348135349135350135351135352135353135354135355135356135357135358135359135360135361135362135363135364135365135366135367135368135369135370135371135372135373135374135375135376135377135378135379135380135381135382135383135384135385135386135387135388135389135390135391135392135393135394135395135396135397135398135399135400135401135402135403135404135405135406135407135408135409135410135411135412135413135414135415135416135417135418135419135420135421135422135423135424135425135426135427135428135429135430135431135432135433135434135435135436135437135438135439135440135441135442135443135444135445135446135447135448135449135450135451135452135453135454135455135456135457135458135459135460135461135462135463135464135465135466135467135468135469135470135471135472135473135474135475135476135477135478135479135480135481135482135483135484135485135486135487135488135489135490135491135492135493135494135495135496135497135498135499135500135501135502135503135504135505135506135507135508135509135510135511135512135513135514135515135516135517135518135519135520135521135522135523135524135525135526135527135528135529135530135531135532135533135534135535135536135537135538135539135540135541135542135543135544135545135546135547135548135549135550135551135552135553135554135555135556135557135558135559135560135561135562135563135564135565135566135567135568135569135570135571135572135573135574135575135576135577135578135579135580135581135582135583135584135585135586135587135588135589135590135591135592135593135594135595135596135597135598135599135600135601135602135603135604135605135606135607135608135609135610135611135612135613135614135615135616135617135618135619135620135621135622135623135624135625135626135627135628135629135630135631135632135633135634135635135636135637135638135639135640135641135642135643135644135645135646135647135648135649135650135651135652135653135654135655135656135657135658135659135660135661135662135663135664135665135666135667135668135669135670135671135672135673135674135675135676135677135678135679135680135681135682135683135684135685135686135687135688135689135690135691135692135693135694135695135696135697135698135699135700135701135702135703135704135705135706135707135708135709135710135711135712135713135714135715135716135717135718135719135720135721135722135723135724135725135726135727135728135729135730135731135732135733135734135735135736135737135738135739135740135741135742135743135744135745135746135747135748135749135750135751135752135753135754135755135756135757135758135759135760135761135762135763135764135765135766135767135768135769135770135771135772135773135774135775135776135777135778135779135780135781135782135783135784135785135786135787135788135789135790135791135792135793135794135795135796135797135798135799135800135801135802135803135804135805135806135807135808135809135810135811135812135813135814135815135816135817135818135819135820135821135822135823135824135825135826135827135828135829135830135831135832135833135834135835135836135837135838135839135840135841135842135843135844135845135846135847135848135849135850135851135852135853135854135855135856135857135858135859135860135861135862135863135864135865135866135867135868135869135870135871135872135873135874135875135876135877135878135879135880135881135882135883135884135885135886135887135888135889135890135891135892135893135894135895135896135897135898135899135900135901135902135903135904135905135906135907135908135909135910135911135912135913135914135915135916135917135918135919135920135921135922135923135924135925135926135927135928135929135930135931135932135933135934135935135936135937135938135939135940135941135942135943135944135945135946135947135948135949135950135951135952135953135954135955135956135957135958135959135960135961135962135963135964135965135966135967135968135969135970135971135972135973135974135975135976135977135978135979135980135981135982135983135984135985135986135987135988135989135990135991135992135993135994135995135996135997135998135999136000136001136002136003136004136005136006136007136008136009136010136011136012136013136014136015136016136017136018136019136020136021136022136023136024136025136026136027136028136029136030136031136032136033136034136035136036136037136038136039136040136041136042136043136044136045136046136047136048136049136050136051136052136053136054136055136056136057136058136059136060136061136062136063136064136065136066136067136068136069136070136071136072136073136074136075136076136077136078136079136080136081136082136083136084136085136086136087136088136089136090136091136092136093136094136095136096136097136098136099136100136101136102136103136104136105136106136107136108136109136110136111136112136113136114136115136116136117136118136119136120136121136122136123136124136125136126136127136128136129136130136131136132136133136134136135136136136137136138136139136140136141136142136143136144136145136146136147136148136149136150136151136152136153136154136155136156136157136158136159136160136161136162136163136164136165136166136167136168136169136170136171136172136173136174136175136176136177136178136179136180136181136182136183136184136185136186136187136188136189136190136191136192136193136194136195136196136197136198136199136200136201136202136203136204136205136206136207136208136209136210136211136212136213136214136215136216136217136218136219136220136221136222136223136224136225136226136227136228136229136230136231136232136233136234136235136236136237136238136239136240136241136242136243136244136245136246136247136248136249136250136251136252136253136254136255136256136257136258136259136260136261136262136263136264136265136266136267136268136269136270136271136272136273136274136275136276136277136278136279136280136281136282136283136284136285136286136287136288136289136290136291136292136293136294136295136296136297136298136299136300136301136302136303136304136305136306136307136308136309136310136311136312136313136314136315136316136317136318136319136320136321136322136323136324136325136326136327136328136329136330136331136332136333136334136335136336136337136338136339136340136341136342136343136344136345136346136347136348136349136350136351136352136353136354136355136356136357136358136359136360136361136362136363136364136365136366136367136368136369136370136371136372136373136374136375136376136377136378136379136380136381136382136383136384136385136386136387136388136389136390136391136392136393136394136395136396136397136398136399136400136401136402136403136404136405136406136407136408136409136410136411136412136413136414136415136416136417136418136419136420136421136422136423136424136425136426136427136428136429136430136431136432136433136434136435136436136437136438136439136440136441136442136443136444136445136446136447136448136449136450136451136452136453136454136455136456136457136458136459136460136461136462136463136464136465136466136467136468136469136470136471136472136473136474136475136476136477136478136479136480136481136482136483136484136485136486136487136488136489136490136491136492136493136494136495136496136497136498136499136500136501136502136503136504136505136506136507136508136509136510136511136512136513136514136515136516136517136518136519136520136521136522136523136524136525136526136527136528136529136530136531136532136533136534136535136536136537136538136539136540136541136542136543136544136545136546136547136548136549136550136551136552136553136554136555136556136557136558136559136560136561136562136563136564136565136566136567136568136569136570136571136572136573136574136575136576136577136578136579136580136581136582136583136584136585136586136587136588136589136590136591136592136593136594136595136596136597136598136599136600136601136602136603136604136605136606136607136608136609136610136611136612136613136614136615136616136617136618136619136620136621136622136623136624136625136626136627136628136629136630136631136632136633136634136635136636136637136638136639136640136641136642136643136644136645136646136647136648136649136650136651136652136653136654136655136656136657136658136659136660136661136662136663136664136665136666136667136668136669136670136671136672136673136674136675136676136677136678136679136680136681136682136683136684136685136686136687136688136689136690136691136692136693136694136695136696136697136698136699136700136701136702136703136704136705136706136707136708136709136710136711136712136713136714136715136716136717136718136719136720136721136722136723136724136725136726136727136728136729136730136731136732136733136734136735136736136737136738136739136740136741136742136743136744136745136746136747136748136749136750136751136752136753136754136755136756136757136758136759136760136761136762136763136764136765136766136767136768136769136770136771136772136773136774136775136776136777136778136779136780136781136782136783136784136785136786136787136788136789136790136791136792136793136794136795136796136797136798136799136800136801136802136803136804136805136806136807136808136809136810136811136812136813136814136815136816136817136818136819136820136821136822136823136824136825136826136827136828136829136830136831136832136833136834136835136836136837136838136839136840136841136842136843136844136845136846136847136848136849136850136851136852136853136854136855136856136857136858136859136860136861136862136863136864136865136866136867136868136869136870136871136872136873136874136875136876136877136878136879136880136881136882136883136884136885136886136887136888136889136890136891136892136893136894136895136896136897136898136899136900136901136902136903136904136905136906136907136908136909136910136911136912136913136914136915136916136917136918136919136920136921136922136923136924136925136926136927136928136929136930136931136932136933136934136935136936136937136938136939136940136941136942136943136944136945136946136947136948136949136950136951136952136953136954136955136956136957136958136959136960136961136962136963136964136965136966136967136968136969136970136971136972136973136974136975136976136977136978136979136980136981136982136983136984136985136986136987136988136989136990136991136992136993136994136995136996136997136998136999137000137001137002137003137004137005137006137007137008137009137010137011137012137013137014137015137016137017137018137019137020137021137022137023137024137025137026137027137028137029137030137031137032137033137034137035137036137037137038137039137040137041137042137043137044137045137046137047137048137049137050137051137052137053137054137055137056137057137058137059137060137061137062137063137064137065137066137067137068137069137070137071137072137073137074137075137076137077137078137079137080137081137082137083137084137085137086137087137088137089137090137091137092137093137094137095137096137097137098137099137100137101137102137103137104137105137106137107137108137109137110137111137112137113137114137115137116137117137118137119137120137121137122137123137124137125137126137127137128137129137130137131137132137133137134137135137136137137137138137139137140137141137142137143137144137145137146137147137148137149137150137151137152137153137154137155137156137157137158137159137160137161137162137163137164137165137166137167137168137169137170137171137172137173137174137175137176137177137178137179137180137181137182137183137184137185137186137187137188137189137190137191137192137193137194137195137196137197137198137199137200137201137202137203137204137205137206137207137208137209137210137211137212137213137214137215137216137217137218137219137220137221137222137223137224137225137226137227137228137229137230137231137232137233137234137235137236137237137238137239137240137241137242137243137244137245137246137247137248137249137250137251137252137253137254137255137256137257137258137259137260137261137262137263137264137265137266137267137268137269137270137271137272137273137274137275137276137277137278137279137280137281137282137283137284137285137286137287137288137289137290137291137292137293137294137295137296137297137298137299137300137301137302137303137304137305137306137307137308137309137310137311137312137313137314137315137316137317137318137319137320137321137322137323137324137325137326137327137328137329137330137331137332137333137334137335137336137337137338137339137340137341137342137343137344137345137346137347137348137349137350137351137352137353137354137355137356137357137358137359137360137361137362137363137364137365137366137367137368137369137370137371137372137373137374137375137376137377137378137379137380137381137382137383137384137385137386137387137388137389137390137391137392137393137394137395137396137397137398137399137400137401137402137403137404137405137406137407137408137409137410137411137412137413137414137415137416137417137418137419137420137421137422137423137424137425137426137427137428137429137430137431137432137433137434137435137436137437137438137439137440137441137442137443137444137445137446137447137448137449137450137451137452137453137454137455137456137457137458137459137460137461137462137463137464137465137466137467137468137469137470137471137472137473137474137475137476137477137478137479137480137481137482137483137484137485137486137487137488137489137490137491137492137493137494137495137496137497137498137499137500137501137502137503137504137505137506137507137508137509137510137511137512137513137514137515137516137517137518137519137520137521137522137523137524137525137526137527137528137529137530137531137532137533137534137535137536137537137538137539137540137541137542137543137544137545137546137547137548137549137550137551137552137553137554137555137556137557137558137559137560137561137562137563137564137565137566137567137568137569137570137571137572137573137574137575137576137577137578137579137580137581137582137583137584137585137586137587137588137589137590137591137592137593137594137595137596137597137598137599137600137601137602137603137604137605137606137607137608137609137610137611137612137613137614137615137616137617137618137619137620137621137622137623137624137625137626137627137628137629137630137631137632137633137634137635137636137637137638137639137640137641137642137643137644137645137646137647137648137649137650137651137652137653137654137655137656137657137658137659137660137661137662137663137664137665137666137667137668137669137670137671137672137673137674137675137676137677137678137679137680137681137682137683137684137685137686137687137688137689137690137691137692137693137694137695137696137697137698137699137700137701137702137703137704137705137706137707137708137709137710137711137712137713137714137715137716137717137718137719137720137721137722137723137724137725137726137727137728137729137730137731137732137733137734137735137736137737137738137739137740137741137742137743137744137745137746137747137748137749137750137751137752137753137754137755137756137757137758137759137760137761137762137763137764137765137766137767137768137769137770137771137772137773137774137775137776137777137778137779137780137781137782137783137784137785137786137787137788137789137790137791137792137793137794137795137796137797137798137799137800137801137802137803137804137805137806137807137808137809137810137811137812137813137814137815137816137817137818137819137820137821137822137823137824137825137826137827137828137829137830137831137832137833137834137835137836137837137838137839137840137841137842137843137844137845137846137847137848137849137850137851137852137853137854137855137856137857137858137859137860137861137862137863137864137865137866137867137868137869137870137871137872137873137874137875137876137877137878137879137880137881137882137883137884137885137886137887137888137889137890137891137892137893137894137895137896137897137898137899137900137901137902137903137904137905137906137907137908137909137910137911137912137913137914137915137916137917137918137919137920137921137922137923137924137925137926137927137928137929137930137931137932137933137934137935137936137937137938137939137940137941137942137943137944137945137946137947137948137949137950137951137952137953137954137955137956137957137958137959137960137961137962137963137964137965137966137967137968137969137970137971137972137973137974137975137976137977137978137979137980137981137982137983137984137985137986137987137988137989137990137991137992137993137994137995137996137997137998137999138000138001138002138003138004138005138006138007138008138009138010138011138012138013138014138015138016138017138018138019138020138021138022138023138024138025138026138027138028138029138030138031138032138033138034138035138036138037138038138039138040138041138042138043138044138045138046138047138048138049138050138051138052138053138054138055138056138057138058138059138060138061138062138063138064138065138066138067138068138069138070138071138072138073138074138075138076138077138078138079138080138081138082138083138084138085138086138087138088138089138090138091138092138093138094138095138096138097138098138099138100138101138102138103138104138105138106138107138108138109138110138111138112138113138114138115138116138117138118138119138120138121138122138123138124138125138126138127138128138129138130138131138132138133138134138135138136138137138138138139138140138141138142138143138144138145138146138147138148138149138150138151138152138153138154138155138156138157138158138159138160138161138162138163138164138165138166138167138168138169138170138171138172138173138174138175138176138177138178138179138180138181138182138183138184138185138186138187138188138189138190138191138192138193138194138195138196138197138198138199138200138201138202138203138204138205138206138207138208138209138210138211138212138213138214138215138216138217138218138219138220138221138222138223138224138225138226138227138228138229138230138231138232138233138234138235138236138237138238138239138240138241138242138243138244138245138246138247138248138249138250138251138252138253138254138255138256138257138258138259138260138261138262138263138264138265138266138267138268138269138270138271138272138273138274138275138276138277138278138279138280138281138282138283138284138285138286138287138288138289138290138291138292138293138294138295138296138297138298138299138300138301138302138303138304138305138306138307138308138309138310138311138312138313138314138315138316138317138318138319138320138321138322138323138324138325138326138327138328138329138330138331138332138333138334138335138336138337138338138339138340138341138342138343138344138345138346138347138348138349138350138351138352138353138354138355138356138357138358138359138360138361138362138363138364138365138366138367138368138369138370138371138372138373138374138375138376138377138378138379138380138381138382138383138384138385138386138387138388138389138390138391138392138393138394138395138396138397138398138399138400138401138402138403138404138405138406138407138408138409138410138411138412138413138414138415138416138417138418138419138420138421138422138423138424138425138426138427138428138429138430138431138432138433138434138435138436138437138438138439138440138441138442138443138444138445138446138447138448138449138450138451138452138453138454138455138456138457138458138459138460138461138462138463138464138465138466138467138468138469138470138471138472138473138474138475138476138477138478138479138480138481138482138483138484138485138486138487138488138489138490138491138492138493138494138495138496138497138498138499138500138501138502138503138504138505138506138507138508138509138510138511138512138513138514138515138516138517138518138519138520138521138522138523138524138525138526138527138528138529138530138531138532138533138534138535138536138537138538138539138540138541138542138543138544138545138546138547138548138549138550138551138552138553138554138555138556138557138558138559138560138561138562138563138564138565138566138567138568138569138570138571138572138573138574138575138576138577138578138579138580138581138582138583138584138585138586138587138588138589138590138591138592138593138594138595138596138597138598138599138600138601138602138603138604138605138606138607138608138609138610138611138612138613138614138615138616138617138618138619138620138621138622138623138624138625138626138627138628138629138630138631138632138633138634138635138636138637138638138639138640138641138642138643138644138645138646138647138648138649138650138651138652138653138654138655138656138657138658138659138660138661138662138663138664138665138666138667138668138669138670138671138672138673138674138675138676138677138678138679138680138681138682138683138684138685138686138687138688138689138690138691138692138693138694138695138696138697138698138699138700138701138702138703138704138705138706138707138708138709138710138711138712138713138714138715138716138717138718138719138720138721138722138723138724138725138726138727138728138729138730138731138732138733138734138735138736138737138738138739138740138741138742138743138744138745138746138747138748138749138750138751138752138753138754138755138756138757138758138759138760138761138762138763138764138765138766138767138768138769138770138771138772138773138774138775138776138777138778138779138780138781138782138783138784138785138786138787138788138789138790138791138792138793138794138795138796138797138798138799138800138801138802138803138804138805138806138807138808138809138810138811138812138813138814138815138816138817138818138819138820138821138822138823138824138825138826138827138828138829138830138831138832138833138834138835138836138837138838138839138840138841138842138843138844138845138846138847138848138849138850138851138852138853138854138855138856138857138858138859138860138861138862138863138864138865138866138867138868138869138870138871138872138873138874138875138876138877138878138879138880138881138882138883138884138885138886138887138888138889138890138891138892138893138894138895138896138897138898138899138900138901138902138903138904138905138906138907138908138909138910138911138912138913138914138915138916138917138918138919138920138921138922138923138924138925138926138927138928138929138930138931138932138933138934138935138936138937138938138939138940138941138942138943138944138945138946138947138948138949138950138951138952138953138954138955138956138957138958138959138960138961138962138963138964138965138966138967138968138969138970138971138972138973138974138975138976138977138978138979138980138981138982138983138984138985138986138987138988138989138990138991138992138993138994138995138996138997138998138999139000139001139002139003139004139005139006139007139008139009139010139011139012139013139014139015139016139017139018139019139020139021139022139023139024139025139026139027139028139029139030139031139032139033139034139035139036139037139038139039139040139041139042139043139044139045139046139047139048139049139050139051139052139053139054139055139056139057139058139059139060139061139062139063139064139065139066139067139068139069139070139071139072139073139074139075139076139077139078139079139080139081139082139083139084139085139086139087139088139089139090139091139092139093139094139095139096139097139098139099139100139101139102139103139104139105139106139107139108139109139110139111139112139113139114139115139116139117139118139119139120139121139122139123139124139125139126139127139128139129139130139131139132139133139134139135139136139137139138139139139140139141139142139143139144139145139146139147139148139149139150139151139152139153139154139155139156139157139158139159139160139161139162139163139164139165139166139167139168139169139170139171139172139173139174139175139176139177139178139179139180139181139182139183139184139185139186139187139188139189139190139191139192139193139194139195139196139197139198139199139200139201139202139203139204139205139206139207139208139209139210139211139212139213139214139215139216139217139218139219139220139221139222139223139224139225139226139227139228139229139230139231139232139233139234139235139236139237139238139239139240139241139242139243139244139245139246139247139248139249139250139251139252139253139254139255139256139257139258139259139260139261139262139263139264139265139266139267139268139269139270139271139272139273139274139275139276139277139278139279139280139281139282139283139284139285139286139287139288139289139290139291139292139293139294139295139296139297139298139299139300139301139302139303139304139305139306139307139308139309139310139311139312139313139314139315139316139317139318139319139320139321139322139323139324139325139326139327139328139329139330139331139332139333139334139335139336139337139338139339139340139341139342139343139344139345139346139347139348139349139350139351139352139353139354139355139356139357139358139359139360139361139362139363139364139365139366139367139368139369139370139371139372139373139374139375139376139377139378139379139380139381139382139383139384139385139386139387139388139389139390139391139392139393139394139395139396139397139398139399139400139401139402139403139404139405139406139407139408139409139410139411139412139413139414139415139416139417139418139419139420139421139422139423139424139425139426139427139428139429139430139431139432139433139434139435139436139437139438139439139440139441139442139443139444139445139446139447139448139449139450139451139452139453139454139455139456139457139458139459139460139461139462139463139464139465139466139467139468139469139470139471139472139473139474139475139476139477139478139479139480139481139482139483139484139485139486139487139488139489139490139491139492139493139494139495139496139497139498139499139500139501139502139503139504139505139506139507139508139509139510139511139512139513139514139515139516139517139518139519139520139521139522139523139524139525139526139527139528139529139530139531139532139533139534139535139536139537139538139539139540139541139542139543139544139545139546139547139548139549139550139551139552139553139554139555139556139557139558139559139560139561139562139563139564139565139566139567139568139569139570139571139572139573139574139575139576139577139578139579139580139581139582139583139584139585139586139587139588139589139590139591139592139593139594139595139596139597139598139599139600139601139602139603139604139605139606139607139608139609139610139611139612139613139614139615139616139617139618139619139620139621139622139623139624139625139626139627139628139629139630139631139632139633139634139635139636139637139638139639139640139641139642139643139644139645139646139647139648139649139650139651139652139653139654139655139656139657139658139659139660139661139662139663139664139665139666139667139668139669139670139671139672139673139674139675139676139677139678139679139680139681139682139683139684139685139686139687139688139689139690139691139692139693139694139695139696139697139698139699139700139701139702139703139704139705139706139707139708139709139710139711139712139713139714139715139716139717139718139719139720139721139722139723139724139725139726139727139728139729139730139731139732139733139734139735139736139737139738139739139740139741139742139743139744139745139746139747139748139749139750139751139752139753139754139755139756139757139758139759139760139761139762139763139764139765139766139767139768139769139770139771139772139773139774139775139776139777139778139779139780139781139782139783139784139785139786139787139788139789139790139791139792139793139794139795139796139797139798139799139800139801139802139803139804139805139806139807139808139809139810139811139812139813139814139815139816139817139818139819139820139821139822139823139824139825139826139827139828139829139830139831139832139833139834139835139836139837139838139839139840139841139842139843139844139845139846139847139848139849139850139851139852139853139854139855139856139857139858139859139860139861139862139863139864139865139866139867139868139869139870139871139872139873139874139875139876139877139878139879139880139881139882139883139884139885139886139887139888139889139890139891139892139893139894139895139896139897139898139899139900139901139902139903139904139905139906139907139908139909139910139911139912139913139914139915139916139917139918139919139920139921139922139923139924139925139926139927139928139929139930139931139932139933139934139935139936139937139938139939139940139941139942139943139944139945139946139947139948139949139950139951139952139953139954139955139956139957139958139959139960139961139962139963139964139965139966139967139968139969139970139971139972139973139974139975139976139977139978139979139980139981139982139983139984139985139986139987139988139989139990139991139992139993139994139995139996139997139998139999140000140001140002140003140004140005140006140007140008140009140010140011140012140013140014140015140016140017140018140019140020140021140022140023140024140025140026140027140028140029140030140031140032140033140034140035140036140037140038140039140040140041140042140043140044140045140046140047140048140049140050140051140052140053140054140055140056140057140058140059140060140061140062140063140064140065140066140067140068140069140070140071140072140073140074140075140076140077140078140079140080140081140082140083140084140085140086140087140088140089140090140091140092140093140094140095140096140097140098140099140100140101140102140103140104140105140106140107140108140109140110140111140112140113140114140115140116140117140118140119140120140121140122140123140124140125140126140127140128140129140130140131140132140133140134140135140136140137140138140139140140140141140142140143140144140145140146140147140148140149140150140151140152140153140154140155140156140157140158140159140160140161140162140163140164140165140166140167140168140169140170140171140172140173140174140175140176140177140178140179140180140181140182140183140184140185140186140187140188140189140190140191140192140193140194140195140196140197140198140199140200140201140202140203140204140205140206140207140208140209140210140211140212140213140214140215140216140217140218140219140220140221140222140223140224140225140226140227140228140229140230140231140232140233140234140235140236140237140238140239140240140241140242140243140244140245140246140247140248140249140250140251140252140253140254140255140256140257140258140259140260140261140262140263140264140265140266140267140268140269140270140271140272140273140274140275140276140277140278140279140280140281140282140283140284140285140286140287140288140289140290140291140292140293140294140295140296140297140298140299140300140301140302140303140304140305140306140307140308140309140310140311140312140313140314140315140316140317140318140319140320140321140322140323140324140325140326140327140328140329140330140331140332140333140334140335140336140337140338140339140340140341140342140343140344140345140346140347140348140349140350140351140352140353140354140355140356140357140358140359140360140361140362140363140364140365140366140367140368140369140370140371140372140373140374140375140376140377140378140379140380140381140382140383140384140385140386140387140388140389140390140391140392140393140394140395140396140397140398140399140400140401140402140403140404140405140406140407140408140409140410140411140412140413140414140415140416140417140418140419140420140421140422140423140424140425140426140427140428140429140430140431140432140433140434140435140436140437140438140439140440140441140442140443140444140445140446140447140448140449140450140451140452140453140454140455140456140457140458140459140460140461140462140463140464140465140466140467140468140469140470140471140472140473140474140475140476140477140478140479140480140481140482140483140484140485140486140487140488140489140490140491140492140493140494140495140496140497140498140499140500140501140502140503140504140505140506140507140508140509140510140511140512140513140514140515140516140517140518140519140520140521140522140523140524140525140526140527140528140529140530140531140532140533140534140535140536140537140538140539140540140541140542140543140544140545140546140547140548140549140550140551140552140553140554140555140556140557140558140559140560140561140562140563140564140565140566140567140568140569140570140571140572140573140574140575140576140577140578140579140580140581140582140583140584140585140586140587140588140589140590140591140592140593140594140595140596140597140598140599140600140601140602140603140604140605140606140607140608140609140610140611140612140613140614140615140616140617140618140619140620140621140622140623140624140625140626140627140628140629140630140631140632140633140634140635140636140637140638140639140640140641140642140643140644140645140646140647140648140649140650140651140652140653140654140655140656140657140658140659140660140661140662140663140664140665140666140667140668140669140670140671140672140673140674140675140676140677140678140679140680140681140682140683140684140685140686140687140688140689140690140691140692140693140694140695140696140697140698140699140700140701140702140703140704140705140706140707140708140709140710140711140712140713140714140715140716140717140718140719140720140721140722140723140724140725140726140727140728140729140730140731140732140733140734140735140736140737140738140739140740140741140742140743140744140745140746140747140748140749140750140751140752140753140754140755140756140757140758140759140760140761140762140763140764140765140766140767140768140769140770140771140772140773140774140775140776140777140778140779140780140781140782140783140784140785140786140787140788140789140790140791140792140793140794140795140796140797140798140799140800140801140802140803140804140805140806140807140808140809140810140811140812140813140814140815140816140817140818140819140820140821140822140823140824140825140826140827140828140829140830140831140832140833140834140835140836140837140838140839140840140841140842140843140844140845140846140847140848140849140850140851140852140853140854140855140856140857140858140859140860140861140862140863140864140865140866140867140868140869140870140871140872140873140874140875140876140877140878140879140880140881140882140883140884140885140886140887140888140889140890140891140892140893140894140895140896140897140898140899140900140901140902140903140904140905140906140907140908140909140910140911140912140913140914140915140916140917140918140919140920140921140922140923140924140925140926140927140928140929140930140931140932140933140934140935140936140937140938140939140940140941140942140943140944140945140946140947140948140949140950140951140952140953140954140955140956140957140958140959140960140961140962140963140964140965140966140967140968140969140970140971140972140973140974140975140976140977140978140979140980140981140982140983140984140985140986140987140988140989140990140991140992140993140994140995140996140997140998140999141000141001141002141003141004141005141006141007141008141009141010141011141012141013141014141015141016141017141018141019141020141021141022141023141024141025141026141027141028141029141030141031141032141033141034141035141036141037141038141039141040141041141042141043141044141045141046141047141048141049141050141051141052141053141054141055141056141057141058141059141060141061141062141063141064141065141066141067141068141069141070141071141072141073141074141075141076141077141078141079141080141081141082141083141084141085141086141087141088141089141090141091141092141093141094141095141096141097141098141099141100141101141102141103141104141105141106141107141108141109141110141111141112141113141114141115141116141117141118141119141120141121141122141123141124141125141126141127141128141129141130141131141132141133141134141135141136141137141138141139141140141141141142141143141144141145141146141147141148141149141150141151141152141153141154141155141156141157141158141159141160141161141162141163141164141165141166141167141168141169141170141171141172141173141174141175141176141177141178141179141180141181141182141183141184141185141186141187141188141189141190141191141192141193141194141195141196141197141198141199141200141201141202141203141204141205141206141207141208141209141210141211141212141213141214141215141216141217141218141219141220141221141222141223141224141225141226141227141228141229141230141231141232141233141234141235141236141237141238141239141240141241141242141243141244141245141246141247141248141249141250141251141252141253141254141255141256141257141258141259141260141261141262141263141264141265141266141267141268141269141270141271141272141273141274141275141276141277141278141279141280141281141282141283141284141285141286141287141288141289141290141291141292141293141294141295141296141297141298141299141300141301141302141303141304141305141306141307141308141309141310141311141312141313141314141315141316141317141318141319141320141321141322141323141324141325141326141327141328141329141330141331141332141333141334141335141336141337141338141339141340141341141342141343141344141345141346141347141348141349141350141351141352141353141354141355141356141357141358141359141360141361141362141363141364141365141366141367141368141369141370141371141372141373141374141375141376141377141378141379141380141381141382141383141384141385141386141387141388141389141390141391141392141393141394141395141396141397141398141399141400141401141402141403141404141405141406141407141408141409141410141411141412141413141414141415141416141417141418141419141420141421141422141423141424141425141426141427141428141429141430141431141432141433141434141435141436141437141438141439141440141441141442141443141444141445141446141447141448141449141450141451141452141453141454141455141456141457141458141459141460141461141462141463141464141465141466141467141468141469141470141471141472141473141474141475141476141477141478141479141480141481141482141483141484141485141486141487141488141489141490141491141492141493141494141495141496141497141498141499141500141501141502141503141504141505141506141507141508141509141510141511141512141513141514141515141516141517141518141519141520141521141522141523141524141525141526141527141528141529141530141531141532141533141534141535141536141537141538141539141540141541141542141543141544141545141546141547141548141549141550141551141552141553141554141555141556141557141558141559141560141561141562141563141564141565141566141567141568141569141570141571141572141573141574141575141576141577141578141579141580141581141582141583141584141585141586141587141588141589141590141591141592141593141594141595141596141597141598141599141600141601141602141603141604141605141606141607141608141609141610141611141612141613141614141615141616141617141618141619141620141621141622141623141624141625141626141627141628141629141630141631141632141633141634141635141636141637141638141639141640141641141642141643141644141645141646141647141648141649141650141651141652141653141654141655141656141657141658141659141660141661141662141663141664141665141666141667141668141669141670141671141672141673141674141675141676141677141678141679141680141681141682141683141684141685141686141687141688141689141690141691141692141693141694141695141696141697141698141699141700141701141702141703141704141705141706141707141708141709141710141711141712141713141714141715141716141717141718141719141720141721141722141723141724141725141726141727141728141729141730141731141732141733141734141735141736141737141738141739141740141741141742141743141744141745141746141747141748141749141750141751141752141753141754141755141756141757141758141759141760141761141762141763141764141765141766141767141768141769141770141771141772141773141774141775141776141777141778141779141780141781141782141783141784141785141786141787141788141789141790141791141792141793141794141795141796141797141798141799141800141801141802141803141804141805141806141807141808141809141810141811141812141813141814141815141816141817141818141819141820141821141822141823141824141825141826141827141828141829141830141831141832141833141834141835141836141837141838141839141840141841141842141843141844141845141846141847141848141849141850141851141852141853141854141855141856141857141858141859141860141861141862141863141864141865141866141867141868141869141870141871141872141873141874141875141876141877141878141879141880141881141882141883141884141885141886141887141888141889141890141891141892141893141894141895141896141897141898141899141900141901141902141903141904141905141906141907141908141909141910141911141912141913141914141915141916141917141918141919141920141921141922141923141924141925141926141927141928141929141930141931141932141933141934141935141936141937141938141939141940141941141942141943141944141945141946141947141948141949141950141951141952141953141954141955141956141957141958141959141960141961141962141963141964141965141966141967141968141969141970141971141972141973141974141975141976141977141978141979141980141981141982141983141984141985141986141987141988141989141990141991141992141993141994141995141996141997141998141999142000142001142002142003142004142005142006142007142008142009142010142011142012142013142014142015142016142017142018142019142020142021142022142023142024142025142026142027142028142029142030142031142032142033142034142035142036142037142038142039142040142041142042142043142044142045142046142047142048142049142050142051142052142053142054142055142056142057142058142059142060142061142062142063142064142065142066142067142068142069142070142071142072142073142074142075142076142077142078142079142080142081142082142083142084142085142086142087142088142089142090142091142092142093142094142095142096142097142098142099142100142101142102142103142104142105142106142107142108142109142110142111142112142113142114142115142116142117142118142119142120142121142122142123142124142125142126142127142128142129142130142131142132142133142134142135142136142137142138142139142140142141142142142143142144142145142146142147142148142149142150142151142152142153142154142155142156142157142158142159142160142161142162142163142164142165142166142167142168142169142170142171142172142173142174142175142176142177142178142179142180142181142182142183142184142185142186142187142188142189142190142191142192142193142194142195142196142197142198142199142200142201142202142203142204142205142206142207142208142209142210142211142212142213142214142215142216142217142218142219142220142221142222142223142224142225142226142227142228142229142230142231142232142233142234142235142236142237142238142239142240142241142242142243142244142245142246142247142248142249142250142251142252142253142254142255142256142257142258142259142260142261142262142263142264142265142266142267142268142269142270142271142272142273142274142275142276142277142278142279142280142281142282142283142284142285142286142287142288142289142290142291142292142293142294142295142296142297142298142299142300142301142302142303142304142305142306142307142308142309142310142311142312142313142314142315142316142317142318142319142320142321142322142323142324142325142326142327142328142329142330142331142332142333142334142335142336142337142338142339142340142341142342142343142344142345142346142347142348142349142350142351142352142353142354142355142356142357142358142359142360142361142362142363142364142365142366142367142368142369142370142371142372142373142374142375142376142377142378142379142380142381142382142383142384142385142386142387142388142389142390142391142392142393142394142395142396142397142398142399142400142401142402142403142404142405142406142407142408142409142410142411142412142413142414142415142416142417142418142419142420142421142422142423142424142425142426142427142428142429142430142431142432142433142434142435142436142437142438142439142440142441142442142443142444142445142446142447142448142449142450142451142452142453142454142455142456142457142458142459142460142461142462142463142464142465142466142467142468142469142470142471142472142473142474142475142476142477142478142479142480142481142482142483142484142485142486142487142488142489142490142491142492142493142494142495142496142497142498142499142500142501142502142503142504142505142506142507142508142509142510142511142512142513142514142515142516142517142518142519142520142521142522142523142524142525142526142527142528142529142530142531142532142533142534142535142536142537142538142539142540142541142542142543142544142545142546142547142548142549142550142551142552142553142554142555142556142557142558142559142560142561142562142563142564142565142566142567142568142569142570142571142572142573142574142575142576142577142578142579142580142581142582142583142584142585142586142587142588142589142590142591142592142593142594142595142596142597142598142599142600142601142602142603142604142605142606142607142608142609142610142611142612142613142614142615142616142617142618142619142620142621142622142623142624142625142626142627142628142629142630142631142632142633142634142635142636142637142638142639142640142641142642142643142644142645142646142647142648142649142650142651142652142653142654142655142656142657142658142659142660142661142662142663142664142665142666142667142668142669142670142671142672142673142674142675142676142677142678142679142680142681142682142683142684142685142686142687142688142689142690142691142692142693142694142695142696142697142698142699142700142701142702142703142704142705142706142707142708142709142710142711142712142713142714142715142716142717142718142719142720142721142722142723142724142725142726142727142728142729142730142731142732142733142734142735142736142737142738142739142740142741142742142743142744142745142746142747142748142749142750142751142752142753142754142755142756142757142758142759142760142761142762142763142764142765142766142767142768142769142770142771142772142773142774142775142776142777142778142779142780142781142782142783142784142785142786142787142788142789142790142791142792142793142794142795142796142797142798142799142800142801142802142803142804142805142806142807142808142809142810142811142812142813142814142815142816142817142818142819142820142821142822142823142824142825142826142827142828142829142830142831142832142833142834142835142836142837142838142839142840142841142842142843142844142845142846142847142848142849142850142851142852142853142854142855142856142857142858142859142860142861142862142863142864142865142866142867142868142869142870142871142872142873142874142875142876142877142878142879142880142881142882142883142884142885142886142887142888142889142890142891142892142893142894142895142896142897142898142899142900142901142902142903142904142905142906142907142908142909142910142911142912142913142914142915142916142917142918142919142920142921142922142923142924142925142926142927142928142929142930142931142932142933142934142935142936142937142938142939142940142941142942142943142944142945142946142947142948142949142950142951142952142953142954142955142956142957142958142959142960142961142962142963142964142965142966142967142968142969142970142971142972142973142974142975142976142977142978142979142980142981142982142983142984142985142986142987142988142989142990142991142992142993142994142995142996142997142998142999143000143001143002143003143004143005143006143007143008143009143010143011143012143013143014143015143016143017143018143019143020143021143022143023143024143025143026143027143028143029143030143031143032143033143034143035143036143037143038143039143040143041143042143043143044143045143046143047143048143049143050143051143052143053143054143055143056143057143058143059143060143061143062143063143064143065143066143067143068143069143070143071143072143073143074143075143076143077143078143079143080143081143082143083143084143085143086143087143088143089143090143091143092143093143094143095143096143097143098143099143100143101143102143103143104143105143106143107143108143109143110143111143112143113143114143115143116143117143118143119143120143121143122143123143124143125143126143127143128143129143130143131143132143133143134143135143136143137143138143139143140143141143142143143143144143145143146143147143148143149143150143151143152143153143154143155143156143157143158143159143160143161143162143163143164143165143166143167143168143169143170143171143172143173143174143175143176143177143178143179143180143181143182143183143184143185143186143187143188143189143190143191143192143193143194143195143196143197143198143199143200143201143202143203143204143205143206143207143208143209143210143211143212143213143214143215143216143217143218143219143220143221143222143223143224143225143226143227143228143229143230143231143232143233143234143235143236143237143238143239143240143241143242143243143244143245143246143247143248143249143250143251143252143253143254143255143256143257143258143259143260143261143262143263143264143265143266143267143268143269143270143271143272143273143274143275143276143277143278143279143280143281143282143283143284143285143286143287143288143289143290143291143292143293143294143295143296143297143298143299143300143301143302143303143304143305143306143307143308143309143310143311143312143313143314143315143316143317143318143319143320143321143322143323143324143325143326143327143328143329143330143331143332143333143334143335143336143337143338143339143340143341143342143343143344143345143346143347143348143349143350143351143352143353143354143355143356143357143358143359143360143361143362143363143364143365143366143367143368143369143370143371143372143373143374143375143376143377143378143379143380143381143382143383143384143385143386143387143388143389143390143391143392143393143394143395143396143397143398143399143400143401143402143403143404143405143406143407143408143409143410143411143412143413143414143415143416143417143418143419143420143421143422143423143424143425143426143427143428143429143430143431143432143433143434143435143436143437143438143439143440143441143442143443143444143445143446143447143448143449143450143451143452143453143454143455143456143457143458143459143460143461143462143463143464143465143466143467143468143469143470143471143472143473143474143475143476143477143478143479143480143481143482143483143484143485143486143487143488143489143490143491143492143493143494143495143496143497143498143499143500143501143502143503143504143505143506143507143508143509143510143511143512143513143514143515143516143517143518143519143520143521143522143523143524143525143526143527143528143529143530143531143532143533143534143535143536143537143538143539143540143541143542143543143544143545143546143547143548143549143550143551143552143553143554143555143556143557143558143559143560143561143562143563143564143565143566143567143568143569143570143571143572143573143574143575143576143577143578143579143580143581143582143583143584143585143586143587143588143589143590143591143592143593143594143595143596143597143598143599143600143601143602143603143604143605143606143607143608143609143610143611143612143613143614143615143616143617143618143619143620143621143622143623143624143625143626143627143628143629143630143631143632143633143634143635143636143637143638143639143640143641143642143643143644143645143646143647143648143649143650143651143652143653143654143655143656143657143658143659143660143661143662143663143664143665143666143667143668143669143670143671143672143673143674143675143676143677143678143679143680143681143682143683143684143685143686143687143688143689143690143691143692143693143694143695143696143697143698143699143700143701143702143703143704143705143706143707143708143709143710143711143712143713143714143715143716143717143718143719143720143721143722143723143724143725143726143727143728143729143730143731143732143733143734143735143736143737143738143739143740143741143742143743143744143745143746143747143748143749143750143751143752143753143754143755143756143757143758143759143760143761143762143763143764143765143766143767143768143769143770143771143772143773143774143775143776143777143778143779143780143781143782143783143784143785143786143787143788143789143790143791143792143793143794143795143796143797143798143799143800143801143802143803143804143805143806143807143808143809143810143811143812143813143814143815143816143817143818143819143820143821143822143823143824143825143826143827143828143829143830143831143832143833143834143835143836143837143838143839143840143841143842143843143844143845143846143847143848143849143850143851143852143853143854143855143856143857143858143859143860143861143862143863143864143865143866143867143868143869143870143871143872143873143874143875143876143877143878143879143880143881143882143883143884143885143886143887143888143889143890143891143892143893143894143895143896143897143898143899143900143901143902143903143904143905143906143907143908143909143910143911143912143913143914143915143916143917143918143919143920143921143922143923143924143925143926143927143928143929143930143931143932143933143934143935143936143937143938143939143940143941143942143943143944143945143946143947143948143949143950143951143952143953143954143955143956143957143958143959143960143961143962143963143964143965143966143967143968143969143970143971143972143973143974143975143976143977143978143979143980143981143982143983143984143985143986143987143988143989143990143991143992143993143994143995143996143997143998143999144000144001144002144003144004144005144006144007144008144009144010144011144012144013144014144015144016144017144018144019144020144021144022144023144024144025144026144027144028144029144030144031144032144033144034144035144036144037144038144039144040144041144042144043144044144045144046144047144048144049144050144051144052144053144054144055144056144057144058144059144060144061144062144063144064144065144066144067144068144069144070144071144072144073144074144075144076144077144078144079144080144081144082144083144084144085144086144087144088144089144090144091144092144093144094144095144096144097144098144099144100144101144102144103144104144105144106144107144108144109144110144111144112144113144114144115144116144117144118144119144120144121144122144123144124144125144126144127144128144129144130144131144132144133144134144135144136144137144138144139144140144141144142144143144144144145144146144147144148144149144150144151144152144153144154144155144156144157144158144159144160144161144162144163144164144165144166144167144168144169144170144171144172144173144174144175144176144177144178144179144180144181144182144183144184144185144186144187144188144189144190144191144192144193144194144195144196144197144198144199144200144201144202144203144204144205144206144207144208144209144210144211144212144213144214144215144216144217144218144219144220144221144222144223144224144225144226144227144228144229144230144231144232144233144234144235144236144237144238144239144240144241144242144243144244144245144246144247144248144249144250144251144252144253144254144255144256144257144258144259144260144261144262144263144264144265144266144267144268144269144270144271144272144273144274144275144276144277144278144279144280144281144282144283144284144285144286144287144288144289144290144291144292144293144294144295144296144297144298144299144300144301144302144303144304144305144306144307144308144309144310144311144312144313144314144315144316144317144318144319144320144321144322144323144324144325144326144327144328144329144330144331144332144333144334144335144336144337144338144339144340144341144342144343144344144345144346144347144348144349144350144351144352144353144354144355144356144357144358144359144360144361144362144363144364144365144366144367144368144369144370144371144372144373144374144375144376144377144378144379144380144381144382144383144384144385144386144387144388144389144390144391144392144393144394144395144396144397144398144399144400144401144402144403144404144405144406144407144408144409144410144411144412144413144414144415144416144417144418144419144420144421144422144423144424144425144426144427144428144429144430144431144432144433144434144435144436144437144438144439144440144441144442144443144444144445144446144447144448144449144450144451144452144453144454144455144456144457144458144459144460144461144462144463144464144465144466144467144468144469144470144471144472144473144474144475144476144477144478144479144480144481144482144483144484144485144486144487144488144489144490144491144492144493144494144495144496144497144498144499144500144501144502144503144504144505144506144507144508144509144510144511144512144513144514144515144516144517144518144519144520144521144522144523144524144525144526144527144528144529144530144531144532144533144534144535144536144537144538144539144540144541144542144543144544144545144546144547144548144549144550144551144552144553144554144555144556144557144558144559144560144561144562144563144564144565144566144567144568144569144570144571144572144573144574144575144576144577144578144579144580144581144582144583144584144585144586144587144588144589144590144591144592144593144594144595144596144597144598144599144600144601144602144603144604144605144606144607144608144609144610144611144612144613144614144615144616144617144618144619144620144621144622144623144624144625144626144627144628144629144630144631144632144633144634144635144636144637144638144639144640144641144642144643144644144645144646144647144648144649144650144651144652144653144654144655144656144657144658144659144660144661144662144663144664144665144666144667144668144669144670144671144672144673144674144675144676144677144678144679144680144681144682144683144684144685144686144687144688144689144690144691144692144693144694144695144696144697144698144699144700144701144702144703144704144705144706144707144708144709144710144711144712144713144714144715144716144717144718144719144720144721144722144723144724144725144726144727144728144729144730144731144732144733144734144735144736144737144738144739144740144741144742144743144744144745144746144747144748144749144750144751144752144753144754144755144756144757144758144759144760144761144762144763144764144765144766144767144768144769144770144771144772144773144774144775144776144777144778144779144780144781144782144783144784144785144786144787144788144789144790144791144792144793144794144795144796144797144798144799144800144801144802144803144804144805144806144807144808144809144810144811144812144813144814144815144816144817144818144819144820144821144822144823144824144825144826144827144828144829144830144831144832144833144834144835144836144837144838144839144840144841144842144843144844144845144846144847144848144849144850144851144852144853144854144855144856144857144858144859144860144861144862144863144864144865144866144867144868144869144870144871144872144873144874144875144876144877144878144879144880144881144882144883144884144885144886144887144888144889144890144891144892144893144894144895144896144897144898144899144900144901144902144903144904144905144906144907144908144909144910144911144912144913144914144915144916144917144918144919144920144921144922144923144924144925144926144927144928144929144930144931144932144933144934144935144936144937144938144939144940144941144942144943144944144945144946144947144948144949144950144951144952144953144954144955144956144957144958144959144960144961144962144963144964144965144966144967144968144969144970144971144972144973144974144975144976144977144978144979144980144981144982144983144984144985144986144987144988144989144990144991144992144993144994144995144996144997144998144999145000145001145002145003145004145005145006145007145008145009145010145011145012145013145014145015145016145017145018145019145020145021145022145023145024145025145026145027145028145029145030145031145032145033145034145035145036145037145038145039145040145041145042145043145044145045145046145047145048145049145050145051145052145053145054145055145056145057145058145059145060145061145062145063145064145065145066145067145068145069145070145071145072145073145074145075145076145077145078145079145080145081145082145083145084145085145086145087145088145089145090145091145092145093145094145095145096145097145098145099145100145101145102145103145104145105145106145107145108145109145110145111145112145113145114145115145116145117145118145119145120145121145122145123145124145125145126145127145128145129145130145131145132145133145134145135145136145137145138145139145140145141145142145143145144145145145146145147145148145149145150145151145152145153145154145155145156145157145158145159145160145161145162145163145164145165145166145167145168145169145170145171145172145173145174145175145176145177145178145179145180145181145182145183145184145185145186145187145188145189145190145191145192145193145194145195145196145197145198145199145200145201145202145203145204145205145206145207145208145209145210145211145212145213145214145215145216145217145218145219145220145221145222145223145224145225145226145227145228145229145230145231145232145233145234145235145236145237145238145239145240145241145242145243145244145245145246145247145248145249145250145251145252145253145254145255145256145257145258145259145260145261145262145263145264145265145266145267145268145269145270145271145272145273145274145275145276145277145278145279145280145281145282145283145284145285145286145287145288145289145290145291145292145293145294145295145296145297145298145299145300145301145302145303145304145305145306145307145308145309145310145311145312145313145314145315145316145317145318145319145320145321145322145323145324145325145326145327145328145329145330145331145332145333145334145335145336145337145338145339145340145341145342145343145344145345145346145347145348145349145350145351145352145353145354145355145356145357145358145359145360145361145362145363145364145365145366145367145368145369145370145371145372145373145374145375145376145377145378145379145380145381145382145383145384145385145386145387145388145389145390145391145392145393145394145395145396145397145398145399145400145401145402145403145404145405145406145407145408145409145410145411145412145413145414145415145416145417145418145419145420145421145422145423145424145425145426145427145428145429145430145431145432145433145434145435145436145437145438145439145440145441145442145443145444145445145446145447145448145449145450145451145452145453145454145455145456145457145458145459145460145461145462145463145464145465145466145467145468145469145470145471145472145473145474145475145476145477145478145479145480145481145482145483145484145485145486145487145488145489145490145491145492145493145494145495145496145497145498145499145500145501145502145503145504145505145506145507145508145509145510145511145512145513145514145515145516145517145518145519145520145521145522145523145524145525145526145527145528145529145530145531145532145533145534145535145536145537145538145539145540145541145542145543145544145545145546145547145548145549145550145551145552145553145554145555145556145557145558145559145560145561145562145563145564145565145566145567145568145569145570145571145572145573145574145575145576145577145578145579145580145581145582145583145584145585145586145587145588145589145590145591145592145593145594145595145596145597145598145599145600145601145602145603145604145605145606145607145608145609145610145611145612145613145614145615145616145617145618145619145620145621145622145623145624145625145626145627145628145629145630145631145632145633145634145635145636145637145638145639145640145641145642145643145644145645145646145647145648145649145650145651145652145653145654145655145656145657145658145659145660145661145662145663145664145665145666145667145668145669145670145671145672145673145674145675145676145677145678145679145680145681145682145683145684145685145686145687145688145689145690145691145692145693145694145695145696145697145698145699145700145701145702145703145704145705145706145707145708145709145710145711145712145713145714145715145716145717145718145719145720145721145722145723145724145725145726145727145728145729145730145731145732145733145734145735145736145737145738145739145740145741145742145743145744145745145746145747145748145749145750145751145752145753145754145755145756145757145758145759145760145761145762145763145764145765145766145767145768145769145770145771145772145773145774145775145776145777145778145779145780145781145782145783145784145785145786145787145788145789145790145791145792145793145794145795145796145797145798145799145800145801145802145803145804145805145806145807145808145809145810145811145812145813145814145815145816145817145818145819145820145821145822145823145824145825145826145827145828145829145830145831145832145833145834145835145836145837145838145839145840145841145842145843145844145845145846145847145848145849145850145851145852145853145854145855145856145857145858145859145860145861145862145863145864145865145866145867145868145869145870145871145872145873145874145875145876145877145878145879145880145881145882145883145884145885145886145887145888145889145890145891145892145893145894145895145896145897145898145899145900145901145902145903145904145905145906145907145908145909145910145911145912145913145914145915145916145917145918145919145920145921145922145923145924145925145926145927145928145929145930145931145932145933145934145935145936145937145938145939145940145941145942145943145944145945145946145947145948145949145950145951145952145953145954145955145956145957145958145959145960145961145962145963145964145965145966145967145968145969145970145971145972145973145974145975145976145977145978145979145980145981145982145983145984145985145986145987145988145989145990145991145992145993145994145995145996145997145998145999146000146001146002146003146004146005146006146007146008146009146010146011146012146013146014146015146016146017146018146019146020146021146022146023146024146025146026146027146028146029146030146031146032146033146034146035146036146037146038146039146040146041146042146043146044146045146046146047146048146049146050146051146052146053146054146055146056146057146058146059146060146061146062146063146064146065146066146067146068146069146070146071146072146073146074146075146076146077146078146079146080146081146082146083146084146085146086146087146088146089146090146091146092146093146094146095146096146097146098146099146100146101146102146103146104146105146106146107146108146109146110146111146112146113146114146115146116146117146118146119146120146121146122146123146124146125146126146127146128146129146130146131146132146133146134146135146136146137146138146139146140146141146142146143146144146145146146146147146148146149146150146151146152146153146154146155146156146157146158146159146160146161146162146163146164146165146166146167146168146169146170146171146172146173146174146175146176146177146178146179146180146181146182146183146184146185146186146187146188146189146190146191146192146193146194146195146196146197146198146199146200146201146202146203146204146205146206146207146208146209146210146211146212146213146214146215146216146217146218146219146220146221146222146223146224146225146226146227146228146229146230146231146232146233146234146235146236146237146238146239146240146241146242146243146244146245146246146247146248146249146250146251146252146253146254146255146256146257146258146259146260146261146262146263146264146265146266146267146268146269146270146271146272146273146274146275146276146277146278146279146280146281146282146283146284146285146286146287146288146289146290146291146292146293146294146295146296146297146298146299146300146301146302146303146304146305146306146307146308146309146310146311146312146313146314146315146316146317146318146319146320146321146322146323146324146325146326146327146328146329146330146331146332146333146334146335146336146337146338146339146340146341146342146343146344146345146346146347146348146349146350146351146352146353146354146355146356146357146358146359146360146361146362146363146364146365146366146367146368146369146370146371146372146373146374146375146376146377146378146379146380146381146382146383146384146385146386146387146388146389146390146391146392146393146394146395146396146397146398146399146400146401146402146403146404146405146406146407146408146409146410146411146412146413146414146415146416146417146418146419146420146421146422146423146424146425146426146427146428146429146430146431146432146433146434146435146436146437146438146439146440146441146442146443146444146445146446146447146448146449146450146451146452146453146454146455146456146457146458146459146460146461146462146463146464146465146466146467146468146469146470146471146472146473146474146475146476146477146478146479146480146481146482146483146484146485146486146487146488146489146490146491146492146493146494146495146496146497146498146499146500146501146502146503146504146505146506146507146508146509146510146511146512146513146514146515146516146517146518146519146520146521146522146523146524146525146526146527146528146529146530146531146532146533146534146535146536146537146538146539146540146541146542146543146544146545146546146547146548146549146550146551146552146553146554146555146556146557146558146559146560146561146562146563146564146565146566146567146568146569146570146571146572146573146574146575146576146577146578146579146580146581146582146583146584146585146586146587146588146589146590146591146592146593146594146595146596146597146598146599146600146601146602146603146604146605146606146607146608146609146610146611146612146613146614146615146616146617146618146619146620146621146622146623146624146625146626146627146628146629146630146631146632146633146634146635146636146637146638146639146640146641146642146643146644146645146646146647146648146649146650146651146652146653146654146655146656146657146658146659146660146661146662146663146664146665146666146667146668146669146670146671146672146673146674146675146676146677146678146679146680146681146682146683146684146685146686146687146688146689146690146691146692146693146694146695146696146697146698146699146700146701146702146703146704146705146706146707146708146709146710146711146712146713146714146715146716146717146718146719146720146721146722146723146724146725146726146727146728146729146730146731146732146733146734146735146736146737146738146739146740146741146742146743146744146745146746146747146748146749146750146751146752146753146754146755146756146757146758146759146760146761146762146763146764146765146766146767146768146769146770146771146772146773146774146775146776146777146778146779146780146781146782146783146784146785146786146787146788146789146790146791146792146793146794146795146796146797146798146799146800146801146802146803146804146805146806146807146808146809146810146811146812146813146814146815146816146817146818146819146820146821146822146823146824146825146826146827146828146829146830146831146832146833146834146835146836146837146838146839146840146841146842146843146844146845146846146847146848146849146850146851146852146853146854146855146856146857146858146859146860146861146862146863146864146865146866146867146868146869146870146871146872146873146874146875146876146877146878146879146880146881146882146883146884146885146886146887146888146889146890146891146892146893146894146895146896146897146898146899146900146901146902146903146904146905146906146907146908146909146910146911146912146913146914146915146916146917146918146919146920146921146922146923146924146925146926146927146928146929146930146931146932146933146934146935146936146937146938146939146940146941146942146943146944146945146946146947146948146949146950146951146952146953146954146955146956146957146958146959146960146961146962146963146964146965146966146967146968146969146970146971146972146973146974146975146976146977146978146979146980146981146982146983146984146985146986146987146988146989146990146991146992146993146994146995146996146997146998146999147000147001147002147003147004147005147006147007147008147009147010147011147012147013147014147015147016147017147018147019147020147021147022147023147024147025147026147027147028147029147030147031147032147033147034147035147036147037147038147039147040147041147042147043147044147045147046147047147048147049147050147051147052147053147054147055147056147057147058147059147060147061147062147063147064147065147066147067147068147069147070147071147072147073147074147075147076147077147078147079147080147081147082147083147084147085147086147087147088147089147090147091147092147093147094147095147096147097147098147099147100147101147102147103147104147105147106147107147108147109147110147111147112147113147114147115147116147117147118147119147120147121147122147123147124147125147126147127147128147129147130147131147132147133147134147135147136147137147138147139147140147141147142147143147144147145147146147147147148147149147150147151147152147153147154147155147156147157147158147159147160147161147162147163147164147165147166147167147168147169147170147171147172147173147174147175147176147177147178147179147180147181147182147183147184147185147186147187147188147189147190147191147192147193147194147195147196147197147198147199147200147201147202147203147204147205147206147207147208147209147210147211147212147213147214147215147216147217147218147219147220147221147222147223147224147225147226147227147228147229147230147231147232147233147234147235147236147237147238147239147240147241147242147243147244147245147246147247147248147249147250147251147252147253147254147255147256147257147258147259147260147261147262147263147264147265147266147267147268147269147270147271147272147273147274147275147276147277147278147279147280147281147282147283147284147285147286147287147288147289147290147291147292147293147294147295147296147297147298147299147300147301147302147303147304147305147306147307147308147309147310147311147312147313147314147315147316147317147318147319147320147321147322147323147324147325147326147327147328147329147330147331147332147333147334147335147336147337147338147339147340147341147342147343147344147345147346147347147348147349147350147351147352147353147354147355147356147357147358147359147360147361147362147363147364147365147366147367147368147369147370147371147372147373147374147375147376147377147378147379147380147381147382147383147384147385147386147387147388147389147390147391147392147393147394147395147396147397147398147399147400147401147402147403147404147405147406147407147408147409147410147411147412147413147414147415147416147417147418147419147420147421147422147423147424147425147426147427147428147429147430147431147432147433147434147435147436147437147438147439147440147441147442147443147444147445147446147447147448147449147450147451147452147453147454147455147456147457147458147459147460147461147462147463147464147465147466147467147468147469147470147471147472147473147474147475147476147477147478147479147480147481147482147483147484147485147486147487147488147489147490147491147492147493147494147495147496147497147498147499147500147501147502147503147504147505147506147507147508147509147510147511147512147513147514147515147516147517147518147519147520147521147522147523147524147525147526147527147528147529147530147531147532147533147534147535147536147537147538147539147540147541147542147543147544147545147546147547147548147549147550147551147552147553147554147555147556147557147558147559147560147561147562147563147564147565147566147567147568147569147570147571147572147573147574147575147576147577147578147579147580147581147582147583147584147585147586147587147588147589147590147591147592147593147594147595147596147597147598147599147600147601147602147603147604147605147606147607147608147609147610147611147612147613147614147615147616147617147618147619147620147621147622147623147624147625147626147627147628147629147630147631147632147633147634147635147636147637147638147639147640147641147642147643147644147645147646147647147648147649147650147651147652147653147654147655147656147657147658147659147660147661147662147663147664147665147666147667147668147669147670147671147672147673147674147675147676147677147678147679147680147681147682147683147684147685147686147687147688147689147690147691147692147693147694147695147696147697147698147699147700147701147702147703147704147705147706147707147708147709147710147711147712147713147714147715147716147717147718147719147720147721147722147723147724147725147726147727147728147729147730147731147732147733147734147735147736147737147738147739147740147741147742147743147744147745147746147747147748147749147750147751147752147753147754147755147756147757147758147759147760147761147762147763147764147765147766147767147768147769147770147771147772147773147774147775147776147777147778147779147780147781147782147783147784147785147786147787147788147789147790147791147792147793147794147795147796147797147798147799147800147801147802147803147804147805147806147807147808147809147810147811147812147813147814147815147816147817147818147819147820147821147822147823147824147825147826147827147828147829147830147831147832147833147834147835147836147837147838147839147840147841147842147843147844147845147846147847147848147849147850147851147852147853147854147855147856147857147858147859147860147861147862147863147864147865147866147867147868147869147870147871147872147873147874147875147876147877147878147879147880147881147882147883147884147885147886147887147888147889147890147891147892147893147894147895147896147897147898147899147900147901147902147903147904147905147906147907147908147909147910147911147912147913147914147915147916147917147918147919147920147921147922147923147924147925147926147927147928147929147930147931147932147933147934147935147936147937147938147939147940147941147942147943147944147945147946147947147948147949147950147951147952147953147954147955147956147957147958147959147960147961147962147963147964147965147966147967147968147969147970147971147972147973147974147975147976147977147978147979147980147981147982147983147984147985147986147987147988147989147990147991147992147993147994147995147996147997147998147999148000148001148002148003148004148005148006148007148008148009148010148011148012148013148014148015148016148017148018148019148020148021148022148023148024148025148026148027148028148029148030148031148032148033148034148035148036148037148038148039148040148041148042148043148044148045148046148047148048148049148050148051148052148053148054148055148056148057148058148059148060148061148062148063148064148065148066148067148068148069148070148071148072148073148074148075148076148077148078148079148080148081148082148083148084148085148086148087148088148089148090148091148092148093148094148095148096148097148098148099148100148101148102148103148104148105148106148107148108148109148110148111148112148113148114148115148116148117148118148119148120148121148122148123148124148125148126148127148128148129148130148131148132148133148134148135148136148137148138148139148140148141148142148143148144148145148146148147148148148149148150148151148152148153148154148155148156148157148158148159148160148161148162148163148164148165148166148167148168148169148170148171148172148173148174148175148176148177148178148179148180148181148182148183148184148185148186148187148188148189148190148191148192148193148194148195148196148197148198148199148200148201148202148203148204148205148206148207148208148209148210148211148212148213148214148215148216148217148218148219148220148221148222148223148224148225148226148227148228148229148230148231148232148233148234148235148236148237148238148239148240148241148242148243148244148245148246148247148248148249148250148251148252148253148254148255148256148257148258148259148260148261148262148263148264148265148266148267148268148269148270148271148272148273148274148275148276148277148278148279148280148281148282148283148284148285148286148287148288148289148290148291148292148293148294148295148296148297148298148299148300148301148302148303148304148305148306148307148308148309148310148311148312148313148314148315148316148317148318148319148320148321148322148323148324148325148326148327148328148329148330148331148332148333148334148335148336148337148338148339148340148341148342148343148344148345148346148347148348148349148350148351148352148353148354148355148356148357148358148359148360148361148362148363148364148365148366148367148368148369148370148371148372148373148374148375148376148377148378148379148380148381148382148383148384148385148386148387148388148389148390148391148392148393148394148395148396148397148398148399148400148401148402148403148404148405148406148407148408148409148410148411148412148413148414148415148416148417148418148419148420148421148422148423148424148425148426148427148428148429148430148431148432148433148434148435148436148437148438148439148440148441148442148443148444148445148446148447148448148449148450148451148452148453148454148455148456148457148458148459148460148461148462148463148464148465148466148467148468148469148470148471148472148473148474148475148476148477148478148479148480148481148482148483148484148485148486148487148488148489148490148491148492148493148494148495148496148497148498148499148500148501148502148503148504148505148506148507148508148509148510148511148512148513148514148515148516148517148518148519148520148521148522148523148524148525148526148527148528148529148530148531148532148533148534148535148536148537148538148539148540148541148542148543148544148545148546148547148548148549148550148551148552148553148554148555148556148557148558148559148560148561148562148563148564148565148566148567148568148569148570148571148572148573148574148575148576148577148578148579148580148581148582148583148584148585148586148587148588148589148590148591148592148593148594148595148596148597148598148599148600148601148602148603148604148605148606148607148608148609148610148611148612148613148614148615148616148617148618148619148620148621148622148623148624148625148626148627148628148629148630148631148632148633148634148635148636148637148638148639148640148641148642148643148644148645148646148647148648148649148650148651148652148653148654148655148656148657148658148659148660148661148662148663148664148665148666148667148668148669148670148671148672148673148674148675148676148677148678148679148680148681148682148683148684148685148686148687148688148689148690148691148692148693148694148695148696148697148698148699148700148701148702148703148704148705148706148707148708148709148710148711148712148713148714148715148716148717148718148719148720148721148722148723148724148725148726148727148728148729148730148731148732148733148734148735148736148737148738148739148740148741148742148743148744148745148746148747148748148749148750148751148752148753148754148755148756148757148758148759148760148761148762148763148764148765148766148767148768148769148770148771148772148773148774148775148776148777148778148779148780148781148782148783148784148785148786148787148788148789148790148791148792148793148794148795148796148797148798148799148800148801148802148803148804148805148806148807148808148809148810148811148812148813148814148815148816148817148818148819148820148821148822148823148824148825148826148827148828148829148830148831148832148833148834148835148836148837148838148839148840148841148842148843148844148845148846148847148848148849148850148851148852148853148854148855148856148857148858148859148860148861148862148863148864148865148866148867148868148869148870148871148872148873148874148875148876148877148878148879148880148881148882148883148884148885148886148887148888148889148890148891148892148893148894148895148896148897148898148899148900148901148902148903148904148905148906148907148908148909148910148911148912148913148914148915148916148917148918148919148920148921148922148923148924148925148926148927148928148929148930148931148932148933148934148935148936148937148938148939148940148941148942148943148944148945148946148947148948148949148950148951148952148953148954148955148956148957148958148959148960148961148962148963148964148965148966148967148968148969148970148971148972148973148974148975148976148977148978148979148980148981148982148983148984148985148986148987148988148989148990148991148992148993148994148995148996148997148998148999149000149001149002149003149004149005149006149007149008149009149010149011149012149013149014149015149016149017149018149019149020149021149022149023149024149025149026149027149028149029149030149031149032149033149034149035149036149037149038149039149040149041149042149043149044149045149046149047149048149049149050149051149052149053149054149055149056149057149058149059149060149061149062149063149064149065149066149067149068149069149070149071149072149073149074149075149076149077149078149079149080149081149082149083149084149085149086149087149088149089149090149091149092149093149094149095149096149097149098149099149100149101149102149103149104149105149106149107149108149109149110149111149112149113149114149115149116149117149118149119149120149121149122149123149124149125149126149127149128149129149130149131149132149133149134149135149136149137149138149139149140149141149142149143149144149145149146149147149148149149149150149151149152149153149154149155149156149157149158149159149160149161149162149163149164149165149166149167149168149169149170149171149172149173149174149175149176149177149178149179149180149181149182149183149184149185149186149187149188149189149190149191149192149193149194149195149196149197149198149199149200149201149202149203149204149205149206149207149208149209149210149211149212149213149214149215149216149217149218149219149220149221149222149223149224149225149226149227149228149229149230149231149232149233149234149235149236149237149238149239149240149241149242149243149244149245149246149247149248149249149250149251149252149253149254149255149256149257149258149259149260149261149262149263149264149265149266149267149268149269149270149271149272149273149274149275149276149277149278149279149280149281149282149283149284149285149286149287149288149289149290149291149292149293149294149295149296149297149298149299149300149301149302149303149304149305149306149307149308149309149310149311149312149313149314149315149316149317149318149319149320149321149322149323149324149325149326149327149328149329149330149331149332149333149334149335149336149337149338149339149340149341149342149343149344149345149346149347149348149349149350149351149352149353149354149355149356149357149358149359149360149361149362149363149364149365149366149367149368149369149370149371149372149373149374149375149376149377149378149379149380149381149382149383149384149385149386149387149388149389149390149391149392149393149394149395149396149397149398149399149400149401149402149403149404149405149406149407149408149409149410149411149412149413149414149415149416149417149418149419149420149421149422149423149424149425149426149427149428149429149430149431149432149433149434149435149436149437149438149439149440149441149442149443149444149445149446149447149448149449149450149451149452149453149454149455149456149457149458149459149460149461149462149463149464149465149466149467149468149469149470149471149472149473149474149475149476149477149478149479149480149481149482149483149484149485149486149487149488149489149490149491149492149493149494149495149496149497149498149499149500149501149502149503149504149505149506149507149508149509149510149511149512149513149514149515149516149517149518149519149520149521149522149523149524149525149526149527149528149529149530149531149532149533149534149535149536149537149538149539149540149541149542149543149544149545149546149547149548149549149550149551149552149553149554149555149556149557149558149559149560149561149562149563149564149565149566149567149568149569149570149571149572149573149574149575149576149577149578149579149580149581149582149583149584149585149586149587149588149589149590149591149592149593149594149595149596149597149598149599149600149601149602149603149604149605149606149607149608149609149610149611149612149613149614149615149616149617149618149619149620149621149622149623149624149625149626149627149628149629149630149631149632149633149634149635149636149637149638149639149640149641149642149643149644149645149646149647149648149649149650149651149652149653149654149655149656149657149658149659149660149661149662149663149664149665149666149667149668149669149670149671149672149673149674149675149676149677149678149679149680149681149682149683149684149685149686149687149688149689149690149691149692149693149694149695149696149697149698149699149700149701149702149703149704149705149706149707149708149709149710149711149712149713149714149715149716149717149718149719149720149721149722149723149724149725149726149727149728149729149730149731149732149733149734149735149736149737149738149739149740149741149742149743149744149745149746149747149748149749149750149751149752149753149754149755149756149757149758149759149760149761149762149763149764149765149766149767149768149769149770149771149772149773149774149775149776149777149778149779149780149781149782149783149784149785149786149787149788149789149790149791149792149793149794149795149796149797149798149799149800149801149802149803149804149805149806149807149808149809149810149811149812149813149814149815149816149817149818149819149820149821149822149823149824149825149826149827149828149829149830149831149832149833149834149835149836149837149838149839149840149841149842149843149844149845149846149847149848149849149850149851149852149853149854149855149856149857149858149859149860149861149862149863149864149865149866149867149868149869149870149871149872149873149874149875149876149877149878149879149880149881149882149883149884149885 |
- /*!
- * @license Copyright (c) 2003-2022, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
- (function(d){ const l = d['en'] = d['en'] || {}; l.dictionary=Object.assign( l.dictionary||{}, {"%0 of %1":"%0 of %1","Align center":"Align center","Align left":"Align left","Align right":"Align right",Aquamarine:"Aquamarine",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Bulleted List":"Bulleted List",Cancel:"Cancel","Cannot upload file:":"Cannot upload file:","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Column:"Column","Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.","Decrease indent":"Decrease indent","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey","Document colors":"Document colors",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Edit source":"Edit source","Editor toolbar":"Editor toolbar","Empty snippet content":"Empty snippet content","Enter image caption":"Enter image caption","Font Background Color":"Font Background Color","Font Color":"Font Color","Full size image":"Full size image",Green:"Green",Grey:"Grey","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","HTML snippet":"HTML snippet","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","Increase indent":"Increase indent","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert HTML":"Insert HTML","Insert image":"Insert image","Insert image or file":"Insert image or file","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table","Inserting image failed":"Inserting image failed",Italic:"Italic",Justify:"Justify","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link image":"Link image","Link URL":"Link URL","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells",Next:"Next","No preview available":"No preview available","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Original:"Original",Paragraph:"Paragraph","Paste raw HTML here...":"Paste raw HTML here...",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Remove Format":"Remove Format","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Row:"Row",Save:"Save","Save changes":"Save changes","Select all":"Select all","Select column":"Select column","Select row":"Select row","Selecting resized image failed":"Selecting resized image failed","Show more items":"Show more items","Side image":"Side image","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically",Strikethrough:"Strikethrough",Subscript:"Subscript",Superscript:"Superscript","Table toolbar":"Table toolbar","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","This link has no URL":"This link has no URL",Turquoise:"Turquoise",Underline:"Underline",Undo:"Undo",Unlink:"Unlink","Upload failed":"Upload failed","Upload in progress":"Upload in progress",White:"White","Widget toolbar":"Widget toolbar",Yellow:"Yellow"} );})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory();
- else if(typeof define === 'function' && define.amd)
- define([], factory);
- else if(typeof exports === 'object')
- exports["ClassicEditor"] = factory();
- else
- root["ClassicEditor"] = factory();
- })(window, function() {
- return /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
- /******/ }
- /******/ };
- /******/
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/
- /******/ // create a fake namespace object
- /******/ // mode & 1: value is a module id, require it
- /******/ // mode & 2: merge all properties of value into the ns
- /******/ // mode & 4: return value when already ns object
- /******/ // mode & 8|1: behave like require
- /******/ __webpack_require__.t = function(value, mode) {
- /******/ if(mode & 1) value = __webpack_require__(value);
- /******/ if(mode & 8) return value;
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
- /******/ var ns = Object.create(null);
- /******/ __webpack_require__.r(ns);
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
- /******/ return ns;
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = "./src/ckeditor.js");
- /******/ })
- /************************************************************************/
- /******/ ({
- /***/ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderUploadAdapter; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /* globals XMLHttpRequest, FormData */
- /**
- * @module adapter-ckfinder/uploadadapter
- */
- /**
- * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.
- *
- * See the {@glink features/image-upload/ckfinder "CKFinder file manager integration" guide} to learn how to configure
- * and use this feature as well as find out more about the full integration with the file manager
- * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.
- *
- * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload overview"} to learn about
- * other ways to upload images into CKEditor 5.
- *
- * @extends module:core/plugin~Plugin
- */
- class CKFinderUploadAdapter extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'CKFinderUploadAdapter';
- }
- /**
- * @inheritDoc
- */
- init() {
- const url = this.editor.config.get( 'ckfinder.uploadUrl' );
- if ( !url ) {
- return;
- }
- // Register CKFinderAdapter
- this.editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] ).createUploadAdapter = loader => new UploadAdapter( loader, url, this.editor.t );
- }
- }
- /**
- * Upload adapter for CKFinder.
- *
- * @private
- * @implements module:upload/filerepository~UploadAdapter
- */
- class UploadAdapter {
- /**
- * Creates a new adapter instance.
- *
- * @param {module:upload/filerepository~FileLoader} loader
- * @param {String} url
- * @param {module:utils/locale~Locale#t} t
- */
- constructor( loader, url, t ) {
- /**
- * FileLoader instance to use during the upload.
- *
- * @member {module:upload/filerepository~FileLoader} #loader
- */
- this.loader = loader;
- /**
- * Upload URL.
- *
- * @member {String} #url
- */
- this.url = url;
- /**
- * Locale translation method.
- *
- * @member {module:utils/locale~Locale#t} #t
- */
- this.t = t;
- }
- /**
- * Starts the upload process.
- *
- * @see module:upload/filerepository~UploadAdapter#upload
- * @returns {Promise.<Object>}
- */
- upload() {
- return this.loader.file.then( file => {
- return new Promise( ( resolve, reject ) => {
- this._initRequest();
- this._initListeners( resolve, reject, file );
- this._sendRequest( file );
- } );
- } );
- }
- /**
- * Aborts the upload process.
- *
- * @see module:upload/filerepository~UploadAdapter#abort
- */
- abort() {
- if ( this.xhr ) {
- this.xhr.abort();
- }
- }
- /**
- * Initializes the XMLHttpRequest object.
- *
- * @private
- */
- _initRequest() {
- const xhr = this.xhr = new XMLHttpRequest();
- xhr.open( 'POST', this.url, true );
- xhr.responseType = 'json';
- }
- /**
- * Initializes XMLHttpRequest listeners.
- *
- * @private
- * @param {Function} resolve Callback function to be called when the request is successful.
- * @param {Function} reject Callback function to be called when the request cannot be completed.
- * @param {File} file File instance to be uploaded.
- */
- _initListeners( resolve, reject, file ) {
- const xhr = this.xhr;
- const loader = this.loader;
- const t = this.t;
- const genericError = t( 'Cannot upload file:' ) + ` ${ file.name }.`;
- xhr.addEventListener( 'error', () => reject( genericError ) );
- xhr.addEventListener( 'abort', () => reject() );
- xhr.addEventListener( 'load', () => {
- const response = xhr.response;
- if ( !response || !response.uploaded ) {
- return reject( response && response.error && response.error.message ? response.error.message : genericError );
- }
- resolve( {
- default: response.url
- } );
- } );
- // Upload progress when it's supported.
- /* istanbul ignore else */
- if ( xhr.upload ) {
- xhr.upload.addEventListener( 'progress', evt => {
- if ( evt.lengthComputable ) {
- loader.uploadTotal = evt.total;
- loader.uploaded = evt.loaded;
- }
- } );
- }
- }
- /**
- * Prepares the data and sends the request.
- *
- * @private
- * @param {File} file File instance to be uploaded.
- */
- _sendRequest( file ) {
- // Prepare form data.
- const data = new FormData();
- data.append( 'upload', file );
- data.append( 'ckCsrfToken', Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCsrfToken"])() );
- // Send request.
- this.xhr.send( data );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js ***!
- \************************************************************************/
- /*! exports provided: getCsrfToken, getCookie, setCookie */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCsrfToken", function() { return getCsrfToken; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCookie", function() { return getCookie; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCookie", function() { return setCookie; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /* globals window, document */
- /**
- * @module adapter-ckfinder/utils
- */
- const TOKEN_COOKIE_NAME = 'ckCsrfToken';
- const TOKEN_LENGTH = 40;
- const tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';
- /**
- * Returns the CSRF token value. The value is a hash stored in `document.cookie`
- * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication
- * between the web browser and the CKFinder server.
- *
- * @returns {String}
- */
- function getCsrfToken() {
- let token = getCookie( TOKEN_COOKIE_NAME );
- if ( !token || token.length != TOKEN_LENGTH ) {
- token = generateToken( TOKEN_LENGTH );
- setCookie( TOKEN_COOKIE_NAME, token );
- }
- return token;
- }
- /**
- * Returns the value of the cookie with a given name or `null` if the cookie is not found.
- *
- * @param {String} name
- * @returns {String|null}
- */
- function getCookie( name ) {
- name = name.toLowerCase();
- const parts = document.cookie.split( ';' );
- for ( const part of parts ) {
- const pair = part.split( '=' );
- const key = decodeURIComponent( pair[ 0 ].trim().toLowerCase() );
- if ( key === name ) {
- return decodeURIComponent( pair[ 1 ] );
- }
- }
- return null;
- }
- /**
- * Sets the value of the cookie with a given name.
- *
- * @param {String} name
- * @param {String} value
- */
- function setCookie( name, value ) {
- document.cookie = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';path=/';
- }
- // Generates the CSRF token with the given length.
- //
- // @private
- // @param {Number} length
- // @returns {string}
- function generateToken( length ) {
- let result = '';
- const randValues = new Uint8Array( length );
- window.crypto.getRandomValues( randValues );
- for ( let j = 0; j < randValues.length; j++ ) {
- const character = tokenCharset.charAt( randValues[ j ] % tokenCharset.length );
- result += Math.random() > 0.5 ? character.toUpperCase() : character;
- }
- return result;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Alignment; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _alignmentediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./alignmentediting */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js");
- /* harmony import */ var _alignmentui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./alignmentui */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module alignment/alignment
- */
- /**
- * The text alignment plugin.
- *
- * For a detailed overview, check the {@glink features/text-alignment Text alignment feature documentation}
- * and the {@glink api/alignment package page}.
- *
- * This is a "glue" plugin which loads the {@link module:alignment/alignmentediting~AlignmentEditing} and
- * {@link module:alignment/alignmentui~AlignmentUI} plugins.
- *
- * @extends module:core/plugin~Plugin
- */
- class Alignment extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _alignmentediting__WEBPACK_IMPORTED_MODULE_1__["default"], _alignmentui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Alignment';
- }
- }
- /**
- * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
- *
- * Read more in {@link module:alignment/alignment~AlignmentConfig}.
- *
- * @member {module:alignment/alignment~AlignmentConfig} module:core/editor/editorconfig~EditorConfig#alignment
- */
- /**
- * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
- *
- * ClassicEditor
- * .create( editorElement, {
- * alignment: {
- * options: [ 'left', 'right' ]
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
- *
- * @interface AlignmentConfig
- */
- /**
- * Available alignment options.
- *
- * The available options are: `'left'`, `'right'`, `'center'` and `'justify'`. Other values are ignored.
- *
- * **Note:** It is recommended to always use `'left'` or `'right'` as these are default values which the user should
- * normally be able to choose depending on the
- * {@glink features/ui-language#setting-the-language-of-the-content language of the editor content}.
- *
- * ClassicEditor
- * .create( editorElement, {
- * alignment: {
- * options: [ 'left', 'right' ]
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * By default the alignment is set inline using the `text-align` CSS property. To further customize the alignment,
- * you can provide names of classes for each alignment option using the `className` property.
- *
- * **Note:** Once you define the `className` property for one option, you need to specify it for all other options.
- *
- * ClassicEditor
- * .create( editorElement, {
- * alignment: {
- * options: [
- * { name: 'left', className: 'my-align-left' },
- * { name: 'right', className: 'my-align-right' }
- * ]
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See the demo of {@glink features/text-alignment#configuring-alignment-options custom alignment options}.
- *
- * @member {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} module:alignment/alignment~AlignmentConfig#options
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AlignmentCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module alignment/alignmentcommand
- */
- const ALIGNMENT = 'alignment';
- /**
- * The alignment command plugin.
- *
- * @extends module:core/command~Command
- */
- class AlignmentCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const editor = this.editor;
- const locale = editor.locale;
- const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this.editor.model.document.selection.getSelectedBlocks() );
- // As first check whether to enable or disable the command as the value will always be false if the command cannot be enabled.
- this.isEnabled = !!firstBlock && this._canBeAligned( firstBlock );
- /**
- * A value of the current block's alignment.
- *
- * @observable
- * @readonly
- * @member {String} #value
- */
- if ( this.isEnabled && firstBlock.hasAttribute( 'alignment' ) ) {
- this.value = firstBlock.getAttribute( 'alignment' );
- } else {
- this.value = locale.contentLanguageDirection === 'rtl' ? 'right' : 'left';
- }
- }
- /**
- * Executes the command. Applies the alignment `value` to the selected blocks.
- * If no `value` is passed, the `value` is the default one or it is equal to the currently selected block's alignment attribute,
- * the command will remove the attribute from the selected blocks.
- *
- * @param {Object} [options] Options for the executed command.
- * @param {String} [options.value] The value to apply.
- * @fires execute
- */
- execute( options = {} ) {
- const editor = this.editor;
- const locale = editor.locale;
- const model = editor.model;
- const doc = model.document;
- const value = options.value;
- model.change( writer => {
- // Get only those blocks from selected that can have alignment set
- const blocks = Array.from( doc.selection.getSelectedBlocks() ).filter( block => this._canBeAligned( block ) );
- const currentAlignment = blocks[ 0 ].getAttribute( 'alignment' );
- // Remove alignment attribute if current alignment is:
- // - default (should not be stored in model as it will bloat model data)
- // - equal to currently set
- // - or no value is passed - denotes default alignment.
- const removeAlignment = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isDefault"])( value, locale ) || currentAlignment === value || !value;
- if ( removeAlignment ) {
- removeAlignmentFromSelection( blocks, writer );
- } else {
- setAlignmentOnSelection( blocks, writer, value );
- }
- } );
- }
- /**
- * Checks whether a block can have alignment set.
- *
- * @private
- * @param {module:engine/model/element~Element} block The block to be checked.
- * @returns {Boolean}
- */
- _canBeAligned( block ) {
- return this.editor.model.schema.checkAttribute( block, ALIGNMENT );
- }
- }
- // Removes the alignment attribute from blocks.
- // @private
- function removeAlignmentFromSelection( blocks, writer ) {
- for ( const block of blocks ) {
- writer.removeAttribute( ALIGNMENT, block );
- }
- }
- // Sets the alignment attribute on blocks.
- // @private
- function setAlignmentOnSelection( blocks, writer, alignment ) {
- for ( const block of blocks ) {
- writer.setAttribute( ALIGNMENT, alignment, block );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AlignmentEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _alignmentcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./alignmentcommand */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module alignment/alignmentediting
- */
- /**
- * The alignment editing feature. It introduces the {@link module:alignment/alignmentcommand~AlignmentCommand command} and adds
- * the `alignment` attribute for block elements in the {@link module:engine/model/model~Model model}.
- * @extends module:core/plugin~Plugin
- */
- class AlignmentEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'AlignmentEditing';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- editor.config.define( 'alignment', {
- options: [ ..._utils__WEBPACK_IMPORTED_MODULE_2__["supportedOptions"].map( option => ( { name: option } ) ) ]
- } );
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const locale = editor.locale;
- const schema = editor.model.schema;
- const options = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeAlignmentOptions"])( editor.config.get( 'alignment.options' ) );
- // Filter out unsupported options and those that are redundant, e.g. `left` in LTR / `right` in RTL mode.
- const optionsToConvert = options.filter(
- option => Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isSupported"])( option.name ) && !Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isDefault"])( option.name, locale )
- );
- // Once there is at least one `className` defined, we switch to alignment with classes.
- const shouldUseClasses = optionsToConvert.some( option => !!option.className );
- // Allow alignment attribute on all blocks.
- schema.extend( '$block', { allowAttributes: 'alignment' } );
- editor.model.schema.setAttributeProperties( 'alignment', { isFormatting: true } );
- if ( shouldUseClasses ) {
- editor.conversion.attributeToAttribute( buildClassDefinition( optionsToConvert ) );
- } else {
- // Downcast inline styles.
- editor.conversion.for( 'downcast' ).attributeToAttribute( buildDowncastInlineDefinition( optionsToConvert ) );
- }
- const upcastInlineDefinitions = buildUpcastInlineDefinitions( optionsToConvert );
- // Always upcast from inline styles.
- for ( const definition of upcastInlineDefinitions ) {
- editor.conversion.for( 'upcast' ).attributeToAttribute( definition );
- }
- const upcastCompatibilityDefinitions = buildUpcastCompatibilityDefinitions( optionsToConvert );
- // Always upcast from deprecated `align` attribute.
- for ( const definition of upcastCompatibilityDefinitions ) {
- editor.conversion.for( 'upcast' ).attributeToAttribute( definition );
- }
- editor.commands.add( 'alignment', new _alignmentcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
- }
- }
- // Prepare downcast conversion definition for inline alignment styling.
- // @private
- function buildDowncastInlineDefinition( options ) {
- const definition = {
- model: {
- key: 'alignment',
- values: options.map( option => option.name )
- },
- view: {}
- };
- for ( const { name } of options ) {
- definition.view[ name ] = {
- key: 'style',
- value: {
- 'text-align': name
- }
- };
- }
- return definition;
- }
- // Prepare upcast definitions for inline alignment styles.
- // @private
- function buildUpcastInlineDefinitions( options ) {
- const definitions = [];
- for ( const { name } of options ) {
- definitions.push( {
- view: {
- key: 'style',
- value: {
- 'text-align': name
- }
- },
- model: {
- key: 'alignment',
- value: name
- }
- } );
- }
- return definitions;
- }
- // Prepare upcast definitions for deprecated `align` attribute.
- // @private
- function buildUpcastCompatibilityDefinitions( options ) {
- const definitions = [];
- for ( const { name } of options ) {
- definitions.push( {
- view: {
- key: 'align',
- value: name
- },
- model: {
- key: 'alignment',
- value: name
- }
- } );
- }
- return definitions;
- }
- // Prepare conversion definitions for upcast and downcast alignment with classes.
- // @private
- function buildClassDefinition( options ) {
- const definition = {
- model: {
- key: 'alignment',
- values: options.map( option => option.name )
- },
- view: {}
- };
- for ( const option of options ) {
- definition.view[ option.name ] = {
- key: 'class',
- value: option.className
- };
- }
- return definition;
- }
- /**
- * The alignment configuration format descriptor.
- *
- * const alignmentFormat = {
- * name: 'right',
- * className: 'my-align-right-class'
- * }
- *
- * @typedef {Object} module:alignment/alignmentediting~AlignmentFormat
- *
- * @property {'left'|'right'|'center'|'justify'} name One of the alignment names options.
- *
- * @property {String} className The CSS class used to represent the style in the view.
- * Used to override default, inline styling for alignment.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AlignmentUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module alignment/alignmentui
- */
- const iconsMap = new Map( [
- [ 'left', ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].alignLeft ],
- [ 'right', ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].alignRight ],
- [ 'center', ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].alignCenter ],
- [ 'justify', ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].alignJustify ]
- ] );
- /**
- * The default alignment UI plugin.
- *
- * It introduces the `'alignment:left'`, `'alignment:right'`, `'alignment:center'` and `'alignment:justify'` buttons
- * and the `'alignment'` dropdown.
- *
- * @extends module:core/plugin~Plugin
- */
- class AlignmentUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * Returns the localized option titles provided by the plugin.
- *
- * The following localized titles corresponding with
- * {@link module:alignment/alignment~AlignmentConfig#options} are available:
- *
- * * `'left'`,
- * * `'right'`,
- * * `'center'`,
- * * `'justify'`.
- *
- * @readonly
- * @type {Object.<String,String>}
- */
- get localizedOptionTitles() {
- const t = this.editor.t;
- return {
- 'left': t( 'Align left' ),
- 'right': t( 'Align right' ),
- 'center': t( 'Align center' ),
- 'justify': t( 'Justify' )
- };
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'AlignmentUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const componentFactory = editor.ui.componentFactory;
- const t = editor.t;
- const options = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeAlignmentOptions"])( editor.config.get( 'alignment.options' ) );
- options
- .map( option => option.name )
- .filter( _utils__WEBPACK_IMPORTED_MODULE_2__["isSupported"] )
- .forEach( option => this._addButton( option ) );
- componentFactory.add( 'alignment', locale => {
- const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
- // Add existing alignment buttons to dropdown's toolbar.
- const buttons = options.map( option => componentFactory.create( `alignment:${ option.name }` ) );
- Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addToolbarToDropdown"])( dropdownView, buttons );
- // Configure dropdown properties an behavior.
- dropdownView.buttonView.set( {
- label: t( 'Text alignment' ),
- tooltip: true
- } );
- dropdownView.toolbarView.isVertical = true;
- dropdownView.toolbarView.ariaLabel = t( 'Text alignment toolbar' );
- dropdownView.extendTemplate( {
- attributes: {
- class: 'ck-alignment-dropdown'
- }
- } );
- // The default icon depends on the direction of the content.
- const defaultIcon = locale.contentLanguageDirection === 'rtl' ? iconsMap.get( 'right' ) : iconsMap.get( 'left' );
- // Change icon to reflect current selection's alignment.
- dropdownView.buttonView.bind( 'icon' ).toMany( buttons, 'isOn', ( ...areActive ) => {
- // Get the index of an active button.
- const index = areActive.findIndex( value => value );
- // If none of the commands is active, display either defaultIcon or the first button's icon.
- if ( index < 0 ) {
- return defaultIcon;
- }
- // Return active button's icon.
- return buttons[ index ].icon;
- } );
- // Enable button if any of the buttons is enabled.
- dropdownView.bind( 'isEnabled' ).toMany( buttons, 'isEnabled', ( ...areEnabled ) => areEnabled.some( isEnabled => isEnabled ) );
- return dropdownView;
- } );
- }
- /**
- * Helper method for initializing the button and linking it with an appropriate command.
- *
- * @private
- * @param {String} option The name of the alignment option for which the button is added.
- */
- _addButton( option ) {
- const editor = this.editor;
- editor.ui.componentFactory.add( `alignment:${ option }`, locale => {
- const command = editor.commands.get( 'alignment' );
- const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- buttonView.set( {
- label: this.localizedOptionTitles[ option ],
- icon: iconsMap.get( option ),
- tooltip: true,
- isToggleable: true
- } );
- // Bind button model to command.
- buttonView.bind( 'isEnabled' ).to( command );
- buttonView.bind( 'isOn' ).to( command, 'value', value => value === option );
- // Execute command.
- this.listenTo( buttonView, 'execute', () => {
- editor.execute( 'alignment', { value: option } );
- editor.editing.view.focus();
- } );
- return buttonView;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js ***!
- \*****************************************************************/
- /*! exports provided: supportedOptions, isSupported, isDefault, normalizeAlignmentOptions */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportedOptions", function() { return supportedOptions; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSupported", function() { return isSupported; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDefault", function() { return isDefault; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeAlignmentOptions", function() { return normalizeAlignmentOptions; });
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module alignment/utils
- */
- /**
- * The list of supported alignment options:
- *
- * * `'left'`,
- * * `'right'`,
- * * `'center'`,
- * * `'justify'`
- */
- const supportedOptions = [ 'left', 'right', 'center', 'justify' ];
- /**
- * Checks whether the passed option is supported by {@link module:alignment/alignmentediting~AlignmentEditing}.
- *
- * @param {String} option The option value to check.
- * @returns {Boolean}
- */
- function isSupported( option ) {
- return supportedOptions.includes( option );
- }
- /**
- * Checks whether alignment is the default one considering the direction
- * of the editor content.
- *
- * @param {String} alignment The name of the alignment to check.
- * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
- * @returns {Boolean}
- */
- function isDefault( alignment, locale ) {
- // Right now only LTR is supported so the 'left' value is always the default one.
- if ( locale.contentLanguageDirection == 'rtl' ) {
- return alignment === 'right';
- } else {
- return alignment === 'left';
- }
- }
- /**
- * Brings the configuration to the common form, an array of objects.
- *
- * @param {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} configuredOptions Alignment plugin configuration.
- * @returns {Array.<module:alignment/alignmentediting~AlignmentFormat>} Normalized object holding the configuration.
- */
- function normalizeAlignmentOptions( configuredOptions ) {
- const normalizedOptions = configuredOptions
- .map( option => {
- let result;
- if ( typeof option == 'string' ) {
- result = { name: option };
- } else {
- result = option;
- }
- return result;
- } )
- // Remove all unknown options.
- .filter( option => {
- const isNameValid = !!supportedOptions.includes( option.name );
- if ( !isNameValid ) {
- /**
- * The `name` in one of the `alignment.options` is not recognized.
- * The available options are: `'left'`, `'right'`, `'center'` and `'justify'`.
- *
- * @error alignment-config-name-not-recognized
- * @param {Object} option Options with unknown value of the `name` property.
- */
- Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["logWarning"])( 'alignment-config-name-not-recognized', { option } );
- }
- return isNameValid;
- } );
- const classNameCount = normalizedOptions.filter( option => !!option.className ).length;
- // We either use classes for all styling options or for none.
- if ( classNameCount && classNameCount < normalizedOptions.length ) {
- /**
- * The `className` property has to be defined for all options once at least one option declares `className`.
- *
- * @error alignment-config-classnames-are-missing
- * @param {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} configuredOptions Contents of `alignment.options`.
- */
- throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"]( 'alignment-config-classnames-are-missing', { configuredOptions } );
- }
- // Validate resulting config.
- normalizedOptions.forEach( ( option, index, allOptions ) => {
- const succeedingOptions = allOptions.slice( index + 1 );
- const nameAlreadyExists = succeedingOptions.some( item => item.name == option.name );
- if ( nameAlreadyExists ) {
- /**
- * The same `name` in one of the `alignment.options` was already declared.
- * Each `name` representing one alignment option can be set exactly once.
- *
- * @error alignment-config-name-already-defined
- * @param {Object} option First option that declares given `name`.
- * @param {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} configuredOptions Contents of `alignment.options`.
- */
- throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"]( 'alignment-config-name-already-defined', { option, configuredOptions } );
- }
- // The `className` property is present. Check for duplicates then.
- if ( option.className ) {
- const classNameAlreadyExists = succeedingOptions.some( item => item.className == option.className );
- if ( classNameAlreadyExists ) {
- /**
- * The same `className` in one of the `alignment.options` was already declared.
- *
- * @error alignment-config-classname-already-defined
- * @param {Object} option First option that declares given `className`.
- * @param {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} configuredOptions
- * Contents of `alignment.options`.
- */
- throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"]( 'alignment-config-classname-already-defined', { option, configuredOptions } );
- }
- }
- } );
- return normalizedOptions;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Autoformat; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blockautoformatediting */ "./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js");
- /* harmony import */ var _inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inlineautoformatediting */ "./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module autoformat/autoformat
- */
- /**
- * Enables a set of predefined autoformatting actions.
- *
- * For a detailed overview, check the {@glink features/autoformat Autoformatting feature documentation}
- * and the {@glink api/autoformat package page}.
- *
- * @extends module:core/plugin~Plugin
- */
- class Autoformat extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Autoformat';
- }
- /**
- * @inheritDoc
- */
- afterInit() {
- this._addListAutoformats();
- this._addBasicStylesAutoformats();
- this._addHeadingAutoformats();
- this._addBlockQuoteAutoformats();
- this._addCodeBlockAutoformats();
- this._addHorizontalLineAutoformats();
- }
- /**
- * Adds autoformatting related to the {@link module:list/list~List}.
- *
- * When typed:
- * - `* ` or `- ` – A paragraph will be changed to a bulleted list.
- * - `1. ` or `1) ` – A paragraph will be changed to a numbered list ("1" can be any digit or a list of digits).
- * - `[] ` or `[ ] ` – A paragraph will be changed to a to-do list.
- * - `[x] ` or `[ x ] ` – A paragraph will be changed to a checked to-do list.
- *
- * @private
- */
- _addListAutoformats() {
- const commands = this.editor.commands;
- if ( commands.get( 'bulletedList' ) ) {
- Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^[*-]\s$/, 'bulletedList' );
- }
- if ( commands.get( 'numberedList' ) ) {
- Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^1[.|)]\s$/, 'numberedList' );
- }
- if ( commands.get( 'todoList' ) ) {
- Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^\[\s?\]\s$/, 'todoList' );
- }
- if ( commands.get( 'checkTodoList' ) ) {
- Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^\[\s?x\s?\]\s$/, () => {
- this.editor.execute( 'todoList' );
- this.editor.execute( 'checkTodoList' );
- } );
- }
- }
- /**
- * Adds autoformatting related to the {@link module:basic-styles/bold~Bold},
- * {@link module:basic-styles/italic~Italic}, {@link module:basic-styles/code~Code}
- * and {@link module:basic-styles/strikethrough~Strikethrough}
- *
- * When typed:
- * - `**foobar**` – `**` characters are removed and `foobar` is set to bold,
- * - `__foobar__` – `__` characters are removed and `foobar` is set to bold,
- * - `*foobar*` – `*` characters are removed and `foobar` is set to italic,
- * - `_foobar_` – `_` characters are removed and `foobar` is set to italic,
- * - ``` `foobar` – ``` ` ``` characters are removed and `foobar` is set to code,
- * - `~~foobar~~` – `~~` characters are removed and `foobar` is set to strikethrough.
- *
- * @private
- */
- _addBasicStylesAutoformats() {
- const commands = this.editor.commands;
- if ( commands.get( 'bold' ) ) {
- const boldCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'bold' );
- Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /(?:^|\s)(\*\*)([^*]+)(\*\*)$/g, boldCallback );
- Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /(?:^|\s)(__)([^_]+)(__)$/g, boldCallback );
- }
- if ( commands.get( 'italic' ) ) {
- const italicCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'italic' );
- // The italic autoformatter cannot be triggered by the bold markers, so we need to check the
- // text before the pattern (e.g. `(?:^|[^\*])`).
- Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /(?:^|\s)(\*)([^*_]+)(\*)$/g, italicCallback );
- Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /(?:^|\s)(_)([^_]+)(_)$/g, italicCallback );
- }
- if ( commands.get( 'code' ) ) {
- const codeCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'code' );
- Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /(`)([^`]+)(`)$/g, codeCallback );
- }
- if ( commands.get( 'strikethrough' ) ) {
- const strikethroughCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'strikethrough' );
- Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /(~~)([^~]+)(~~)$/g, strikethroughCallback );
- }
- }
- /**
- * Adds autoformatting related to {@link module:heading/heading~Heading}.
- *
- * It is using a number at the end of the command name to associate it with the proper trigger:
- *
- * * `heading` with value `heading1` will be executed when typing `#`,
- * * `heading` with value `heading2` will be executed when typing `##`,
- * * ... up to `heading6` and `######`.
- *
- * @private
- */
- _addHeadingAutoformats() {
- const command = this.editor.commands.get( 'heading' );
- if ( command ) {
- command.modelElements
- .filter( name => name.match( /^heading[1-6]$/ ) )
- .forEach( modelName => {
- const level = modelName[ 7 ];
- const pattern = new RegExp( `^(#{${ level }})\\s$` );
- Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, pattern, () => {
- // Should only be active if command is enabled and heading style associated with pattern is inactive.
- if ( !command.isEnabled || command.value === modelName ) {
- return false;
- }
- this.editor.execute( 'heading', { value: modelName } );
- } );
- } );
- }
- }
- /**
- * Adds autoformatting related to {@link module:block-quote/blockquote~BlockQuote}.
- *
- * When typed:
- * * `> ` – A paragraph will be changed to a block quote.
- *
- * @private
- */
- _addBlockQuoteAutoformats() {
- if ( this.editor.commands.get( 'blockQuote' ) ) {
- Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^>\s$/, 'blockQuote' );
- }
- }
- /**
- * Adds autoformatting related to {@link module:code-block/codeblock~CodeBlock}.
- *
- * When typed:
- * - `` ``` `` – A paragraph will be changed to a code block.
- *
- * @private
- */
- _addCodeBlockAutoformats() {
- if ( this.editor.commands.get( 'codeBlock' ) ) {
- Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^```$/, 'codeBlock' );
- }
- }
- /**
- * Adds autoformatting related to {@link module:horizontal-line/horizontalline~HorizontalLine}.
- *
- * When typed:
- * - `` --- `` – Will be replaced with a horizontal line.
- *
- * @private
- */
- _addHorizontalLineAutoformats() {
- if ( this.editor.commands.get( 'horizontalLine' ) ) {
- Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /^---$/, 'horizontalLine' );
- }
- }
- }
- // Helper function for getting `inlineAutoformatEditing` callbacks that checks if command is enabled.
- //
- // @param {module:core/editor/editor~Editor} editor
- // @param {String} attributeKey
- // @returns {Function}
- function getCallbackFunctionForInlineAutoformat( editor, attributeKey ) {
- return ( writer, rangesToFormat ) => {
- const command = editor.commands.get( attributeKey );
- if ( !command.isEnabled ) {
- return false;
- }
- const validRanges = editor.model.schema.getValidRanges( rangesToFormat, attributeKey );
- for ( const range of validRanges ) {
- writer.setAttribute( attributeKey, true, range );
- }
- // After applying attribute to the text, remove given attribute from the selection.
- // This way user is able to type a text without attribute used by auto formatter.
- writer.removeSelectionAttribute( attributeKey );
- };
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return blockAutoformatEditing; });
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * The block autoformatting engine. It allows to format various block patterns. For example,
- * it can be configured to turn a paragraph starting with `*` and followed by a space into a list item.
- *
- * The autoformatting operation is integrated with the undo manager,
- * so the autoformatting step can be undone if the user's intention was not to format the text.
- *
- * See the {@link module:autoformat/blockautoformatediting~blockAutoformatEditing `blockAutoformatEditing`} documentation
- * to learn how to create custom block autoformatters. You can also use
- * the {@link module:autoformat/autoformat~Autoformat} feature which enables a set of default autoformatters
- * (lists, headings, bold and italic).
- *
- * @module autoformat/blockautoformatediting
- */
- /**
- * Creates a listener triggered on {@link module:engine/model/document~Document#event:change:data `change:data`} event in the document.
- * Calls the callback when inserted text matches the regular expression or the command name
- * if provided instead of the callback.
- *
- * Examples of usage:
- *
- * To convert a paragraph to heading 1 when `- ` is typed, using just the command name:
- *
- * blockAutoformatEditing( editor, plugin, /^\- $/, 'heading1' );
- *
- * To convert a paragraph to heading 1 when `- ` is typed, using just the callback:
- *
- * blockAutoformatEditing( editor, plugin, /^\- $/, ( context ) => {
- * const { match } = context;
- * const headingLevel = match[ 1 ].length;
- *
- * editor.execute( 'heading', {
- * formatId: `heading${ headingLevel }`
- * } );
- * } );
- *
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- * @param {module:autoformat/autoformat~Autoformat} plugin The autoformat plugin instance.
- * @param {RegExp} pattern The regular expression to execute on just inserted text. The regular expression is tested against the text
- * from the beginning until the caret position.
- * @param {Function|String} callbackOrCommand The callback to execute or the command to run when the text is matched.
- * In case of providing the callback, it receives the following parameter:
- * * {Object} match RegExp.exec() result of matching the pattern to inserted text.
- */
- function blockAutoformatEditing( editor, plugin, pattern, callbackOrCommand ) {
- let callback;
- let command = null;
- if ( typeof callbackOrCommand == 'function' ) {
- callback = callbackOrCommand;
- } else {
- // We assume that the actual command name was provided.
- command = editor.commands.get( callbackOrCommand );
- callback = () => {
- editor.execute( callbackOrCommand );
- };
- }
- editor.model.document.on( 'change:data', ( evt, batch ) => {
- if ( command && !command.isEnabled || !plugin.isEnabled ) {
- return;
- }
- const range = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( editor.model.document.selection.getRanges() );
- if ( !range.isCollapsed ) {
- return;
- }
- if ( batch.type == 'transparent' ) {
- return;
- }
- const changes = Array.from( editor.model.document.differ.getChanges() );
- const entry = changes[ 0 ];
- // Typing is represented by only a single change.
- if ( changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1 ) {
- return;
- }
- const blockToFormat = entry.position.parent;
- // Block formatting should be disabled in codeBlocks (#5800).
- if ( blockToFormat.is( 'element', 'codeBlock' ) ) {
- return;
- }
- // Only list commands and custom callbacks can be applied inside a list.
- if ( blockToFormat.is( 'element', 'listItem' ) &&
- typeof callbackOrCommand !== 'function' &&
- ![ 'numberedList', 'bulletedList', 'todoList' ].includes( callbackOrCommand )
- ) {
- return;
- }
- // In case a command is bound, do not re-execute it over an existing block style which would result with a style removal.
- // Instead just drop processing so that autoformat trigger text is not lost. E.g. writing "# " in a level 1 heading.
- if ( command && command.value === true ) {
- return;
- }
- const firstNode = blockToFormat.getChild( 0 );
- const firstNodeRange = editor.model.createRangeOn( firstNode );
- // Range is only expected to be within or at the very end of the first text node.
- if ( !firstNodeRange.containsRange( range ) && !range.end.isEqual( firstNodeRange.end ) ) {
- return;
- }
- const match = pattern.exec( firstNode.data.substr( 0, range.end.offset ) );
- // ...and this text node's data match the pattern.
- if ( !match ) {
- return;
- }
- // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.
- editor.model.enqueueChange( writer => {
- // Matched range.
- const start = writer.createPositionAt( blockToFormat, 0 );
- const end = writer.createPositionAt( blockToFormat, match[ 0 ].length );
- const range = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["LiveRange"]( start, end );
- const wasChanged = callback( { match } );
- // Remove matched text.
- if ( wasChanged !== false ) {
- writer.remove( range );
- const selectionRange = editor.model.document.selection.getFirstRange();
- const blockRange = writer.createRangeIn( blockToFormat );
- // If the block is empty and the document selection has been moved when
- // applying formatting (e.g. is now in newly created block).
- if ( blockToFormat.isEmpty && !blockRange.isEqual( selectionRange ) && !blockRange.containsRange( selectionRange, true ) ) {
- writer.remove( blockToFormat );
- }
- }
- range.detach();
- } );
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return inlineAutoformatEditing; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * The inline autoformatting engine. It allows to format various inline patterns. For example,
- * it can be configured to make "foo" bold when typed `**foo**` (the `**` markers will be removed).
- *
- * The autoformatting operation is integrated with the undo manager,
- * so the autoformatting step can be undone if the user's intention was not to format the text.
- *
- * See the {@link module:autoformat/inlineautoformatediting~inlineAutoformatEditing `inlineAutoformatEditing`} documentation
- * to learn how to create custom inline autoformatters. You can also use
- * the {@link module:autoformat/autoformat~Autoformat} feature which enables a set of default autoformatters
- * (lists, headings, bold and italic).
- *
- * @module autoformat/inlineautoformatediting
- */
- /**
- * Enables autoformatting mechanism for a given {@link module:core/editor/editor~Editor}.
- *
- * It formats the matched text by applying the given model attribute or by running the provided formatting callback.
- * On every {@link module:engine/model/document~Document#event:change:data data change} in the model document
- * the autoformatting engine checks the text on the left of the selection
- * and executes the provided action if the text matches given criteria (regular expression or callback).
- *
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- * @param {module:autoformat/autoformat~Autoformat} plugin The autoformat plugin instance.
- * @param {Function|RegExp} testRegexpOrCallback The regular expression or callback to execute on text.
- * Provided regular expression *must* have three capture groups. The first and the third capture group
- * should match opening and closing delimiters. The second capture group should match the text to format.
- *
- * // Matches the `**bold text**` pattern.
- * // There are three capturing groups:
- * // - The first to match the starting `**` delimiter.
- * // - The second to match the text to format.
- * // - The third to match the ending `**` delimiter.
- * inlineAutoformatEditing( editor, plugin, /(\*\*)([^\*]+?)(\*\*)$/g, formatCallback );
- *
- * When a function is provided instead of the regular expression, it will be executed with the text to match as a parameter.
- * The function should return proper "ranges" to delete and format.
- *
- * {
- * remove: [
- * [ 0, 1 ], // Remove the first letter from the given text.
- * [ 5, 6 ] // Remove the 6th letter from the given text.
- * ],
- * format: [
- * [ 1, 5 ] // Format all letters from 2nd to 5th.
- * ]
- * }
- *
- * @param {Function} formatCallback A callback to apply actual formatting.
- * It should return `false` if changes should not be applied (e.g. if a command is disabled).
- *
- * inlineAutoformatEditing( editor, plugin, /(\*\*)([^\*]+?)(\*\*)$/g, ( writer, rangesToFormat ) => {
- * const command = editor.commands.get( 'bold' );
- *
- * if ( !command.isEnabled ) {
- * return false;
- * }
- *
- * const validRanges = editor.model.schema.getValidRanges( rangesToFormat, 'bold' );
- *
- * for ( let range of validRanges ) {
- * writer.setAttribute( 'bold', true, range );
- * }
- * } );
- */
- function inlineAutoformatEditing( editor, plugin, testRegexpOrCallback, formatCallback ) {
- let regExp;
- let testCallback;
- if ( testRegexpOrCallback instanceof RegExp ) {
- regExp = testRegexpOrCallback;
- } else {
- testCallback = testRegexpOrCallback;
- }
- // A test callback run on changed text.
- testCallback = testCallback || ( text => {
- let result;
- const remove = [];
- const format = [];
- while ( ( result = regExp.exec( text ) ) !== null ) {
- // There should be full match and 3 capture groups.
- if ( result && result.length < 4 ) {
- break;
- }
- let {
- index,
- '1': leftDel,
- '2': content,
- '3': rightDel
- } = result;
- // Real matched string - there might be some non-capturing groups so we need to recalculate starting index.
- const found = leftDel + content + rightDel;
- index += result[ 0 ].length - found.length;
- // Start and End offsets of delimiters to remove.
- const delStart = [
- index,
- index + leftDel.length
- ];
- const delEnd = [
- index + leftDel.length + content.length,
- index + leftDel.length + content.length + rightDel.length
- ];
- remove.push( delStart );
- remove.push( delEnd );
- format.push( [ index + leftDel.length, index + leftDel.length + content.length ] );
- }
- return {
- remove,
- format
- };
- } );
- editor.model.document.on( 'change:data', ( evt, batch ) => {
- if ( batch.type == 'transparent' || !plugin.isEnabled ) {
- return;
- }
- const model = editor.model;
- const selection = model.document.selection;
- // Do nothing if selection is not collapsed.
- if ( !selection.isCollapsed ) {
- return;
- }
- const changes = Array.from( model.document.differ.getChanges() );
- const entry = changes[ 0 ];
- // Typing is represented by only a single change.
- if ( changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1 ) {
- return;
- }
- const focus = selection.focus;
- const block = focus.parent;
- const { text, range } = getTextAfterCode( model.createRange( model.createPositionAt( block, 0 ), focus ), model );
- const testOutput = testCallback( text );
- const rangesToFormat = testOutputToRanges( range.start, testOutput.format, model );
- const rangesToRemove = testOutputToRanges( range.start, testOutput.remove, model );
- if ( !( rangesToFormat.length && rangesToRemove.length ) ) {
- return;
- }
- // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.
- model.enqueueChange( writer => {
- // Apply format.
- const hasChanged = formatCallback( writer, rangesToFormat );
- // Strict check on `false` to have backward compatibility (when callbacks were returning `undefined`).
- if ( hasChanged === false ) {
- return;
- }
- // Remove delimiters - use reversed order to not mix the offsets while removing.
- for ( const range of rangesToRemove.reverse() ) {
- writer.remove( range );
- }
- } );
- } );
- }
- // Converts output of the test function provided to the inlineAutoformatEditing and converts it to the model ranges
- // inside provided block.
- //
- // @private
- // @param {module:engine/model/position~Position} start
- // @param {Array.<Array>} arrays
- // @param {module:engine/model/model~Model} model
- function testOutputToRanges( start, arrays, model ) {
- return arrays
- .filter( array => ( array[ 0 ] !== undefined && array[ 1 ] !== undefined ) )
- .map( array => {
- return model.createRange( start.getShiftedBy( array[ 0 ] ), start.getShiftedBy( array[ 1 ] ) );
- } );
- }
- // Returns the last text line after the last code element from the given range.
- // It is similar to {@link module:typing/utils/getlasttextline.getLastTextLine `getLastTextLine()`},
- // but it ignores any text before the last `code`.
- //
- // @param {module:engine/model/range~Range} range
- // @param {module:engine/model/model~Model} model
- // @returns {module:typing/utils/getlasttextline~LastTextLineData}
- function getTextAfterCode( range, model ) {
- let start = range.start;
- const text = Array.from( range.getItems() ).reduce( ( rangeText, node ) => {
- // Trim text to a last occurrence of an inline element and update range start.
- if ( !( node.is( '$text' ) || node.is( '$textProxy' ) ) || node.getAttribute( 'code' ) ) {
- start = model.createPositionAfter( node );
- return '';
- }
- return rangeText + node.data;
- }, '' );
- return { text, range: model.createRange( start, range.end ) };
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AttributeCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/attributecommand
- */
- /**
- * An extension of the base {@link module:core/command~Command} class, which provides utilities for a command
- * that toggles a single attribute on a text or an element.
- *
- * `AttributeCommand` uses {@link module:engine/model/document~Document#selection}
- * to decide which nodes (if any) should be changed, and applies or removes the attribute from them.
- *
- * The command checks the {@link module:engine/model/model~Model#schema} to decide if it can be enabled
- * for the current selection and to which nodes the attribute can be applied.
- *
- * @extends module:core/command~Command
- */
- class AttributeCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @param {module:core/editor/editor~Editor} editor
- * @param {String} attributeKey Attribute that will be set by the command.
- */
- constructor( editor, attributeKey ) {
- super( editor );
- /**
- * The attribute that will be set by the command.
- *
- * @readonly
- * @member {String}
- */
- this.attributeKey = attributeKey;
- /**
- * Flag indicating whether the command is active. The command is active when the
- * {@link module:engine/model/selection~Selection#hasAttribute selection has the attribute} which means that:
- *
- * * If the selection is not empty – That the attribute is set on the first node in the selection that allows this attribute.
- * * If the selection is empty – That the selection has the attribute itself (which means that newly typed
- * text will have this attribute, too).
- *
- * @observable
- * @readonly
- * @member {Boolean} #value
- */
- }
- /**
- * Updates the command's {@link #value} and {@link #isEnabled} based on the current selection.
- */
- refresh() {
- const model = this.editor.model;
- const doc = model.document;
- this.value = this._getValueFromFirstAllowedNode();
- this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, this.attributeKey );
- }
- /**
- * Executes the command — applies the attribute to the selection or removes it from the selection.
- *
- * If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.
- *
- * The execution result differs, depending on the {@link module:engine/model/document~Document#selection}:
- *
- * * If the selection is on a range, the command applies the attribute to all nodes in that range
- * (if they are allowed to have this attribute by the {@link module:engine/model/schema~Schema schema}).
- * * If the selection is collapsed in a non-empty node, the command applies the attribute to the
- * {@link module:engine/model/document~Document#selection} itself (note that typed characters copy attributes from the selection).
- * * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note
- * that the selection inherits all attributes from a node if it is in an empty node).
- *
- * @fires execute
- * @param {Object} [options] Command options.
- * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will apply the attribute,
- * otherwise the command will remove the attribute.
- * If not set, the command will look for its current value to decide what it should do.
- */
- execute( options = {} ) {
- const model = this.editor.model;
- const doc = model.document;
- const selection = doc.selection;
- const value = ( options.forceValue === undefined ) ? !this.value : options.forceValue;
- model.change( writer => {
- if ( selection.isCollapsed ) {
- if ( value ) {
- writer.setSelectionAttribute( this.attributeKey, true );
- } else {
- writer.removeSelectionAttribute( this.attributeKey );
- }
- } else {
- const ranges = model.schema.getValidRanges( selection.getRanges(), this.attributeKey );
- for ( const range of ranges ) {
- if ( value ) {
- writer.setAttribute( this.attributeKey, value, range );
- } else {
- writer.removeAttribute( this.attributeKey, range );
- }
- }
- }
- } );
- }
- /**
- * Checks the attribute value of the first node in the selection that allows the attribute.
- * For the collapsed selection returns the selection attribute.
- *
- * @private
- * @returns {Boolean} The attribute value.
- */
- _getValueFromFirstAllowedNode() {
- const model = this.editor.model;
- const schema = model.schema;
- const selection = model.document.selection;
- if ( selection.isCollapsed ) {
- return selection.hasAttribute( this.attributeKey );
- }
- for ( const range of selection.getRanges() ) {
- for ( const item of range.getItems() ) {
- if ( schema.checkAttribute( item, this.attributeKey ) ) {
- return item.hasAttribute( this.attributeKey );
- }
- }
- }
- return false;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Bold; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _bold_boldediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bold/boldediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js");
- /* harmony import */ var _bold_boldui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bold/boldui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/bold
- */
- /**
- * The bold feature.
- *
- * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
- * and the {@glink api/basic-styles package page}.
- *
- * This is a "glue" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}
- * and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.
- *
- * @extends module:core/plugin~Plugin
- */
- class Bold extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _bold_boldediting__WEBPACK_IMPORTED_MODULE_1__["default"], _bold_boldui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Bold';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoldEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/bold/boldediting
- */
- const BOLD = 'bold';
- /**
- * The bold editing feature.
- *
- * It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
- * as a `<strong>` element.
- *
- * @extends module:core/plugin~Plugin
- */
- class BoldEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'BoldEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Allow bold attribute on text nodes.
- editor.model.schema.extend( '$text', { allowAttributes: BOLD } );
- editor.model.schema.setAttributeProperties( BOLD, {
- isFormatting: true,
- copyOnEnter: true
- } );
- // Build converter from model to view for data and editing pipelines.
- editor.conversion.attributeToElement( {
- model: BOLD,
- view: 'strong',
- upcastAlso: [
- 'b',
- viewElement => {
- const fontWeight = viewElement.getStyle( 'font-weight' );
- if ( !fontWeight ) {
- return null;
- }
- // Value of the `font-weight` attribute can be defined as a string or a number.
- if ( fontWeight == 'bold' || Number( fontWeight ) >= 600 ) {
- return {
- name: true,
- styles: [ 'font-weight' ]
- };
- }
- }
- ]
- } );
- // Create bold command.
- editor.commands.add( BOLD, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, BOLD ) );
- // Set the Ctrl+B keystroke.
- editor.keystrokes.set( 'CTRL+B', BOLD );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoldUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _theme_icons_bold_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/bold.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/bold/boldui
- */
- const BOLD = 'bold';
- /**
- * The bold UI feature. It introduces the Bold button.
- *
- * @extends module:core/plugin~Plugin
- */
- class BoldUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'BoldUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const t = editor.t;
- // Add bold button to feature components.
- editor.ui.componentFactory.add( BOLD, locale => {
- const command = editor.commands.get( BOLD );
- const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- view.set( {
- label: t( 'Bold' ),
- icon: _theme_icons_bold_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
- keystroke: 'CTRL+B',
- tooltip: true,
- isToggleable: true
- } );
- view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
- // Execute command.
- this.listenTo( view, 'execute', () => {
- editor.execute( BOLD );
- editor.editing.view.focus();
- } );
- return view;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Italic; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _italic_italicediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./italic/italicediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js");
- /* harmony import */ var _italic_italicui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./italic/italicui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/italic
- */
- /**
- * The italic feature.
- *
- * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
- * and the {@glink api/basic-styles package page}.
- *
- * This is a "glue" plugin which loads the {@link module:basic-styles/italic/italicediting~ItalicEditing} and
- * {@link module:basic-styles/italic/italicui~ItalicUI} plugins.
- *
- * @extends module:core/plugin~Plugin
- */
- class Italic extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _italic_italicediting__WEBPACK_IMPORTED_MODULE_1__["default"], _italic_italicui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Italic';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ItalicEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/italic/italicediting
- */
- const ITALIC = 'italic';
- /**
- * The italic editing feature.
- *
- * It registers the `'italic'` command, the <kbd>Ctrl+I</kbd> keystroke and introduces the `italic` attribute in the model
- * which renders to the view as an `<i>` element.
- *
- * @extends module:core/plugin~Plugin
- */
- class ItalicEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ItalicEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Allow italic attribute on text nodes.
- editor.model.schema.extend( '$text', { allowAttributes: ITALIC } );
- editor.model.schema.setAttributeProperties( ITALIC, {
- isFormatting: true,
- copyOnEnter: true
- } );
- editor.conversion.attributeToElement( {
- model: ITALIC,
- view: 'i',
- upcastAlso: [
- 'em',
- {
- styles: {
- 'font-style': 'italic'
- }
- }
- ]
- } );
- // Create italic command.
- editor.commands.add( ITALIC, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, ITALIC ) );
- // Set the Ctrl+I keystroke.
- editor.keystrokes.set( 'CTRL+I', ITALIC );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ItalicUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _theme_icons_italic_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/italic.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/italic/italicui
- */
- const ITALIC = 'italic';
- /**
- * The italic UI feature. It introduces the Italic button.
- *
- * @extends module:core/plugin~Plugin
- */
- class ItalicUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ItalicUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const t = editor.t;
- // Add bold button to feature components.
- editor.ui.componentFactory.add( ITALIC, locale => {
- const command = editor.commands.get( ITALIC );
- const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- view.set( {
- label: t( 'Italic' ),
- icon: _theme_icons_italic_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
- keystroke: 'CTRL+I',
- tooltip: true,
- isToggleable: true
- } );
- view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
- // Execute command.
- this.listenTo( view, 'execute', () => {
- editor.execute( ITALIC );
- editor.editing.view.focus();
- } );
- return view;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Strikethrough; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _strikethrough_strikethroughediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strikethrough/strikethroughediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js");
- /* harmony import */ var _strikethrough_strikethroughui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./strikethrough/strikethroughui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/strikethrough
- */
- /**
- * The strikethrough feature.
- *
- * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
- * and the {@glink api/basic-styles package page}.
- *
- * This is a "glue" plugin which loads the {@link module:basic-styles/strikethrough/strikethroughediting~StrikethroughEditing} and
- * {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.
- *
- * @extends module:core/plugin~Plugin
- */
- class Strikethrough extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _strikethrough_strikethroughediting__WEBPACK_IMPORTED_MODULE_1__["default"], _strikethrough_strikethroughui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Strikethrough';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js":
- /*!*************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js ***!
- \*************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StrikethroughEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/strikethrough/strikethroughediting
- */
- const STRIKETHROUGH = 'strikethrough';
- /**
- * The strikethrough editing feature.
- *
- * It registers the `'strikethrough'` command, the <kbd>Ctrl+Shift+X</kbd> keystroke and introduces the
- * `strikethroughsthrough` attribute in the model which renders to the view
- * as a `<s>` element.
- *
- * @extends module:core/plugin~Plugin
- */
- class StrikethroughEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'StrikethroughEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Allow strikethrough attribute on text nodes.
- editor.model.schema.extend( '$text', { allowAttributes: STRIKETHROUGH } );
- editor.model.schema.setAttributeProperties( STRIKETHROUGH, {
- isFormatting: true,
- copyOnEnter: true
- } );
- editor.conversion.attributeToElement( {
- model: STRIKETHROUGH,
- view: 's',
- upcastAlso: [
- 'del',
- 'strike',
- {
- styles: {
- 'text-decoration': 'line-through'
- }
- }
- ]
- } );
- // Create strikethrough command.
- editor.commands.add( STRIKETHROUGH, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, STRIKETHROUGH ) );
- // Set the Ctrl+Shift+X keystroke.
- editor.keystrokes.set( 'CTRL+SHIFT+X', 'strikethrough' );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js":
- /*!********************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js ***!
- \********************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StrikethroughUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _theme_icons_strikethrough_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/strikethrough.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/strikethrough/strikethroughui
- */
- const STRIKETHROUGH = 'strikethrough';
- /**
- * The strikethrough UI feature. It introduces the Strikethrough button.
- *
- * @extends module:core/plugin~Plugin
- */
- class StrikethroughUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'StrikethroughUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const t = editor.t;
- // Add strikethrough button to feature components.
- editor.ui.componentFactory.add( STRIKETHROUGH, locale => {
- const command = editor.commands.get( STRIKETHROUGH );
- const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- view.set( {
- label: t( 'Strikethrough' ),
- icon: _theme_icons_strikethrough_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
- keystroke: 'CTRL+SHIFT+X',
- tooltip: true,
- isToggleable: true
- } );
- view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
- // Execute command.
- this.listenTo( view, 'execute', () => {
- editor.execute( STRIKETHROUGH );
- editor.editing.view.focus();
- } );
- return view;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Subscript; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _subscript_subscriptediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscript/subscriptediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js");
- /* harmony import */ var _subscript_subscriptui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./subscript/subscriptui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/subscript
- */
- /**
- * The subscript feature.
- *
- * It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and
- * {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.
- *
- * @extends module:core/plugin~Plugin
- */
- class Subscript extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _subscript_subscriptediting__WEBPACK_IMPORTED_MODULE_1__["default"], _subscript_subscriptui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Subscript';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js":
- /*!*****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js ***!
- \*****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SubscriptEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/subscript/subscriptediting
- */
- const SUBSCRIPT = 'subscript';
- /**
- * The subscript editing feature.
- *
- * It registers the `sub` command and introduces the `sub` attribute in the model which renders to the view
- * as a `<sub>` element.
- *
- * @extends module:core/plugin~Plugin
- */
- class SubscriptEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'SubscriptEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Allow sub attribute on text nodes.
- editor.model.schema.extend( '$text', { allowAttributes: SUBSCRIPT } );
- editor.model.schema.setAttributeProperties( SUBSCRIPT, {
- isFormatting: true,
- copyOnEnter: true
- } );
- // Build converter from model to view for data and editing pipelines.
- editor.conversion.attributeToElement( {
- model: SUBSCRIPT,
- view: 'sub',
- upcastAlso: [
- {
- styles: {
- 'vertical-align': 'sub'
- }
- }
- ]
- } );
- // Create sub command.
- editor.commands.add( SUBSCRIPT, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, SUBSCRIPT ) );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SubscriptUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _theme_icons_subscript_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/subscript.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/subscript/subscriptui
- */
- const SUBSCRIPT = 'subscript';
- /**
- * The subscript UI feature. It introduces the Subscript button.
- *
- * @extends module:core/plugin~Plugin
- */
- class SubscriptUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'SubscriptUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const t = editor.t;
- // Add subscript button to feature components.
- editor.ui.componentFactory.add( SUBSCRIPT, locale => {
- const command = editor.commands.get( SUBSCRIPT );
- const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- view.set( {
- label: t( 'Subscript' ),
- icon: _theme_icons_subscript_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
- tooltip: true,
- isToggleable: true
- } );
- view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
- // Execute command.
- this.listenTo( view, 'execute', () => {
- editor.execute( SUBSCRIPT );
- editor.editing.view.focus();
- } );
- return view;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Superscript; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _superscript_superscriptediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./superscript/superscriptediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js");
- /* harmony import */ var _superscript_superscriptui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./superscript/superscriptui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/superscript
- */
- /**
- * The superscript feature.
- *
- * It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and
- * {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.
- *
- * @extends module:core/plugin~Plugin
- */
- class Superscript extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _superscript_superscriptediting__WEBPACK_IMPORTED_MODULE_1__["default"], _superscript_superscriptui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Superscript';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js":
- /*!*********************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js ***!
- \*********************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SuperscriptEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/superscript/superscriptediting
- */
- const SUPERSCRIPT = 'superscript';
- /**
- * The superscript editing feature.
- *
- * It registers the `super` command and introduces the `super` attribute in the model which renders to the view
- * as a `<super>` element.
- *
- * @extends module:core/plugin~Plugin
- */
- class SuperscriptEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'SuperscriptEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Allow super attribute on text nodes.
- editor.model.schema.extend( '$text', { allowAttributes: SUPERSCRIPT } );
- editor.model.schema.setAttributeProperties( SUPERSCRIPT, {
- isFormatting: true,
- copyOnEnter: true
- } );
- // Build converter from model to view for data and editing pipelines.
- editor.conversion.attributeToElement( {
- model: SUPERSCRIPT,
- view: 'sup',
- upcastAlso: [
- {
- styles: {
- 'vertical-align': 'super'
- }
- }
- ]
- } );
- // Create super command.
- editor.commands.add( SUPERSCRIPT, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, SUPERSCRIPT ) );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js ***!
- \****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SuperscriptUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _theme_icons_superscript_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/superscript.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/superscript/superscriptui
- */
- const SUPERSCRIPT = 'superscript';
- /**
- * The superscript UI feature. It introduces the Superscript button.
- *
- * @extends module:core/plugin~Plugin
- */
- class SuperscriptUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'SuperscriptUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const t = editor.t;
- // Add superscript button to feature components.
- editor.ui.componentFactory.add( SUPERSCRIPT, locale => {
- const command = editor.commands.get( SUPERSCRIPT );
- const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- view.set( {
- label: t( 'Superscript' ),
- icon: _theme_icons_superscript_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
- tooltip: true,
- isToggleable: true
- } );
- view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
- // Execute command.
- this.listenTo( view, 'execute', () => {
- editor.execute( SUPERSCRIPT );
- editor.editing.view.focus();
- } );
- return view;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Underline; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _underline_underlineediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./underline/underlineediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js");
- /* harmony import */ var _underline_underlineui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./underline/underlineui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/underline
- */
- /**
- * The underline feature.
- *
- * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
- * and the {@glink api/basic-styles package page}.
- *
- * This is a "glue" plugin which loads the {@link module:basic-styles/underline/underlineediting~UnderlineEditing} and
- * {@link module:basic-styles/underline/underlineui~UnderlineUI} plugins.
- *
- * @extends module:core/plugin~Plugin
- */
- class Underline extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _underline_underlineediting__WEBPACK_IMPORTED_MODULE_1__["default"], _underline_underlineui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Underline';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js":
- /*!*****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js ***!
- \*****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UnderlineEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/underline/underlineediting
- */
- const UNDERLINE = 'underline';
- /**
- * The underline editing feature.
- *
- * It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
- * and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
- *
- * @extends module:core/plugin~Plugin
- */
- class UnderlineEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'UnderlineEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Allow strikethrough attribute on text nodes.
- editor.model.schema.extend( '$text', { allowAttributes: UNDERLINE } );
- editor.model.schema.setAttributeProperties( UNDERLINE, {
- isFormatting: true,
- copyOnEnter: true
- } );
- editor.conversion.attributeToElement( {
- model: UNDERLINE,
- view: 'u',
- upcastAlso: {
- styles: {
- 'text-decoration': 'underline'
- }
- }
- } );
- // Create underline command.
- editor.commands.add( UNDERLINE, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, UNDERLINE ) );
- // Set the Ctrl+U keystroke.
- editor.keystrokes.set( 'CTRL+U', 'underline' );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UnderlineUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _theme_icons_underline_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/underline.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module basic-styles/underline/underlineui
- */
- const UNDERLINE = 'underline';
- /**
- * The underline UI feature. It introduces the Underline button.
- *
- * @extends module:core/plugin~Plugin
- */
- class UnderlineUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'UnderlineUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const t = editor.t;
- // Add bold button to feature components.
- editor.ui.componentFactory.add( UNDERLINE, locale => {
- const command = editor.commands.get( UNDERLINE );
- const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- view.set( {
- label: t( 'Underline' ),
- icon: _theme_icons_underline_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
- keystroke: 'CTRL+U',
- tooltip: true,
- isToggleable: true
- } );
- view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
- // Execute command.
- this.listenTo( view, 'execute', () => {
- editor.execute( UNDERLINE );
- editor.editing.view.focus();
- } );
- return view;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg":
- /*!*************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg ***!
- \*************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9 6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z\"/><path d=\"M3 10.5V9h14v1.5z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m7.03 10.349 3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82zm8.147 7.829h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M15.677 8.678h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309zM7.03 10.349l3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3 18v-1.5h14V18zm2.2-8V3.6c0-.4.4-.6.8-.6.3 0 .7.2.7.6v6.2c0 2 1.3 2.8 3.2 2.8 1.9 0 3.4-.9 3.4-2.9V3.6c0-.3.4-.5.8-.5.3 0 .7.2.7.5V10c0 2.7-2.2 4-4.9 4-2.6 0-4.7-1.2-4.7-4z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuote; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _blockquoteediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blockquoteediting */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js");
- /* harmony import */ var _blockquoteui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./blockquoteui */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module block-quote/blockquote
- */
- /**
- * The block quote plugin.
- *
- * For more information about this feature check the {@glink api/block-quote package page}.
- *
- * This is a "glue" plugin which loads the {@link module:block-quote/blockquoteediting~BlockQuoteEditing block quote editing feature}
- * and {@link module:block-quote/blockquoteui~BlockQuoteUI block quote UI feature}.
- *
- * @extends module:core/plugin~Plugin
- */
- class BlockQuote extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _blockquoteediting__WEBPACK_IMPORTED_MODULE_1__["default"], _blockquoteui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'BlockQuote';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuoteCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module block-quote/blockquotecommand
- */
- /**
- * The block quote command plugin.
- *
- * @extends module:core/command~Command
- */
- class BlockQuoteCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * Whether the selection starts in a block quote.
- *
- * @observable
- * @readonly
- * @member {Boolean} #value
- */
- /**
- * @inheritDoc
- */
- refresh() {
- this.value = this._getValue();
- this.isEnabled = this._checkEnabled();
- }
- /**
- * Executes the command. When the command {@link #value is on}, all top-most block quotes within
- * the selection will be removed. If it is off, all selected blocks will be wrapped with
- * a block quote.
- *
- * @fires execute
- * @param {Object} [options] Command options.
- * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will apply a block quote,
- * otherwise the command will remove the block quote. If not set, the command will act basing on its current value.
- */
- execute( options = {} ) {
- const model = this.editor.model;
- const schema = model.schema;
- const selection = model.document.selection;
- const blocks = Array.from( selection.getSelectedBlocks() );
- const value = ( options.forceValue === undefined ) ? !this.value : options.forceValue;
- model.change( writer => {
- if ( !value ) {
- this._removeQuote( writer, blocks.filter( findQuote ) );
- } else {
- const blocksToQuote = blocks.filter( block => {
- // Already quoted blocks needs to be considered while quoting too
- // in order to reuse their <bQ> elements.
- return findQuote( block ) || checkCanBeQuoted( schema, block );
- } );
- this._applyQuote( writer, blocksToQuote );
- }
- } );
- }
- /**
- * Checks the command's {@link #value}.
- *
- * @private
- * @returns {Boolean} The current value.
- */
- _getValue() {
- const selection = this.editor.model.document.selection;
- const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( selection.getSelectedBlocks() );
- // In the current implementation, the block quote must be an immediate parent of a block element.
- return !!( firstBlock && findQuote( firstBlock ) );
- }
- /**
- * Checks whether the command can be enabled in the current context.
- *
- * @private
- * @returns {Boolean} Whether the command should be enabled.
- */
- _checkEnabled() {
- if ( this.value ) {
- return true;
- }
- const selection = this.editor.model.document.selection;
- const schema = this.editor.model.schema;
- const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( selection.getSelectedBlocks() );
- if ( !firstBlock ) {
- return false;
- }
- return checkCanBeQuoted( schema, firstBlock );
- }
- /**
- * Removes the quote from given blocks.
- *
- * If blocks which are supposed to be "unquoted" are in the middle of a quote,
- * start it or end it, then the quote will be split (if needed) and the blocks
- * will be moved out of it, so other quoted blocks remained quoted.
- *
- * @private
- * @param {module:engine/model/writer~Writer} writer
- * @param {Array.<module:engine/model/element~Element>} blocks
- */
- _removeQuote( writer, blocks ) {
- // Unquote all groups of block. Iterate in the reverse order to not break following ranges.
- getRangesOfBlockGroups( writer, blocks ).reverse().forEach( groupRange => {
- if ( groupRange.start.isAtStart && groupRange.end.isAtEnd ) {
- writer.unwrap( groupRange.start.parent );
- return;
- }
- // The group of blocks are at the beginning of an <bQ> so let's move them left (out of the <bQ>).
- if ( groupRange.start.isAtStart ) {
- const positionBefore = writer.createPositionBefore( groupRange.start.parent );
- writer.move( groupRange, positionBefore );
- return;
- }
- // The blocks are in the middle of an <bQ> so we need to split the <bQ> after the last block
- // so we move the items there.
- if ( !groupRange.end.isAtEnd ) {
- writer.split( groupRange.end );
- }
- // Now we are sure that groupRange.end.isAtEnd is true, so let's move the blocks right.
- const positionAfter = writer.createPositionAfter( groupRange.end.parent );
- writer.move( groupRange, positionAfter );
- } );
- }
- /**
- * Applies the quote to given blocks.
- *
- * @private
- * @param {module:engine/model/writer~Writer} writer
- * @param {Array.<module:engine/model/element~Element>} blocks
- */
- _applyQuote( writer, blocks ) {
- const quotesToMerge = [];
- // Quote all groups of block. Iterate in the reverse order to not break following ranges.
- getRangesOfBlockGroups( writer, blocks ).reverse().forEach( groupRange => {
- let quote = findQuote( groupRange.start );
- if ( !quote ) {
- quote = writer.createElement( 'blockQuote' );
- writer.wrap( groupRange, quote );
- }
- quotesToMerge.push( quote );
- } );
- // Merge subsequent <bQ> elements. Reverse the order again because this time we want to go through
- // the <bQ> elements in the source order (due to how merge works – it moves the right element's content
- // to the first element and removes the right one. Since we may need to merge a couple of subsequent `<bQ>` elements
- // we want to keep the reference to the first (furthest left) one.
- quotesToMerge.reverse().reduce( ( currentQuote, nextQuote ) => {
- if ( currentQuote.nextSibling == nextQuote ) {
- writer.merge( writer.createPositionAfter( currentQuote ) );
- return currentQuote;
- }
- return nextQuote;
- } );
- }
- }
- function findQuote( elementOrPosition ) {
- return elementOrPosition.parent.name == 'blockQuote' ? elementOrPosition.parent : null;
- }
- // Returns a minimal array of ranges containing groups of subsequent blocks.
- //
- // content: abcdefgh
- // blocks: [ a, b, d, f, g, h ]
- // output ranges: [ab]c[d]e[fgh]
- //
- // @param {Array.<module:engine/model/element~Element>} blocks
- // @returns {Array.<module:engine/model/range~Range>}
- function getRangesOfBlockGroups( writer, blocks ) {
- let startPosition;
- let i = 0;
- const ranges = [];
- while ( i < blocks.length ) {
- const block = blocks[ i ];
- const nextBlock = blocks[ i + 1 ];
- if ( !startPosition ) {
- startPosition = writer.createPositionBefore( block );
- }
- if ( !nextBlock || block.nextSibling != nextBlock ) {
- ranges.push( writer.createRange( startPosition, writer.createPositionAfter( block ) ) );
- startPosition = null;
- }
- i++;
- }
- return ranges;
- }
- // Checks whether <bQ> can wrap the block.
- function checkCanBeQuoted( schema, block ) {
- // TMP will be replaced with schema.checkWrap().
- const isBQAllowed = schema.checkChild( block.parent, 'blockQuote' );
- const isBlockAllowedInBQ = schema.checkChild( [ '$root', 'blockQuote' ], block );
- return isBQAllowed && isBlockAllowedInBQ;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuoteEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/enter */ "./node_modules/ckeditor5/src/enter.js");
- /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
- /* harmony import */ var _blockquotecommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./blockquotecommand */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module block-quote/blockquoteediting
- */
- /**
- * The block quote editing.
- *
- * Introduces the `'blockQuote'` command and the `'blockQuote'` model element.
- *
- * @extends module:core/plugin~Plugin
- */
- class BlockQuoteEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'BlockQuoteEditing';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_1__["Enter"], ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["Delete"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const schema = editor.model.schema;
- editor.commands.add( 'blockQuote', new _blockquotecommand__WEBPACK_IMPORTED_MODULE_3__["default"]( editor ) );
- schema.register( 'blockQuote', {
- allowWhere: '$block',
- allowContentOf: '$root'
- } );
- editor.conversion.elementToElement( { model: 'blockQuote', view: 'blockquote' } );
- // Postfixer which cleans incorrect model states connected with block quotes.
- editor.model.document.registerPostFixer( writer => {
- const changes = editor.model.document.differ.getChanges();
- for ( const entry of changes ) {
- if ( entry.type == 'insert' ) {
- const element = entry.position.nodeAfter;
- if ( !element ) {
- // We are inside a text node.
- continue;
- }
- if ( element.is( 'element', 'blockQuote' ) && element.isEmpty ) {
- // Added an empty blockQuote - remove it.
- writer.remove( element );
- return true;
- } else if ( element.is( 'element', 'blockQuote' ) && !schema.checkChild( entry.position, element ) ) {
- // Added a blockQuote in incorrect place. Unwrap it so the content inside is not lost.
- writer.unwrap( element );
- return true;
- } else if ( element.is( 'element' ) ) {
- // Just added an element. Check that all children meet the scheme rules.
- const range = writer.createRangeIn( element );
- for ( const child of range.getItems() ) {
- if (
- child.is( 'element', 'blockQuote' ) &&
- !schema.checkChild( writer.createPositionBefore( child ), child )
- ) {
- writer.unwrap( child );
- return true;
- }
- }
- }
- } else if ( entry.type == 'remove' ) {
- const parent = entry.position.parent;
- if ( parent.is( 'element', 'blockQuote' ) && parent.isEmpty ) {
- // Something got removed and now blockQuote is empty. Remove the blockQuote as well.
- writer.remove( parent );
- return true;
- }
- }
- }
- return false;
- } );
- const viewDocument = this.editor.editing.view.document;
- const selection = editor.model.document.selection;
- const blockQuoteCommand = editor.commands.get( 'blockQuote' );
- // Overwrite default Enter key behavior.
- // If Enter key is pressed with selection collapsed in empty block inside a quote, break the quote.
- this.listenTo( viewDocument, 'enter', ( evt, data ) => {
- if ( !selection.isCollapsed || !blockQuoteCommand.value ) {
- return;
- }
- const positionParent = selection.getLastPosition().parent;
- if ( positionParent.isEmpty ) {
- editor.execute( 'blockQuote' );
- editor.editing.view.scrollToTheSelection();
- data.preventDefault();
- evt.stop();
- }
- }, { context: 'blockquote' } );
- // Overwrite default Backspace key behavior.
- // If Backspace key is pressed with selection collapsed in first empty block inside a quote, break the quote.
- this.listenTo( viewDocument, 'delete', ( evt, data ) => {
- if ( data.direction != 'backward' || !selection.isCollapsed || !blockQuoteCommand.value ) {
- return;
- }
- const positionParent = selection.getLastPosition().parent;
- if ( positionParent.isEmpty && !positionParent.previousSibling ) {
- editor.execute( 'blockQuote' );
- editor.editing.view.scrollToTheSelection();
- data.preventDefault();
- evt.stop();
- }
- }, { context: 'blockquote' } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuoteUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _theme_blockquote_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/blockquote.css */ "./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css");
- /* harmony import */ var _theme_blockquote_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_blockquote_css__WEBPACK_IMPORTED_MODULE_2__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module block-quote/blockquoteui
- */
- /**
- * The block quote UI plugin.
- *
- * It introduces the `'blockQuote'` button.
- *
- * @extends module:core/plugin~Plugin
- */
- class BlockQuoteUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'BlockQuoteUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const t = editor.t;
- editor.ui.componentFactory.add( 'blockQuote', locale => {
- const command = editor.commands.get( 'blockQuote' );
- const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- buttonView.set( {
- label: t( 'Block quote' ),
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].quote,
- tooltip: true,
- isToggleable: true
- } );
- // Bind button model to command.
- buttonView.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
- // Execute command.
- this.listenTo( buttonView, 'execute', () => {
- editor.execute( 'blockQuote' );
- editor.editing.view.focus();
- } );
- return buttonView;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css ***!
- \***************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./blockquote.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinder.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinder.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinder; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _ckfinderui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ckfinderui */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderui.js");
- /* harmony import */ var _ckfinderediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ckfinderediting */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderediting.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckfinder/ckfinder
- */
- /**
- * The CKFinder feature, a bridge between the CKEditor 5 WYSIWYG editor and the
- * [CKFinder](https://ckeditor.com/ckfinder) file manager and uploader.
- *
- * This is a "glue" plugin which enables:
- *
- * * {@link module:ckfinder/ckfinderediting~CKFinderEditing},
- * * {@link module:ckfinder/ckfinderui~CKFinderUI},
- * * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}.
- *
- * See the {@glink features/image-upload/ckfinder "CKFinder integration" guide} to learn how to configure
- * and use this feature.
- *
- * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload" guide} to learn about
- * other ways to upload images into CKEditor 5.
- *
- * @extends module:core/plugin~Plugin
- */
- class CKFinder extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'CKFinder';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ 'Image', 'Link', 'CKFinderUploadAdapter', _ckfinderediting__WEBPACK_IMPORTED_MODULE_2__["default"], _ckfinderui__WEBPACK_IMPORTED_MODULE_1__["default"] ];
- }
- }
- /**
- * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}.
- *
- * Read more in {@link module:ckfinder/ckfinder~CKFinderConfig}.
- *
- * @member {module:ckfinder/ckfinder~CKFinderConfig} module:core/editor/editorconfig~EditorConfig#ckfinder
- */
- /**
- * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}
- * and its {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
- *
- * ClassicEditor
- * .create( editorElement, {
- * ckfinder: {
- * options: {
- * resourceType: 'Images'
- * }
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- *
- * @interface CKFinderConfig
- */
- /**
- * The configuration options passed to the CKFinder file manager instance.
- *
- * Check the file manager [documentation](https://ckeditor.com/docs/ckfinder/ckfinder3/#!/api/CKFinder.Config-cfg-language)
- * for the complete list of options.
- *
- * @member {Object} module:ckfinder/ckfinder~CKFinderConfig#options
- */
- /**
- * The type of the CKFinder opener method.
- *
- * Supported types are:
- *
- * * `'modal'` – Opens CKFinder in a modal,
- * * `'popup'` – Opens CKFinder in a new "pop-up" window.
- *
- * Defaults to `'modal'`.
- *
- * @member {String} module:ckfinder/ckfinder~CKFinderConfig#openerMethod
- */
- /**
- * The path (URL) to the connector which handles the file upload in CKFinder file manager.
- * When specified, it enables the automatic upload of resources such as images inserted into the content.
- *
- * For instance, to use CKFinder's
- * [quick upload](https://ckeditor.com/docs/ckfinder/ckfinder3-php/commands.html#command_quick_upload)
- * command, your can use the following (or similar) path:
- *
- * ClassicEditor
- * .create( editorElement, {
- * ckfinder: {
- * uploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json'
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * Used by the {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
- *
- * @member {String} module:ckfinder/ckfinder~CKFinderConfig#uploadUrl
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfindercommand.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfindercommand.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /* global window */
- /**
- * @module ckfinder/ckfindercommand
- */
- /**
- * The CKFinder command. It is used by the {@link module:ckfinder/ckfinderediting~CKFinderEditing CKFinder editing feature}
- * to open the CKFinder file manager to insert an image or a link to a file into the editor content.
- *
- * editor.execute( 'ckfinder' );
- *
- * **Note:** This command uses other features to perform tasks:
- * - To insert images the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command
- * from the {@link module:image/image~Image Image feature}.
- * - To insert links to files the {@link module:link/linkcommand~LinkCommand 'link'} command
- * from the {@link module:link/link~Link Link feature}.
- *
- * @extends module:core/command~Command
- */
- class CKFinderCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- // Remove default document listener to lower its priority.
- this.stopListening( this.editor.model.document, 'change' );
- // Lower this command listener priority to be sure that refresh() will be called after link & image refresh.
- this.listenTo( this.editor.model.document, 'change', () => this.refresh(), { priority: 'low' } );
- }
- /**
- * @inheritDoc
- */
- refresh() {
- const imageCommand = this.editor.commands.get( 'insertImage' );
- const linkCommand = this.editor.commands.get( 'link' );
- // The CKFinder command is enabled when one of image or link command is enabled.
- this.isEnabled = imageCommand.isEnabled || linkCommand.isEnabled;
- }
- /**
- * @inheritDoc
- */
- execute() {
- const editor = this.editor;
- const openerMethod = this.editor.config.get( 'ckfinder.openerMethod' ) || 'modal';
- if ( openerMethod != 'popup' && openerMethod != 'modal' ) {
- /**
- * The `ckfinder.openerMethod` must be one of: "popup" or "modal".
- *
- * @error ckfinder-unknown-openermethod
- */
- throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["CKEditorError"]( 'ckfinder-unknown-openermethod', editor );
- }
- const options = this.editor.config.get( 'ckfinder.options' ) || {};
- options.chooseFiles = true;
- // Cache the user-defined onInit method
- const originalOnInit = options.onInit;
- // Pass the lang code to the CKFinder if not defined by user.
- if ( !options.language ) {
- options.language = editor.locale.uiLanguage;
- }
- // The onInit method allows to extend CKFinder's behavior. It is used to attach event listeners to file choosing related events.
- options.onInit = finder => {
- // Call original options.onInit if it was defined by user.
- if ( originalOnInit ) {
- originalOnInit( finder );
- }
- finder.on( 'files:choose', evt => {
- const files = evt.data.files.toArray();
- // Insert links
- const links = files.filter( file => !file.isImage() );
- const images = files.filter( file => file.isImage() );
- for ( const linkFile of links ) {
- editor.execute( 'link', linkFile.getUrl() );
- }
- const imagesUrls = [];
- for ( const image of images ) {
- const url = image.getUrl();
- imagesUrls.push( url ? url : finder.request( 'file:getProxyUrl', { file: image } ) );
- }
- if ( imagesUrls.length ) {
- insertImages( editor, imagesUrls );
- }
- } );
- finder.on( 'file:choose:resizedImage', evt => {
- const resizedUrl = evt.data.resizedUrl;
- if ( !resizedUrl ) {
- const notification = editor.plugins.get( 'Notification' );
- const t = editor.locale.t;
- notification.showWarning( t( 'Could not obtain resized image URL.' ), {
- title: t( 'Selecting resized image failed' ),
- namespace: 'ckfinder'
- } );
- return;
- }
- insertImages( editor, [ resizedUrl ] );
- } );
- };
- window.CKFinder[ openerMethod ]( options );
- }
- }
- function insertImages( editor, urls ) {
- const imageCommand = editor.commands.get( 'insertImage' );
- // Check if inserting an image is actually possible - it might be possible to only insert a link.
- if ( !imageCommand.isEnabled ) {
- const notification = editor.plugins.get( 'Notification' );
- const t = editor.locale.t;
- notification.showWarning( t( 'Could not insert image at the current position.' ), {
- title: t( 'Inserting image failed' ),
- namespace: 'ckfinder'
- } );
- return;
- }
- editor.execute( 'insertImage', { source: urls } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderediting.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderediting.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _ckfindercommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ckfindercommand */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfindercommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckfinder/ckfinderediting
- */
- /**
- * The CKFinder editing feature. It introduces the {@link module:ckfinder/ckfindercommand~CKFinderCommand CKFinder command}.
- *
- * @extends module:core/plugin~Plugin
- */
- class CKFinderEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'CKFinderEditing';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Notification"], 'ImageEditing', 'LinkEditing' ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- editor.commands.add( 'ckfinder', new _ckfindercommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor ) );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderui.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderui.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _theme_icons_browse_files_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/browse-files.svg */ "./node_modules/@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckfinder/ckfinderui
- */
- /**
- * The CKFinder UI plugin. It introduces the `'ckfinder'` toolbar button.
- *
- * @extends module:core/plugin~Plugin
- */
- class CKFinderUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'CKFinderUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const componentFactory = editor.ui.componentFactory;
- const t = editor.t;
- componentFactory.add( 'ckfinder', locale => {
- const command = editor.commands.get( 'ckfinder' );
- const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- button.set( {
- label: t( 'Insert image or file' ),
- icon: _theme_icons_browse_files_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
- tooltip: true
- } );
- button.bind( 'isEnabled' ).to( command );
- button.on( 'execute', () => {
- editor.execute( 'ckfinder' );
- editor.editing.view.focus();
- } );
- return button;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z\"/><path d=\"M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Clipboard; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardpipeline */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js");
- /* harmony import */ var _dragdrop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dragdrop */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js");
- /* harmony import */ var _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pasteplaintext */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module clipboard/clipboard
- */
- /**
- * The clipboard feature.
- *
- * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
- *
- * This is a "glue" plugin which loads the following plugins:
- * * {@link module:clipboard/clipboardpipeline~ClipboardPipeline}
- * * {@link module:clipboard/dragdrop~DragDrop}
- * * {@link module:clipboard/pasteplaintext~PastePlainText}
- *
- * @extends module:core/plugin~Plugin
- */
- class Clipboard extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Clipboard';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__["default"], _dragdrop__WEBPACK_IMPORTED_MODULE_2__["default"], _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__["default"] ];
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClipboardObserver; });
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
- /* harmony import */ var _datatransfer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./datatransfer */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/datatransfer.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module clipboard/clipboardobserver
- */
- /**
- * Clipboard events observer.
- *
- * Fires the following events:
- *
- * * {@link module:engine/view/document~Document#event:clipboardInput},
- * * {@link module:engine/view/document~Document#event:paste},
- * * {@link module:engine/view/document~Document#event:copy},
- * * {@link module:engine/view/document~Document#event:cut},
- * * {@link module:engine/view/document~Document#event:drop},
- * * {@link module:engine/view/document~Document#event:dragover},
- * * {@link module:engine/view/document~Document#event:dragging},
- * * {@link module:engine/view/document~Document#event:dragstart},
- * * {@link module:engine/view/document~Document#event:dragend},
- * * {@link module:engine/view/document~Document#event:dragenter},
- * * {@link module:engine/view/document~Document#event:dragleave}.
- *
- * **Note**: This observer is not available by default (ckeditor5-engine does not add it on its own).
- * To make it available, it needs to be added to {@link module:engine/view/document~Document} by using
- * the {@link module:engine/view/view~View#addObserver `View#addObserver()`} method. Alternatively, you can load the
- * {@link module:clipboard/clipboard~Clipboard} plugin which adds this observer automatically (because it uses it).
- *
- * @extends module:engine/view/observer/domeventobserver~DomEventObserver
- */
- class ClipboardObserver extends _ckeditor_ckeditor5_engine_src_view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
- constructor( view ) {
- super( view );
- const viewDocument = this.document;
- this.domEventType = [ 'paste', 'copy', 'cut', 'drop', 'dragover', 'dragstart', 'dragend', 'dragenter', 'dragleave' ];
- this.listenTo( viewDocument, 'paste', handleInput( 'clipboardInput' ), { priority: 'low' } );
- this.listenTo( viewDocument, 'drop', handleInput( 'clipboardInput' ), { priority: 'low' } );
- this.listenTo( viewDocument, 'dragover', handleInput( 'dragging' ), { priority: 'low' } );
- function handleInput( type ) {
- return ( evt, data ) => {
- data.preventDefault();
- const targetRanges = data.dropRange ? [ data.dropRange ] : null;
- const eventInfo = new _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_1__["default"]( viewDocument, type );
- viewDocument.fire( eventInfo, {
- dataTransfer: data.dataTransfer,
- method: evt.name,
- targetRanges,
- target: data.target
- } );
- // If CKEditor handled the input, do not bubble the original event any further.
- // This helps external integrations recognize that fact and act accordingly.
- // https://github.com/ckeditor/ckeditor5-upload/issues/92
- if ( eventInfo.stop.called ) {
- data.stopPropagation();
- }
- };
- }
- }
- onDomEvent( domEvent ) {
- const evtData = {
- dataTransfer: new _datatransfer__WEBPACK_IMPORTED_MODULE_2__["default"]( domEvent.clipboardData ? domEvent.clipboardData : domEvent.dataTransfer )
- };
- if ( domEvent.type == 'drop' || domEvent.type == 'dragover' ) {
- evtData.dropRange = getDropViewRange( this.view, domEvent );
- }
- this.fire( domEvent.type, domEvent, evtData );
- }
- }
- function getDropViewRange( view, domEvent ) {
- const domDoc = domEvent.target.ownerDocument;
- const x = domEvent.clientX;
- const y = domEvent.clientY;
- let domRange;
- // Webkit & Blink.
- if ( domDoc.caretRangeFromPoint && domDoc.caretRangeFromPoint( x, y ) ) {
- domRange = domDoc.caretRangeFromPoint( x, y );
- }
- // FF.
- else if ( domEvent.rangeParent ) {
- domRange = domDoc.createRange();
- domRange.setStart( domEvent.rangeParent, domEvent.rangeOffset );
- domRange.collapse( true );
- }
- if ( domRange ) {
- return view.domConverter.domRangeToView( domRange );
- }
- return null;
- }
- /**
- * Fired as a continuation of the {@link #event:paste} and {@link #event:drop} events.
- *
- * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
- *
- * This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed
- * and inserted into the editor.
- *
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
- * the observer must be added manually.
- *
- * @see module:clipboard/clipboardobserver~ClipboardObserver
- * @see module:clipboard/clipboard~Clipboard
- * @event module:engine/view/document~Document#event:clipboardInput
- * @param {Object} data The event data.
- * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
- * @param {'paste'|'drop'} method Whether the event was triggered by a paste or drop operation.
- * @param {module:engine/view/element~Element} target The tree view element representing the target.
- * @param {Array.<module:engine/view/range~Range>} data.targetRanges Ranges which are the target of the operation
- * (usually – into which the content should be inserted).
- * If the clipboard input was triggered by a paste operation, this property is not set. If by a drop operation,
- * then it is the drop position (which can be different than the selection at the moment of drop).
- */
- /**
- * Fired when the user drags the content over one of the editing roots of the editor.
- *
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
- *
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
- * the observer must be added manually.
- *
- * @see module:engine/view/document~Document#event:clipboardInput
- * @event module:engine/view/document~Document#event:dragover
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
- */
- /**
- * Fired when the user dropped the content into one of the editing roots of the editor.
- *
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
- *
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
- * the observer must be added manually.
- *
- * @see module:engine/view/document~Document#event:clipboardInput
- * @event module:engine/view/document~Document#event:drop
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
- * @param {module:engine/view/range~Range} dropRange The position into which the content is dropped.
- */
- /**
- * Fired when the user pasted the content into one of the editing roots of the editor.
- *
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
- *
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
- * the observer must be added manually.
- *
- * @see module:engine/view/document~Document#event:clipboardInput
- * @event module:engine/view/document~Document#event:paste
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
- */
- /**
- * Fired when the user copied the content from one of the editing roots of the editor.
- *
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
- *
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
- * the observer must be added manually.
- *
- * @see module:clipboard/clipboardobserver~ClipboardObserver
- * @event module:engine/view/document~Document#event:copy
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
- */
- /**
- * Fired when the user cut the content from one of the editing roots of the editor.
- *
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
- *
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
- * the observer must be added manually.
- *
- * @see module:clipboard/clipboardobserver~ClipboardObserver
- * @event module:engine/view/document~Document#event:cut
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
- */
- /**
- * The value of the {@link module:engine/view/document~Document#event:paste},
- * {@link module:engine/view/document~Document#event:copy} and {@link module:engine/view/document~Document#event:cut} events.
- *
- * In order to access the clipboard data, use the `dataTransfer` property.
- *
- * @class module:clipboard/clipboardobserver~ClipboardEventData
- * @extends module:engine/view/observer/domeventdata~DomEventData
- */
- /**
- * The data transfer instance.
- *
- * @readonly
- * @member {module:clipboard/datatransfer~DataTransfer} module:clipboard/clipboardobserver~ClipboardEventData#dataTransfer
- */
- /**
- * Fired as a continuation of the {@link #event:dragover} event.
- *
- * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
- *
- * This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed
- * and inserted into the editor.
- *
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
- * the observer must be added manually.
- *
- * @see module:clipboard/clipboardobserver~ClipboardObserver
- * @see module:clipboard/clipboard~Clipboard
- * @event module:engine/view/document~Document#event:dragging
- * @param {Object} data The event data.
- * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
- * @param {module:engine/view/element~Element} target The tree view element representing the target.
- * @param {Array.<module:engine/view/range~Range>} data.targetRanges Ranges which are the target of the operation
- * (usually – into which the content should be inserted).
- * It is the drop position (which can be different than the selection at the moment of drop).
- */
- /**
- * Fired when the user starts dragging the content in one of the editing roots of the editor.
- *
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
- *
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
- * the observer must be added manually.
- *
- * @see module:engine/view/document~Document#event:clipboardInput
- * @event module:engine/view/document~Document#event:dragstart
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
- */
- /**
- * Fired when the user ended dragging the content.
- *
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
- *
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
- * the observer must be added manually.
- *
- * @see module:engine/view/document~Document#event:clipboardInput
- * @event module:engine/view/document~Document#event:dragend
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
- */
- /**
- * Fired when the user drags the content into one of the editing roots of the editor.
- *
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
- *
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
- * the observer must be added manually.
- *
- * @see module:engine/view/document~Document#event:clipboardInput
- * @event module:engine/view/document~Document#event:dragenter
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
- */
- /**
- * Fired when the user drags the content out of one of the editing roots of the editor.
- *
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
- *
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
- * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
- * the observer must be added manually.
- *
- * @see module:engine/view/document~Document#event:clipboardInput
- * @event module:engine/view/document~Document#event:dragleave
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClipboardPipeline; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
- /* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clipboardobserver */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js");
- /* harmony import */ var _utils_plaintexttohtml__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/plaintexttohtml */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js");
- /* harmony import */ var _utils_normalizeclipboarddata__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/normalizeclipboarddata */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js");
- /* harmony import */ var _utils_viewtoplaintext_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/viewtoplaintext.js */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module clipboard/clipboardpipeline
- */
- // Input pipeline events overview:
- //
- // ┌──────────────────────┐ ┌──────────────────────┐
- // │ view.Document │ │ view.Document │
- // │ paste │ │ drop │
- // └───────────┬──────────┘ └───────────┬──────────┘
- // │ │
- // └────────────────┌────────────────┘
- // │
- // ┌─────────V────────┐
- // │ view.Document │ Retrieves text/html or text/plain from data.dataTransfer
- // │ clipboardInput │ and processes it to view.DocumentFragment.
- // └─────────┬────────┘
- // │
- // ┌───────────V───────────┐
- // │ ClipboardPipeline │ Converts view.DocumentFragment to model.DocumentFragment.
- // │ inputTransformation │
- // └───────────┬───────────┘
- // │
- // ┌──────────V──────────┐
- // │ ClipboardPipeline │ Calls model.insertContent().
- // │ contentInsertion │
- // └─────────────────────┘
- //
- //
- // Output pipeline events overview:
- //
- // ┌──────────────────────┐ ┌──────────────────────┐
- // │ view.Document │ │ view.Document │ Retrieves the selected model.DocumentFragment
- // │ copy │ │ cut │ and converts it to view.DocumentFragment.
- // └───────────┬──────────┘ └───────────┬──────────┘
- // │ │
- // └────────────────┌────────────────┘
- // │
- // ┌─────────V────────┐
- // │ view.Document │ Processes view.DocumentFragment to text/html and text/plain
- // │ clipboardOutput │ and stores the results in data.dataTransfer.
- // └──────────────────┘
- //
- /**
- * The clipboard pipeline feature. It is responsible for intercepting the `paste` and `drop` events and
- * passing the pasted content through a series of events in order to insert it into the editor's content.
- * It also handles the `cut` and `copy` events to fill the native clipboard with the serialized editor's data.
- *
- * # Input pipeline
- *
- * The behavior of the default handlers (all at a `low` priority):
- *
- * ## Event: `paste` or `drop`
- *
- * 1. Translates the event data.
- * 2. Fires the {@link module:engine/view/document~Document#event:clipboardInput `view.Document#clipboardInput`} event.
- *
- * ## Event: `view.Document#clipboardInput`
- *
- * 1. If the `data.content` event field is already set (by some listener on a higher priority), it takes this content and fires the event
- * from the last point.
- * 2. Otherwise, it retrieves `text/html` or `text/plain` from `data.dataTransfer`.
- * 3. Normalizes the raw data by applying simple filters on string data.
- * 4. Processes the raw data to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} with the
- * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.
- * 5. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
- * `ClipboardPipeline#inputTransformation`} event with the view document fragment in the `data.content` event field.
- *
- * ## Event: `ClipboardPipeline#inputTransformation`
- *
- * 1. Converts {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} from the `data.content` field to
- * {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`}.
- * 2. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion `ClipboardPipeline#contentInsertion`}
- * event with the model document fragment in the `data.content` event field.
- * **Note**: The `ClipboardPipeline#contentInsertion` event is fired within a model change block to allow other handlers
- * to run in the same block without post-fixers called in between (i.e., the selection post-fixer).
- *
- * ## Event: `ClipboardPipeline#contentInsertion`
- *
- * 1. Calls {@link module:engine/model/model~Model#insertContent `model.insertContent()`} to insert `data.content`
- * at the current selection position.
- *
- * # Output pipeline
- *
- * The behavior of the default handlers (all at a `low` priority):
- *
- * ## Event: `copy`, `cut` or `dragstart`
- *
- * 1. Retrieves the selected {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`} by calling
- * {@link module:engine/model/model~Model#getSelectedContent `model#getSelectedContent()`}.
- * 2. Converts the model document fragment to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`}.
- * 3. Fires the {@link module:engine/view/document~Document#event:clipboardOutput `view.Document#clipboardOutput`} event
- * with the view document fragment in the `data.content` event field.
- *
- * ## Event: `view.Document#clipboardOutput`
- *
- * 1. Processes `data.content` to HTML and plain text with the
- * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.
- * 2. Updates the `data.dataTransfer` data for `text/html` and `text/plain` with the processed data.
- * 3. For the `cut` method, calls {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}
- * on the current selection.
- *
- * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
- *
- * @extends module:core/plugin~Plugin
- */
- class ClipboardPipeline extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ClipboardPipeline';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const view = editor.editing.view;
- view.addObserver( _clipboardobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
- this._setupPasteDrop();
- this._setupCopyCut();
- }
- /**
- * The clipboard paste pipeline.
- *
- * @private
- */
- _setupPasteDrop() {
- const editor = this.editor;
- const model = editor.model;
- const view = editor.editing.view;
- const viewDocument = view.document;
- // Pasting and dropping is disabled when editor is in the read-only mode.
- // See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26.
- this.listenTo( viewDocument, 'clipboardInput', evt => {
- if ( editor.isReadOnly ) {
- evt.stop();
- }
- }, { priority: 'highest' } );
- this.listenTo( viewDocument, 'clipboardInput', ( evt, data ) => {
- const dataTransfer = data.dataTransfer;
- let content = data.content || '';
- // Some feature could already inject content in the higher priority event handler (i.e., codeBlock).
- if ( !content ) {
- if ( dataTransfer.getData( 'text/html' ) ) {
- content = Object(_utils_normalizeclipboarddata__WEBPACK_IMPORTED_MODULE_4__["default"])( dataTransfer.getData( 'text/html' ) );
- } else if ( dataTransfer.getData( 'text/plain' ) ) {
- content = Object(_utils_plaintexttohtml__WEBPACK_IMPORTED_MODULE_3__["default"])( dataTransfer.getData( 'text/plain' ) );
- }
- content = this.editor.data.htmlProcessor.toView( content );
- }
- const eventInfo = new _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_1__["default"]( this, 'inputTransformation' );
- this.fire( eventInfo, {
- content,
- dataTransfer,
- targetRanges: data.targetRanges,
- method: data.method
- } );
- // If CKEditor handled the input, do not bubble the original event any further.
- // This helps external integrations recognize this fact and act accordingly.
- // https://github.com/ckeditor/ckeditor5-upload/issues/92
- if ( eventInfo.stop.called ) {
- evt.stop();
- }
- view.scrollToTheSelection();
- }, { priority: 'low' } );
- this.listenTo( this, 'inputTransformation', ( evt, data ) => {
- if ( data.content.isEmpty ) {
- return;
- }
- const dataController = this.editor.data;
- // Convert the pasted content into a model document fragment.
- // The conversion is contextual, but in this case an "all allowed" context is needed
- // and for that we use the $clipboardHolder item.
- const modelFragment = dataController.toModel( data.content, '$clipboardHolder' );
- if ( modelFragment.childCount == 0 ) {
- return;
- }
- evt.stop();
- // Fire content insertion event in a single change block to allow other handlers to run in the same block
- // without post-fixers called in between (i.e., the selection post-fixer).
- model.change( () => {
- this.fire( 'contentInsertion', {
- content: modelFragment,
- method: data.method,
- dataTransfer: data.dataTransfer,
- targetRanges: data.targetRanges
- } );
- } );
- }, { priority: 'low' } );
- this.listenTo( this, 'contentInsertion', ( evt, data ) => {
- data.resultRange = model.insertContent( data.content );
- }, { priority: 'low' } );
- }
- /**
- * The clipboard copy/cut pipeline.
- *
- * @private
- */
- _setupCopyCut() {
- const editor = this.editor;
- const modelDocument = editor.model.document;
- const view = editor.editing.view;
- const viewDocument = view.document;
- function onCopyCut( evt, data ) {
- const dataTransfer = data.dataTransfer;
- data.preventDefault();
- const content = editor.data.toView( editor.model.getSelectedContent( modelDocument.selection ) );
- viewDocument.fire( 'clipboardOutput', { dataTransfer, content, method: evt.name } );
- }
- this.listenTo( viewDocument, 'copy', onCopyCut, { priority: 'low' } );
- this.listenTo( viewDocument, 'cut', ( evt, data ) => {
- // Cutting is disabled when editor is in the read-only mode.
- // See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26.
- if ( editor.isReadOnly ) {
- data.preventDefault();
- } else {
- onCopyCut( evt, data );
- }
- }, { priority: 'low' } );
- this.listenTo( viewDocument, 'clipboardOutput', ( evt, data ) => {
- if ( !data.content.isEmpty ) {
- data.dataTransfer.setData( 'text/html', this.editor.data.htmlProcessor.toData( data.content ) );
- data.dataTransfer.setData( 'text/plain', Object(_utils_viewtoplaintext_js__WEBPACK_IMPORTED_MODULE_5__["default"])( data.content ) );
- }
- if ( data.method == 'cut' ) {
- editor.model.deleteContent( modelDocument.selection );
- }
- }, { priority: 'low' } );
- }
- }
- /**
- * Fired with the `content`, `dataTransfer`, `method`, and `targetRanges` properties:
- *
- * * The `content` which comes from the clipboard (it was pasted or dropped) should be processed in order to be inserted into the editor.
- * * The `dataTransfer` object is available in case the transformation functions need access to the raw clipboard data.
- * * The `method` indicates the original DOM event (for example `'drop'` or `'paste'`).
- * * The `targetRanges` property is an array of view ranges (it is available only for `'drop'`).
- *
- * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
- *
- * **Note**: You should not stop this event if you want to change the input data. You should modify the `content` property instead.
- *
- * @see module:clipboard/clipboardobserver~ClipboardObserver
- * @see module:clipboard/clipboardpipeline~ClipboardPipeline
- * @event module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
- * @param {Object} data The event data.
- * @param {module:engine/view/documentfragment~DocumentFragment} data.content The event data. The content to be inserted into the editor.
- * It can be modified by event listeners. Read more about the clipboard pipelines in
- * the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
- * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
- * @param {'paste'|'drop'} data.method Whether the event was triggered by a paste or drop operation.
- * @param {Array.<module:engine/view/range~Range>} data.targetRanges The target drop ranges.
- */
- /**
- * Fired with the `content`, `dataTransfer`, `method`, and `targetRanges` properties:
- *
- * * The `content` which comes from the clipboard (was pasted or dropped) should be processed in order to be inserted into the editor.
- * * The `dataTransfer` object is available in case the transformation functions need access to the raw clipboard data.
- * * The `method` indicates the original DOM event (for example `'drop'` or `'paste'`).
- * * The `targetRanges` property is an array of view ranges (it is available only for `'drop'`).
- *
- * Event handlers can modify the content according to the final insertion position.
- *
- * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
- *
- * **Note**: You should not stop this event if you want to change the input data. You should modify the `content` property instead.
- *
- * @see module:clipboard/clipboardobserver~ClipboardObserver
- * @see module:clipboard/clipboardpipeline~ClipboardPipeline
- * @see module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
- * @event module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion
- * @param {Object} data The event data.
- * @param {module:engine/model/documentfragment~DocumentFragment} data.content The event data. The content to be inserted into the editor.
- * Read more about the clipboard pipelines in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
- * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
- * @param {'paste'|'drop'} data.method Whether the event was triggered by a paste or drop operation.
- * @param {Array.<module:engine/view/range~Range>} data.targetRanges The target drop ranges.
- * @param {module:engine/model/range~Range} data.resultRange The result of the `model.insertContent()` call
- * (inserted by the event handler at a low priority).
- */
- /**
- * Fired on {@link module:engine/view/document~Document#event:copy} and {@link module:engine/view/document~Document#event:cut}
- * with a copy of the selected content. The content can be processed before it ends up in the clipboard.
- *
- * It is a part of the {@glink framework/guides/deep-dive/clipboard#output-pipeline clipboard output pipeline}.
- *
- * @see module:clipboard/clipboardobserver~ClipboardObserver
- * @see module:clipboard/clipboardpipeline~ClipboardPipeline
- * @event module:engine/view/document~Document#event:clipboardOutput
- * @param {module:clipboard/clipboardpipeline~ClipboardOutputEventData} data The event data.
- */
- /**
- * The value of the {@link module:engine/view/document~Document#event:clipboardOutput} event.
- *
- * @class module:clipboard/clipboardpipeline~ClipboardOutputEventData
- */
- /**
- * The data transfer instance.
- *
- * @readonly
- * @member {module:clipboard/datatransfer~DataTransfer} module:clipboard/clipboardpipeline~ClipboardOutputEventData#dataTransfer
- */
- /**
- * Content to be put into the clipboard. It can be modified by the event listeners.
- * Read more about the clipboard pipelines in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
- *
- * @member {module:engine/view/documentfragment~DocumentFragment} module:clipboard/clipboardpipeline~ClipboardOutputEventData#content
- */
- /**
- * Whether the event was triggered by a copy or cut operation.
- *
- * @member {'copy'|'cut'} module:clipboard/clipboardpipeline~ClipboardOutputEventData#method
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/datatransfer.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/datatransfer.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DataTransfer; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module clipboard/datatransfer
- */
- /**
- * A facade over the native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.
- */
- class DataTransfer {
- constructor( nativeDataTransfer ) {
- /**
- * The array of files created from the native `DataTransfer#files` or `DataTransfer#items`.
- *
- * @readonly
- * @member {Array.<File>} #files
- */
- this.files = getFiles( nativeDataTransfer );
- /**
- * The native DataTransfer object.
- *
- * @private
- * @member {DataTransfer} #_native
- */
- this._native = nativeDataTransfer;
- }
- /**
- * Returns an array of available native content types.
- *
- * @returns {Array.<String>}
- */
- get types() {
- return this._native.types;
- }
- /**
- * Gets the data from the data transfer by its MIME type.
- *
- * dataTransfer.getData( 'text/plain' );
- *
- * @param {String} type The MIME type. E.g. `text/html` or `text/plain`.
- * @returns {String}
- */
- getData( type ) {
- return this._native.getData( type );
- }
- /**
- * Sets the data in the data transfer.
- *
- * @param {String} type The MIME type. E.g. `text/html` or `text/plain`.
- * @param {String} data
- */
- setData( type, data ) {
- this._native.setData( type, data );
- }
- /**
- * The effect that is allowed for a drag operation.
- *
- * @param {String} value
- */
- set effectAllowed( value ) {
- this._native.effectAllowed = value;
- }
- get effectAllowed() {
- return this._native.effectAllowed;
- }
- /**
- * The actual drop effect.
- *
- * @param {String} value
- */
- set dropEffect( value ) {
- this._native.dropEffect = value;
- }
- get dropEffect() {
- return this._native.dropEffect;
- }
- /**
- * Whether the dragging operation was canceled.
- *
- * @returns {Boolean}
- */
- get isCanceled() {
- return this._native.dropEffect == 'none' || !!this._native.mozUserCancelled;
- }
- }
- function getFiles( nativeDataTransfer ) {
- // DataTransfer.files and items are array-like and might not have an iterable interface.
- const files = nativeDataTransfer.files ? Array.from( nativeDataTransfer.files ) : [];
- const items = nativeDataTransfer.items ? Array.from( nativeDataTransfer.items ) : [];
- if ( files.length ) {
- return files;
- }
- // Chrome has empty DataTransfer.files, but allows getting files through the items interface.
- return items
- .filter( item => item.kind === 'file' )
- .map( item => item.getAsFile() );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DragDrop; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/model/liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
- /* harmony import */ var _ckeditor_ckeditor5_widget_src_widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/widget */ "./node_modules/@ckeditor/ckeditor5-widget/src/widget.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
- /* harmony import */ var _ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
- /* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./clipboardpipeline */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js");
- /* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./clipboardobserver */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /* harmony import */ var _theme_clipboard_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../theme/clipboard.css */ "./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css");
- /* harmony import */ var _theme_clipboard_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_theme_clipboard_css__WEBPACK_IMPORTED_MODULE_10__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module clipboard/dragdrop
- */
- /* globals setTimeout, clearTimeout */
- // Drag and drop events overview:
- //
- // ┌──────────────────┐
- // │ mousedown │ Sets the draggable attribute.
- // └─────────┬────────┘
- // │
- // └─────────────────────┐
- // │ │
- // │ ┌─────────V────────┐
- // │ │ mouseup │ Dragging did not start, removes the draggable attribute.
- // │ └──────────────────┘
- // │
- // ┌─────────V────────┐ Retrieves the selected model.DocumentFragment
- // │ dragstart │ and converts it to view.DocumentFragment.
- // └─────────┬────────┘
- // │
- // ┌─────────V────────┐ Processes view.DocumentFragment to text/html and text/plain
- // │ clipboardOutput │ and stores the results in data.dataTransfer.
- // └─────────┬────────┘
- // │
- // │ DOM dragover
- // ┌────────────┐
- // │ │
- // ┌─────────V────────┐ │
- // │ dragging │ │ Updates the drop target marker.
- // └─────────┬────────┘ │
- // │ │
- // ┌─────────────└────────────┘
- // │ │ │
- // │ ┌─────────V────────┐ │
- // │ │ dragleave │ │ Removes the drop target marker.
- // │ └─────────┬────────┘ │
- // │ │ │
- // ┌───│─────────────┘ │
- // │ │ │ │
- // │ │ ┌─────────V────────┐ │
- // │ │ │ dragenter │ │ Focuses the editor view.
- // │ │ └─────────┬────────┘ │
- // │ │ │ │
- // │ │ └────────────┘
- // │ │
- // │ └─────────────┐
- // │ │ │
- // │ │ ┌─────────V────────┐
- // └───┐ │ drop │ (The default handler of the clipboard pipeline).
- // │ └─────────┬────────┘
- // │ │
- // │ ┌─────────V────────┐ Resolves the final data.targetRanges.
- // │ │ clipboardInput │ Aborts if dropping on dragged content.
- // │ └─────────┬────────┘
- // │ │
- // │ ┌─────────V────────┐
- // │ │ clipboardInput │ (The default handler of the clipboard pipeline).
- // │ └─────────┬────────┘
- // │ │
- // │ ┌───────────V───────────┐
- // │ │ inputTransformation │ (The default handler of the clipboard pipeline).
- // │ └───────────┬───────────┘
- // │ │
- // │ ┌──────────V──────────┐
- // │ │ contentInsertion │ Updates the document selection to drop range.
- // │ └──────────┬──────────┘
- // │ │
- // │ ┌──────────V──────────┐
- // │ │ contentInsertion │ (The default handler of the clipboard pipeline).
- // │ └──────────┬──────────┘
- // │ │
- // │ ┌──────────V──────────┐
- // │ │ contentInsertion │ Removes the content from the original range if the insertion was successful.
- // │ └──────────┬──────────┘
- // │ │
- // └─────────────┐
- // │
- // ┌─────────V────────┐
- // │ dragend │ Removes the drop marker and cleans the state.
- // └──────────────────┘
- //
- /**
- * The drag and drop feature. It works on top of the {@link module:clipboard/clipboardpipeline~ClipboardPipeline}.
- *
- * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
- *
- * @extends module:core/plugin~Plugin
- */
- class DragDrop extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'DragDrop';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _clipboardpipeline__WEBPACK_IMPORTED_MODULE_7__["default"], _ckeditor_ckeditor5_widget_src_widget__WEBPACK_IMPORTED_MODULE_3__["default"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const view = editor.editing.view;
- /**
- * The live range over the original content that is being dragged.
- *
- * @private
- * @type {module:engine/model/liverange~LiveRange}
- */
- this._draggedRange = null;
- /**
- * The UID of current dragging that is used to verify if the drop started in the same editor as the drag start.
- *
- * **Note**: This is a workaround for broken 'dragend' events (they are not fired if the source text node got removed).
- *
- * @private
- * @type {String}
- */
- this._draggingUid = '';
- /**
- * The reference to the model element that currently has a `draggable` attribute set (it is set while dragging).
- *
- * @private
- * @type {module:engine/model/element~Element}
- */
- this._draggableElement = null;
- /**
- * A throttled callback updating the drop marker.
- *
- * @private
- * @type {Function}
- */
- this._updateDropMarkerThrottled = Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__["throttle"])( targetRange => this._updateDropMarker( targetRange ), 40 );
- /**
- * A delayed callback removing the drop marker.
- *
- * @private
- * @type {Function}
- */
- this._removeDropMarkerDelayed = delay( () => this._removeDropMarker(), 40 );
- /**
- * A delayed callback removing draggable attributes.
- *
- * @private
- * @type {Function}
- */
- this._clearDraggableAttributesDelayed = delay( () => this._clearDraggableAttributes(), 40 );
- view.addObserver( _clipboardobserver__WEBPACK_IMPORTED_MODULE_8__["default"] );
- view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
- this._setupDragging();
- this._setupContentInsertionIntegration();
- this._setupClipboardInputIntegration();
- this._setupDropMarker();
- this._setupDraggableAttributeHandling();
- this.listenTo( editor, 'change:isReadOnly', ( evt, name, isReadOnly ) => {
- if ( isReadOnly ) {
- this.forceDisabled( 'readOnlyMode' );
- } else {
- this.clearForceDisabled( 'readOnlyMode' );
- }
- } );
- this.on( 'change:isEnabled', ( evt, name, isEnabled ) => {
- if ( !isEnabled ) {
- this._finalizeDragging( false );
- }
- } );
- if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isAndroid ) {
- this.forceDisabled( 'noAndroidSupport' );
- }
- }
- /**
- * @inheritDoc
- */
- destroy() {
- if ( this._draggedRange ) {
- this._draggedRange.detach();
- this._draggedRange = null;
- }
- this._updateDropMarkerThrottled.cancel();
- this._removeDropMarkerDelayed.cancel();
- this._clearDraggableAttributesDelayed.cancel();
- return super.destroy();
- }
- /**
- * Drag and drop events handling.
- *
- * @private
- */
- _setupDragging() {
- const editor = this.editor;
- const model = editor.model;
- const modelDocument = model.document;
- const view = editor.editing.view;
- const viewDocument = view.document;
- // The handler for the drag start; it is responsible for setting data transfer object.
- this.listenTo( viewDocument, 'dragstart', ( evt, data ) => {
- const selection = modelDocument.selection;
- // Don't drag the editable element itself.
- if ( data.target && data.target.is( 'editableElement' ) ) {
- data.preventDefault();
- return;
- }
- // TODO we could clone this node somewhere and style it to match editing view but without handles,
- // selection outline, WTA buttons, etc.
- // data.dataTransfer._native.setDragImage( data.domTarget, 0, 0 );
- // Check if this is dragstart over the widget (but not a nested editable).
- const draggableWidget = data.target ? findDraggableWidget( data.target ) : null;
- if ( draggableWidget ) {
- const modelElement = editor.editing.mapper.toModelElement( draggableWidget );
- this._draggedRange = _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_1__["default"].fromRange( model.createRangeOn( modelElement ) );
- }
- // If this was not a widget we should check if we need to drag some text content.
- else if ( !viewDocument.selection.isCollapsed ) {
- const selectedElement = viewDocument.selection.getSelectedElement();
- if ( !selectedElement || !Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( selectedElement ) ) {
- this._draggedRange = _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_1__["default"].fromRange( selection.getFirstRange() );
- }
- }
- if ( !this._draggedRange ) {
- data.preventDefault();
- return;
- }
- this._draggingUid = Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_4__["default"])();
- data.dataTransfer.effectAllowed = this.isEnabled ? 'copyMove' : 'copy';
- data.dataTransfer.setData( 'application/ckeditor5-dragging-uid', this._draggingUid );
- const draggedSelection = model.createSelection( this._draggedRange.toRange() );
- const content = editor.data.toView( model.getSelectedContent( draggedSelection ) );
- viewDocument.fire( 'clipboardOutput', { dataTransfer: data.dataTransfer, content, method: evt.name } );
- if ( !this.isEnabled ) {
- this._draggedRange.detach();
- this._draggedRange = null;
- this._draggingUid = '';
- }
- }, { priority: 'low' } );
- // The handler for finalizing drag and drop. It should always be triggered after dragging completes
- // even if it was completed in a different application.
- // Note: This is not fired if source text node got removed while downcasting a marker.
- this.listenTo( viewDocument, 'dragend', ( evt, data ) => {
- this._finalizeDragging( !data.dataTransfer.isCanceled && data.dataTransfer.dropEffect == 'move' );
- }, { priority: 'low' } );
- // Dragging over the editable.
- this.listenTo( viewDocument, 'dragenter', () => {
- if ( !this.isEnabled ) {
- return;
- }
- view.focus();
- } );
- // Dragging out of the editable.
- this.listenTo( viewDocument, 'dragleave', () => {
- // We do not know if the mouse left the editor or just some element in it, so let us wait a few milliseconds
- // to check if 'dragover' is not fired.
- this._removeDropMarkerDelayed();
- } );
- // Handler for moving dragged content over the target area.
- this.listenTo( viewDocument, 'dragging', ( evt, data ) => {
- if ( !this.isEnabled ) {
- data.dataTransfer.dropEffect = 'none';
- return;
- }
- this._removeDropMarkerDelayed.cancel();
- const targetRange = findDropTargetRange( editor, data.targetRanges, data.target );
- // If this is content being dragged from another editor, moving out of current editor instance
- // is not possible until 'dragend' event case will be fixed.
- if ( !this._draggedRange ) {
- data.dataTransfer.dropEffect = 'copy';
- }
- // In Firefox it is already set and effect allowed remains the same as originally set.
- if ( !_ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isGecko ) {
- if ( data.dataTransfer.effectAllowed == 'copy' ) {
- data.dataTransfer.dropEffect = 'copy';
- } else if ( [ 'all', 'copyMove' ].includes( data.dataTransfer.effectAllowed ) ) {
- data.dataTransfer.dropEffect = 'move';
- }
- }
- /* istanbul ignore else */
- if ( targetRange ) {
- this._updateDropMarkerThrottled( targetRange );
- }
- }, { priority: 'low' } );
- }
- /**
- * Integration with the `clipboardInput` event.
- *
- * @private
- */
- _setupClipboardInputIntegration() {
- const editor = this.editor;
- const view = editor.editing.view;
- const viewDocument = view.document;
- // Update the event target ranges and abort dropping if dropping over itself.
- this.listenTo( viewDocument, 'clipboardInput', ( evt, data ) => {
- if ( data.method != 'drop' ) {
- return;
- }
- const targetRange = findDropTargetRange( editor, data.targetRanges, data.target );
- // The dragging markers must be removed after searching for the target range because sometimes
- // the target lands on the marker itself.
- this._removeDropMarker();
- /* istanbul ignore if */
- if ( !targetRange ) {
- this._finalizeDragging( false );
- evt.stop();
- return;
- }
- // Since we cannot rely on the drag end event, we must check if the local drag range is from the current drag and drop
- // or it is from some previous not cleared one.
- if ( this._draggedRange && this._draggingUid != data.dataTransfer.getData( 'application/ckeditor5-dragging-uid' ) ) {
- this._draggedRange.detach();
- this._draggedRange = null;
- this._draggingUid = '';
- }
- // Do not do anything if some content was dragged within the same document to the same position.
- const isMove = getFinalDropEffect( data.dataTransfer ) == 'move';
- if ( isMove && this._draggedRange && this._draggedRange.containsRange( targetRange, true ) ) {
- this._finalizeDragging( false );
- evt.stop();
- return;
- }
- // Override the target ranges with the one adjusted to the best one for a drop.
- data.targetRanges = [ editor.editing.mapper.toViewRange( targetRange ) ];
- }, { priority: 'high' } );
- }
- /**
- * Integration with the `contentInsertion` event of the clipboard pipeline.
- *
- * @private
- */
- _setupContentInsertionIntegration() {
- const clipboardPipeline = this.editor.plugins.get( _clipboardpipeline__WEBPACK_IMPORTED_MODULE_7__["default"] );
- clipboardPipeline.on( 'contentInsertion', ( evt, data ) => {
- if ( !this.isEnabled || data.method !== 'drop' ) {
- return;
- }
- // Update the selection to the target range in the same change block to avoid selection post-fixing
- // and to be able to clone text attributes for plain text dropping.
- const ranges = data.targetRanges.map( viewRange => this.editor.editing.mapper.toModelRange( viewRange ) );
- this.editor.model.change( writer => writer.setSelection( ranges ) );
- }, { priority: 'high' } );
- clipboardPipeline.on( 'contentInsertion', ( evt, data ) => {
- if ( !this.isEnabled || data.method !== 'drop' ) {
- return;
- }
- // Remove dragged range content, remove markers, clean after dragging.
- const isMove = getFinalDropEffect( data.dataTransfer ) == 'move';
- // Whether any content was inserted (insertion might fail if the schema is disallowing some elements
- // (for example an image caption allows only the content of a block but not blocks themselves.
- // Some integrations might not return valid range (i.e., table pasting).
- const isSuccess = !data.resultRange || !data.resultRange.isCollapsed;
- this._finalizeDragging( isSuccess && isMove );
- }, { priority: 'lowest' } );
- }
- /**
- * Adds listeners that add the `draggable` attribute to the elements while the mouse button is down so the dragging could start.
- *
- * @private
- */
- _setupDraggableAttributeHandling() {
- const editor = this.editor;
- const view = editor.editing.view;
- const viewDocument = view.document;
- // Add the 'draggable' attribute to the widget while pressing the selection handle.
- // This is required for widgets to be draggable. In Chrome it will enable dragging text nodes.
- this.listenTo( viewDocument, 'mousedown', ( evt, data ) => {
- // The lack of data can be caused by editor tests firing fake mouse events. This should not occur
- // in real-life scenarios but this greatly simplifies editor tests that would otherwise fail a lot.
- if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isAndroid || !data ) {
- return;
- }
- this._clearDraggableAttributesDelayed.cancel();
- // Check if this is a mousedown over the widget (but not a nested editable).
- let draggableElement = findDraggableWidget( data.target );
- // Note: There is a limitation that if more than a widget is selected (a widget and some text)
- // and dragging starts on the widget, then only the widget is dragged.
- // If this was not a widget then we should check if we need to drag some text content.
- // In Chrome set a 'draggable' attribute on closest editable to allow immediate dragging of the selected text range.
- // In Firefox this is not needed. In Safari it makes the whole editable draggable (not just textual content).
- // Disabled in read-only mode because draggable="true" + contenteditable="false" results
- // in not firing selectionchange event ever, which makes the selection stuck in read-only mode.
- if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isBlink && !editor.isReadOnly && !draggableElement && !viewDocument.selection.isCollapsed ) {
- const selectedElement = viewDocument.selection.getSelectedElement();
- if ( !selectedElement || !Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( selectedElement ) ) {
- draggableElement = viewDocument.selection.editableElement;
- }
- }
- if ( draggableElement ) {
- view.change( writer => {
- writer.setAttribute( 'draggable', 'true', draggableElement );
- } );
- // Keep the reference to the model element in case the view element gets removed while dragging.
- this._draggableElement = editor.editing.mapper.toModelElement( draggableElement );
- }
- } );
- // Remove the draggable attribute in case no dragging started (only mousedown + mouseup).
- this.listenTo( viewDocument, 'mouseup', () => {
- if ( !_ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isAndroid ) {
- this._clearDraggableAttributesDelayed();
- }
- } );
- }
- /**
- * Removes the `draggable` attribute from the element that was used for dragging.
- *
- * @private
- */
- _clearDraggableAttributes() {
- const editing = this.editor.editing;
- editing.view.change( writer => {
- // Remove 'draggable' attribute.
- if ( this._draggableElement && this._draggableElement.root.rootName != '$graveyard' ) {
- writer.removeAttribute( 'draggable', editing.mapper.toViewElement( this._draggableElement ) );
- }
- this._draggableElement = null;
- } );
- }
- /**
- * Creates downcast conversion for the drop target marker.
- *
- * @private
- */
- _setupDropMarker() {
- const editor = this.editor;
- // Drop marker conversion for hovering over widgets.
- editor.conversion.for( 'editingDowncast' ).markerToHighlight( {
- model: 'drop-target',
- view: {
- classes: [ 'ck-clipboard-drop-target-range' ]
- }
- } );
- // Drop marker conversion for in text drop target.
- editor.conversion.for( 'editingDowncast' ).markerToElement( {
- model: 'drop-target',
- view: ( data, { writer } ) => {
- const inText = editor.model.schema.checkChild( data.markerRange.start, '$text' );
- if ( !inText ) {
- return;
- }
- return writer.createUIElement( 'span', { class: 'ck ck-clipboard-drop-target-position' }, function( domDocument ) {
- const domElement = this.toDomElement( domDocument );
- // Using word joiner to make this marker as high as text and also making text not break on marker.
- domElement.innerHTML = '⁠<span></span>⁠';
- return domElement;
- } );
- }
- } );
- }
- /**
- * Updates the drop target marker to the provided range.
- *
- * @private
- * @param {module:engine/model/range~Range} targetRange The range to set the marker to.
- */
- _updateDropMarker( targetRange ) {
- const editor = this.editor;
- const markers = editor.model.markers;
- editor.model.change( writer => {
- if ( markers.has( 'drop-target' ) ) {
- if ( !markers.get( 'drop-target' ).getRange().isEqual( targetRange ) ) {
- writer.updateMarker( 'drop-target', { range: targetRange } );
- }
- } else {
- writer.addMarker( 'drop-target', {
- range: targetRange,
- usingOperation: false,
- affectsData: false
- } );
- }
- } );
- }
- /**
- * Removes the drop target marker.
- *
- * @private
- */
- _removeDropMarker() {
- const model = this.editor.model;
- this._removeDropMarkerDelayed.cancel();
- this._updateDropMarkerThrottled.cancel();
- if ( model.markers.has( 'drop-target' ) ) {
- model.change( writer => {
- writer.removeMarker( 'drop-target' );
- } );
- }
- }
- /**
- * Deletes the dragged content from its original range and clears the dragging state.
- *
- * @private
- * @param {Boolean} moved Whether the move succeeded.
- */
- _finalizeDragging( moved ) {
- const editor = this.editor;
- const model = editor.model;
- this._removeDropMarker();
- this._clearDraggableAttributes();
- this._draggingUid = '';
- if ( !this._draggedRange ) {
- return;
- }
- // Delete moved content.
- if ( moved && this.isEnabled ) {
- model.deleteContent( model.createSelection( this._draggedRange ), { doNotAutoparagraph: true } );
- }
- this._draggedRange.detach();
- this._draggedRange = null;
- }
- }
- // Returns fixed selection range for given position and target element.
- //
- // @param {module:core/editor/editor~Editor} editor
- // @param {Array.<module:engine/view/range~Range>} targetViewRanges
- // @param {module:engine/view/element~Element} targetViewElement
- // @returns {module:engine/model/range~Range|null}
- function findDropTargetRange( editor, targetViewRanges, targetViewElement ) {
- const model = editor.model;
- const mapper = editor.editing.mapper;
- let range = null;
- const targetViewPosition = targetViewRanges ? targetViewRanges[ 0 ].start : null;
- // A UIElement is not a valid drop element, use parent (this could be a drop marker or any other UIElement).
- if ( targetViewElement.is( 'uiElement' ) ) {
- targetViewElement = targetViewElement.parent;
- }
- // Quick win if the target is a widget (but not a nested editable).
- range = findDropTargetRangeOnWidget( editor, targetViewElement );
- if ( range ) {
- return range;
- }
- // The easiest part is over, now we need to move to the model space.
- // Find target model element and position.
- const targetModelElement = getClosestMappedModelElement( editor, targetViewElement );
- const targetModelPosition = targetViewPosition ? mapper.toModelPosition( targetViewPosition ) : null;
- // There is no target position while hovering over an empty table cell.
- // In Safari, target position can be empty while hovering over a widget (e.g., a page-break).
- // Find the drop position inside the element.
- if ( !targetModelPosition ) {
- return findDropTargetRangeInElement( editor, targetModelElement );
- }
- // Check if target position is between blocks and adjust drop position to the next object.
- // This is because while hovering over a root element next to a widget the target position can jump in crazy places.
- range = findDropTargetRangeBetweenBlocks( editor, targetModelPosition, targetModelElement );
- if ( range ) {
- return range;
- }
- // Try fixing selection position.
- // In Firefox, the target position lands before widgets but in other browsers it tends to land after a widget.
- range = model.schema.getNearestSelectionRange( targetModelPosition, _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isGecko ? 'forward' : 'backward' );
- if ( range ) {
- return range;
- }
- // There is no valid selection position inside the current limit element so find a closest object ancestor.
- // This happens if the model position lands directly in the <table> element itself (view target element was a `<td>`
- // so a nested editable, but view target position was directly in the `<figure>` element).
- return findDropTargetRangeOnAncestorObject( editor, targetModelPosition.parent );
- }
- // Returns fixed selection range for a given position and a target element if it is over the widget but not over its nested editable.
- //
- // @param {module:core/editor/editor~Editor} editor
- // @param {module:engine/view/element~Element} targetViewElement
- // @returns {module:engine/model/range~Range|null}
- function findDropTargetRangeOnWidget( editor, targetViewElement ) {
- const model = editor.model;
- const mapper = editor.editing.mapper;
- // Quick win if the target is a widget.
- if ( Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( targetViewElement ) ) {
- return model.createRangeOn( mapper.toModelElement( targetViewElement ) );
- }
- // Check if we are deeper over a widget (but not over a nested editable).
- if ( !targetViewElement.is( 'editableElement' ) ) {
- // Find a closest ancestor that is either a widget or an editable element...
- const ancestor = targetViewElement.findAncestor( node => Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( node ) || node.is( 'editableElement' ) );
- // ...and if the widget was closer then it is a drop target.
- if ( Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( ancestor ) ) {
- return model.createRangeOn( mapper.toModelElement( ancestor ) );
- }
- }
- return null;
- }
- // Returns fixed selection range inside a model element.
- //
- // @param {module:core/editor/editor~Editor} editor
- // @param {module:engine/model/element~Element} targetModelElement
- // @returns {module:engine/model/range~Range}
- function findDropTargetRangeInElement( editor, targetModelElement ) {
- const model = editor.model;
- const schema = model.schema;
- const positionAtElementStart = model.createPositionAt( targetModelElement, 0 );
- return schema.getNearestSelectionRange( positionAtElementStart, 'forward' );
- }
- // Returns fixed selection range for a given position and a target element if the drop is between blocks.
- //
- // @param {module:core/editor/editor~Editor} editor
- // @param {module:engine/model/position~Position} targetModelPosition
- // @param {module:engine/model/element~Element} targetModelElement
- // @returns {module:engine/model/range~Range|null}
- function findDropTargetRangeBetweenBlocks( editor, targetModelPosition, targetModelElement ) {
- const model = editor.model;
- // Check if target is between blocks.
- if ( !model.schema.checkChild( targetModelElement, '$block' ) ) {
- return null;
- }
- // Find position between blocks.
- const positionAtElementStart = model.createPositionAt( targetModelElement, 0 );
- // Get the common part of the path (inside the target element and the target position).
- const commonPath = targetModelPosition.path.slice( 0, positionAtElementStart.path.length );
- // Position between the blocks.
- const betweenBlocksPosition = model.createPositionFromPath( targetModelPosition.root, commonPath );
- const nodeAfter = betweenBlocksPosition.nodeAfter;
- // Adjust drop position to the next object.
- // This is because while hovering over a root element next to a widget the target position can jump in crazy places.
- if ( nodeAfter && model.schema.isObject( nodeAfter ) ) {
- return model.createRangeOn( nodeAfter );
- }
- return null;
- }
- // Returns a selection range on the ancestor object.
- //
- // @param {module:core/editor/editor~Editor} editor
- // @param {module:engine/model/element~Element} element
- // @returns {module:engine/model/range~Range}
- function findDropTargetRangeOnAncestorObject( editor, element ) {
- const model = editor.model;
- while ( element ) {
- if ( model.schema.isObject( element ) ) {
- return model.createRangeOn( element );
- }
- element = element.parent;
- }
- }
- // Returns the closest model element for the specified view element.
- //
- // @param {module:core/editor/editor~Editor} editor
- // @param {module:engine/view/element~Element} element
- // @returns {module:engine/model/element~Element}
- function getClosestMappedModelElement( editor, element ) {
- const mapper = editor.editing.mapper;
- const view = editor.editing.view;
- const targetModelElement = mapper.toModelElement( element );
- if ( targetModelElement ) {
- return targetModelElement;
- }
- // Find mapped ancestor if the target is inside not mapped element (for example inline code element).
- const viewPosition = view.createPositionBefore( element );
- const viewElement = mapper.findMappedViewAncestor( viewPosition );
- return mapper.toModelElement( viewElement );
- }
- // Returns the drop effect that should be a result of dragging the content.
- // This function is handling a quirk when checking the effect in the 'drop' DOM event.
- function getFinalDropEffect( dataTransfer ) {
- if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isGecko ) {
- return dataTransfer.dropEffect;
- }
- return [ 'all', 'copyMove' ].includes( dataTransfer.effectAllowed ) ? 'move' : 'copy';
- }
- // Returns a function wrapper that will trigger a function after a specified wait time.
- // The timeout can be canceled by calling the cancel function on the returned wrapped function.
- //
- // @param {Function} func The function to wrap.
- // @param {Number} wait The timeout in ms.
- // @returns {Function}
- function delay( func, wait ) {
- let timer;
- function delayed( ...args ) {
- delayed.cancel();
- timer = setTimeout( () => func( ...args ), wait );
- }
- delayed.cancel = () => {
- clearTimeout( timer );
- };
- return delayed;
- }
- // Returns a widget element that should be dragged.
- //
- // @param {module:engine/view/element~Element} target
- // @returns {module:engine/view/element~Element}
- function findDraggableWidget( target ) {
- // This is directly an editable so not a widget for sure.
- if ( target.is( 'editableElement' ) ) {
- return null;
- }
- // TODO: Let's have a isWidgetSelectionHandleDomElement() helper in ckeditor5-widget utils.
- if ( target.hasClass( 'ck-widget__selection-handle' ) ) {
- return target.findAncestor( _ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"] );
- }
- // Direct hit on a widget.
- if ( Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( target ) ) {
- return target;
- }
- // Find closest ancestor that is either a widget or an editable element...
- const ancestor = target.findAncestor( node => Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( node ) || node.is( 'editableElement' ) );
- // ...and if closer was the widget then enable dragging it.
- if ( Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( ancestor ) ) {
- return ancestor;
- }
- return null;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/index.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/index.js ***!
- \*****************************************************************/
- /*! exports provided: Clipboard, ClipboardPipeline, DragDrop, PastePlainText */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _clipboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clipboard */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Clipboard", function() { return _clipboard__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardpipeline */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClipboardPipeline", function() { return _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _dragdrop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dragdrop */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragDrop", function() { return _dragdrop__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pasteplaintext */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PastePlainText", function() { return _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module clipboard
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PastePlainText; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardobserver */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js");
- /* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clipboardpipeline */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module clipboard/pasteplaintext
- */
- /**
- * The plugin detects the user's intention to paste plain text.
- *
- * For example, it detects the <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> keystroke.
- *
- * @extends module:core/plugin~Plugin
- */
- class PastePlainText extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'PastePlainText';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _clipboardpipeline__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const model = editor.model;
- const view = editor.editing.view;
- const viewDocument = view.document;
- const selection = model.document.selection;
- let shiftPressed = false;
- view.addObserver( _clipboardobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
- this.listenTo( viewDocument, 'keydown', ( evt, data ) => {
- shiftPressed = data.shiftKey;
- } );
- editor.plugins.get( _clipboardpipeline__WEBPACK_IMPORTED_MODULE_2__["default"] ).on( 'contentInsertion', ( evt, data ) => {
- // Plain text can be determined based on the event flag (#7799) or auto-detection (#1006). If detected,
- // preserve selection attributes on pasted items.
- if ( !shiftPressed && !isPlainTextFragment( data.content, model.schema ) ) {
- return;
- }
- model.change( writer => {
- // Formatting attributes should be preserved.
- const textAttributes = Array.from( selection.getAttributes() )
- .filter( ( [ key ] ) => model.schema.getAttributeProperties( key ).isFormatting );
- if ( !selection.isCollapsed ) {
- model.deleteContent( selection, { doNotAutoparagraph: true } );
- }
- // Also preserve other attributes if they survived the content deletion (because they were not fully selected).
- // For example linkHref is not a formatting attribute but it should be preserved if pasted text was in the middle
- // of a link.
- textAttributes.push( ...selection.getAttributes() );
- const range = writer.createRangeIn( data.content );
- for ( const item of range.getItems() ) {
- if ( item.is( '$textProxy' ) ) {
- writer.setAttributes( textAttributes, item );
- }
- }
- } );
- } );
- }
- }
- // Returns true if specified `documentFragment` represents a plain text.
- //
- // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment
- // @param {module:engine/model/schema~Schema} schema
- // @returns {Boolean}
- function isPlainTextFragment( documentFragment, schema ) {
- if ( documentFragment.childCount > 1 ) {
- return false;
- }
- const child = documentFragment.getChild( 0 );
- if ( schema.isObject( child ) ) {
- return false;
- }
- return [ ...child.getAttributeKeys() ].length == 0;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js ***!
- \****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeClipboardData; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module clipboard/utils/normalizeclipboarddata
- */
- /**
- * Removes some popular browser quirks out of the clipboard data (HTML).
- *
- * @param {String} data The HTML data to normalize.
- * @returns {String} Normalized HTML.
- */
- function normalizeClipboardData( data ) {
- return data
- .replace( /<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g, ( fullMatch, spaces ) => {
- // Handle the most popular and problematic case when even a single space becomes an nbsp;.
- // Decode those to normal spaces. Read more in https://github.com/ckeditor/ckeditor5-clipboard/issues/2.
- if ( spaces.length == 1 ) {
- return ' ';
- }
- return spaces;
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return plainTextToHtml; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module clipboard/utils/plaintexttohtml
- */
- /**
- * Converts plain text to its HTML-ized version.
- *
- * @param {String} text The plain text to convert.
- * @returns {String} HTML generated from the plain text.
- */
- function plainTextToHtml( text ) {
- text = text
- // Encode <>.
- .replace( /</g, '<' )
- .replace( />/g, '>' )
- // Creates a paragraph for each double line break.
- .replace( /\r?\n\r?\n/g, '</p><p>' )
- // Creates a line break for each single line break.
- .replace( /\r?\n/g, '<br>' )
- // Preserve trailing spaces (only the first and last one – the rest is handled below).
- .replace( /^\s/, ' ' )
- .replace( /\s$/, ' ' )
- // Preserve other subsequent spaces now.
- .replace( /\s\s/g, ' ' );
- if ( text.includes( '</p><p>' ) || text.includes( '<br>' ) ) {
- // If we created paragraphs above, add the trailing ones.
- text = `<p>${ text }</p>`;
- }
- // TODO:
- // * What about '\nfoo' vs ' foo'?
- return text;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return viewToPlainText; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module clipboard/utils/viewtoplaintext
- */
- // Elements which should not have empty-line padding.
- // Most `view.ContainerElement` want to be separate by new-line, but some are creating one structure
- // together (like `<li>`) so it is better to separate them by only one "\n".
- const smallPaddingElements = [ 'figcaption', 'li' ];
- /**
- * Converts {@link module:engine/view/item~Item view item} and all of its children to plain text.
- *
- * @param {module:engine/view/item~Item} viewItem View item to convert.
- * @returns {String} Plain text representation of `viewItem`.
- */
- function viewToPlainText( viewItem ) {
- let text = '';
- if ( viewItem.is( '$text' ) || viewItem.is( '$textProxy' ) ) {
- // If item is `Text` or `TextProxy` simple take its text data.
- text = viewItem.data;
- } else if ( viewItem.is( 'element', 'img' ) && viewItem.hasAttribute( 'alt' ) ) {
- // Special case for images - use alt attribute if it is provided.
- text = viewItem.getAttribute( 'alt' );
- } else if ( viewItem.is( 'element', 'br' ) ) {
- // A soft break should be converted into a single line break (#8045).
- text = '\n';
- } else {
- // Other elements are document fragments, attribute elements or container elements.
- // They don't have their own text value, so convert their children.
- let prev = null;
- for ( const child of viewItem.getChildren() ) {
- const childText = viewToPlainText( child );
- // Separate container element children with one or more new-line characters.
- if ( prev && ( prev.is( 'containerElement' ) || child.is( 'containerElement' ) ) ) {
- if ( smallPaddingElements.includes( prev.name ) || smallPaddingElements.includes( child.name ) ) {
- text += '\n';
- } else {
- text += '\n\n';
- }
- }
- text += childText;
- prev = child;
- }
- }
- return text;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css ***!
- \************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./clipboard.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/command.js":
- /*!**************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/command.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Command; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/command
- */
- /**
- * The base class for CKEditor commands.
- *
- * Commands are the main way to manipulate editor contents and state. They are mostly used by UI elements (or by other
- * commands) to make changes in the model. Commands are available in every part of code that has access to
- * the {@link module:core/editor/editor~Editor editor} instance.
- *
- * Instances of registered commands can be retrieved from {@link module:core/editor/editor~Editor#commands `editor.commands`}.
- * The easiest way to execute a command is through {@link module:core/editor/editor~Editor#execute `editor.execute()`}.
- *
- * By default commands are disabled when the editor is in {@link module:core/editor/editor~Editor#isReadOnly read-only} mode.
- *
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class Command {
- /**
- * Creates a new `Command` instance.
- *
- * @param {module:core/editor/editor~Editor} editor Editor on which this command will be used.
- */
- constructor( editor ) {
- /**
- * The editor on which this command will be used.
- *
- * @readonly
- * @member {module:core/editor/editor~Editor}
- */
- this.editor = editor;
- /**
- * The value of the command. A concrete command class should define what it represents for it.
- *
- * For example, the `'bold'` command's value indicates whether the selection starts in a bolded text.
- * And the value of the `'link'` command may be an object with links details.
- *
- * It is possible for a command to have no value (e.g. for stateless actions such as `'uploadImage'`).
- *
- * A concrete command class should control this value by overriding the {@link #refresh `refresh()`} method.
- *
- * @observable
- * @readonly
- * @member #value
- */
- this.set( 'value', undefined );
- /**
- * Flag indicating whether a command is enabled or disabled.
- * A disabled command will do nothing when executed.
- *
- * A concrete command class should control this value by overriding the {@link #refresh `refresh()`} method.
- *
- * It is possible to disable a command from "outside". For instance, in your integration you may want to disable
- * a certain set of commands for the time being. To do that, you can use the fact that `isEnabled` is observable
- * and it fires the `set:isEnabled` event every time anyone tries to modify its value:
- *
- * function disableCommand( cmd ) {
- * cmd.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
- *
- * cmd.isEnabled = false;
- *
- * // Make it possible to enable the command again.
- * return () => {
- * cmd.off( 'set:isEnabled', forceDisable );
- * cmd.refresh();
- * };
- *
- * function forceDisable( evt ) {
- * evt.return = false;
- * evt.stop();
- * }
- * }
- *
- * // Usage:
- *
- * // Disabling the command.
- * const enableBold = disableCommand( editor.commands.get( 'bold' ) );
- *
- * // Enabling the command again.
- * enableBold();
- *
- * @observable
- * @readonly
- * @member {Boolean} #isEnabled
- */
- this.set( 'isEnabled', false );
- /**
- * Holds identifiers for {@link #forceDisabled} mechanism.
- *
- * @type {Set.<String>}
- * @private
- */
- this._disableStack = new Set();
- this.decorate( 'execute' );
- // By default every command is refreshed when changes are applied to the model.
- this.listenTo( this.editor.model.document, 'change', () => {
- this.refresh();
- } );
- this.on( 'execute', evt => {
- if ( !this.isEnabled ) {
- evt.stop();
- }
- }, { priority: 'high' } );
- // By default commands are disabled when the editor is in read-only mode.
- this.listenTo( editor, 'change:isReadOnly', ( evt, name, value ) => {
- if ( value ) {
- this.forceDisabled( 'readOnlyMode' );
- } else {
- this.clearForceDisabled( 'readOnlyMode' );
- }
- } );
- }
- /**
- * Refreshes the command. The command should update its {@link #isEnabled} and {@link #value} properties
- * in this method.
- *
- * This method is automatically called when
- * {@link module:engine/model/document~Document#event:change any changes are applied to the document}.
- */
- refresh() {
- this.isEnabled = true;
- }
- /**
- * Disables the command.
- *
- * Command may be disabled by multiple features or algorithms (at once). When disabling a command, unique id should be passed
- * (e.g. feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the command.
- * The command becomes enabled only after all features {@link #clearForceDisabled enabled it back}.
- *
- * Disabling and enabling a command:
- *
- * command.isEnabled; // -> true
- * command.forceDisabled( 'MyFeature' );
- * command.isEnabled; // -> false
- * command.clearForceDisabled( 'MyFeature' );
- * command.isEnabled; // -> true
- *
- * Command disabled by multiple features:
- *
- * command.forceDisabled( 'MyFeature' );
- * command.forceDisabled( 'OtherFeature' );
- * command.clearForceDisabled( 'MyFeature' );
- * command.isEnabled; // -> false
- * command.clearForceDisabled( 'OtherFeature' );
- * command.isEnabled; // -> true
- *
- * Multiple disabling with the same identifier is redundant:
- *
- * command.forceDisabled( 'MyFeature' );
- * command.forceDisabled( 'MyFeature' );
- * command.clearForceDisabled( 'MyFeature' );
- * command.isEnabled; // -> true
- *
- * **Note:** some commands or algorithms may have more complex logic when it comes to enabling or disabling certain commands,
- * so the command might be still disabled after {@link #clearForceDisabled} was used.
- *
- * @param {String} id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the command.
- */
- forceDisabled( id ) {
- this._disableStack.add( id );
- if ( this._disableStack.size == 1 ) {
- this.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
- this.isEnabled = false;
- }
- }
- /**
- * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.
- *
- * @param {String} id Unique identifier, equal to the one passed in {@link #forceDisabled} call.
- */
- clearForceDisabled( id ) {
- this._disableStack.delete( id );
- if ( this._disableStack.size == 0 ) {
- this.off( 'set:isEnabled', forceDisable );
- this.refresh();
- }
- }
- /**
- * Executes the command.
- *
- * A command may accept parameters. They will be passed from {@link module:core/editor/editor~Editor#execute `editor.execute()`}
- * to the command.
- *
- * The `execute()` method will automatically abort when the command is disabled ({@link #isEnabled} is `false`).
- * This behavior is implemented by a high priority listener to the {@link #event:execute} event.
- *
- * In order to see how to disable a command from "outside" see the {@link #isEnabled} documentation.
- *
- * This method may return a value, which would be forwarded all the way down to the
- * {@link module:core/editor/editor~Editor#execute `editor.execute()`}.
- *
- * @fires execute
- */
- execute() {}
- /**
- * Destroys the command.
- */
- destroy() {
- this.stopListening();
- }
- /**
- * Event fired by the {@link #execute} method. The command action is a listener to this event so it's
- * possible to change/cancel the behavior of the command by listening to this event.
- *
- * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
- *
- * **Note:** This event is fired even if command is disabled. However, it is automatically blocked
- * by a high priority listener in order to prevent command execution.
- *
- * @event execute
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Command, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
- // Helper function that forces command to be disabled.
- function forceDisable( evt ) {
- evt.return = false;
- evt.stop();
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CommandCollection; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/commandcollection
- */
- /**
- * Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.
- */
- class CommandCollection {
- /**
- * Creates collection instance.
- */
- constructor() {
- /**
- * Command map.
- *
- * @private
- * @member {Map}
- */
- this._commands = new Map();
- }
- /**
- * Registers a new command.
- *
- * @param {String} commandName The name of the command.
- * @param {module:core/command~Command} command
- */
- add( commandName, command ) {
- this._commands.set( commandName, command );
- }
- /**
- * Retrieves a command from the collection.
- *
- * @param {String} commandName The name of the command.
- * @returns {module:core/command~Command}
- */
- get( commandName ) {
- return this._commands.get( commandName );
- }
- /**
- * Executes a command.
- *
- * @param {String} commandName The name of the command.
- * @param {*} [...commandParams] Command parameters.
- * @returns {*} The value returned by the {@link module:core/command~Command#execute `command.execute()`}.
- */
- execute( commandName, ...args ) {
- const command = this.get( commandName );
- if ( !command ) {
- /**
- * Command does not exist.
- *
- * @error commandcollection-command-not-found
- * @param {String} commandName Name of the command.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'commandcollection-command-not-found', this, { commandName } );
- }
- return command.execute( ...args );
- }
- /**
- * Returns iterator of command names.
- *
- * @returns {Iterable.<String>}
- */
- * names() {
- yield* this._commands.keys();
- }
- /**
- * Returns iterator of command instances.
- *
- * @returns {Iterable.<module:core/command~Command>}
- */
- * commands() {
- yield* this._commands.values();
- }
- /**
- * Iterable interface.
- *
- * Returns `[ commandName, commandInstance ]` pairs.
- *
- * @returns {Iterable.<Array>}
- */
- [ Symbol.iterator ]() {
- return this._commands[ Symbol.iterator ]();
- }
- /**
- * Destroys all collection commands.
- */
- destroy() {
- for ( const command of this.commands() ) {
- command.destroy();
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/context.js":
- /*!**************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/context.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Context; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/config */ "./node_modules/@ckeditor/ckeditor5-utils/src/config.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
- /* harmony import */ var _plugincollection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./plugincollection */ "./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/locale */ "./node_modules/@ckeditor/ckeditor5-utils/src/locale.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/context
- */
- /**
- * Provides a common, higher-level environment for solutions that use multiple {@link module:core/editor/editor~Editor editors}
- * or plugins that work outside the editor. Use it instead of {@link module:core/editor/editor~Editor.create `Editor.create()`}
- * in advanced application integrations.
- *
- * All configuration options passed to a context will be used as default options for editor instances initialized in that context.
- *
- * {@link module:core/contextplugin~ContextPlugin Context plugins} passed to a context instance will be shared among all
- * editor instances initialized in this context. These will be the same plugin instances for all the editors.
- *
- * **Note:** The context can only be initialized with {@link module:core/contextplugin~ContextPlugin context plugins}
- * (e.g. [comments](https://ckeditor.com/collaboration/comments/)). Regular {@link module:core/plugin~Plugin plugins} require an
- * editor instance to work and cannot be added to a context.
- *
- * **Note:** You can add a context plugin to an editor instance, though.
- *
- * If you are using multiple editor instances on one page and use any context plugins, create a context to share the configuration and
- * plugins among these editors. Some plugins will use the information about all existing editors to better integrate between them.
- *
- * If you are using plugins that do not require an editor to work (e.g. [comments](https://ckeditor.com/collaboration/comments/)),
- * enable and configure them using the context.
- *
- * If you are using only a single editor on each page, use {@link module:core/editor/editor~Editor.create `Editor.create()`} instead.
- * In such case, a context instance will be created by the editor instance in a transparent way.
- *
- * See {@link module:core/context~Context.create `Context.create()`} for usage examples.
- */
- class Context {
- /**
- * Creates a context instance with a given configuration.
- *
- * Usually not to be used directly. See the static {@link module:core/context~Context.create `create()`} method.
- *
- * @param {Object} [config={}] The context configuration.
- */
- constructor( config ) {
- /**
- * Stores all the configurations specific to this context instance.
- *
- * @readonly
- * @type {module:utils/config~Config}
- */
- this.config = new _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_0__["default"]( config, this.constructor.defaultConfig );
- const availablePlugins = this.constructor.builtinPlugins;
- this.config.define( 'plugins', availablePlugins );
- /**
- * The plugins loaded and in use by this context instance.
- *
- * @readonly
- * @type {module:core/plugincollection~PluginCollection}
- */
- this.plugins = new _plugincollection__WEBPACK_IMPORTED_MODULE_2__["default"]( this, availablePlugins );
- const languageConfig = this.config.get( 'language' ) || {};
- /**
- * @readonly
- * @type {module:utils/locale~Locale}
- */
- this.locale = new _ckeditor_ckeditor5_utils_src_locale__WEBPACK_IMPORTED_MODULE_3__["default"]( {
- uiLanguage: typeof languageConfig === 'string' ? languageConfig : languageConfig.ui,
- contentLanguage: this.config.get( 'language.content' )
- } );
- /**
- * Shorthand for {@link module:utils/locale~Locale#t}.
- *
- * @see module:utils/locale~Locale#t
- * @method #t
- */
- this.t = this.locale.t;
- /**
- * A list of editors that this context instance is injected to.
- *
- * @readonly
- * @type {module:utils/collection~Collection}
- */
- this.editors = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__["default"]();
- /**
- * Reference to the editor which created the context.
- * Null when the context was created outside of the editor.
- *
- * It is used to destroy the context when removing the editor that has created the context.
- *
- * @private
- * @type {module:core/editor/editor~Editor|null}
- */
- this._contextOwner = null;
- }
- /**
- * Loads and initializes plugins specified in the configuration.
- *
- * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which resolves
- * once the initialization is completed, providing an array of loaded plugins.
- */
- initPlugins() {
- const plugins = this.config.get( 'plugins' ) || [];
- const substitutePlugins = this.config.get( 'substitutePlugins' ) || [];
- // Plugins for substitution should be checked as well.
- for ( const Plugin of plugins.concat( substitutePlugins ) ) {
- if ( typeof Plugin != 'function' ) {
- /**
- * Only a constructor function is allowed as a {@link module:core/contextplugin~ContextPlugin context plugin}.
- *
- * @error context-initplugins-constructor-only
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
- 'context-initplugins-constructor-only',
- null,
- { Plugin }
- );
- }
- if ( Plugin.isContextPlugin !== true ) {
- /**
- * Only a plugin marked as a {@link module:core/contextplugin~ContextPlugin.isContextPlugin context plugin}
- * is allowed to be used with a context.
- *
- * @error context-initplugins-invalid-plugin
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
- 'context-initplugins-invalid-plugin',
- null,
- { Plugin }
- );
- }
- }
- return this.plugins.init( plugins, [], substitutePlugins );
- }
- /**
- * Destroys the context instance and all editors used with the context,
- * releasing all resources used by the context.
- *
- * @returns {Promise} A promise that resolves once the context instance is fully destroyed.
- */
- destroy() {
- return Promise.all( Array.from( this.editors, editor => editor.destroy() ) )
- .then( () => this.plugins.destroy() );
- }
- /**
- * Adds a reference to the editor which is used with this context.
- *
- * When the given editor has created the context, the reference to this editor will be stored
- * as a {@link ~Context#_contextOwner}.
- *
- * This method should only be used by the editor.
- *
- * @protected
- * @param {module:core/editor/editor~Editor} editor
- * @param {Boolean} isContextOwner Stores the given editor as a context owner.
- */
- _addEditor( editor, isContextOwner ) {
- if ( this._contextOwner ) {
- /**
- * Cannot add multiple editors to the context which is created by the editor.
- *
- * @error context-addeditor-private-context
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'context-addeditor-private-context' );
- }
- this.editors.add( editor );
- if ( isContextOwner ) {
- this._contextOwner = editor;
- }
- }
- /**
- * Removes a reference to the editor which was used with this context.
- * When the context was created by the given editor, the context will be destroyed.
- *
- * This method should only be used by the editor.
- *
- * @protected
- * @param {module:core/editor/editor~Editor} editor
- * @return {Promise} A promise that resolves once the editor is removed from the context or when the context was destroyed.
- */
- _removeEditor( editor ) {
- if ( this.editors.has( editor ) ) {
- this.editors.remove( editor );
- }
- if ( this._contextOwner === editor ) {
- return this.destroy();
- }
- return Promise.resolve();
- }
- /**
- * Returns the context configuration which will be copied to the editors created using this context.
- *
- * The configuration returned by this method has the plugins configuration removed — plugins are shared with all editors
- * through another mechanism.
- *
- * This method should only be used by the editor.
- *
- * @protected
- * @returns {Object} Configuration as a plain object.
- */
- _getEditorConfig() {
- const result = {};
- for ( const name of this.config.names() ) {
- if ( ![ 'plugins', 'removePlugins', 'extraPlugins' ].includes( name ) ) {
- result[ name ] = this.config.get( name );
- }
- }
- return result;
- }
- /**
- * Creates and initializes a new context instance.
- *
- * const commonConfig = { ... }; // Configuration for all the plugins and editors.
- * const editorPlugins = [ ... ]; // Regular plugins here.
- *
- * Context
- * .create( {
- * // Only context plugins here.
- * plugins: [ ... ],
- *
- * // Configure the language for all the editors (it cannot be overwritten).
- * language: { ... },
- *
- * // Configuration for context plugins.
- * comments: { ... },
- * ...
- *
- * // Default configuration for editor plugins.
- * toolbar: { ... },
- * image: { ... },
- * ...
- * } )
- * .then( context => {
- * const promises = [];
- *
- * promises.push( ClassicEditor.create(
- * document.getElementById( 'editor1' ),
- * {
- * editorPlugins,
- * context
- * }
- * ) );
- *
- * promises.push( ClassicEditor.create(
- * document.getElementById( 'editor2' ),
- * {
- * editorPlugins,
- * context,
- * toolbar: { ... } // You can overwrite the configuration of the context.
- * }
- * ) );
- *
- * return Promise.all( promises );
- * } );
- *
- * @param {Object} [config] The context configuration.
- * @returns {Promise} A promise resolved once the context is ready. The promise resolves with the created context instance.
- */
- static create( config ) {
- return new Promise( resolve => {
- const context = new this( config );
- resolve( context.initPlugins().then( () => context ) );
- } );
- }
- }
- /**
- * An array of plugins built into the `Context` class.
- *
- * It is used in CKEditor 5 builds featuring `Context` to provide a list of context plugins which are later automatically initialized
- * during the context initialization.
- *
- * They will be automatically initialized by `Context` unless `config.plugins` is passed.
- *
- * // Build some context plugins into the Context class first.
- * Context.builtinPlugins = [ FooPlugin, BarPlugin ];
- *
- * // Normally, you need to define config.plugins, but since Context.builtinPlugins was
- * // defined, now you can call create() without any configuration.
- * Context
- * .create()
- * .then( context => {
- * context.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
- * context.plugins.get( BarPlugin ); // -> An instance of the Bar plugin.
- * } );
- *
- * See also {@link module:core/context~Context.defaultConfig `Context.defaultConfig`}
- * and {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.
- *
- * @static
- * @member {Array.<Function>} module:core/context~Context.builtinPlugins
- */
- /**
- * The default configuration which is built into the `Context` class.
- *
- * It is used in CKEditor 5 builds featuring `Context` to provide the default configuration options which are later used during the
- * context initialization.
- *
- * Context.defaultConfig = {
- * foo: 1,
- * bar: 2
- * };
- *
- * Context
- * .create()
- * .then( context => {
- * context.config.get( 'foo' ); // -> 1
- * context.config.get( 'bar' ); // -> 2
- * } );
- *
- * // The default options can be overridden by the configuration passed to create().
- * Context
- * .create( { bar: 3 } )
- * .then( context => {
- * context.config.get( 'foo' ); // -> 1
- * context.config.get( 'bar' ); // -> 3
- * } );
- *
- * See also {@link module:core/context~Context.builtinPlugins `Context.builtinPlugins`}
- * and {@link module:core/editor/editor~Editor.defaultConfig `Editor.defaultConfig`}.
- *
- * @static
- * @member {Object} module:core/context~Context.defaultConfig
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContextPlugin; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/contextplugin
- */
- /**
- * The base class for {@link module:core/context~Context} plugin classes.
- *
- * A context plugin can either be initialized for an {@link module:core/editor/editor~Editor editor} or for
- * a {@link module:core/context~Context context}. In other words, it can either
- * work within one editor instance or with one or more editor instances that use a single context.
- * It is the context plugin's role to implement handling for both modes.
- *
- * There are a few rules for interaction between the editor plugins and context plugins:
- *
- * * A context plugin can require another context plugin.
- * * An {@link module:core/plugin~Plugin editor plugin} can require a context plugin.
- * * A context plugin MUST NOT require an {@link module:core/plugin~Plugin editor plugin}.
- *
- * @implements module:core/plugin~PluginInterface
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class ContextPlugin {
- /**
- * Creates a new plugin instance.
- *
- * @param {module:core/context~Context|module:core/editor/editor~Editor} context
- */
- constructor( context ) {
- /**
- * The context instance.
- *
- * @readonly
- * @type {module:core/context~Context|module:core/editor/editor~Editor}
- */
- this.context = context;
- }
- /**
- * @inheritDoc
- */
- destroy() {
- this.stopListening();
- }
- /**
- * @inheritDoc
- */
- static get isContextPlugin() {
- return true;
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( ContextPlugin, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditingKeystrokeHandler; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/editingkeystrokehandler
- */
- /**
- * A keystroke handler for editor editing. Its instance is available
- * in {@link module:core/editor/editor~Editor#keystrokes} so plugins
- * can register their keystrokes.
- *
- * E.g. an undo plugin would do this:
- *
- * editor.keystrokes.set( 'Ctrl+Z', 'undo' );
- * editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );
- * editor.keystrokes.set( 'Ctrl+Y', 'redo' );
- *
- * @extends module:utils/keystrokehandler~KeystrokeHandler
- */
- class EditingKeystrokeHandler extends _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an instance of the keystroke handler.
- *
- * @param {module:core/editor/editor~Editor} editor
- */
- constructor( editor ) {
- super();
- /**
- * The editor instance.
- *
- * @readonly
- * @member {module:core/editor/editor~Editor}
- */
- this.editor = editor;
- }
- /**
- * Registers a handler for the specified keystroke.
- *
- * The handler can be specified as a command name or a callback.
- *
- * @param {String|Array.<String|Number>} keystroke Keystroke defined in a format accepted by
- * the {@link module:utils/keyboard~parseKeystroke} function.
- * @param {Function|String} callback If a string is passed, then the keystroke will
- * {@link module:core/editor/editor~Editor#execute execute a command}.
- * If a function, then it will be called with the
- * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
- * a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
- * @param {Object} [options={}] Additional options.
- * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of the keystroke
- * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority
- * are called in the order they were added.
- */
- set( keystroke, callback, options = {} ) {
- if ( typeof callback == 'string' ) {
- const commandName = callback;
- callback = ( evtData, cancel ) => {
- this.editor.execute( commandName );
- cancel();
- };
- }
- super.set( keystroke, callback, options );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Editor; });
- /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../context */ "./node_modules/@ckeditor/ckeditor5-core/src/context.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/config */ "./node_modules/@ckeditor/ckeditor5-utils/src/config.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_controller_editingcontroller__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/controller/editingcontroller */ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js");
- /* harmony import */ var _plugincollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../plugincollection */ "./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js");
- /* harmony import */ var _commandcollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../commandcollection */ "./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_controller_datacontroller__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/controller/datacontroller */ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_conversion_conversion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/conversion/conversion */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_model_model__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/model/model */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js");
- /* harmony import */ var _editingkeystrokehandler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../editingkeystrokehandler */ "./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_stylesmap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/stylesmap */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/editor/editor
- */
- /**
- * The class representing a basic, generic editor.
- *
- * Check out the list of its subclasses to learn about specific editor implementations.
- *
- * All editor implementations (like {@link module:editor-classic/classiceditor~ClassicEditor} or
- * {@link module:editor-inline/inlineeditor~InlineEditor}) should extend this class. They can add their
- * own methods and properties.
- *
- * When you are implementing a plugin, this editor represents the API
- * which your plugin can expect to get when using its {@link module:core/plugin~Plugin#editor} property.
- *
- * This API should be sufficient in order to implement the "editing" part of your feature
- * (schema definition, conversion, commands, keystrokes, etc.).
- * It does not define the editor UI, which is available only if
- * the specific editor implements also the {@link module:core/editor/editorwithui~EditorWithUI} interface
- * (as most editor implementations do).
- *
- * @abstract
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class Editor {
- /**
- * Creates a new instance of the editor class.
- *
- * Usually, not to be used directly. See the static {@link module:core/editor/editor~Editor.create `create()`} method.
- *
- * @param {Object} [config={}] The editor configuration.
- */
- constructor( config = {} ) {
- /**
- * The editor context.
- * When it is not provided through the configuration, the editor creates it.
- *
- * @protected
- * @type {module:core/context~Context}
- */
- this._context = config.context || new _context__WEBPACK_IMPORTED_MODULE_0__["default"]( { language: config.language } );
- this._context._addEditor( this, !config.context );
- // Clone the plugins to make sure that the plugin array will not be shared
- // between editors and make the watchdog feature work correctly.
- const availablePlugins = Array.from( this.constructor.builtinPlugins || [] );
- /**
- * Stores all configurations specific to this editor instance.
- *
- * editor.config.get( 'image.toolbar' );
- * // -> [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
- *
- * @readonly
- * @member {module:utils/config~Config}
- */
- this.config = new _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_1__["default"]( config, this.constructor.defaultConfig );
- this.config.define( 'plugins', availablePlugins );
- this.config.define( this._context._getEditorConfig() );
- /**
- * The plugins loaded and in use by this editor instance.
- *
- * editor.plugins.get( 'ClipboardPipeline' ); // -> An instance of the clipboard pipeline plugin.
- *
- * @readonly
- * @member {module:core/plugincollection~PluginCollection}
- */
- this.plugins = new _plugincollection__WEBPACK_IMPORTED_MODULE_3__["default"]( this, availablePlugins, this._context.plugins );
- /**
- * The locale instance.
- *
- * @readonly
- * @type {module:utils/locale~Locale}
- */
- this.locale = this._context.locale;
- /**
- * Shorthand for {@link module:utils/locale~Locale#t}.
- *
- * @see module:utils/locale~Locale#t
- * @method #t
- */
- this.t = this.locale.t;
- /**
- * Commands registered to the editor.
- *
- * Use the shorthand {@link #execute `editor.execute()`} method to execute commands:
- *
- * // Execute the bold command:
- * editor.execute( 'bold' );
- *
- * // Check the state of the bold command:
- * editor.commands.get( 'bold' ).value;
- *
- * @readonly
- * @member {module:core/commandcollection~CommandCollection}
- */
- this.commands = new _commandcollection__WEBPACK_IMPORTED_MODULE_4__["default"]();
- /**
- * Indicates the editor life-cycle state.
- *
- * The editor is in one of the following states:
- *
- * * `initializing` – During the editor initialization (before
- * {@link module:core/editor/editor~Editor.create `Editor.create()`}) finished its job.
- * * `ready` – After the promise returned by the {@link module:core/editor/editor~Editor.create `Editor.create()`}
- * method is resolved.
- * * `destroyed` – Once the {@link #destroy `editor.destroy()`} method was called.
- *
- * @observable
- * @member {'initializing'|'ready'|'destroyed'} #state
- */
- this.set( 'state', 'initializing' );
- this.once( 'ready', () => ( this.state = 'ready' ), { priority: 'high' } );
- this.once( 'destroy', () => ( this.state = 'destroyed' ), { priority: 'high' } );
- /**
- * Defines whether this editor is in read-only mode.
- *
- * In read-only mode the editor {@link #commands commands} are disabled so it is not possible
- * to modify the document by using them. Also, the editable element(s) become non-editable.
- *
- * In order to make the editor read-only, you can set this value directly:
- *
- * editor.isReadOnly = true;
- *
- * @observable
- * @member {Boolean} #isReadOnly
- */
- this.set( 'isReadOnly', false );
- /**
- * The editor's model.
- *
- * The central point of the editor's abstract data model.
- *
- * @readonly
- * @member {module:engine/model/model~Model}
- */
- this.model = new _ckeditor_ckeditor5_engine_src_model_model__WEBPACK_IMPORTED_MODULE_7__["default"]();
- const stylesProcessor = new _ckeditor_ckeditor5_engine_src_view_stylesmap__WEBPACK_IMPORTED_MODULE_12__["StylesProcessor"]();
- /**
- * The {@link module:engine/controller/datacontroller~DataController data controller}.
- * Used e.g. for setting and retrieving the editor data.
- *
- * @readonly
- * @member {module:engine/controller/datacontroller~DataController}
- */
- this.data = new _ckeditor_ckeditor5_engine_src_controller_datacontroller__WEBPACK_IMPORTED_MODULE_5__["default"]( this.model, stylesProcessor );
- /**
- * The {@link module:engine/controller/editingcontroller~EditingController editing controller}.
- * Controls user input and rendering the content for editing.
- *
- * @readonly
- * @member {module:engine/controller/editingcontroller~EditingController}
- */
- this.editing = new _ckeditor_ckeditor5_engine_src_controller_editingcontroller__WEBPACK_IMPORTED_MODULE_2__["default"]( this.model, stylesProcessor );
- this.editing.view.document.bind( 'isReadOnly' ).to( this );
- /**
- * Conversion manager through which you can register model-to-view and view-to-model converters.
- *
- * See the {@link module:engine/conversion/conversion~Conversion} documentation to learn how to add converters.
- *
- * @readonly
- * @member {module:engine/conversion/conversion~Conversion}
- */
- this.conversion = new _ckeditor_ckeditor5_engine_src_conversion_conversion__WEBPACK_IMPORTED_MODULE_6__["default"]( [ this.editing.downcastDispatcher, this.data.downcastDispatcher ], this.data.upcastDispatcher );
- this.conversion.addAlias( 'dataDowncast', this.data.downcastDispatcher );
- this.conversion.addAlias( 'editingDowncast', this.editing.downcastDispatcher );
- /**
- * An instance of the {@link module:core/editingkeystrokehandler~EditingKeystrokeHandler}.
- *
- * It allows setting simple keystrokes:
- *
- * // Execute the bold command on Ctrl+E:
- * editor.keystrokes.set( 'Ctrl+E', 'bold' );
- *
- * // Execute your own callback:
- * editor.keystrokes.set( 'Ctrl+E', ( data, cancel ) => {
- * console.log( data.keyCode );
- *
- * // Prevent the default (native) action and stop the underlying keydown event
- * // so no other editor feature will interfere.
- * cancel();
- * } );
- *
- * Note: Certain typing-oriented keystrokes (like <kbd>Backspace</kbd> or <kbd>Enter</kbd>) are handled
- * by a low-level mechanism and trying to listen to them via the keystroke handler will not work reliably.
- * To handle these specific keystrokes, see the events fired by the
- * {@link module:engine/view/document~Document editing view document} (`editor.editing.view.document`).
- *
- * @readonly
- * @member {module:core/editingkeystrokehandler~EditingKeystrokeHandler}
- */
- this.keystrokes = new _editingkeystrokehandler__WEBPACK_IMPORTED_MODULE_8__["default"]( this );
- this.keystrokes.listenTo( this.editing.view.document );
- }
- /**
- * Loads and initializes plugins specified in the configuration.
- *
- * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which resolves
- * once the initialization is completed, providing an array of loaded plugins.
- */
- initPlugins() {
- const config = this.config;
- const plugins = config.get( 'plugins' );
- const removePlugins = config.get( 'removePlugins' ) || [];
- const extraPlugins = config.get( 'extraPlugins' ) || [];
- const substitutePlugins = config.get( 'substitutePlugins' ) || [];
- return this.plugins.init( plugins.concat( extraPlugins ), removePlugins, substitutePlugins );
- }
- /**
- * Destroys the editor instance, releasing all resources used by it.
- *
- * **Note** The editor cannot be destroyed during the initialization phase so if it is called
- * while the editor {@link #state is being initialized}, it will wait for the editor initialization before destroying it.
- *
- * @fires destroy
- * @returns {Promise} A promise that resolves once the editor instance is fully destroyed.
- */
- destroy() {
- let readyPromise = Promise.resolve();
- if ( this.state == 'initializing' ) {
- readyPromise = new Promise( resolve => this.once( 'ready', resolve ) );
- }
- return readyPromise
- .then( () => {
- this.fire( 'destroy' );
- this.stopListening();
- this.commands.destroy();
- } )
- .then( () => this.plugins.destroy() )
- .then( () => {
- this.model.destroy();
- this.data.destroy();
- this.editing.destroy();
- this.keystrokes.destroy();
- } )
- // Remove the editor from the context.
- // When the context was created by this editor, the context will be destroyed.
- .then( () => this._context._removeEditor( this ) );
- }
- /**
- * Executes the specified command with given parameters.
- *
- * Shorthand for:
- *
- * editor.commands.get( commandName ).execute( ... );
- *
- * @param {String} commandName The name of the command to execute.
- * @param {*} [...commandParams] Command parameters.
- * @returns {*} The value returned by the {@link module:core/commandcollection~CommandCollection#execute `commands.execute()`}.
- */
- execute( ...args ) {
- try {
- return this.commands.execute( ...args );
- } catch ( err ) {
- // @if CK_DEBUG // throw err;
- /* istanbul ignore next */
- _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["default"].rethrowUnexpectedError( err, this );
- }
- }
- /**
- * Focuses the editor.
- *
- * **Note** To explicitly focus the editing area of the editor, use the
- * {@link module:engine/view/view~View#focus `editor.editing.view.focus()`} method of the editing view.
- *
- * Check out the {@glink framework/guides/deep-dive/ui/focus-tracking#focus-in-the-editor-ui Focus in the editor UI} section
- * of the {@glink framework/guides/deep-dive/ui/focus-tracking Deep dive into focus tracking} guide to learn more.
- */
- focus() {
- this.editing.view.focus();
- }
- /**
- * Creates and initializes a new editor instance.
- *
- * This is an abstract method. Every editor type needs to implement its own initialization logic.
- *
- * See the `create()` methods of the existing editor types to learn how to use them:
- *
- * * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}
- * * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}
- * * {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`}
- * * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}
- *
- * @abstract
- * @method module:core/editor/editor~Editor.create
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_10__["default"])( Editor, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_9__["default"] );
- /**
- * Fired when the {@link module:engine/controller/datacontroller~DataController#event:ready data} and all additional
- * editor components are ready.
- *
- * Note: This event is most useful for plugin developers. When integrating the editor with your website or
- * application, you do not have to listen to `editor#ready` because when the promise returned by the static
- * {@link module:core/editor/editor~Editor.create `Editor.create()`} event is resolved, the editor is already ready.
- * In fact, since the first moment when the editor instance is available to you is inside `then()`'s callback,
- * you cannot even add a listener to the `editor#ready` event.
- *
- * See also the {@link #state `editor.state`} property.
- *
- * @event ready
- */
- /**
- * Fired when this editor instance is destroyed. The editor at this point is not usable and this event should be used to
- * perform the clean-up in any plugin.
- *
- *
- * See also the {@link #state `editor.state`} property.
- *
- * @event destroy
- */
- /**
- * This error is thrown when trying to pass a `<textarea>` element to a `create()` function of an editor class.
- *
- * The only editor type which can be initialized on `<textarea>` elements is {@glink builds/guides/overview#classic-editor classic editor}.
- * This editor hides the passed element and inserts its own UI next to it. Other types of editors reuse the passed element as their root
- * editable element and therefore `<textarea>` is not appropriate for them. Use a `<div>` or another text container instead:
- *
- * <div id="editor">
- * <p>Initial content.</p>
- * </div>
- *
- * @error editor-wrong-element
- */
- /**
- * An array of plugins built into this editor class.
- *
- * It is used in CKEditor 5 builds to provide a list of plugins which are later automatically initialized
- * during the editor initialization.
- *
- * They will be automatically initialized by the editor, unless listed in `config.removePlugins` and
- * unless `config.plugins` is passed.
- *
- * // Build some plugins into the editor class first.
- * ClassicEditor.builtinPlugins = [ FooPlugin, BarPlugin ];
- *
- * // Normally, you need to define config.plugins, but since ClassicEditor.builtinPlugins was
- * // defined, now you can call create() without any configuration.
- * ClassicEditor
- * .create( sourceElement )
- * .then( editor => {
- * editor.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
- * editor.plugins.get( BarPlugin ); // -> An instance of the Bar plugin.
- * } );
- *
- * ClassicEditor
- * .create( sourceElement, {
- * // Do not initialize these plugins (note: it is defined by a string):
- * removePlugins: [ 'Foo' ]
- * } )
- * .then( editor => {
- * editor.plugins.get( FooPlugin ); // -> Undefined.
- * editor.config.get( BarPlugin ); // -> An instance of the Bar plugin.
- * } );
- *
- * ClassicEditor
- * .create( sourceElement, {
- * // Load only this plugin. It can also be defined by a string if
- * // this plugin was built into the editor class.
- * plugins: [ FooPlugin ]
- * } )
- * .then( editor => {
- * editor.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
- * editor.config.get( BarPlugin ); // -> Undefined.
- * } );
- *
- * See also {@link module:core/editor/editor~Editor.defaultConfig}.
- *
- * @static
- * @member {Array.<Function>} module:core/editor/editor~Editor.builtinPlugins
- */
- /**
- * The default configuration which is built into the editor class.
- *
- * It is used in CKEditor 5 builds to provide the default configuration options which are later used during the editor initialization.
- *
- * ClassicEditor.defaultConfig = {
- * foo: 1,
- * bar: 2
- * };
- *
- * ClassicEditor
- * .create( sourceElement )
- * .then( editor => {
- * editor.config.get( 'foo' ); // -> 1
- * editor.config.get( 'bar' ); // -> 2
- * } );
- *
- * // The default options can be overridden by the configuration passed to create().
- * ClassicEditor
- * .create( sourceElement, { bar: 3 } )
- * .then( editor => {
- * editor.config.get( 'foo' ); // -> 1
- * editor.config.get( 'bar' ); // -> 3
- * } );
- *
- * See also {@link module:core/editor/editor~Editor.builtinPlugins}.
- *
- * @static
- * @member {Object} module:core/editor/editor~Editor.defaultConfig
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editorui.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/editorui.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditorUI; });
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_componentfactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/componentfactory */ "./node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/editor/editorui
- */
- /* globals console */
- /**
- * A class providing the minimal interface that is required to successfully bootstrap any editor UI.
- *
- * @mixes module:utils/emittermixin~EmitterMixin
- */
- class EditorUI {
- /**
- * Creates an instance of the editor UI class.
- *
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- */
- constructor( editor ) {
- /**
- * The editor that the UI belongs to.
- *
- * @readonly
- * @member {module:core/editor/editor~Editor} #editor
- */
- this.editor = editor;
- /**
- * An instance of the {@link module:ui/componentfactory~ComponentFactory}, a registry used by plugins
- * to register factories of specific UI components.
- *
- * @readonly
- * @member {module:ui/componentfactory~ComponentFactory} #componentFactory
- */
- this.componentFactory = new _ckeditor_ckeditor5_ui_src_componentfactory__WEBPACK_IMPORTED_MODULE_0__["default"]( editor );
- /**
- * Stores the information about the editor UI focus and propagates it so various plugins and components
- * are unified as a focus group.
- *
- * @readonly
- * @member {module:utils/focustracker~FocusTracker} #focusTracker
- */
- this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
- /**
- * Stores all editable elements used by the editor instance.
- *
- * @private
- * @member {Map.<String,HTMLElement>}
- */
- this._editableElementsMap = new Map();
- // Informs UI components that should be refreshed after layout change.
- this.listenTo( editor.editing.view.document, 'layoutChanged', () => this.update() );
- }
- /**
- * The main (outermost) DOM element of the editor UI.
- *
- * For example, in {@link module:editor-classic/classiceditor~ClassicEditor} it is a `<div>` which
- * wraps the editable element and the toolbar. In {@link module:editor-inline/inlineeditor~InlineEditor}
- * it is the editable element itself (as there is no other wrapper). However, in
- * {@link module:editor-decoupled/decouplededitor~DecoupledEditor} it is set to `null` because this editor does not
- * come with a single "main" HTML element (its editable element and toolbar are separate).
- *
- * This property can be understood as a shorthand for retrieving the element that a specific editor integration
- * considers to be its main DOM element.
- *
- * @readonly
- * @member {HTMLElement|null} #element
- */
- get element() {
- return null;
- }
- /**
- * Fires the {@link module:core/editor/editorui~EditorUI#event:update `update`} event.
- *
- * This method should be called when the editor UI (e.g. positions of its balloons) needs to be updated due to
- * some environmental change which CKEditor 5 is not aware of (e.g. resize of a container in which it is used).
- */
- update() {
- this.fire( 'update' );
- }
- /**
- * Destroys the UI.
- */
- destroy() {
- this.stopListening();
- this.focusTracker.destroy();
- // Clean–up the references to the CKEditor instance stored in the native editable DOM elements.
- for ( const domElement of this._editableElementsMap.values() ) {
- domElement.ckeditorInstance = null;
- }
- this._editableElementsMap = new Map();
- }
- /**
- * Store the native DOM editable element used by the editor under
- * a unique name.
- *
- * @param {String} rootName The unique name of the editable element.
- * @param {HTMLElement} domElement The native DOM editable element.
- */
- setEditableElement( rootName, domElement ) {
- this._editableElementsMap.set( rootName, domElement );
- // Put a reference to the CKEditor instance in the editable native DOM element.
- // It helps 3rd–party software (browser extensions, other libraries) access and recognize
- // CKEditor 5 instances (editing roots) and use their API (there is no global editor
- // instance registry).
- if ( !domElement.ckeditorInstance ) {
- domElement.ckeditorInstance = this.editor;
- }
- }
- /**
- * Returns the editable editor element with the given name or null if editable does not exist.
- *
- * @param {String} [rootName=main] The editable name.
- * @returns {HTMLElement|undefined}
- */
- getEditableElement( rootName = 'main' ) {
- return this._editableElementsMap.get( rootName );
- }
- /**
- * Returns array of names of all editor editable elements.
- *
- * @returns {Iterable.<String>}
- */
- getEditableElementsNames() {
- return this._editableElementsMap.keys();
- }
- /**
- * Stores all editable elements used by the editor instance.
- *
- * @protected
- * @deprecated
- * @member {Map.<String,HTMLElement>}
- */
- get _editableElements() {
- /**
- * The {@link module:core/editor/editorui~EditorUI#_editableElements `EditorUI#_editableElements`} property has been
- * deprecated and will be removed in the near future. Please use {@link #setEditableElement `setEditableElement()`} and
- * {@link #getEditableElement `getEditableElement()`} methods instead.
- *
- * @error editor-ui-deprecated-editable-elements
- * @param {module:core/editor/editorui~EditorUI} editorUI Editor UI instance the deprecated property belongs to.
- */
- console.warn(
- 'editor-ui-deprecated-editable-elements: ' +
- 'The EditorUI#_editableElements property has been deprecated and will be removed in the near future.',
- { editorUI: this } );
- return this._editableElementsMap;
- }
- /**
- * Fired when the editor UI is ready.
- *
- * Fired before {@link module:engine/controller/datacontroller~DataController#event:ready}.
- *
- * @event ready
- */
- /**
- * Fired whenever the UI (all related components) should be refreshed.
- *
- * **Note:**: The event is fired after each {@link module:engine/view/document~Document#event:layoutChanged}.
- * It can also be fired manually via the {@link module:core/editor/editorui~EditorUI#update} method.
- *
- * @event update
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( EditorUI, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return attachToForm; });
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/editor/utils/attachtoform
- */
- /**
- * Checks if the editor is initialized on a `<textarea>` element that belongs to a form. If yes, it updates the editor's element
- * content before submitting the form.
- *
- * This helper requires the {@link module:core/editor/utils/elementapimixin~ElementApi ElementApi interface}.
- *
- * @param {module:core/editor/editor~Editor} editor Editor instance.
- */
- function attachToForm( editor ) {
- if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isFunction"])( editor.updateSourceElement ) ) {
- /**
- * The editor passed to `attachToForm()` must implement the
- * {@link module:core/editor/utils/elementapimixin~ElementApi} interface.
- *
- * @error attachtoform-missing-elementapi-interface
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
- 'attachtoform-missing-elementapi-interface',
- editor
- );
- }
- const sourceElement = editor.sourceElement;
- // Only when replacing a textarea which is inside of a form element.
- if ( sourceElement && sourceElement.tagName.toLowerCase() === 'textarea' && sourceElement.form ) {
- let originalSubmit;
- const form = sourceElement.form;
- const onSubmit = () => editor.updateSourceElement();
- // Replace the original form#submit() to call a custom submit function first.
- // Check if #submit is a function because the form might have an input named "submit".
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isFunction"])( form.submit ) ) {
- originalSubmit = form.submit;
- form.submit = () => {
- onSubmit();
- originalSubmit.apply( form );
- };
- }
- // Update the replaced textarea with data before each form#submit event.
- form.addEventListener( 'submit', onSubmit );
- // Remove the submit listener and revert the original submit method on
- // editor#destroy.
- editor.on( 'destroy', () => {
- form.removeEventListener( 'submit', onSubmit );
- if ( originalSubmit ) {
- form.submit = originalSubmit;
- }
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/editor/utils/dataapimixin
- */
- /**
- * Implementation of the {@link module:core/editor/utils/dataapimixin~DataApi}.
- *
- * @mixin DataApiMixin
- * @implements module:core/editor/utils/dataapimixin~DataApi
- */
- const DataApiMixin = {
- /**
- * @inheritDoc
- */
- setData( data ) {
- this.data.set( data );
- },
- /**
- * @inheritDoc
- */
- getData( options ) {
- return this.data.get( options );
- }
- };
- /* harmony default export */ __webpack_exports__["default"] = (DataApiMixin);
- /**
- * Interface defining editor methods for setting and getting data to and from the editor's main root element
- * using the {@link module:core/editor/editor~Editor#data data pipeline}.
- *
- * This interface is not a part of the {@link module:core/editor/editor~Editor} class because one may want to implement
- * an editor with multiple root elements, in which case the methods for setting and getting data will need to be implemented
- * differently.
- *
- * @interface DataApi
- */
- /**
- * Sets the data in the editor.
- *
- * editor.setData( '<p>This is editor!</p>' );
- *
- * By default the editor accepts HTML. This can be controlled by injecting a different data processor.
- * See the {@glink features/markdown Markdown output} guide for more details.
- *
- * Note: Not only is the format of the data configurable, but the type of the `setData()`'s parameter does not
- * have to be a string either. You can e.g. accept an object or a DOM `DocumentFragment` if you consider this
- * the right format for you.
- *
- * @method #setData
- * @param {String} data Input data.
- */
- /**
- * Gets the data from the editor.
- *
- * editor.getData(); // -> '<p>This is editor!</p>'
- *
- * By default the editor outputs HTML. This can be controlled by injecting a different data processor.
- * See the {@glink features/markdown Markdown output} guide for more details.
- *
- * Note: Not only is the format of the data configurable, but the type of the `getData()`'s return value does not
- * have to be a string either. You can e.g. return an object or a DOM `DocumentFragment` if you consider this
- * the right format for you.
- *
- * @method #getData
- * @param {Object} [options] Additional configuration for the retrieved data.
- * Editor features may introduce more configuration options that can be set through this parameter.
- * @param {String} [options.rootName='main'] Root name.
- * @param {String} [options.trim='empty'] Whether returned data should be trimmed. This option is set to `'empty'` by default,
- * which means that whenever editor content is considered empty, an empty string is returned. To turn off trimming
- * use `'none'`. In such cases exact content will be returned (for example `'<p> </p>'` for an empty editor).
- * @returns {String} Output data.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_setdatainelement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/setdatainelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/editor/utils/elementapimixin
- */
- /**
- * Implementation of the {@link module:core/editor/utils/elementapimixin~ElementApi}.
- *
- * @mixin ElementApiMixin
- * @implements module:core/editor/utils/elementapimixin~ElementApi
- */
- const ElementApiMixin = {
- /**
- * @inheritDoc
- */
- updateSourceElement() {
- if ( !this.sourceElement ) {
- /**
- * Cannot update the source element of a detached editor.
- *
- * The {@link ~ElementApi#updateSourceElement `updateSourceElement()`} method cannot be called if you did not
- * pass an element to `Editor.create()`.
- *
- * @error editor-missing-sourceelement
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'editor-missing-sourceelement',
- this
- );
- }
- Object(_ckeditor_ckeditor5_utils_src_dom_setdatainelement__WEBPACK_IMPORTED_MODULE_1__["default"])( this.sourceElement, this.data.get() );
- }
- };
- /* harmony default export */ __webpack_exports__["default"] = (ElementApiMixin);
- /**
- * Interface describing an editor that replaced a DOM element (was "initialized on an element").
- *
- * Such an editor should provide a method to
- * {@link module:core/editor/utils/elementapimixin~ElementApi#updateSourceElement update the replaced element with the current data}.
- *
- * @interface ElementApi
- */
- /**
- * The element on which the editor has been initialized.
- *
- * @readonly
- * @member {HTMLElement} #sourceElement
- */
- /**
- * Updates the {@link #sourceElement editor source element}'s content with the data.
- *
- * @method #updateSourceElement
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement.js ***!
- \***************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return secureSourceElement; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/editor/utils/securesourceelement
- */
- /**
- * Marks the source element on which the editor was initialized. This prevents other editor instances from using this element.
- *
- * Running multiple editor instances on the same source element causes various issues and it is
- * crucial this helper is called as soon as the source element is known to prevent collisions.
- *
- * @param {module:core/editor/editor~Editor} editor Editor instance.
- */
- function secureSourceElement( editor ) {
- const sourceElement = editor.sourceElement;
- // If the editor was initialized without specifying an element, we don't need to secure anything.
- if ( !sourceElement ) {
- return;
- }
- if ( sourceElement.ckeditorInstance ) {
- /**
- * A DOM element used to create the editor (e.g.
- * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`})
- * has already been used to create another editor instance. Make sure each editor is
- * created with an unique DOM element.
- *
- * @error editor-source-element-already-used
- * @param {HTMLElement} element DOM element that caused the collision.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'editor-source-element-already-used',
- editor
- );
- }
- sourceElement.ckeditorInstance = editor;
- editor.once( 'destroy', () => {
- delete sourceElement.ckeditorInstance;
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/index.js":
- /*!************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/index.js ***!
- \************************************************************/
- /*! exports provided: Plugin, Command, MultiCommand, Context, ContextPlugin, Editor, EditorUI, attachToForm, DataApiMixin, ElementApiMixin, secureSourceElement, PendingActions, icons */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "icons", function() { return icons; });
- /* harmony import */ var _plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Plugin", function() { return _plugin__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return _command__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _multicommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./multicommand */ "./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiCommand", function() { return _multicommand__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./context */ "./node_modules/@ckeditor/ckeditor5-core/src/context.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return _context__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _contextplugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./contextplugin */ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextPlugin", function() { return _contextplugin__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _editor_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editor/editor */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Editor", function() { return _editor_editor__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _editor_editorui__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor/editorui */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editorui.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorUI", function() { return _editor_editorui__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _editor_utils_attachtoform__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./editor/utils/attachtoform */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attachToForm", function() { return _editor_utils_attachtoform__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _editor_utils_dataapimixin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./editor/utils/dataapimixin */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataApiMixin", function() { return _editor_utils_dataapimixin__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _editor_utils_elementapimixin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./editor/utils/elementapimixin */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ElementApiMixin", function() { return _editor_utils_elementapimixin__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _editor_utils_securesourceelement__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./editor/utils/securesourceelement */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "secureSourceElement", function() { return _editor_utils_securesourceelement__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _pendingactions__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./pendingactions */ "./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PendingActions", function() { return _pendingactions__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _theme_icons_cancel_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../theme/icons/cancel.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg");
- /* harmony import */ var _theme_icons_caption_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../theme/icons/caption.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/caption.svg");
- /* harmony import */ var _theme_icons_check_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../theme/icons/check.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg");
- /* harmony import */ var _theme_icons_eraser_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../theme/icons/eraser.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg");
- /* harmony import */ var _theme_icons_low_vision_svg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../theme/icons/low-vision.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg");
- /* harmony import */ var _theme_icons_image_svg__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../theme/icons/image.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg");
- /* harmony import */ var _theme_icons_align_bottom_svg__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../theme/icons/align-bottom.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg");
- /* harmony import */ var _theme_icons_align_middle_svg__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./../theme/icons/align-middle.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-middle.svg");
- /* harmony import */ var _theme_icons_align_top_svg__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./../theme/icons/align-top.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-top.svg");
- /* harmony import */ var _theme_icons_align_left_svg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./../theme/icons/align-left.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg");
- /* harmony import */ var _theme_icons_align_center_svg__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./../theme/icons/align-center.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg");
- /* harmony import */ var _theme_icons_align_right_svg__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./../theme/icons/align-right.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg");
- /* harmony import */ var _theme_icons_align_justify_svg__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./../theme/icons/align-justify.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg");
- /* harmony import */ var _theme_icons_object_left_svg__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./../theme/icons/object-left.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg");
- /* harmony import */ var _theme_icons_object_center_svg__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./../theme/icons/object-center.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg");
- /* harmony import */ var _theme_icons_object_right_svg__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./../theme/icons/object-right.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg");
- /* harmony import */ var _theme_icons_object_full_width_svg__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./../theme/icons/object-full-width.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg");
- /* harmony import */ var _theme_icons_object_size_full_svg__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./../theme/icons/object-size-full.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg");
- /* harmony import */ var _theme_icons_object_size_large_svg__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./../theme/icons/object-size-large.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg");
- /* harmony import */ var _theme_icons_object_size_small_svg__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./../theme/icons/object-size-small.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg");
- /* harmony import */ var _theme_icons_object_size_medium_svg__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./../theme/icons/object-size-medium.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg");
- /* harmony import */ var _theme_icons_pencil_svg__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./../theme/icons/pencil.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg");
- /* harmony import */ var _theme_icons_pilcrow_svg__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./../theme/icons/pilcrow.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg");
- /* harmony import */ var _theme_icons_quote_svg__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./../theme/icons/quote.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg");
- /* harmony import */ var _theme_icons_three_vertical_dots_svg__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./../theme/icons/three-vertical-dots.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core
- */
- const icons = {
- cancel: _theme_icons_cancel_svg__WEBPACK_IMPORTED_MODULE_12__["default"],
- caption: _theme_icons_caption_svg__WEBPACK_IMPORTED_MODULE_13__["default"],
- check: _theme_icons_check_svg__WEBPACK_IMPORTED_MODULE_14__["default"],
- eraser: _theme_icons_eraser_svg__WEBPACK_IMPORTED_MODULE_15__["default"],
- lowVision: _theme_icons_low_vision_svg__WEBPACK_IMPORTED_MODULE_16__["default"],
- image: _theme_icons_image_svg__WEBPACK_IMPORTED_MODULE_17__["default"],
- alignBottom: _theme_icons_align_bottom_svg__WEBPACK_IMPORTED_MODULE_18__["default"],
- alignMiddle: _theme_icons_align_middle_svg__WEBPACK_IMPORTED_MODULE_19__["default"],
- alignTop: _theme_icons_align_top_svg__WEBPACK_IMPORTED_MODULE_20__["default"],
- alignLeft: _theme_icons_align_left_svg__WEBPACK_IMPORTED_MODULE_21__["default"],
- alignCenter: _theme_icons_align_center_svg__WEBPACK_IMPORTED_MODULE_22__["default"],
- alignRight: _theme_icons_align_right_svg__WEBPACK_IMPORTED_MODULE_23__["default"],
- alignJustify: _theme_icons_align_justify_svg__WEBPACK_IMPORTED_MODULE_24__["default"],
- objectLeft: _theme_icons_object_left_svg__WEBPACK_IMPORTED_MODULE_25__["default"],
- objectCenter: _theme_icons_object_center_svg__WEBPACK_IMPORTED_MODULE_26__["default"],
- objectRight: _theme_icons_object_right_svg__WEBPACK_IMPORTED_MODULE_27__["default"],
- objectFullWidth: _theme_icons_object_full_width_svg__WEBPACK_IMPORTED_MODULE_28__["default"],
- objectSizeFull: _theme_icons_object_size_full_svg__WEBPACK_IMPORTED_MODULE_29__["default"],
- objectSizeLarge: _theme_icons_object_size_large_svg__WEBPACK_IMPORTED_MODULE_30__["default"],
- objectSizeSmall: _theme_icons_object_size_small_svg__WEBPACK_IMPORTED_MODULE_31__["default"],
- objectSizeMedium: _theme_icons_object_size_medium_svg__WEBPACK_IMPORTED_MODULE_32__["default"],
- pencil: _theme_icons_pencil_svg__WEBPACK_IMPORTED_MODULE_33__["default"],
- pilcrow: _theme_icons_pilcrow_svg__WEBPACK_IMPORTED_MODULE_34__["default"],
- quote: _theme_icons_quote_svg__WEBPACK_IMPORTED_MODULE_35__["default"],
- threeVerticalDots: _theme_icons_three_vertical_dots_svg__WEBPACK_IMPORTED_MODULE_36__["default"]
- };
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MultiCommand; });
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/multicommand
- */
- /**
- * A CKEditor command that aggregates other commands.
- *
- * This command is used to proxy multiple commands. The multi-command is enabled when
- * at least one of its registered child commands is enabled.
- * When executing a multi-command the first command that is enabled will be executed.
- *
- * const multiCommand = new MultiCommand( editor );
- *
- * const commandFoo = new Command( editor );
- * const commandBar = new Command( editor );
- *
- * // Register child commands.
- * multiCommand.registerChildCommand( commandFoo );
- * multiCommand.registerChildCommand( commandBar );
- *
- * // Enable one of the commands.
- * commandBar.isEnabled = true;
- *
- * multiCommand.execute(); // Will execute commandBar.
- *
- * @extends module:core/command~Command
- */
- class MultiCommand extends _command__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- /**
- * Registered child commands.
- *
- * @type {Array.<module:core/command~Command>}
- * @private
- */
- this._childCommands = [];
- }
- /**
- * @inheritDoc
- */
- refresh() {
- // Override base command refresh(): the command's state is changed when one of child commands changes states.
- }
- /**
- * Executes the first of it registered child commands.
- *
- * @returns {*} The value returned by the {@link module:core/command~Command#execute `command.execute()`}.
- */
- execute( ...args ) {
- const command = this._getFirstEnabledCommand();
- return command != null && command.execute( args );
- }
- /**
- * Registers a child command.
- *
- * @param {module:core/command~Command} command
- */
- registerChildCommand( command ) {
- this._childCommands.push( command );
- // Change multi command enabled state when one of registered commands changes state.
- command.on( 'change:isEnabled', () => this._checkEnabled() );
- this._checkEnabled();
- }
- /**
- * Checks if any of child commands is enabled.
- *
- * @private
- */
- _checkEnabled() {
- this.isEnabled = !!this._getFirstEnabledCommand();
- }
- /**
- * Returns a first enabled command or undefined if none of them is enabled.
- *
- * @returns {module:core/command~Command|undefined}
- * @private
- */
- _getFirstEnabledCommand() {
- return this._childCommands.find( command => command.isEnabled );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PendingActions; });
- /* harmony import */ var _contextplugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contextplugin */ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/pendingactions
- */
- /**
- * The list of pending editor actions.
- *
- * This plugin should be used to synchronise plugins that execute long-lasting actions
- * (e.g. file upload) with the editor integration. It gives the developer who integrates the editor
- * an easy way to check if there are any actions pending whenever such information is needed.
- * All plugins that register a pending action also provide a message about the action that is ongoing
- * which can be displayed to the user. This lets them decide if they want to interrupt the action or wait.
- *
- * Adding and updating a pending action:
- *
- * const pendingActions = editor.plugins.get( 'PendingActions' );
- * const action = pendingActions.add( 'Upload in progress: 0%.' );
- *
- * // You can update the message:
- * action.message = 'Upload in progress: 10%.';
- *
- * Removing a pending action:
- *
- * const pendingActions = editor.plugins.get( 'PendingActions' );
- * const action = pendingActions.add( 'Unsaved changes.' );
- *
- * pendingActions.remove( action );
- *
- * Getting pending actions:
- *
- * const pendingActions = editor.plugins.get( 'PendingActions' );
- *
- * const action1 = pendingActions.add( 'Action 1' );
- * const action2 = pendingActions.add( 'Action 2' );
- *
- * pendingActions.first; // Returns action1
- * Array.from( pendingActions ); // Returns [ action1, action2 ]
- *
- * This plugin is used by features like {@link module:upload/filerepository~FileRepository} to register their ongoing actions
- * and by features like {@link module:autosave/autosave~Autosave} to detect whether there are any ongoing actions.
- * Read more about saving the data in the {@glink builds/guides/integration/saving-data Saving and getting data} guide.
- *
- * @extends module:core/contextplugin~ContextPlugin
- */
- class PendingActions extends _contextplugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'PendingActions';
- }
- /**
- * @inheritDoc
- */
- init() {
- /**
- * Defines whether there is any registered pending action.
- *
- * @readonly
- * @observable
- * @member {Boolean} #hasAny
- */
- this.set( 'hasAny', false );
- /**
- * A list of pending actions.
- *
- * @private
- * @type {module:utils/collection~Collection}
- */
- this._actions = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_2__["default"]( { idProperty: '_id' } );
- this._actions.delegate( 'add', 'remove' ).to( this );
- }
- /**
- * Adds an action to the list of pending actions.
- *
- * This method returns an action object with an observable message property.
- * The action object can be later used in the {@link #remove} method. It also allows you to change the message.
- *
- * @param {String} message The action message.
- * @returns {Object} An observable object that represents a pending action.
- */
- add( message ) {
- if ( typeof message !== 'string' ) {
- /**
- * The message must be a string.
- *
- * @error pendingactions-add-invalid-message
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"]( 'pendingactions-add-invalid-message', this );
- }
- const action = Object.create( _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- action.set( 'message', message );
- this._actions.add( action );
- this.hasAny = true;
- return action;
- }
- /**
- * Removes an action from the list of pending actions.
- *
- * @param {Object} action An action object.
- */
- remove( action ) {
- this._actions.remove( action );
- this.hasAny = !!this._actions.length;
- }
- /**
- * Returns the first action from the list or null when list is empty
- *
- * returns {Object|null} The pending action object.
- */
- get first() {
- return this._actions.get( 0 );
- }
- /**
- * Iterable interface.
- *
- * @returns {Iterable.<*>}
- */
- [ Symbol.iterator ]() {
- return this._actions[ Symbol.iterator ]();
- }
- /**
- * Fired when an action is added to the list.
- *
- * @event add
- * @param {Object} action The added action.
- */
- /**
- * Fired when an action is removed from the list.
- *
- * @event remove
- * @param {Object} action The removed action.
- */
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/plugin.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Plugin; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/plugin
- */
- /**
- * The base class for CKEditor plugin classes.
- *
- * @implements module:core/plugin~PluginInterface
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class Plugin {
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- /**
- * The editor instance.
- *
- * Note that most editors implement the {@link module:core/editor/editorwithui~EditorWithUI} interface in addition
- * to the base {@link module:core/editor/editor~Editor} interface. However, editors with an external UI
- * (i.e. Bootstrap-based) or a headless editor may not implement the {@link module:core/editor/editorwithui~EditorWithUI}
- * interface.
- *
- * Because of above, to make plugins more universal, it is recommended to split features into:
- * - The "editing" part that only uses the {@link module:core/editor/editor~Editor} interface.
- * - The "UI" part that uses both the {@link module:core/editor/editor~Editor} interface and
- * the {@link module:core/editor/editorwithui~EditorWithUI} interface.
- *
- * @readonly
- * @member {module:core/editor/editor~Editor} #editor
- */
- this.editor = editor;
- /**
- * Flag indicating whether a plugin is enabled or disabled.
- * A disabled plugin will not transform text.
- *
- * Plugin can be simply disabled like that:
- *
- * // Disable the plugin so that no toolbars are visible.
- * editor.plugins.get( 'TextTransformation' ).isEnabled = false;
- *
- * You can also use {@link #forceDisabled} method.
- *
- * @observable
- * @readonly
- * @member {Boolean} #isEnabled
- */
- this.set( 'isEnabled', true );
- /**
- * Holds identifiers for {@link #forceDisabled} mechanism.
- *
- * @type {Set.<String>}
- * @private
- */
- this._disableStack = new Set();
- }
- /**
- * Disables the plugin.
- *
- * Plugin may be disabled by multiple features or algorithms (at once). When disabling a plugin, unique id should be passed
- * (e.g. feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the plugin.
- * The plugin becomes enabled only after all features {@link #clearForceDisabled enabled it back}.
- *
- * Disabling and enabling a plugin:
- *
- * plugin.isEnabled; // -> true
- * plugin.forceDisabled( 'MyFeature' );
- * plugin.isEnabled; // -> false
- * plugin.clearForceDisabled( 'MyFeature' );
- * plugin.isEnabled; // -> true
- *
- * Plugin disabled by multiple features:
- *
- * plugin.forceDisabled( 'MyFeature' );
- * plugin.forceDisabled( 'OtherFeature' );
- * plugin.clearForceDisabled( 'MyFeature' );
- * plugin.isEnabled; // -> false
- * plugin.clearForceDisabled( 'OtherFeature' );
- * plugin.isEnabled; // -> true
- *
- * Multiple disabling with the same identifier is redundant:
- *
- * plugin.forceDisabled( 'MyFeature' );
- * plugin.forceDisabled( 'MyFeature' );
- * plugin.clearForceDisabled( 'MyFeature' );
- * plugin.isEnabled; // -> true
- *
- * **Note:** some plugins or algorithms may have more complex logic when it comes to enabling or disabling certain plugins,
- * so the plugin might be still disabled after {@link #clearForceDisabled} was used.
- *
- * @param {String} id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the plugin.
- */
- forceDisabled( id ) {
- this._disableStack.add( id );
- if ( this._disableStack.size == 1 ) {
- this.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
- this.isEnabled = false;
- }
- }
- /**
- * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.
- *
- * @param {String} id Unique identifier, equal to the one passed in {@link #forceDisabled} call.
- */
- clearForceDisabled( id ) {
- this._disableStack.delete( id );
- if ( this._disableStack.size == 0 ) {
- this.off( 'set:isEnabled', forceDisable );
- this.isEnabled = true;
- }
- }
- /**
- * @inheritDoc
- */
- destroy() {
- this.stopListening();
- }
- /**
- * @inheritDoc
- */
- static get isContextPlugin() {
- return false;
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Plugin, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
- /**
- * The base interface for CKEditor plugins.
- *
- * In its minimal form a plugin can be a simple function that accepts {@link module:core/editor/editor~Editor the editor}
- * as a parameter:
- *
- * // A simple plugin that enables a data processor.
- * function MyPlugin( editor ) {
- * editor.data.processor = new MyDataProcessor();
- * }
- *
- * In most cases however, you will want to inherit from the {@link module:core/plugin~Plugin} class which implements the
- * {@link module:utils/observablemixin~ObservableMixin} and is, therefore, more convenient:
- *
- * class MyPlugin extends Plugin {
- * init() {
- * // `listenTo()` and `editor` are available thanks to `Plugin`.
- * // By using `listenTo()` you will ensure that the listener is removed when
- * // the plugin is destroyed.
- * this.listenTo( this.editor.data, 'ready', () => {
- * // Do something when the data is ready.
- * } );
- * }
- * }
- *
- * The plugin can also implement methods (e.g. {@link module:core/plugin~PluginInterface#init `init()`} or
- * {@link module:core/plugin~PluginInterface#destroy `destroy()`}) which, when present, will be used to properly
- * initialize and destroy the plugin.
- *
- * **Note:** When defined as a plain function, the plugin acts as a constructor and will be
- * called in parallel with other plugins' {@link module:core/plugin~PluginInterface#constructor constructors}.
- * This means the code of that plugin will be executed **before** {@link module:core/plugin~PluginInterface#init `init()`} and
- * {@link module:core/plugin~PluginInterface#afterInit `afterInit()`} methods of other plugins and, for instance,
- * you cannot use it to extend other plugins' {@glink framework/guides/architecture/editing-engine#schema schema}
- * rules as they are defined later on during the `init()` stage.
- *
- * @interface PluginInterface
- */
- /**
- * Creates a new plugin instance. This is the first step of the plugin initialization.
- * See also {@link #init} and {@link #afterInit}.
- *
- * A plugin is always instantiated after its {@link module:core/plugin~PluginInterface.requires dependencies} and the
- * {@link #init} and {@link #afterInit} methods are called in the same order.
- *
- * Usually, you will want to put your plugin's initialization code in the {@link #init} method.
- * The constructor can be understood as "before init" and used in special cases, just like
- * {@link #afterInit} serves the special "after init" scenarios (e.g.the code which depends on other
- * plugins, but which does not {@link module:core/plugin~PluginInterface.requires explicitly require} them).
- *
- * @method #constructor
- * @param {module:core/editor/editor~Editor} editor
- */
- /**
- * An array of plugins required by this plugin.
- *
- * To keep the plugin class definition tight it is recommended to define this property as a static getter:
- *
- * import Image from './image.js';
- *
- * export default class ImageCaption {
- * static get requires() {
- * return [ Image ];
- * }
- * }
- *
- * @static
- * @readonly
- * @member {Array.<Function>|undefined} module:core/plugin~PluginInterface.requires
- */
- /**
- * An optional name of the plugin. If set, the plugin will be available in
- * {@link module:core/plugincollection~PluginCollection#get} by its
- * name and its constructor. If not, then only by its constructor.
- *
- * The name should reflect the constructor name.
- *
- * To keep the plugin class definition tight, it is recommended to define this property as a static getter:
- *
- * export default class ImageCaption {
- * static get pluginName() {
- * return 'ImageCaption';
- * }
- * }
- *
- * Note: The native `Function.name` property could not be used to keep the plugin name because
- * it will be mangled during code minification.
- *
- * Naming a plugin is necessary to enable removing it through the
- * {@link module:core/editor/editorconfig~EditorConfig#removePlugins `config.removePlugins`} option.
- *
- * @static
- * @readonly
- * @member {String|undefined} module:core/plugin~PluginInterface.pluginName
- */
- /**
- * The second stage (after plugin {@link #constructor}) of the plugin initialization.
- * Unlike the plugin constructor this method can be asynchronous.
- *
- * A plugin's `init()` method is called after its {@link module:core/plugin~PluginInterface.requires dependencies} are initialized,
- * so in the same order as the constructors of these plugins.
- *
- * **Note:** This method is optional. A plugin instance does not need to have it defined.
- *
- * @method #init
- * @returns {null|Promise}
- */
- /**
- * The third (and last) stage of the plugin initialization. See also {@link #constructor} and {@link #init}.
- *
- * **Note:** This method is optional. A plugin instance does not need to have it defined.
- *
- * @method #afterInit
- * @returns {null|Promise}
- */
- /**
- * Destroys the plugin.
- *
- * **Note:** This method is optional. A plugin instance does not need to have it defined.
- *
- * @method #destroy
- * @returns {null|Promise}
- */
- /**
- * A flag which defines if a plugin is allowed or not allowed to be used directly by a {@link module:core/context~Context}.
- *
- * @static
- * @readonly
- * @member {Boolean} module:core/plugin~PluginInterface.isContextPlugin
- */
- /**
- * An array of loaded plugins.
- *
- * @typedef {Array.<module:core/plugin~PluginInterface>} module:core/plugin~LoadedPlugins
- */
- // Helper function that forces plugin to be disabled.
- function forceDisable( evt ) {
- evt.return = false;
- evt.stop();
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PluginCollection; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module core/plugincollection
- */
- /**
- * Manages a list of CKEditor plugins, including loading, resolving dependencies and initialization.
- *
- * @mixes module:utils/emittermixin~EmitterMixin
- */
- class PluginCollection {
- /**
- * Creates an instance of the plugin collection class.
- * Allows loading and initializing plugins and their dependencies.
- * Allows providing a list of already loaded plugins. These plugins will not be destroyed along with this collection.
- *
- * @param {module:core/editor/editor~Editor|module:core/context~Context} context
- * @param {Array.<Function>} [availablePlugins] Plugins (constructors) which the collection will be able to use
- * when {@link module:core/plugincollection~PluginCollection#init} is used with the plugin names (strings, instead of constructors).
- * Usually, the editor will pass its built-in plugins to the collection so they can later be
- * used in `config.plugins` or `config.removePlugins` by names.
- * @param {Iterable.<Array>} contextPlugins A list of already initialized plugins represented by a
- * `[ PluginConstructor, pluginInstance ]` pair.
- */
- constructor( context, availablePlugins = [], contextPlugins = [] ) {
- /**
- * @protected
- * @type {module:core/editor/editor~Editor|module:core/context~Context}
- */
- this._context = context;
- /**
- * @protected
- * @type {Map}
- */
- this._plugins = new Map();
- /**
- * A map of plugin constructors that can be retrieved by their names.
- *
- * @protected
- * @type {Map.<String|Function,Function>}
- */
- this._availablePlugins = new Map();
- for ( const PluginConstructor of availablePlugins ) {
- if ( PluginConstructor.pluginName ) {
- this._availablePlugins.set( PluginConstructor.pluginName, PluginConstructor );
- }
- }
- /**
- * Map of {@link module:core/contextplugin~ContextPlugin context plugins} which can be retrieved by their constructors or instances.
- *
- * @protected
- * @type {Map<Function,Function>}
- */
- this._contextPlugins = new Map();
- for ( const [ PluginConstructor, pluginInstance ] of contextPlugins ) {
- this._contextPlugins.set( PluginConstructor, pluginInstance );
- this._contextPlugins.set( pluginInstance, PluginConstructor );
- // To make it possible to require a plugin by its name.
- if ( PluginConstructor.pluginName ) {
- this._availablePlugins.set( PluginConstructor.pluginName, PluginConstructor );
- }
- }
- }
- /**
- * Iterable interface.
- *
- * Returns `[ PluginConstructor, pluginInstance ]` pairs.
- *
- * @returns {Iterable.<Array>}
- */
- * [ Symbol.iterator ]() {
- for ( const entry of this._plugins ) {
- if ( typeof entry[ 0 ] == 'function' ) {
- yield entry;
- }
- }
- }
- /**
- * Gets the plugin instance by its constructor or name.
- *
- * // Check if 'Clipboard' plugin was loaded.
- * if ( editor.plugins.has( 'ClipboardPipeline' ) ) {
- * // Get clipboard plugin instance
- * const clipboard = editor.plugins.get( 'ClipboardPipeline' );
- *
- * this.listenTo( clipboard, 'inputTransformation', ( evt, data ) => {
- * // Do something on clipboard input.
- * } );
- * }
- *
- * **Note**: This method will throw an error if a plugin is not loaded. Use `{@link #has editor.plugins.has()}`
- * to check if a plugin is available.
- *
- * @param {Function|String} key The plugin constructor or {@link module:core/plugin~PluginInterface.pluginName name}.
- * @returns {module:core/plugin~PluginInterface}
- */
- get( key ) {
- const plugin = this._plugins.get( key );
- if ( !plugin ) {
- let pluginName = key;
- if ( typeof key == 'function' ) {
- pluginName = key.pluginName || key.name;
- }
- /**
- * The plugin is not loaded and could not be obtained.
- *
- * Plugin classes (constructors) need to be provided to the editor and must be loaded before they can be obtained from
- * the plugin collection.
- * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}
- * property.
- *
- * **Note**: You can use `{@link module:core/plugincollection~PluginCollection#has editor.plugins.has()}`
- * to check if a plugin was loaded.
- *
- * @error plugincollection-plugin-not-loaded
- * @param {String} plugin The name of the plugin which is not loaded.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-not-loaded', this._context, { plugin: pluginName } );
- }
- return plugin;
- }
- /**
- * Checks if a plugin is loaded.
- *
- * // Check if the 'Clipboard' plugin was loaded.
- * if ( editor.plugins.has( 'ClipboardPipeline' ) ) {
- * // Now use the clipboard plugin instance:
- * const clipboard = editor.plugins.get( 'ClipboardPipeline' );
- *
- * // ...
- * }
- *
- * @param {Function|String} key The plugin constructor or {@link module:core/plugin~PluginInterface.pluginName name}.
- * @returns {Boolean}
- */
- has( key ) {
- return this._plugins.has( key );
- }
- /**
- * Initializes a set of plugins and adds them to the collection.
- *
- * @param {Array.<Function|String>} plugins An array of {@link module:core/plugin~PluginInterface plugin constructors}
- * or {@link module:core/plugin~PluginInterface.pluginName plugin names}.
- * @param {Array.<String|Function>} [pluginsToRemove] Names of the plugins or plugin constructors
- * that should not be loaded (despite being specified in the `plugins` array).
- * @param {Array.<Function>} [pluginsSubstitutions] An array of {@link module:core/plugin~PluginInterface plugin constructors}
- * that will be used to replace plugins of the same names that were passed in `plugins` or that are in their dependency tree.
- * A useful option for replacing built-in plugins while creating tests (for mocking their APIs). Plugins that will be replaced
- * must follow these rules:
- * * The new plugin must be a class.
- * * The new plugin must be named.
- * * Both plugins must not depend on other plugins.
- * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which gets resolved once all plugins are loaded
- * and available in the collection.
- */
- init( plugins, pluginsToRemove = [], pluginsSubstitutions = [] ) {
- // Plugin initialization procedure consists of 2 main steps:
- // 1) collecting all available plugin constructors,
- // 2) verification whether all required plugins can be instantiated.
- //
- // In the first step, all plugin constructors, available in the provided `plugins` array and inside
- // plugin's dependencies (from the `Plugin.requires` array), are recursively collected and added to the existing
- // `this._availablePlugins` map, but without any verification at the given moment. Performing the verification
- // at this point (during the plugin constructor searching) would cause false errors to occur, that some plugin
- // is missing but in fact it may be defined further in the array as the dependency of other plugin. After
- // traversing the entire dependency tree, it will be checked if all required "top level" plugins are available.
- //
- // In the second step, the list of plugins that have not been explicitly removed is traversed to get all the
- // plugin constructors to be instantiated in the correct order and to validate against some rules. Finally, if
- // no plugin is missing and no other error has been found, they all will be instantiated.
- const that = this;
- const context = this._context;
- findAvailablePluginConstructors( plugins );
- validatePlugins( plugins );
- const pluginsToLoad = plugins.filter( plugin => !isPluginRemoved( plugin, pluginsToRemove ) );
- const pluginConstructors = [ ...getPluginConstructors( pluginsToLoad ) ];
- substitutePlugins( pluginConstructors, pluginsSubstitutions );
- const pluginInstances = loadPlugins( pluginConstructors );
- return initPlugins( pluginInstances, 'init' )
- .then( () => initPlugins( pluginInstances, 'afterInit' ) )
- .then( () => pluginInstances );
- function isPluginConstructor( plugin ) {
- return typeof plugin === 'function';
- }
- function isContextPlugin( plugin ) {
- return isPluginConstructor( plugin ) && plugin.isContextPlugin;
- }
- function isPluginRemoved( plugin, pluginsToRemove ) {
- return pluginsToRemove.some( removedPlugin => {
- if ( removedPlugin === plugin ) {
- return true;
- }
- if ( getPluginName( plugin ) === removedPlugin ) {
- return true;
- }
- if ( getPluginName( removedPlugin ) === plugin ) {
- return true;
- }
- return false;
- } );
- }
- function getPluginName( plugin ) {
- return isPluginConstructor( plugin ) ?
- plugin.pluginName || plugin.name :
- plugin;
- }
- function findAvailablePluginConstructors( plugins, processed = new Set() ) {
- plugins.forEach( plugin => {
- if ( !isPluginConstructor( plugin ) ) {
- return;
- }
- if ( processed.has( plugin ) ) {
- return;
- }
- processed.add( plugin );
- if ( plugin.pluginName && !that._availablePlugins.has( plugin.pluginName ) ) {
- that._availablePlugins.set( plugin.pluginName, plugin );
- }
- if ( plugin.requires ) {
- findAvailablePluginConstructors( plugin.requires, processed );
- }
- } );
- }
- function getPluginConstructors( plugins, processed = new Set() ) {
- return plugins
- .map( plugin => {
- return isPluginConstructor( plugin ) ?
- plugin :
- that._availablePlugins.get( plugin );
- } )
- .reduce( ( result, plugin ) => {
- if ( processed.has( plugin ) ) {
- return result;
- }
- processed.add( plugin );
- if ( plugin.requires ) {
- validatePlugins( plugin.requires, plugin );
- getPluginConstructors( plugin.requires, processed ).forEach( plugin => result.add( plugin ) );
- }
- return result.add( plugin );
- }, new Set() );
- }
- function validatePlugins( plugins, parentPluginConstructor = null ) {
- plugins
- .map( plugin => {
- return isPluginConstructor( plugin ) ?
- plugin :
- that._availablePlugins.get( plugin ) || plugin;
- } )
- .forEach( plugin => {
- checkMissingPlugin( plugin, parentPluginConstructor );
- checkContextPlugin( plugin, parentPluginConstructor );
- checkRemovedPlugin( plugin, parentPluginConstructor );
- } );
- }
- function checkMissingPlugin( plugin, parentPluginConstructor ) {
- if ( isPluginConstructor( plugin ) ) {
- return;
- }
- if ( parentPluginConstructor ) {
- /**
- * A required "soft" dependency was not found on the plugin list.
- *
- * When configuring the editor, either prior to building (via
- * {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}) or when
- * creating a new instance of the editor (e.g. via
- * {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`}), you need to provide
- * some of the dependencies for other plugins that you used.
- *
- * This error is thrown when one of these dependencies was not provided. The name of the missing plugin
- * can be found in `missingPlugin` and the plugin that required it in `requiredBy`.
- *
- * In order to resolve it, you need to import the missing plugin and add it to the
- * current list of plugins (`Editor.builtinPlugins` or `config.plugins`/`config.extraPlugins`).
- *
- * Soft requirements were introduced in version 26.0.0. If you happen to stumble upon this error
- * when upgrading to version 26.0.0, read also the
- * {@glink builds/guides/migration/migration-to-26 Migration to 26.0.0} guide.
- *
- * @error plugincollection-soft-required
- * @param {String} missingPlugin The name of the required plugin.
- * @param {String} requiredBy The name of the plugin that requires the other plugin.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'plugincollection-soft-required',
- context,
- { missingPlugin: plugin, requiredBy: getPluginName( parentPluginConstructor ) }
- );
- }
- /**
- * A plugin is not available and could not be loaded.
- *
- * Plugin classes (constructors) need to be provided to the editor before they can be loaded by name.
- * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}
- * property.
- *
- * **If you see this warning when using one of the {@glink builds/index CKEditor 5 Builds}**, it means
- * that you try to enable a plugin which was not included in that build. This may be due to a typo
- * in the plugin name or simply because that plugin is not a part of this build. In the latter scenario,
- * read more about {@glink builds/guides/development/custom-builds custom builds}.
- *
- * **If you see this warning when using one of the editor creators directly** (not a build), then it means
- * that you tried loading plugins by name. However, unlike CKEditor 4, CKEditor 5 does not implement a "plugin loader".
- * This means that CKEditor 5 does not know where to load the plugin modules from. Therefore, you need to
- * provide each plugin through a reference (as a constructor function). Check out the examples in
- * {@glink builds/guides/integration/advanced-setup#scenario-2-building-from-source "Building from source"}.
- *
- * @error plugincollection-plugin-not-found
- * @param {String} plugin The name of the plugin which could not be loaded.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'plugincollection-plugin-not-found',
- context,
- { plugin }
- );
- }
- function checkContextPlugin( plugin, parentPluginConstructor ) {
- if ( !isContextPlugin( parentPluginConstructor ) ) {
- return;
- }
- if ( isContextPlugin( plugin ) ) {
- return;
- }
- /**
- * If a plugin is a context plugin, all plugins it requires should also be context plugins
- * instead of plugins. In other words, if one plugin can be used in the context,
- * all its requirements should also be ready to be used in the context. Note that the context
- * provides only a part of the API provided by the editor. If one plugin needs a full
- * editor API, all plugins which require it are considered as plugins that need a full
- * editor API.
- *
- * @error plugincollection-context-required
- * @param {String} plugin The name of the required plugin.
- * @param {String} requiredBy The name of the parent plugin.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'plugincollection-context-required',
- context,
- { plugin: getPluginName( plugin ), requiredBy: getPluginName( parentPluginConstructor ) }
- );
- }
- function checkRemovedPlugin( plugin, parentPluginConstructor ) {
- if ( !parentPluginConstructor ) {
- return;
- }
- if ( !isPluginRemoved( plugin, pluginsToRemove ) ) {
- return;
- }
- /**
- * Cannot load a plugin because one of its dependencies is listed in the `removePlugins` option.
- *
- * @error plugincollection-required
- * @param {String} plugin The name of the required plugin.
- * @param {String} requiredBy The name of the parent plugin.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'plugincollection-required',
- context,
- { plugin: getPluginName( plugin ), requiredBy: getPluginName( parentPluginConstructor ) }
- );
- }
- function loadPlugins( pluginConstructors ) {
- return pluginConstructors.map( PluginConstructor => {
- const pluginInstance = that._contextPlugins.get( PluginConstructor ) || new PluginConstructor( context );
- that._add( PluginConstructor, pluginInstance );
- return pluginInstance;
- } );
- }
- function initPlugins( pluginInstances, method ) {
- return pluginInstances.reduce( ( promise, plugin ) => {
- if ( !plugin[ method ] ) {
- return promise;
- }
- if ( that._contextPlugins.has( plugin ) ) {
- return promise;
- }
- return promise.then( plugin[ method ].bind( plugin ) );
- }, Promise.resolve() );
- }
- // Replaces plugin constructors with the specified set of plugins.
- //
- // @param {Array.<Function>} pluginConstructors
- // @param {Array.<Function>} pluginsSubstitutions
- function substitutePlugins( pluginConstructors, pluginsSubstitutions ) {
- for ( const pluginItem of pluginsSubstitutions ) {
- if ( typeof pluginItem != 'function' ) {
- /**
- * The plugin replacing an existing plugin must be a function.
- *
- * @error plugincollection-replace-plugin-invalid-type
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-replace-plugin-invalid-type', null, { pluginItem } );
- }
- const pluginName = pluginItem.pluginName;
- if ( !pluginName ) {
- /**
- * The plugin replacing an existing plugin must have a name.
- *
- * @error plugincollection-replace-plugin-missing-name
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-replace-plugin-missing-name', null, { pluginItem } );
- }
- if ( pluginItem.requires && pluginItem.requires.length ) {
- /**
- * The plugin replacing an existing plugin cannot depend on other plugins.
- *
- * @error plugincollection-plugin-for-replacing-cannot-have-dependencies
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-for-replacing-cannot-have-dependencies', null, { pluginName } );
- }
- const pluginToReplace = that._availablePlugins.get( pluginName );
- if ( !pluginToReplace ) {
- /**
- * The replaced plugin does not exist in the
- * {@link module:core/plugincollection~PluginCollection available plugins} collection.
- *
- * @error plugincollection-plugin-for-replacing-not-exist
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-for-replacing-not-exist', null, { pluginName } );
- }
- const indexInPluginConstructors = pluginConstructors.indexOf( pluginToReplace );
- if ( indexInPluginConstructors === -1 ) {
- // The Context feature can substitute plugins as well.
- // It may happen that the editor will be created with the given context, where the plugin for substitute
- // was already replaced. In such a case, we don't want to do it again.
- if ( that._contextPlugins.has( pluginToReplace ) ) {
- return;
- }
- /**
- * The replaced plugin will not be loaded so it cannot be replaced.
- *
- * @error plugincollection-plugin-for-replacing-not-loaded
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-for-replacing-not-loaded', null, { pluginName } );
- }
- if ( pluginToReplace.requires && pluginToReplace.requires.length ) {
- /**
- * The replaced plugin cannot depend on other plugins.
- *
- * @error plugincollection-replaced-plugin-cannot-have-dependencies
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-replaced-plugin-cannot-have-dependencies', null, { pluginName } );
- }
- pluginConstructors.splice( indexInPluginConstructors, 1, pluginItem );
- that._availablePlugins.set( pluginName, pluginItem );
- }
- }
- }
- /**
- * Destroys all loaded plugins.
- *
- * @returns {Promise}
- */
- destroy() {
- const promises = [];
- for ( const [ , pluginInstance ] of this ) {
- if ( typeof pluginInstance.destroy == 'function' && !this._contextPlugins.has( pluginInstance ) ) {
- promises.push( pluginInstance.destroy() );
- }
- }
- return Promise.all( promises );
- }
- /**
- * Adds the plugin to the collection. Exposed mainly for testing purposes.
- *
- * @protected
- * @param {Function} PluginConstructor The plugin constructor.
- * @param {module:core/plugin~PluginInterface} plugin The instance of the plugin.
- */
- _add( PluginConstructor, plugin ) {
- this._plugins.set( PluginConstructor, plugin );
- const pluginName = PluginConstructor.pluginName;
- if ( !pluginName ) {
- return;
- }
- if ( this._plugins.has( pluginName ) ) {
- /**
- * Two plugins with the same {@link module:core/plugin~PluginInterface.pluginName} were loaded.
- * This will lead to runtime conflicts between these plugins.
- *
- * In practice, this warning usually means that new plugins were added to an existing CKEditor 5 build.
- * Plugins should always be added to a source version of the editor (`@ckeditor/ckeditor5-editor-*`),
- * not to an editor imported from one of the `@ckeditor/ckeditor5-build-*` packages.
- *
- * Check your import paths and the list of plugins passed to
- * {@link module:core/editor/editor~Editor.create `Editor.create()`}
- * or specified in {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.
- *
- * The second option is that your `node_modules/` directory contains duplicated versions of the same
- * CKEditor 5 packages. Normally, on clean installations, npm deduplicates packages in `node_modules/`, so
- * it may be enough to call `rm -rf node_modules && npm i`. However, if you installed conflicting versions
- * of some packages, their dependencies may need to be installed in more than one version which may lead to this
- * warning.
- *
- * Technically speaking, this error occurs because after adding a plugin to an existing editor build
- * the dependencies of this plugin are being duplicated.
- * They are already built into that editor build and now get added for the second time as dependencies
- * of the plugin you are installing.
- *
- * Read more about {@glink builds/guides/integration/installing-plugins installing plugins}.
- *
- * @error plugincollection-plugin-name-conflict
- * @param {String} pluginName The duplicated plugin name.
- * @param {Function} plugin1 The first plugin constructor.
- * @param {Function} plugin2 The second plugin constructor.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'plugincollection-plugin-name-conflict',
- null,
- { pluginName, plugin1: this._plugins.get( pluginName ).constructor, plugin2: PluginConstructor }
- );
- }
- this._plugins.set( pluginName, plugin );
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( PluginCollection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m9.239 13.938-2.88-1.663a.75.75 0 0 1 .75-1.3L9 12.067V4.75a.75.75 0 1 1 1.5 0v7.318l1.89-1.093a.75.75 0 0 1 .75 1.3l-2.879 1.663a.752.752 0 0 1-.511.187.752.752 0 0 1-.511-.187zM4.25 17a.75.75 0 1 1 0-1.5h10.5a.75.75 0 0 1 0 1.5H4.25z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-middle.svg":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-middle.svg ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9.75 11.875a.752.752 0 0 1 .508.184l2.883 1.666a.75.75 0 0 1-.659 1.344l-.091-.044-1.892-1.093.001 4.318a.75.75 0 1 1-1.5 0v-4.317l-1.89 1.092a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .51-.187zM15.25 9a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM9.75.375a.75.75 0 0 1 .75.75v4.318l1.89-1.093.092-.045a.75.75 0 0 1 .659 1.344l-2.883 1.667a.752.752 0 0 1-.508.184.752.752 0 0 1-.511-.187L6.359 5.65a.75.75 0 0 1 .75-1.299L9 5.442V1.125a.75.75 0 0 1 .75-.75z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-top.svg":
- /*!*************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-top.svg ***!
- \*************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m10.261 7.062 2.88 1.663a.75.75 0 0 1-.75 1.3L10.5 8.933v7.317a.75.75 0 1 1-1.5 0V8.932l-1.89 1.093a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .511-.187.752.752 0 0 1 .511.187zM15.25 4a.75.75 0 1 1 0 1.5H4.75a.75.75 0 0 1 0-1.5h10.5z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/caption.svg":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/caption.svg ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 16h9a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2z\"/><path d=\"M17 1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14zm0 1.5H3a.5.5 0 0 0-.492.41L2.5 3v9a.5.5 0 0 0 .41.492L3 12.5h14a.5.5 0 0 0 .492-.41L17.5 12V3a.5.5 0 0 0-.41-.492L17 2.5z\" fill-opacity=\".6\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z\"/><path d=\"M4 18h5.523v-1H4zm-2 0h1v-1H2z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.085 6.22 2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 4.5V3h16v1.5zm4.5 3V12h7V7.5h-7zM5.758 6h8.484c.419 0 .758.407.758.91v5.681c0 .502-.34.909-.758.909H5.758c-.419 0-.758-.407-.758-.91V6.91c0-.503.34-.91.758-.91zM2 16.5V15h16v1.5z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 4.5V3h16v1.5zm2.5 3V12h11V7.5h-11zM4.061 6H15.94c.586 0 1.061.407 1.061.91v5.68c0 .503-.475.91-1.061.91H4.06c-.585 0-1.06-.407-1.06-.91V6.91C3 6.406 3.475 6 4.061 6zM2 16.5V15h16v1.5z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" clip-rule=\"evenodd\" stroke-linejoin=\"round\" stroke-miterlimit=\"1.414\"><path d=\"M18 4.5V3H2v1.5h16zm0 3V6h-5.674v1.5H18zm0 3V9h-5.674v1.5H18zm0 3V12h-5.674v1.5H18zm-8.5-6V12h-6V7.5h6zm.818-1.5H2.682C2.305 6 2 6.407 2 6.91v5.68c0 .503.305.91.682.91h7.636c.377 0 .682-.407.682-.91V6.91c0-.503-.305-.91-.682-.91zM18 16.5V15H2v1.5h16z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 4.5V3h16v1.5zm0 3V6h5.674v1.5zm0 3V9h5.674v1.5zm0 3V12h5.674v1.5zm8.5-6V12h6V7.5h-6zM9.682 6h7.636c.377 0 .682.407.682.91v5.68c0 .503-.305.91-.682.91H9.682c-.377 0-.682-.407-.682-.91V6.91c0-.503.305-.91.682-.91zM2 16.5V15h16v1.5z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\"/><path d=\"M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\"/><path d=\"M13 6H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5h11z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\"/><path d=\"M10 8H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .5-.5h8z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\"/><path d=\"M7 10H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h5z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m7.3 17.37-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5 9.375 17H19v1.5H8z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"9.5\" cy=\"4.5\" r=\"1.5\"/><circle cx=\"9.5\" cy=\"10.5\" r=\"1.5\"/><circle cx=\"9.5\" cy=\"16.5\" r=\"1.5\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-easy-image/src/cloudservicesuploadadapter.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-easy-image/src/cloudservicesuploadadapter.js ***!
- \***************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CloudServicesUploadAdapter; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module easy-image/cloudservicesuploadadapter
- */
- /**
- * A plugin that enables upload to [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/).
- *
- * It is mainly used by the {@link module:easy-image/easyimage~EasyImage} feature.
- *
- * After enabling this adapter you need to configure the CKEditor Cloud Services integration through
- * {@link module:cloud-services/cloudservices~CloudServicesConfig `config.cloudServices`}.
- *
- * @extends module:core/plugin~Plugin
- */
- class CloudServicesUploadAdapter extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'CloudServicesUploadAdapter';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ 'CloudServices', ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const cloudServices = editor.plugins.get( 'CloudServices' );
- const token = cloudServices.token;
- const uploadUrl = cloudServices.uploadUrl;
- if ( !token ) {
- return;
- }
- this._uploadGateway = editor.plugins.get( 'CloudServicesCore' ).createUploadGateway( token, uploadUrl );
- editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] ).createUploadAdapter = loader => {
- return new Adapter( this._uploadGateway, loader );
- };
- }
- }
- /**
- * @private
- */
- class Adapter {
- constructor( uploadGateway, loader ) {
- this.uploadGateway = uploadGateway;
- this.loader = loader;
- }
- upload() {
- return this.loader.file.then( file => {
- this.fileUploader = this.uploadGateway.upload( file );
- this.fileUploader.on( 'progress', ( evt, data ) => {
- this.loader.uploadTotal = data.total;
- this.loader.uploaded = data.uploaded;
- } );
- return this.fileUploader.send();
- } );
- }
- abort() {
- this.fileUploader.abort();
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-easy-image/src/easyimage.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-easy-image/src/easyimage.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EasyImage; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _cloudservicesuploadadapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cloudservicesuploadadapter */ "./node_modules/@ckeditor/ckeditor5-easy-image/src/cloudservicesuploadadapter.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module easy-image/easyimage
- */
- /**
- * The Easy Image feature, which makes the image upload in CKEditor 5 possible with virtually zero
- * server setup. A part of the [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)
- * family.
- *
- * This is a "glue" plugin which enables:
- *
- * * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter}.
- *
- * This plugin requires plugin to be present in the editor configuration:
- *
- * * {@link module:image/image~Image},
- * * {@link module:image/imageupload~ImageUpload},
- *
- * See the {@glink features/image-upload/easy-image "Easy Image integration" guide} to learn how to configure
- * and use this feature.
- *
- * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload" guide} to learn about
- * other ways to upload images into CKEditor 5.
- *
- * **Note**: After enabling the Easy Image plugin you need to configure the
- * [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)
- * integration through {@link module:cloud-services/cloudservices~CloudServicesConfig `config.cloudServices`}.
- *
- * @extends module:core/plugin~Plugin
- */
- class EasyImage extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _cloudservicesuploadadapter__WEBPACK_IMPORTED_MODULE_1__["default"], 'Image', 'ImageUpload' ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'EasyImage';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditor; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /* harmony import */ var _classiceditorui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./classiceditorui */ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js");
- /* harmony import */ var _classiceditoruiview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classiceditoruiview */ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module editor-classic/classiceditor
- */
- /**
- * The {@glink builds/guides/overview#classic-editor classic editor} implementation.
- * It uses an inline editable and a sticky toolbar, all enclosed in a boxed UI.
- * See the {@glink examples/builds/classic-editor demo}.
- *
- * In order to create a classic editor instance, use the static
- * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method.
- *
- * # Classic editor and classic build
- *
- * The classic editor can be used directly from source (if you installed the
- * [`@ckeditor/ckeditor5-editor-classic`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-classic) package)
- * but it is also available in the {@glink builds/guides/overview#classic-editor classic build}.
- *
- * {@glink builds/guides/overview Builds} are ready-to-use editors with plugins bundled in. When using the editor from
- * source you need to take care of loading all plugins by yourself
- * (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
- * Using the editor from source gives much better flexibility and allows easier customization.
- *
- * Read more about initializing the editor from source or as a build in
- * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
- *
- * @mixes module:core/editor/utils/dataapimixin~DataApiMixin
- * @mixes module:core/editor/utils/elementapimixin~ElementApiMixin
- * @implements module:core/editor/editorwithui~EditorWithUI
- * @extends module:core/editor/editor~Editor
- */
- class ClassicEditor extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Editor"] {
- /**
- * Creates an instance of the classic editor.
- *
- * **Note:** do not use the constructor to create editor instances. Use the static
- * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method instead.
- *
- * @protected
- * @param {HTMLElement|String} sourceElementOrData The DOM element that will be the source for the created editor
- * or the editor's initial data. For more information see
- * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
- * @param {module:core/editor/editorconfig~EditorConfig} config The editor configuration.
- */
- constructor( sourceElementOrData, config ) {
- super( config );
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isElement"])( sourceElementOrData ) ) {
- this.sourceElement = sourceElementOrData;
- }
- this.model.document.createRoot();
- const shouldToolbarGroupWhenFull = !this.config.get( 'toolbar.shouldNotGroupWhenFull' );
- const view = new _classiceditoruiview__WEBPACK_IMPORTED_MODULE_4__["default"]( this.locale, this.editing.view, {
- shouldToolbarGroupWhenFull
- } );
- this.ui = new _classiceditorui__WEBPACK_IMPORTED_MODULE_3__["default"]( this, view );
- Object(ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["attachToForm"])( this );
- }
- /**
- * Destroys the editor instance, releasing all resources used by it.
- *
- * Updates the editor's source element with the data.
- *
- * @returns {Promise}
- */
- destroy() {
- if ( this.sourceElement ) {
- this.updateSourceElement();
- }
- this.ui.destroy();
- return super.destroy();
- }
- /**
- * Creates a new classic editor instance.
- *
- * There are three ways how the editor can be initialized.
- *
- * # Replacing a DOM element (and loading data from it)
- *
- * You can initialize the editor using an existing DOM element:
- *
- * ClassicEditor
- * .create( document.querySelector( '#editor' ) )
- * .then( editor => {
- * console.log( 'Editor was initialized', editor );
- * } )
- * .catch( err => {
- * console.error( err.stack );
- * } );
- *
- * The element's content will be used as the editor data and the element will be replaced by the editor UI.
- *
- * # Creating a detached editor
- *
- * Alternatively, you can initialize the editor by passing the initial data directly as a string.
- * In this case, the editor will render an element that must be inserted into the DOM:
- *
- * ClassicEditor
- * .create( '<p>Hello world!</p>' )
- * .then( editor => {
- * console.log( 'Editor was initialized', editor );
- *
- * // Initial data was provided so the editor UI element needs to be added manually to the DOM.
- * document.body.appendChild( editor.ui.element );
- * } )
- * .catch( err => {
- * console.error( err.stack );
- * } );
- *
- * This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your
- * web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.
- *
- * # Replacing a DOM element (and data provided in `config.initialData`)
- *
- * You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:
- *
- * ClassicEditor
- * .create( document.querySelector( '#editor' ), {
- * initialData: '<h2>Initial data</h2><p>Foo bar.</p>'
- * } )
- * .then( editor => {
- * console.log( 'Editor was initialized', editor );
- * } )
- * .catch( err => {
- * console.error( err.stack );
- * } );
- *
- * This method can be used to initialize the editor on an existing element with the specified content in case if your integration
- * makes it difficult to set the content of the source element.
- *
- * Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.
- *
- * # Configuring the editor
- *
- * See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
- * customizing plugins, toolbar and more.
- *
- * # Using the editor from source
- *
- * The code samples listed in the previous sections of this documentation assume that you are using an
- * {@glink builds/guides/overview editor build} (for example – `@ckeditor/ckeditor5-build-classic`).
- *
- * If you want to use the classic editor from source (`@ckeditor/ckeditor5-editor-classic/src/classiceditor`),
- * you need to define the list of
- * {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
- * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
- * source in the {@glink builds/guides/integration/advanced-setup "Advanced setup" guide}.
- *
- * @param {HTMLElement|String} sourceElementOrData The DOM element that will be the source for the created editor
- * or the editor's initial data.
- *
- * If a DOM element is passed, its content will be automatically loaded to the editor upon initialization
- * and the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element editor element} will replace the passed element
- * in the DOM (the original one will be hidden and the editor will be injected next to it).
- *
- * Moreover, the editor data will be set back to the original element once the editor is destroyed and when a form, in which
- * this element is contained, is submitted (if the original element is a `<textarea>`). This ensures seamless integration with native
- * web forms.
- *
- * If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.
- * It is available under the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element `editor.ui.element`} property.
- *
- * @param {module:core/editor/editorconfig~EditorConfig} [config] The editor configuration.
- * @returns {Promise} A promise resolved once the editor is ready. The promise resolves with the created editor instance.
- */
- static create( sourceElementOrData, config = {} ) {
- return new Promise( resolve => {
- const editor = new this( sourceElementOrData, config );
- resolve(
- editor.initPlugins()
- .then( () => editor.ui.init( Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isElement"])( sourceElementOrData ) ? sourceElementOrData : null ) )
- .then( () => {
- if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isElement"])( sourceElementOrData ) && config.initialData ) {
- // Documented in core/editor/editorconfig.jdoc.
- // eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
- throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["CKEditorError"]( 'editor-create-initial-data', null );
- }
- const initialData = config.initialData !== undefined ? config.initialData : getInitialData( sourceElementOrData );
- return editor.data.init( initialData );
- } )
- .then( () => editor.fire( 'ready' ) )
- .then( () => editor )
- );
- } );
- }
- }
- Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["mix"])( ClassicEditor, ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["DataApiMixin"] );
- Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["mix"])( ClassicEditor, ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["ElementApiMixin"] );
- function getInitialData( sourceElementOrData ) {
- return Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isElement"])( sourceElementOrData ) ? Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["getDataFromElement"])( sourceElementOrData ) : sourceElementOrData;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditorUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module editor-classic/classiceditorui
- */
- /**
- * The classic editor UI class.
- *
- * @extends module:core/editor/editorui~EditorUI
- */
- class ClassicEditorUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["EditorUI"] {
- /**
- * Creates an instance of the classic editor UI class.
- *
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- * @param {module:ui/editorui/editoruiview~EditorUIView} view The view of the UI.
- */
- constructor( editor, view ) {
- super( editor );
- /**
- * The main (top–most) view of the editor UI.
- *
- * @readonly
- * @member {module:ui/editorui/editoruiview~EditorUIView} #view
- */
- this.view = view;
- /**
- * A normalized `config.toolbar` object.
- *
- * @private
- * @member {Object}
- */
- this._toolbarConfig = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["normalizeToolbarConfig"])( editor.config.get( 'toolbar' ) );
- /**
- * The element replacer instance used to hide the editor's source element.
- *
- * @protected
- * @member {module:utils/elementreplacer~ElementReplacer}
- */
- this._elementReplacer = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["ElementReplacer"]();
- }
- /**
- * @inheritDoc
- */
- get element() {
- return this.view.element;
- }
- /**
- * Initializes the UI.
- *
- * @param {HTMLElement|null} replacementElement The DOM element that will be the source for the created editor.
- */
- init( replacementElement ) {
- const editor = this.editor;
- const view = this.view;
- const editingView = editor.editing.view;
- const editable = view.editable;
- const editingRoot = editingView.document.getRoot();
- // The editable UI and editing root should share the same name. Then name is used
- // to recognize the particular editable, for instance in ARIA attributes.
- editable.name = editingRoot.rootName;
- view.render();
- // The editable UI element in DOM is available for sure only after the editor UI view has been rendered.
- // But it can be available earlier if a DOM element has been passed to BalloonEditor.create().
- const editableElement = editable.element;
- // Register the editable UI view in the editor. A single editor instance can aggregate multiple
- // editable areas (roots) but the classic editor has only one.
- this.setEditableElement( editable.name, editableElement );
- // Let the global focus tracker know that the editable UI element is focusable and
- // belongs to the editor. From now on, the focus tracker will sustain the editor focus
- // as long as the editable is focused (e.g. the user is typing).
- this.focusTracker.add( editableElement );
- // Let the editable UI element respond to the changes in the global editor focus
- // tracker. It has been added to the same tracker a few lines above but, in reality, there are
- // many focusable areas in the editor, like balloons, toolbars or dropdowns and as long
- // as they have focus, the editable should act like it is focused too (although technically
- // it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.
- // Doing otherwise will result in editable focus styles disappearing, once e.g. the
- // toolbar gets focused.
- view.editable.bind( 'isFocused' ).to( this.focusTracker );
- // Bind the editable UI element to the editing view, making it an end– and entry–point
- // of the editor's engine. This is where the engine meets the UI.
- editingView.attachDomRoot( editableElement );
- // If an element containing the initial data of the editor was provided, replace it with
- // an editor instance's UI in DOM until the editor is destroyed. For instance, a <textarea>
- // can be such element.
- if ( replacementElement ) {
- this._elementReplacer.replace( replacementElement, this.element );
- }
- this._initPlaceholder();
- this._initToolbar();
- this.fire( 'ready' );
- }
- /**
- * @inheritDoc
- */
- destroy() {
- const view = this.view;
- const editingView = this.editor.editing.view;
- this._elementReplacer.restore();
- editingView.detachDomRoot( view.editable.name );
- view.destroy();
- super.destroy();
- }
- /**
- * Initializes the editor toolbar.
- *
- * @private
- */
- _initToolbar() {
- const editor = this.editor;
- const view = this.view;
- const editingView = editor.editing.view;
- // Set–up the sticky panel with toolbar.
- view.stickyPanel.bind( 'isActive' ).to( this.focusTracker, 'isFocused' );
- view.stickyPanel.limiterElement = view.element;
- if ( this._toolbarConfig.viewportTopOffset ) {
- view.stickyPanel.viewportTopOffset = this._toolbarConfig.viewportTopOffset;
- }
- view.toolbar.fillFromConfig( this._toolbarConfig, this.componentFactory );
- Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["enableToolbarKeyboardFocus"])( {
- origin: editingView,
- originFocusTracker: this.focusTracker,
- originKeystrokeHandler: editor.keystrokes,
- toolbar: view.toolbar
- } );
- }
- /**
- * Enable the placeholder text on the editing root, if any was configured.
- *
- * @private
- */
- _initPlaceholder() {
- const editor = this.editor;
- const editingView = editor.editing.view;
- const editingRoot = editingView.document.getRoot();
- const sourceElement = editor.sourceElement;
- const placeholderText = editor.config.get( 'placeholder' ) ||
- sourceElement && sourceElement.tagName.toLowerCase() === 'textarea' && sourceElement.getAttribute( 'placeholder' );
- if ( placeholderText ) {
- Object(ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_2__["enablePlaceholder"])( {
- view: editingView,
- element: editingRoot,
- text: placeholderText,
- isDirectHost: false,
- keepOnFocus: true
- } );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditorUIView; });
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _theme_classiceditor_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../theme/classiceditor.css */ "./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css");
- /* harmony import */ var _theme_classiceditor_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_theme_classiceditor_css__WEBPACK_IMPORTED_MODULE_1__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module editor-classic/classiceditoruiview
- */
- /**
- * Classic editor UI view. Uses an inline editable and a sticky toolbar, all
- * enclosed in a boxed UI view.
- *
- * @extends module:ui/editorui/boxed/boxededitoruiview~BoxedEditorUIView
- */
- class ClassicEditorUIView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["BoxedEditorUIView"] {
- /**
- * Creates an instance of the classic editor UI view.
- *
- * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
- * @param {module:engine/view/view~View} editingView The editing view instance this view is related to.
- * @param {Object} [options={}] Configuration options for the view instance.
- * @param {Boolean} [options.shouldToolbarGroupWhenFull] When set `true` enables automatic items grouping
- * in the main {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#toolbar toolbar}.
- * See {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull} to learn more.
- */
- constructor( locale, editingView, options = {} ) {
- super( locale );
- /**
- * Sticky panel view instance. This is a parent view of a {@link #toolbar}
- * that makes toolbar sticky.
- *
- * @readonly
- * @member {module:ui/panel/sticky/stickypanelview~StickyPanelView}
- */
- this.stickyPanel = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["StickyPanelView"]( locale );
- /**
- * Toolbar view instance.
- *
- * @readonly
- * @member {module:ui/toolbar/toolbarview~ToolbarView}
- */
- this.toolbar = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ToolbarView"]( locale, {
- shouldGroupWhenFull: options.shouldToolbarGroupWhenFull
- } );
- /**
- * Editable UI view.
- *
- * @readonly
- * @member {module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}
- */
- this.editable = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["InlineEditableUIView"]( locale, editingView );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- // Set toolbar as a child of a stickyPanel and makes toolbar sticky.
- this.stickyPanel.content.add( this.toolbar );
- this.top.add( this.stickyPanel );
- this.main.add( this.editable );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css ***!
- \*********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./classiceditor.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DataController; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _conversion_mapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../conversion/mapper */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js");
- /* harmony import */ var _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../conversion/downcastdispatcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js");
- /* harmony import */ var _conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../conversion/downcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js");
- /* harmony import */ var _conversion_upcastdispatcher__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../conversion/upcastdispatcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js");
- /* harmony import */ var _conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../conversion/upcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js");
- /* harmony import */ var _view_documentfragment__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../view/documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
- /* harmony import */ var _view_document__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../view/document */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js");
- /* harmony import */ var _view_downcastwriter__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../view/downcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js");
- /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../model/utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
- /* harmony import */ var _dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../dataprocessor/htmldataprocessor */ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/controller/datacontroller
- */
- /**
- * Controller for the data pipeline. The data pipeline controls how data is retrieved from the document
- * and set inside it. Hence, the controller features two methods which allow to {@link ~DataController#get get}
- * and {@link ~DataController#set set} data of the {@link ~DataController#model model}
- * using given:
- *
- * * {@link module:engine/dataprocessor/dataprocessor~DataProcessor data processor},
- * * downcast converters,
- * * upcast converters.
- *
- * An instance of the data controller is always available in the {@link module:core/editor/editor~Editor#data `editor.data`}
- * property:
- *
- * editor.data.get( { rootName: 'customRoot' } ); // -> '<p>Hello!</p>'
- *
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class DataController {
- /**
- * Creates a data controller instance.
- *
- * @param {module:engine/model/model~Model} model Data model.
- * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
- */
- constructor( model, stylesProcessor ) {
- /**
- * Data model.
- *
- * @readonly
- * @member {module:engine/model/model~Model}
- */
- this.model = model;
- /**
- * Mapper used for the conversion. It has no permanent bindings, because they are created when getting data and
- * cleared directly after the data are converted. However, the mapper is defined as a class property, because
- * it needs to be passed to the `DowncastDispatcher` as a conversion API.
- *
- * @readonly
- * @member {module:engine/conversion/mapper~Mapper}
- */
- this.mapper = new _conversion_mapper__WEBPACK_IMPORTED_MODULE_3__["default"]();
- /**
- * Downcast dispatcher used by the {@link #get get method}. Downcast converters should be attached to it.
- *
- * @readonly
- * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher}
- */
- this.downcastDispatcher = new _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_4__["default"]( {
- mapper: this.mapper,
- schema: model.schema
- } );
- this.downcastDispatcher.on( 'insert:$text', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_5__["insertText"])(), { priority: 'lowest' } );
- /**
- * Upcast dispatcher used by the {@link #set set method}. Upcast converters should be attached to it.
- *
- * @readonly
- * @member {module:engine/conversion/upcastdispatcher~UpcastDispatcher}
- */
- this.upcastDispatcher = new _conversion_upcastdispatcher__WEBPACK_IMPORTED_MODULE_6__["default"]( {
- schema: model.schema
- } );
- /**
- * The view document used by the data controller.
- *
- * @readonly
- * @member {module:engine/view/document~Document}
- */
- this.viewDocument = new _view_document__WEBPACK_IMPORTED_MODULE_9__["default"]( stylesProcessor );
- /**
- * Styles processor used during the conversion.
- *
- * @readonly
- * @member {module:engine/view/stylesmap~StylesProcessor}
- */
- this.stylesProcessor = stylesProcessor;
- /**
- * Data processor used specifically for HTML conversion.
- *
- * @readonly
- * @member {module:engine/dataprocessor/htmldataprocessor~HtmlDataProcessor} #htmlProcessor
- */
- this.htmlProcessor = new _dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_13__["default"]( this.viewDocument );
- /**
- * Data processor used during the conversion.
- * Same instance as {@link #htmlProcessor} by default. Can be replaced at run time to handle different format, e.g. XML or Markdown.
- *
- * @member {module:engine/dataprocessor/dataprocessor~DataProcessor} #processor
- */
- this.processor = this.htmlProcessor;
- /**
- * The view downcast writer just for data conversion purposes, i.e. to modify
- * the {@link #viewDocument}.
- *
- * @private
- * @readonly
- * @member {module:engine/view/downcastwriter~DowncastWriter}
- */
- this._viewWriter = new _view_downcastwriter__WEBPACK_IMPORTED_MODULE_10__["default"]( this.viewDocument );
- // Define default converters for text and elements.
- //
- // Note that if there is no default converter for the element it will be skipped, for instance `<b>foo</b>` will be
- // converted to nothing. We therefore add `convertToModelFragment` as a last converter so it converts children of that
- // element to the document fragment and so `<b>foo</b>` will be converted to `foo` if there is no converter for `<b>`.
- this.upcastDispatcher.on( 'text', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertText"])(), { priority: 'lowest' } );
- this.upcastDispatcher.on( 'element', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertToModelFragment"])(), { priority: 'lowest' } );
- this.upcastDispatcher.on( 'documentFragment', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertToModelFragment"])(), { priority: 'lowest' } );
- this.decorate( 'init' );
- this.decorate( 'set' );
- // Fire the `ready` event when the initialization has completed. Such low-level listener gives possibility
- // to plug into the initialization pipeline without interrupting the initialization flow.
- this.on( 'init', () => {
- this.fire( 'ready' );
- }, { priority: 'lowest' } );
- // Fix empty roots after DataController is 'ready' (note that init method could be decorated and stopped).
- // We need to handle this event because initial data could be empty and post-fixer would not get triggered.
- this.on( 'ready', () => {
- this.model.enqueueChange( 'transparent', _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_12__["autoParagraphEmptyRoots"] );
- }, { priority: 'lowest' } );
- }
- /**
- * Returns the model's data converted by downcast dispatchers attached to {@link #downcastDispatcher} and
- * formatted by the {@link #processor data processor}.
- *
- * @param {Object} [options] Additional configuration for the retrieved data. `DataController` provides two optional
- * properties: `rootName` and `trim`. Other properties of this object are specified by various editor features.
- * @param {String} [options.rootName='main'] Root name.
- * @param {String} [options.trim='empty'] Whether returned data should be trimmed. This option is set to `empty` by default,
- * which means whenever editor content is considered empty, an empty string will be returned. To turn off trimming completely
- * use `'none'`. In such cases exact content will be returned (for example `<p> </p>` for an empty editor).
- * @returns {String} Output data.
- */
- get( options = {} ) {
- const { rootName = 'main', trim = 'empty' } = options;
- if ( !this._checkIfRootsExists( [ rootName ] ) ) {
- /**
- * Cannot get data from a non-existing root. This error is thrown when {@link #get DataController#get() method}
- * is called with non-existent root name. For example, if there is an editor instance with only `main` root,
- * calling {@link #get} like:
- *
- * data.get( { rootName: 'root2' } );
- *
- * will throw this error.
- *
- * @error datacontroller-get-non-existent-root
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-get-non-existent-root', this );
- }
- const root = this.model.document.getRoot( rootName );
- if ( trim === 'empty' && !this.model.hasContent( root, { ignoreWhitespaces: true } ) ) {
- return '';
- }
- return this.stringify( root, options );
- }
- /**
- * Returns the content of the given {@link module:engine/model/element~Element model's element} or
- * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast converters
- * attached to {@link #downcastDispatcher} and formatted by the {@link #processor data processor}.
- *
- * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} modelElementOrFragment
- * Element whose content will be stringified.
- * @param {Object} [options] Additional configuration passed to the conversion process.
- * @returns {String} Output data.
- */
- stringify( modelElementOrFragment, options = {} ) {
- // Model -> view.
- const viewDocumentFragment = this.toView( modelElementOrFragment, options );
- // View -> data.
- return this.processor.toData( viewDocumentFragment );
- }
- /**
- * Returns the content of the given {@link module:engine/model/element~Element model element} or
- * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast
- * converters attached to {@link #downcastDispatcher} to a
- * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}.
- *
- * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} modelElementOrFragment
- * Element or document fragment whose content will be converted.
- * @param {Object} [options={}] Additional configuration that will be available through
- * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi#options} during the conversion process.
- * @returns {module:engine/view/documentfragment~DocumentFragment} Output view DocumentFragment.
- */
- toView( modelElementOrFragment, options = {} ) {
- const viewDocument = this.viewDocument;
- const viewWriter = this._viewWriter;
- // Clear bindings so the call to this method gives correct results.
- this.mapper.clearBindings();
- // First, convert elements.
- const modelRange = _model_range__WEBPACK_IMPORTED_MODULE_11__["default"]._createIn( modelElementOrFragment );
- const viewDocumentFragment = new _view_documentfragment__WEBPACK_IMPORTED_MODULE_8__["default"]( viewDocument );
- this.mapper.bindElements( modelElementOrFragment, viewDocumentFragment );
- // Make additional options available during conversion process through `conversionApi`.
- this.downcastDispatcher.conversionApi.options = options;
- // We have no view controller and rendering to DOM in DataController so view.change() block is not used here.
- this.downcastDispatcher.convertInsert( modelRange, viewWriter );
- // Convert markers.
- // For document fragment, simply take the markers assigned to this document fragment.
- // For model root, all markers in that root will be taken.
- // For model element, we need to check which markers are intersecting with this element and relatively modify the markers' ranges.
- const markers = modelElementOrFragment.is( 'documentFragment' ) ?
- Array.from( modelElementOrFragment.markers ) :
- _getMarkersRelativeToElement( modelElementOrFragment );
- for ( const [ name, range ] of markers ) {
- this.downcastDispatcher.convertMarkerAdd( name, range, viewWriter );
- }
- // Clean `conversionApi`.
- delete this.downcastDispatcher.conversionApi.options;
- return viewDocumentFragment;
- }
- /**
- * Sets initial input data parsed by the {@link #processor data processor} and
- * converted by the {@link #upcastDispatcher view-to-model converters}.
- * Initial data can be set only to document that {@link module:engine/model/document~Document#version} is equal 0.
- *
- * **Note** This method is {@link module:utils/observablemixin~ObservableMixin#decorate decorated} which is
- * used by e.g. collaborative editing plugin that syncs remote data on init.
- *
- * When data is passed as a string it is initialized on a default `main` root:
- *
- * dataController.init( '<p>Foo</p>' ); // Initializes data on the `main` root.
- *
- * To initialize data on a different root or multiple roots at once, object containing `rootName` - `data` pairs should be passed:
- *
- * dataController.init( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Initializes data on the `main` and `title` roots.
- *
- * @fires init
- * @param {String|Object.<String,String>} data Input data as a string or an object containing `rootName` - `data`
- * pairs to initialize data on multiple roots at once.
- * @returns {Promise} Promise that is resolved after the data is set on the editor.
- */
- init( data ) {
- if ( this.model.document.version ) {
- /**
- * Cannot set initial data to not empty {@link module:engine/model/document~Document}.
- * Initial data should be set once, during {@link module:core/editor/editor~Editor} initialization,
- * when the {@link module:engine/model/document~Document#version} is equal 0.
- *
- * @error datacontroller-init-document-not-empty
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-init-document-not-empty', this );
- }
- let initialData = {};
- if ( typeof data === 'string' ) {
- initialData.main = data; // Default root is 'main'. To initiate data on a different root, object should be passed.
- } else {
- initialData = data;
- }
- if ( !this._checkIfRootsExists( Object.keys( initialData ) ) ) {
- /**
- * Cannot init data on a non-existing root. This error is thrown when {@link #init DataController#init() method}
- * is called with non-existent root name. For example, if there is an editor instance with only `main` root,
- * calling {@link #init} like:
- *
- * data.init( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );
- *
- * will throw this error.
- *
- * @error datacontroller-init-non-existent-root
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-init-non-existent-root', this );
- }
- this.model.enqueueChange( 'transparent', writer => {
- for ( const rootName of Object.keys( initialData ) ) {
- const modelRoot = this.model.document.getRoot( rootName );
- writer.insert( this.parse( initialData[ rootName ], modelRoot ), modelRoot, 0 );
- }
- } );
- return Promise.resolve();
- }
- /**
- * Sets input data parsed by the {@link #processor data processor} and
- * converted by the {@link #upcastDispatcher view-to-model converters}.
- * This method can be used any time to replace existing editor data by the new one without clearing the
- * {@link module:engine/model/document~Document#history document history}.
- *
- * This method also creates a batch with all the changes applied. If all you need is to parse data, use
- * the {@link #parse} method.
- *
- * When data is passed as a string it is set on a default `main` root:
- *
- * dataController.set( '<p>Foo</p>' ); // Sets data on the `main` root.
- *
- * To set data on a different root or multiple roots at once, object containing `rootName` - `data` pairs should be passed:
- *
- * dataController.set( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Sets data on the `main` and `title` roots.
- *
- * @fires set
- * @param {String|Object.<String,String>} data Input data as a string or an object containing `rootName` - `data`
- * pairs to set data on multiple roots at once.
- */
- set( data ) {
- let newData = {};
- if ( typeof data === 'string' ) {
- newData.main = data; // Default root is 'main'. To set data on a different root, object should be passed.
- } else {
- newData = data;
- }
- if ( !this._checkIfRootsExists( Object.keys( newData ) ) ) {
- /**
- * Cannot set data on a non-existing root. This error is thrown when {@link #set DataController#set() method}
- * is called with non-existent root name. For example, if there is an editor instance with only `main` root,
- * calling {@link #set} like:
- *
- * data.set( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );
- *
- * will throw this error.
- *
- * @error datacontroller-set-non-existent-root
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-set-non-existent-root', this );
- }
- this.model.enqueueChange( 'transparent', writer => {
- writer.setSelection( null );
- writer.removeSelectionAttribute( this.model.document.selection.getAttributeKeys() );
- for ( const rootName of Object.keys( newData ) ) {
- // Save to model.
- const modelRoot = this.model.document.getRoot( rootName );
- writer.remove( writer.createRangeIn( modelRoot ) );
- writer.insert( this.parse( newData[ rootName ], modelRoot ), modelRoot, 0 );
- }
- } );
- }
- /**
- * Returns the data parsed by the {@link #processor data processor} and then converted by upcast converters
- * attached to the {@link #upcastDispatcher}.
- *
- * @see #set
- * @param {String} data Data to parse.
- * @param {module:engine/model/schema~SchemaContextDefinition} [context='$root'] Base context in which the view will
- * be converted to the model. See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.
- * @returns {module:engine/model/documentfragment~DocumentFragment} Parsed data.
- */
- parse( data, context = '$root' ) {
- // data -> view
- const viewDocumentFragment = this.processor.toView( data );
- // view -> model
- return this.toModel( viewDocumentFragment, context );
- }
- /**
- * Returns the result of the given {@link module:engine/view/element~Element view element} or
- * {@link module:engine/view/documentfragment~DocumentFragment view document fragment} converted by the
- * {@link #upcastDispatcher view-to-model converters}, wrapped by {@link module:engine/model/documentfragment~DocumentFragment}.
- *
- * When marker elements were converted during the conversion process, it will be set as a document fragment's
- * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
- *
- * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewElementOrFragment
- * Element or document fragment whose content will be converted.
- * @param {module:engine/model/schema~SchemaContextDefinition} [context='$root'] Base context in which the view will
- * be converted to the model. See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.
- * @returns {module:engine/model/documentfragment~DocumentFragment} Output document fragment.
- */
- toModel( viewElementOrFragment, context = '$root' ) {
- return this.model.change( writer => {
- return this.upcastDispatcher.convert( viewElementOrFragment, writer, context );
- } );
- }
- /**
- * Adds a style processor normalization rules.
- *
- * You can implement your own rules as well as use one of the available processor rules:
- *
- * * background: {@link module:engine/view/styles/background~addBackgroundRules}
- * * border: {@link module:engine/view/styles/border~addBorderRules}
- * * margin: {@link module:engine/view/styles/margin~addMarginRules}
- * * padding: {@link module:engine/view/styles/padding~addPaddingRules}
- *
- * @param {Function} callback
- */
- addStyleProcessorRules( callback ) {
- callback( this.stylesProcessor );
- }
- /**
- * Registers a {@link module:engine/view/matcher~MatcherPattern} on {@link #htmlProcessor htmlProcessor}
- * and {@link #processor processor} for view elements whose content should be treated as a raw data
- * and not processed during conversion from DOM to view elements.
- *
- * The raw data can be later accessed by {@link module:engine/view/element~Element#getCustomProperty view element custom property}
- * `"$rawContent"`.
- *
- * @param {module:engine/view/matcher~MatcherPattern} pattern Pattern matching all view elements whose content should
- * be treated as a raw data.
- */
- registerRawContentMatcher( pattern ) {
- // No need to register the pattern if both `htmlProcessor` and `processor` are the same instances.
- if ( this.processor && this.processor !== this.htmlProcessor ) {
- this.processor.registerRawContentMatcher( pattern );
- }
- this.htmlProcessor.registerRawContentMatcher( pattern );
- }
- /**
- * Removes all event listeners set by the DataController.
- */
- destroy() {
- this.stopListening();
- }
- /**
- * Checks if all provided root names are existing editor roots.
- *
- * @private
- * @param {Array.<String>} rootNames Root names to check.
- * @returns {Boolean} Whether all provided root names are existing editor roots.
- */
- _checkIfRootsExists( rootNames ) {
- for ( const rootName of rootNames ) {
- if ( !this.model.document.getRootNames().includes( rootName ) ) {
- return false;
- }
- }
- return true;
- }
- /**
- * Event fired once the data initialization has finished.
- *
- * @event ready
- */
- /**
- * Event fired after the {@link #init `init()` method} was run. It can be {@link #listenTo listened to} in order to adjust or modify
- * the initialization flow. However, if the `init` event is stopped or prevented, the {@link #event:ready `ready` event}
- * should be fired manually.
- *
- * The `init` event is fired by the decorated {@link #init} method.
- * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
- *
- * @event init
- */
- /**
- * Event fired after {@link #set set() method} has been run.
- *
- * The `set` event is fired by decorated {@link #set} method.
- * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
- *
- * @event set
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( DataController, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- // Helper function for downcast conversion.
- //
- // Takes a document element (element that is added to a model document) and checks which markers are inside it
- // and which markers are containing it. If the marker is intersecting with element, the intersection is returned.
- function _getMarkersRelativeToElement( element ) {
- const result = [];
- const doc = element.root.document;
- if ( !doc ) {
- return [];
- }
- const elementRange = _model_range__WEBPACK_IMPORTED_MODULE_11__["default"]._createIn( element );
- for ( const marker of doc.model.markers ) {
- const intersection = elementRange.getIntersection( marker.getRange() );
- if ( intersection ) {
- result.push( [ marker.name, intersection ] );
- }
- }
- return result;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js":
- /*!*************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js ***!
- \*************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditingController; });
- /* harmony import */ var _view_rooteditableelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view/rooteditableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js");
- /* harmony import */ var _view_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../view/view */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js");
- /* harmony import */ var _conversion_mapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../conversion/mapper */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js");
- /* harmony import */ var _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../conversion/downcastdispatcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js");
- /* harmony import */ var _conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../conversion/downcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../conversion/upcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/controller/editingcontroller
- */
- // @if CK_DEBUG_ENGINE // const { dumpTrees, initDocumentDumping } = require( '../dev-utils/utils' );
- /**
- * Controller for the editing pipeline. The editing pipeline controls {@link ~EditingController#model model} rendering,
- * including selection handling. It also creates the {@link ~EditingController#view view} which builds a
- * browser-independent virtualization over the DOM elements. The editing controller also attaches default converters.
- *
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class EditingController {
- /**
- * Creates an editing controller instance.
- *
- * @param {module:engine/model/model~Model} model Editing model.
- * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
- */
- constructor( model, stylesProcessor ) {
- /**
- * Editor model.
- *
- * @readonly
- * @member {module:engine/model/model~Model}
- */
- this.model = model;
- /**
- * Editing view controller.
- *
- * @readonly
- * @member {module:engine/view/view~View}
- */
- this.view = new _view_view__WEBPACK_IMPORTED_MODULE_1__["default"]( stylesProcessor );
- /**
- * Mapper which describes the model-view binding.
- *
- * @readonly
- * @member {module:engine/conversion/mapper~Mapper}
- */
- this.mapper = new _conversion_mapper__WEBPACK_IMPORTED_MODULE_2__["default"]();
- /**
- * Downcast dispatcher that converts changes from the model to {@link #view the editing view}.
- *
- * @readonly
- * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher} #downcastDispatcher
- */
- this.downcastDispatcher = new _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_3__["default"]( {
- mapper: this.mapper,
- schema: model.schema
- } );
- const doc = this.model.document;
- const selection = doc.selection;
- const markers = this.model.markers;
- // When plugins listen on model changes (on selection change, post fixers, etc.) and change the view as a result of
- // model's change, they might trigger view rendering before the conversion is completed (e.g. before the selection
- // is converted). We disable rendering for the length of the outermost model change() block to prevent that.
- //
- // See https://github.com/ckeditor/ckeditor5-engine/issues/1528
- this.listenTo( this.model, '_beforeChanges', () => {
- this.view._disableRendering( true );
- }, { priority: 'highest' } );
- this.listenTo( this.model, '_afterChanges', () => {
- this.view._disableRendering( false );
- }, { priority: 'lowest' } );
- // Whenever model document is changed, convert those changes to the view (using model.Document#differ).
- // Do it on 'low' priority, so changes are converted after other listeners did their job.
- // Also convert model selection.
- this.listenTo( doc, 'change', () => {
- this.view.change( writer => {
- this.downcastDispatcher.convertChanges( doc.differ, markers, writer );
- this.downcastDispatcher.convertSelection( selection, markers, writer );
- } );
- }, { priority: 'low' } );
- // Convert selection from the view to the model when it changes in the view.
- this.listenTo( this.view.document, 'selectionChange', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertSelectionChange"])( this.model, this.mapper ) );
- // Attach default model converters.
- this.downcastDispatcher.on( 'insert:$text', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["insertText"])(), { priority: 'lowest' } );
- this.downcastDispatcher.on( 'remove', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["remove"])(), { priority: 'low' } );
- // Attach default model selection converters.
- this.downcastDispatcher.on( 'selection', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["clearAttributes"])(), { priority: 'low' } );
- this.downcastDispatcher.on( 'selection', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["convertRangeSelection"])(), { priority: 'low' } );
- this.downcastDispatcher.on( 'selection', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["convertCollapsedSelection"])(), { priority: 'low' } );
- // Binds {@link module:engine/view/document~Document#roots view roots collection} to
- // {@link module:engine/model/document~Document#roots model roots collection} so creating
- // model root automatically creates corresponding view root.
- this.view.document.roots.bindTo( this.model.document.roots ).using( root => {
- // $graveyard is a special root that has no reflection in the view.
- if ( root.rootName == '$graveyard' ) {
- return null;
- }
- const viewRoot = new _view_rooteditableelement__WEBPACK_IMPORTED_MODULE_0__["default"]( this.view.document, root.name );
- viewRoot.rootName = root.rootName;
- this.mapper.bindElements( root, viewRoot );
- return viewRoot;
- } );
- // @if CK_DEBUG_ENGINE // initDocumentDumping( this.model.document );
- // @if CK_DEBUG_ENGINE // initDocumentDumping( this.view.document );
- // @if CK_DEBUG_ENGINE // dumpTrees( this.model.document, this.model.document.version );
- // @if CK_DEBUG_ENGINE // dumpTrees( this.view.document, this.model.document.version );
- // @if CK_DEBUG_ENGINE // this.model.document.on( 'change', () => {
- // @if CK_DEBUG_ENGINE // dumpTrees( this.view.document, this.model.document.version );
- // @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );
- }
- /**
- * Removes all event listeners attached to the `EditingController`. Destroys all objects created
- * by `EditingController` that need to be destroyed.
- */
- destroy() {
- this.view.destroy();
- this.stopListening();
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( EditingController, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Conversion; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _upcasthelpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./upcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js");
- /* harmony import */ var _downcasthelpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./downcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/conversion/conversion
- */
- /**
- * A utility class that helps add converters to upcast and downcast dispatchers.
- *
- * We recommend reading the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide first to
- * understand the core concepts of the conversion mechanisms.
- *
- * An instance of the conversion manager is available in the
- * {@link module:core/editor/editor~Editor#conversion `editor.conversion`} property
- * and by default has the following groups of dispatchers (i.e. directions of conversion):
- *
- * * `downcast` (editing and data downcasts)
- * * `editingDowncast`
- * * `dataDowncast`
- * * `upcast`
- *
- * # One-way converters
- *
- * To add a converter to a specific group, use the {@link module:engine/conversion/conversion~Conversion#for `for()`}
- * method:
- *
- * // Add a converter to editing downcast and data downcast.
- * editor.conversion.for( 'downcast' ).elementToElement( config ) );
- *
- * // Add a converter to the data pipepline only:
- * editor.conversion.for( 'dataDowncast' ).elementToElement( dataConversionConfig ) );
- *
- * // And a slightly different one for the editing pipeline:
- * editor.conversion.for( 'editingDowncast' ).elementToElement( editingConversionConfig ) );
- *
- * See {@link module:engine/conversion/conversion~Conversion#for `for()`} method documentation to learn more about
- * available conversion helpers and how to use your custom ones.
- *
- * # Two-way converters
- *
- * Besides using one-way converters via the `for()` method, you can also use other methods available in this
- * class to add two-way converters (upcast and downcast):
- *
- * * {@link module:engine/conversion/conversion~Conversion#elementToElement `elementToElement()`} –
- * Model element to view element and vice versa.
- * * {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement()`} –
- * Model attribute to view element and vice versa.
- * * {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `attributeToAttribute()`} –
- * Model attribute to view element and vice versa.
- */
- class Conversion {
- /**
- * Creates a new conversion instance.
- *
- * @param {module:engine/conversion/downcastdispatcher~DowncastDispatcher|
- * Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher>} downcastDispatchers
- * @param {module:engine/conversion/upcastdispatcher~UpcastDispatcher|
- * Array.<module:engine/conversion/upcastdispatcher~UpcastDispatcher>} upcastDispatchers
- */
- constructor( downcastDispatchers, upcastDispatchers ) {
- /**
- * Maps dispatchers group name to ConversionHelpers instances.
- *
- * @private
- * @member {Map.<String,module:engine/conversion/conversionhelpers~ConversionHelpers>}
- */
- this._helpers = new Map();
- // Define default 'downcast' & 'upcast' dispatchers groups. Those groups are always available as two-way converters needs them.
- this._downcast = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__["default"])( downcastDispatchers );
- this._createConversionHelpers( { name: 'downcast', dispatchers: this._downcast, isDowncast: true } );
- this._upcast = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__["default"])( upcastDispatchers );
- this._createConversionHelpers( { name: 'upcast', dispatchers: this._upcast, isDowncast: false } );
- }
- /**
- * Define an alias for registered dispatcher.
- *
- * const conversion = new Conversion(
- * [ dataDowncastDispatcher, editingDowncastDispatcher ],
- * upcastDispatcher
- * );
- *
- * conversion.addAlias( 'dataDowncast', dataDowncastDispatcher );
- *
- * @param {String} alias An alias of a dispatcher.
- * @param {module:engine/conversion/downcastdispatcher~DowncastDispatcher|
- * module:engine/conversion/upcastdispatcher~UpcastDispatcher} dispatcher Dispatcher which should have an alias.
- */
- addAlias( alias, dispatcher ) {
- const isDowncast = this._downcast.includes( dispatcher );
- const isUpcast = this._upcast.includes( dispatcher );
- if ( !isUpcast && !isDowncast ) {
- /**
- * Trying to register and alias for a dispatcher that nas not been registered.
- *
- * @error conversion-add-alias-dispatcher-not-registered
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'conversion-add-alias-dispatcher-not-registered',
- this
- );
- }
- this._createConversionHelpers( { name: alias, dispatchers: [ dispatcher ], isDowncast } );
- }
- /**
- * Provides a chainable API to assign converters to conversion dispatchers group.
- *
- * If the given group name has not been registered, the
- * {@link module:utils/ckeditorerror~CKEditorError `conversion-for-unknown-group` error} is thrown.
- *
- * You can use conversion helpers available directly in the `for()` chain or your custom ones via
- * the {@link module:engine/conversion/conversionhelpers~ConversionHelpers#add `add()`} method.
- *
- * # Using bulit-in conversion helpers
- *
- * The `for()` chain comes with a set of conversion helpers which you can use like this:
- *
- * editor.conversion.for( 'downcast' )
- * .elementToElement( config1 ) // Adds an element-to-element downcast converter.
- * .attributeToElement( config2 ); // Adds an attribute-to-element downcast converter.
- *
- * editor.conversion.for( 'upcast' )
- * .elementToAttribute( config3 ); // Adds an element-to-attribute upcast converter.
- *
- * Refer to the documentation of built-in conversion helpers to learn about their configuration options.
- *
- * * downcast (model-to-view) conversion helpers:
- *
- * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`},
- * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement `attributeToElement()`},
- * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToAttribute `attributeToAttribute()`}.
- * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToElement `markerToElement()`}.
- * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToHighlight `markerToHighlight()`}.
- *
- * * upcast (view-to-model) conversion helpers:
- *
- * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToElement `elementToElement()`},
- * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute `elementToAttribute()`},
- * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute `attributeToAttribute()`}.
- * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToMarker `elementToMarker()`}.
- *
- * # Using custom conversion helpers
- *
- * If you need to implement a nontypical converter, you can do so by calling:
- *
- * editor.conversion.for( direction ).add( customHelper );
- *
- * The `.add()` method takes exactly one parameter, which is a function. This function should accept one parameter that
- * is a dispatcher instance. The function should add an actual converter to the passed dispatcher instance.
- *
- * Example:
- *
- * editor.conversion.for( 'upcast' ).add( dispatcher => {
- * dispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
- * // Do something with a view <a> element.
- * } );
- * } );
- *
- * Refer to the documentation of {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}
- * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} to learn how to write
- * custom converters.
- *
- * @param {String} groupName The name of dispatchers group to add the converters to.
- * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers|module:engine/conversion/upcasthelpers~UpcastHelpers}
- */
- for( groupName ) {
- if ( !this._helpers.has( groupName ) ) {
- /**
- * Trying to add a converter to an unknown dispatchers group.
- *
- * @error conversion-for-unknown-group
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'conversion-for-unknown-group', this );
- }
- return this._helpers.get( groupName );
- }
- /**
- * Sets up converters between the model and the view that convert a model element to a view element (and vice versa).
- * For example, the model `<paragraph>Foo</paragraph>` is `<p>Foo</p>` in the view.
- *
- * // A simple conversion from the `paragraph` model element to the `<p>` view element (and vice versa).
- * editor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );
- *
- * // Override other converters by specifying a converter definition with a higher priority.
- * editor.conversion.elementToElement( { model: 'paragraph', view: 'div', converterPriority: 'high' } );
- *
- * // View specified as an object instead of a string.
- * editor.conversion.elementToElement( {
- * model: 'fancyParagraph',
- * view: {
- * name: 'p',
- * classes: 'fancy'
- * }
- * } );
- *
- * // Use `upcastAlso` to define other view elements that should also be converted to a `paragraph` element.
- * editor.conversion.elementToElement( {
- * model: 'paragraph',
- * view: 'p',
- * upcastAlso: [
- * 'div',
- * {
- * // Any element with the `display: block` style.
- * styles: {
- * display: 'block'
- * }
- * }
- * ]
- * } );
- *
- * // `upcastAlso` set as callback enables a conversion of a wide range of different view elements.
- * editor.conversion.elementToElement( {
- * model: 'heading',
- * view: 'h2',
- * // Convert "heading-like" paragraphs to headings.
- * upcastAlso: viewElement => {
- * const fontSize = viewElement.getStyle( 'font-size' );
- *
- * if ( !fontSize ) {
- * return null;
- * }
- *
- * const match = fontSize.match( /(\d+)\s*px/ );
- *
- * if ( !match ) {
- * return null;
- * }
- *
- * const size = Number( match[ 1 ] );
- *
- * if ( size > 26 ) {
- * // Returned value can be an object with the matched properties.
- * // These properties will be "consumed" during the conversion.
- * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
- *
- * return { name: true, styles: [ 'font-size' ] };
- * }
- *
- * return null;
- * }
- * } );
- *
- * `definition.model` is a `String` with a model element name to convert from or to.
- * See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.
- *
- * @param {module:engine/conversion/conversion~ConverterDefinition} definition The converter definition.
- */
- elementToElement( definition ) {
- // Set up downcast converter.
- this.for( 'downcast' ).elementToElement( definition );
- // Set up upcast converter.
- for ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {
- this.for( 'upcast' )
- .elementToElement( {
- model,
- view,
- converterPriority: definition.converterPriority
- } );
- }
- }
- /**
- * Sets up converters between the model and the view that convert a model attribute to a view element (and vice versa).
- * For example, a model text node with `"Foo"` as data and the `bold` attribute is `<strong>Foo</strong>` in the view.
- *
- * // A simple conversion from the `bold=true` attribute to the `<strong>` view element (and vice versa).
- * editor.conversion.attributeToElement( { model: 'bold', view: 'strong' } );
- *
- * // Override other converters by specifying a converter definition with a higher priority.
- * editor.conversion.attributeToElement( { model: 'bold', view: 'b', converterPriority: 'high' } );
- *
- * // View specified as an object instead of a string.
- * editor.conversion.attributeToElement( {
- * model: 'bold',
- * view: {
- * name: 'span',
- * classes: 'bold'
- * }
- * } );
- *
- * // Use `config.model.name` to define the conversion only from a given node type, `$text` in this case.
- * // The same attribute on different elements may then be handled by a different converter.
- * editor.conversion.attributeToElement( {
- * model: {
- * key: 'textDecoration',
- * values: [ 'underline', 'lineThrough' ],
- * name: '$text'
- * },
- * view: {
- * underline: {
- * name: 'span',
- * styles: {
- * 'text-decoration': 'underline'
- * }
- * },
- * lineThrough: {
- * name: 'span',
- * styles: {
- * 'text-decoration': 'line-through'
- * }
- * }
- * }
- * } );
- *
- * // Use `upcastAlso` to define other view elements that should also be converted to the `bold` attribute.
- * editor.conversion.attributeToElement( {
- * model: 'bold',
- * view: 'strong',
- * upcastAlso: [
- * 'b',
- * {
- * name: 'span',
- * classes: 'bold'
- * },
- * {
- * name: 'span',
- * styles: {
- * 'font-weight': 'bold'
- * }
- * },
- * viewElement => {
- * const fontWeight = viewElement.getStyle( 'font-weight' );
- *
- * if ( viewElement.is( 'element', 'span' ) && fontWeight && /\d+/.test() && Number( fontWeight ) > 500 ) {
- * // Returned value can be an object with the matched properties.
- * // These properties will be "consumed" during the conversion.
- * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
- *
- * return {
- * name: true,
- * styles: [ 'font-weight' ]
- * };
- * }
- * }
- * ]
- * } );
- *
- * // Conversion from and to a model attribute key whose value is an enum (`fontSize=big|small`).
- * // `upcastAlso` set as callback enables a conversion of a wide range of different view elements.
- * editor.conversion.attributeToElement( {
- * model: {
- * key: 'fontSize',
- * values: [ 'big', 'small' ]
- * },
- * view: {
- * big: {
- * name: 'span',
- * styles: {
- * 'font-size': '1.2em'
- * }
- * },
- * small: {
- * name: 'span',
- * styles: {
- * 'font-size': '0.8em'
- * }
- * }
- * },
- * upcastAlso: {
- * big: viewElement => {
- * const fontSize = viewElement.getStyle( 'font-size' );
- *
- * if ( !fontSize ) {
- * return null;
- * }
- *
- * const match = fontSize.match( /(\d+)\s*px/ );
- *
- * if ( !match ) {
- * return null;
- * }
- *
- * const size = Number( match[ 1 ] );
- *
- * if ( viewElement.is( 'element', 'span' ) && size > 10 ) {
- * // Returned value can be an object with the matched properties.
- * // These properties will be "consumed" during the conversion.
- * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
- *
- * return { name: true, styles: [ 'font-size' ] };
- * }
- *
- * return null;
- * },
- * small: viewElement => {
- * const fontSize = viewElement.getStyle( 'font-size' );
- *
- * if ( !fontSize ) {
- * return null;
- * }
- *
- * const match = fontSize.match( /(\d+)\s*px/ );
- *
- * if ( !match ) {
- * return null;
- * }
- *
- * const size = Number( match[ 1 ] );
- *
- * if ( viewElement.is( 'element', 'span' ) && size < 10 ) {
- * // Returned value can be an object with the matched properties.
- * // These properties will be "consumed" during the conversion.
- * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
- *
- * return { name: true, styles: [ 'font-size' ] };
- * }
- *
- * return null;
- * }
- * }
- * } );
- *
- * The `definition.model` parameter specifies which model attribute should be converted from or to. It can be a `{ key, value }` object
- * describing the attribute key and value to convert or a `String` specifying just the attribute key (then `value` is set to `true`).
- * See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.
- *
- * @param {module:engine/conversion/conversion~ConverterDefinition} definition The converter definition.
- */
- attributeToElement( definition ) {
- // Set up downcast converter.
- this.for( 'downcast' ).attributeToElement( definition );
- // Set up upcast converter.
- for ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {
- this.for( 'upcast' )
- .elementToAttribute( {
- view,
- model,
- converterPriority: definition.converterPriority
- } );
- }
- }
- /**
- * Sets up converters between the model and the view that convert a model attribute to a view attribute (and vice versa).
- * For example, `<image src='foo.jpg'></image>` is converted to `<img src='foo.jpg'></img>` (the same attribute key and value).
- * This type of converters is intended to be used with {@link module:engine/model/element~Element model element} nodes.
- * To convert text attributes {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement converter`}
- * should be set up.
- *
- * // A simple conversion from the `source` model attribute to the `src` view attribute (and vice versa).
- * editor.conversion.attributeToAttribute( { model: 'source', view: 'src' } );
- *
- * // Attribute values are strictly specified.
- * editor.conversion.attributeToAttribute( {
- * model: {
- * name: 'image',
- * key: 'aside',
- * values: [ 'aside' ]
- * },
- * view: {
- * aside: {
- * name: 'img',
- * key: 'class',
- * value: [ 'aside', 'half-size' ]
- * }
- * }
- * } );
- *
- * // Set the style attribute.
- * editor.conversion.attributeToAttribute( {
- * model: {
- * name: 'image',
- * key: 'aside',
- * values: [ 'aside' ]
- * },
- * view: {
- * aside: {
- * name: 'img',
- * key: 'style',
- * value: {
- * float: 'right',
- * width: '50%',
- * margin: '5px'
- * }
- * }
- * }
- * } );
- *
- * // Conversion from and to a model attribute key whose value is an enum (`align=right|center`).
- * // Use `upcastAlso` to define other view elements that should also be converted to the `align=right` attribute.
- * editor.conversion.attributeToAttribute( {
- * model: {
- * key: 'align',
- * values: [ 'right', 'center' ]
- * },
- * view: {
- * right: {
- * key: 'class',
- * value: 'align-right'
- * },
- * center: {
- * key: 'class',
- * value: 'align-center'
- * }
- * },
- * upcastAlso: {
- * right: {
- * styles: {
- * 'text-align': 'right'
- * }
- * },
- * center: {
- * styles: {
- * 'text-align': 'center'
- * }
- * }
- * }
- * } );
- *
- * The `definition.model` parameter specifies which model attribute should be converted from and to.
- * It can be a `{ key, [ values ], [ name ] }` object or a `String`, which will be treated like `{ key: definition.model }`.
- * The `key` property is the model attribute key to convert from and to.
- * The `values` are the possible model attribute values. If `values` is not set, the model attribute value will be the same as the
- * view attribute value.
- * If `name` is set, the conversion will be set up only for model elements with the given name.
- *
- * The `definition.view` parameter specifies which view attribute should be converted from and to.
- * It can be a `{ key, value, [ name ] }` object or a `String`, which will be treated like `{ key: definition.view }`.
- * The `key` property is the view attribute key to convert from and to.
- * The `value` is the view attribute value to convert from and to. If `definition.value` is not set, the view attribute value will be
- * the same as the model attribute value.
- * If `key` is `'class'`, `value` can be a `String` or an array of `String`s.
- * If `key` is `'style'`, `value` is an object with key-value pairs.
- * In other cases, `value` is a `String`.
- * If `name` is set, the conversion will be set up only for model elements with the given name.
- * If `definition.model.values` is set, `definition.view` is an object that assigns values from `definition.model.values`
- * to `{ key, value, [ name ] }` objects.
- *
- * `definition.upcastAlso` specifies which other matching view elements should also be upcast to the given model configuration.
- * If `definition.model.values` is set, `definition.upcastAlso` should be an object assigning values from `definition.model.values`
- * to {@link module:engine/view/matcher~MatcherPattern}s or arrays of {@link module:engine/view/matcher~MatcherPattern}s.
- *
- * **Note:** `definition.model` and `definition.view` form should be mirrored, so the same types of parameters should
- * be given in both parameters.
- *
- * @param {Object} definition The converter definition.
- * @param {String|Object} definition.model The model attribute to convert from and to.
- * @param {String|Object} definition.view The view attribute to convert from and to.
- * @param {module:engine/view/matcher~MatcherPattern|Array.<module:engine/view/matcher~MatcherPattern>} [definition.upcastAlso]
- * Any view element matching `definition.upcastAlso` will also be converted to the given model attribute. `definition.upcastAlso`
- * is used only if `config.model.values` is specified.
- */
- attributeToAttribute( definition ) {
- // Set up downcast converter.
- this.for( 'downcast' ).attributeToAttribute( definition );
- // Set up upcast converter.
- for ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {
- this.for( 'upcast' )
- .attributeToAttribute( {
- view,
- model
- } );
- }
- }
- /**
- * Creates and caches conversion helpers for given dispatchers group.
- *
- * @private
- * @param {Object} options
- * @param {String} options.name Group name.
- * @param {Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher|
- * module:engine/conversion/upcastdispatcher~UpcastDispatcher>} options.dispatchers
- * @param {Boolean} options.isDowncast
- */
- _createConversionHelpers( { name, dispatchers, isDowncast } ) {
- if ( this._helpers.has( name ) ) {
- /**
- * Trying to register a group name that has already been registered.
- *
- * @error conversion-group-exists
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'conversion-group-exists', this );
- }
- const helpers = isDowncast ? new _downcasthelpers__WEBPACK_IMPORTED_MODULE_2__["default"]( dispatchers ) : new _upcasthelpers__WEBPACK_IMPORTED_MODULE_1__["default"]( dispatchers );
- this._helpers.set( name, helpers );
- }
- }
- /**
- * Defines how the model should be converted from and to the view.
- *
- * @typedef {Object} module:engine/conversion/conversion~ConverterDefinition
- *
- * @property {*} [model] The model conversion definition. Describes the model element or model attribute to convert. This parameter differs
- * for different functions that accept `ConverterDefinition`. See the description of the function to learn how to set it.
- * @property {module:engine/view/elementdefinition~ElementDefinition|Object} view The definition of the view element to convert from and
- * to. If `model` describes multiple values, `view` is an object that assigns these values (`view` object keys) to view element definitions
- * (`view` object values).
- * @property {module:engine/view/matcher~MatcherPattern|Array.<module:engine/view/matcher~MatcherPattern>} [upcastAlso]
- * Any view element matching `upcastAlso` will also be converted to the model. If `model` describes multiple values, `upcastAlso`
- * is an object that assigns these values (`upcastAlso` object keys) to {@link module:engine/view/matcher~MatcherPattern}s
- * (`upcastAlso` object values).
- * @property {module:utils/priorities~PriorityString} [converterPriority] The converter priority.
- */
- // Helper function that creates a joint array out of an item passed in `definition.view` and items passed in
- // `definition.upcastAlso`.
- //
- // @param {module:engine/conversion/conversion~ConverterDefinition} definition
- // @returns {Array} Array containing view definitions.
- function* _getAllUpcastDefinitions( definition ) {
- if ( definition.model.values ) {
- for ( const value of definition.model.values ) {
- const model = { key: definition.model.key, value };
- const view = definition.view[ value ];
- const upcastAlso = definition.upcastAlso ? definition.upcastAlso[ value ] : undefined;
- yield* _getUpcastDefinition( model, view, upcastAlso );
- }
- } else {
- yield* _getUpcastDefinition( definition.model, definition.view, definition.upcastAlso );
- }
- }
- function* _getUpcastDefinition( model, view, upcastAlso ) {
- yield { model, view };
- if ( upcastAlso ) {
- for ( const upcastAlsoItem of Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__["default"])( upcastAlso ) ) {
- yield { model, view: upcastAlsoItem };
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js":
- /*!*************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js ***!
- \*************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ConversionHelpers; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/conversion/conversionhelpers
- */
- /**
- * Base class for conversion helpers.
- */
- class ConversionHelpers {
- /**
- * Creates a conversion helpers instance.
- *
- * @param {Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher|
- * module:engine/conversion/upcastdispatcher~UpcastDispatcher>} dispatchers
- */
- constructor( dispatchers ) {
- this._dispatchers = dispatchers;
- }
- /**
- * Registers a conversion helper.
- *
- * **Note**: See full usage example in the `{@link module:engine/conversion/conversion~Conversion#for conversion.for()}`
- * method description.
- *
- * @param {Function} conversionHelper The function to be called on event.
- * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers|module:engine/conversion/upcasthelpers~UpcastHelpers}
- */
- add( conversionHelper ) {
- for ( const dispatcher of this._dispatchers ) {
- conversionHelper( dispatcher );
- }
- return this;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js ***!
- \**************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DowncastDispatcher; });
- /* harmony import */ var _modelconsumable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modelconsumable */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js");
- /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _model_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/conversion/downcastdispatcher
- */
- /**
- * The downcast dispatcher is a central point of downcasting (conversion from the model to the view), which is a process of reacting
- * to changes in the model and firing a set of events. Callbacks listening to these events are called converters. The
- * converters' role is to convert the model changes to changes in view (for example, adding view nodes or
- * changing attributes on view elements).
- *
- * During the conversion process, downcast dispatcher fires events basing on the state of the model and prepares
- * data for these events. It is important to understand that the events are connected with the changes done on the model,
- * for example: "a node has been inserted" or "an attribute has changed". This is in contrary to upcasting (a view-to-model conversion)
- * where you convert the view state (view nodes) to a model tree.
- *
- * The events are prepared basing on a diff created by {@link module:engine/model/differ~Differ Differ}, which buffers them
- * and then passes to the downcast dispatcher as a diff between the old model state and the new model state.
- *
- * Note that because the changes are converted, there is a need to have a mapping between the model structure and the view structure.
- * To map positions and elements during the downcast (a model-to-view conversion), use {@link module:engine/conversion/mapper~Mapper}.
- *
- * Downcast dispatcher fires the following events for model tree changes:
- *
- * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert`} –
- * If a range of nodes was inserted to the model tree.
- * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove `remove`} –
- * If a range of nodes was removed from the model tree.
- * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`} –
- * If an attribute was added, changed or removed from a model node.
- *
- * For {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert`}
- * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`},
- * downcast dispatcher generates {@link module:engine/conversion/modelconsumable~ModelConsumable consumables}.
- * These are used to have control over which changes have already been consumed. It is useful when some converters
- * overwrite others or convert multiple changes (for example, it converts an insertion of an element and also converts that
- * element's attributes during the insertion).
- *
- * Additionally, downcast dispatcher fires events for {@link module:engine/model/markercollection~Marker marker} changes:
- *
- * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} – If a marker was added.
- * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} – If a marker was removed.
- *
- * Note that changing a marker is done through removing the marker from the old range and adding it to the new range,
- * so both events are fired.
- *
- * Finally, downcast dispatcher also handles firing events for the {@link module:engine/model/selection model selection}
- * conversion:
- *
- * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:selection}
- * – Converts the selection from the model to the view.
- * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute}
- * – Fired for every selection attribute.
- * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}
- * – Fired for every marker that contains a selection.
- *
- * Unlike the model tree and the markers, the events for selection are not fired for changes but for a selection state.
- *
- * When providing custom listeners for a downcast dispatcher, remember to check whether a given change has not been
- * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} yet.
- *
- * When providing custom listeners for downcast dispatcher, keep in mind that any callback that has
- * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} a value from a consumable and
- * converted the change should also stop the event (for efficiency purposes).
- *
- * When providing custom listeners for downcast dispatcher, remember to use the provided
- * {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer} to apply changes to the view document.
- *
- * You can read more about conversion in the following guides:
- *
- * * {@glink framework/guides/deep-dive/conversion/conversion-introduction Advanced conversion concepts — attributes}
- * * {@glink framework/guides/deep-dive/conversion/conversion-extending-output Extending the editor output }
- * * {@glink framework/guides/deep-dive/conversion/custom-element-conversion Custom element conversion}
- *
- * An example of a custom converter for the downcast dispatcher:
- *
- * // You will convert inserting a "paragraph" model element into the model.
- * downcastDispatcher.on( 'insert:paragraph', ( evt, data, conversionApi ) => {
- * // Remember to check whether the change has not been consumed yet and consume it.
- * if ( conversionApi.consumable.consume( data.item, 'insert' ) ) {
- * return;
- * }
- *
- * // Translate the position in the model to a position in the view.
- * const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
- *
- * // Create a <p> element that will be inserted into the view at the `viewPosition`.
- * const viewElement = conversionApi.writer.createContainerElement( 'p' );
- *
- * // Bind the newly created view element to the model element so positions will map accordingly in the future.
- * conversionApi.mapper.bindElements( data.item, viewElement );
- *
- * // Add the newly created view element to the view.
- * conversionApi.writer.insert( viewPosition, viewElement );
- *
- * // Remember to stop the event propagation.
- * evt.stop();
- * } );
- */
- class DowncastDispatcher {
- /**
- * Creates a downcast dispatcher instance.
- *
- * @see module:engine/conversion/downcastdispatcher~DowncastConversionApi
- * @param {Object} conversionApi Additional properties for an interface that will be passed to events fired
- * by the downcast dispatcher.
- */
- constructor( conversionApi ) {
- /**
- * An interface passed by the dispatcher to the event callbacks.
- *
- * @member {module:engine/conversion/downcastdispatcher~DowncastConversionApi}
- */
- this.conversionApi = Object.assign( { dispatcher: this }, conversionApi );
- /**
- * Maps conversion event names that will trigger element reconversion for a given element name.
- *
- * @type {Map<String, String>}
- * @private
- */
- this._reconversionEventsMapping = new Map();
- }
- /**
- * Takes a {@link module:engine/model/differ~Differ model differ} object with buffered changes and fires conversion basing on it.
- *
- * @param {module:engine/model/differ~Differ} differ The differ object with buffered changes.
- * @param {module:engine/model/markercollection~MarkerCollection} markers Markers connected with the converted model.
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer that should be used to modify the view document.
- */
- convertChanges( differ, markers, writer ) {
- // Before the view is updated, remove markers which have changed.
- for ( const change of differ.getMarkersToRemove() ) {
- this.convertMarkerRemove( change.name, change.range, writer );
- }
- const changes = this._mapChangesWithAutomaticReconversion( differ );
- // Convert changes that happened on model tree.
- for ( const entry of changes ) {
- if ( entry.type === 'insert' ) {
- this.convertInsert( _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( entry.position, entry.length ), writer );
- } else if ( entry.type === 'remove' ) {
- this.convertRemove( entry.position, entry.length, entry.name, writer );
- } else if ( entry.type === 'reconvert' ) {
- this.reconvertElement( entry.element, writer );
- } else {
- // Defaults to 'attribute' change.
- this.convertAttribute( entry.range, entry.attributeKey, entry.attributeOldValue, entry.attributeNewValue, writer );
- }
- }
- for ( const markerName of this.conversionApi.mapper.flushUnboundMarkerNames() ) {
- const markerRange = markers.get( markerName ).getRange();
- this.convertMarkerRemove( markerName, markerRange, writer );
- this.convertMarkerAdd( markerName, markerRange, writer );
- }
- // After the view is updated, convert markers which have changed.
- for ( const change of differ.getMarkersToAdd() ) {
- this.convertMarkerAdd( change.name, change.range, writer );
- }
- }
- /**
- * Starts a conversion of a range insertion.
- *
- * For each node in the range, {@link #event:insert `insert` event is fired}. For each attribute on each node,
- * {@link #event:attribute `attribute` event is fired}.
- *
- * @fires insert
- * @fires attribute
- * @param {module:engine/model/range~Range} range The inserted range.
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer that should be used to modify the view document.
- */
- convertInsert( range, writer ) {
- this.conversionApi.writer = writer;
- // Create a list of things that can be consumed, consisting of nodes and their attributes.
- this.conversionApi.consumable = this._createInsertConsumable( range );
- // Fire a separate insert event for each node and text fragment contained in the range.
- for ( const data of Array.from( range ).map( walkerValueToEventData ) ) {
- this._convertInsertWithAttributes( data );
- }
- this._clearConversionApi();
- }
- /**
- * Fires conversion of a single node removal. Fires {@link #event:remove remove event} with provided data.
- *
- * @param {module:engine/model/position~Position} position Position from which node was removed.
- * @param {Number} length Offset size of removed node.
- * @param {String} name Name of removed node.
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.
- */
- convertRemove( position, length, name, writer ) {
- this.conversionApi.writer = writer;
- this.fire( 'remove:' + name, { position, length }, this.conversionApi );
- this._clearConversionApi();
- }
- /**
- * Starts a conversion of an attribute change on a given `range`.
- *
- * For each node in the given `range`, {@link #event:attribute attribute event} is fired with the passed data.
- *
- * @fires attribute
- * @param {module:engine/model/range~Range} range Changed range.
- * @param {String} key Key of the attribute that has changed.
- * @param {*} oldValue Attribute value before the change or `null` if the attribute has not been set before.
- * @param {*} newValue New attribute value or `null` if the attribute has been removed.
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.
- */
- convertAttribute( range, key, oldValue, newValue, writer ) {
- this.conversionApi.writer = writer;
- // Create a list with attributes to consume.
- this.conversionApi.consumable = this._createConsumableForRange( range, `attribute:${ key }` );
- // Create a separate attribute event for each node in the range.
- for ( const value of range ) {
- const item = value.item;
- const itemRange = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( value.previousPosition, value.length );
- const data = {
- item,
- range: itemRange,
- attributeKey: key,
- attributeOldValue: oldValue,
- attributeNewValue: newValue
- };
- this._testAndFire( `attribute:${ key }`, data );
- }
- this._clearConversionApi();
- }
- /**
- * Starts the reconversion of an element. It will:
- *
- * * Fire an {@link #event:insert `insert` event} for the element to reconvert.
- * * Fire an {@link #event:attribute `attribute` event} for element attributes.
- *
- * This will not reconvert children of the element if they have existing (already converted) views. For newly inserted child elements
- * it will behave the same as {@link #convertInsert}.
- *
- * Element reconversion is defined by the `triggerBy` configuration for the
- * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} conversion helper.
- *
- * @fires insert
- * @fires attribute
- * @param {module:engine/model/element~Element} element The element to be reconverted.
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer that should be used to modify the view document.
- */
- reconvertElement( element, writer ) {
- const elementRange = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( element );
- this.conversionApi.writer = writer;
- // Create a list of things that can be consumed, consisting of nodes and their attributes.
- this.conversionApi.consumable = this._createInsertConsumable( elementRange );
- const mapper = this.conversionApi.mapper;
- const currentView = mapper.toViewElement( element );
- // Remove the old view but do not remove mapper mappings - those will be used to revive existing elements.
- writer.remove( currentView );
- // Convert the element - without converting children.
- this._convertInsertWithAttributes( {
- item: element,
- range: elementRange
- } );
- const convertedViewElement = mapper.toViewElement( element );
- // Iterate over children of reconverted element in order to...
- for ( const value of _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( element ) ) {
- const { item } = value;
- const view = elementOrTextProxyToView( item, mapper );
- // ...either bring back previously converted view...
- if ( view ) {
- // Do not move views that are already in converted element - those might be created by the main element converter in case
- // when main element converts also its direct children.
- if ( view.root !== convertedViewElement.root ) {
- writer.move(
- writer.createRangeOn( view ),
- mapper.toViewPosition( _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( item ) )
- );
- }
- }
- // ... or by converting newly inserted elements.
- else {
- this._convertInsertWithAttributes( walkerValueToEventData( value ) );
- }
- }
- // After reconversion is done we can unbind the old view.
- mapper.unbindViewElement( currentView );
- this._clearConversionApi();
- }
- /**
- * Starts the model selection conversion.
- *
- * Fires events for a given {@link module:engine/model/selection~Selection selection} to start the selection conversion.
- *
- * @fires selection
- * @fires addMarker
- * @fires attribute
- * @param {module:engine/model/selection~Selection} selection The selection to convert.
- * @param {module:engine/model/markercollection~MarkerCollection} markers Markers connected with the converted model.
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify the view document.
- */
- convertSelection( selection, markers, writer ) {
- const markersAtSelection = Array.from( markers.getMarkersAtPosition( selection.getFirstPosition() ) );
- this.conversionApi.writer = writer;
- this.conversionApi.consumable = this._createSelectionConsumable( selection, markersAtSelection );
- this.fire( 'selection', { selection }, this.conversionApi );
- if ( !selection.isCollapsed ) {
- return;
- }
- for ( const marker of markersAtSelection ) {
- const markerRange = marker.getRange();
- if ( !shouldMarkerChangeBeConverted( selection.getFirstPosition(), marker, this.conversionApi.mapper ) ) {
- continue;
- }
- const data = {
- item: selection,
- markerName: marker.name,
- markerRange
- };
- if ( this.conversionApi.consumable.test( selection, 'addMarker:' + marker.name ) ) {
- this.fire( 'addMarker:' + marker.name, data, this.conversionApi );
- }
- }
- for ( const key of selection.getAttributeKeys() ) {
- const data = {
- item: selection,
- range: selection.getFirstRange(),
- attributeKey: key,
- attributeOldValue: null,
- attributeNewValue: selection.getAttribute( key )
- };
- // Do not fire event if the attribute has been consumed.
- if ( this.conversionApi.consumable.test( selection, 'attribute:' + data.attributeKey ) ) {
- this.fire( 'attribute:' + data.attributeKey + ':$text', data, this.conversionApi );
- }
- }
- this._clearConversionApi();
- }
- /**
- * Converts the added marker. Fires the {@link #event:addMarker `addMarker`} event for each item
- * in the marker's range. If the range is collapsed, a single event is dispatched. See the event description for more details.
- *
- * @fires addMarker
- * @param {String} markerName Marker name.
- * @param {module:engine/model/range~Range} markerRange The marker range.
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify the view document.
- */
- convertMarkerAdd( markerName, markerRange, writer ) {
- // Do not convert if range is in graveyard.
- if ( markerRange.root.rootName == '$graveyard' ) {
- return;
- }
- this.conversionApi.writer = writer;
- // In markers' case, event name == consumable name.
- const eventName = 'addMarker:' + markerName;
- //
- // First, fire an event for the whole marker.
- //
- const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
- consumable.add( markerRange, eventName );
- this.conversionApi.consumable = consumable;
- this.fire( eventName, { markerName, markerRange }, this.conversionApi );
- //
- // Do not fire events for each item inside the range if the range got consumed.
- //
- if ( !consumable.test( markerRange, eventName ) ) {
- return;
- }
- //
- // Then, fire an event for each item inside the marker range.
- //
- this.conversionApi.consumable = this._createConsumableForRange( markerRange, eventName );
- for ( const item of markerRange.getItems() ) {
- // Do not fire event for already consumed items.
- if ( !this.conversionApi.consumable.test( item, eventName ) ) {
- continue;
- }
- const data = { item, range: _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item ), markerName, markerRange };
- this.fire( eventName, data, this.conversionApi );
- }
- this._clearConversionApi();
- }
- /**
- * Fires the conversion of the marker removal. Fires the {@link #event:removeMarker `removeMarker`} event with the provided data.
- *
- * @fires removeMarker
- * @param {String} markerName Marker name.
- * @param {module:engine/model/range~Range} markerRange The marker range.
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify the view document.
- */
- convertMarkerRemove( markerName, markerRange, writer ) {
- // Do not convert if range is in graveyard.
- if ( markerRange.root.rootName == '$graveyard' ) {
- return;
- }
- this.conversionApi.writer = writer;
- this.fire( 'removeMarker:' + markerName, { markerName, markerRange }, this.conversionApi );
- this._clearConversionApi();
- }
- /**
- * Maps the model element "insert" reconversion for given event names. The event names must be fully specified:
- *
- * * For "attribute" change event, it should include the main element name, i.e: `'attribute:attributeName:elementName'`.
- * * For child node change events, these should use the child event name as well, i.e:
- * * For adding a node: `'insert:childElementName'`.
- * * For removing a node: `'remove:childElementName'`.
- *
- * **Note**: This method should not be used directly. The reconversion is defined by the `triggerBy()` configuration of the
- * `elementToElement()` conversion helper.
- *
- * @protected
- * @param {String} modelName The name of the main model element for which the events will trigger the reconversion.
- * @param {String} eventName The name of an event that would trigger conversion for a given model element.
- */
- _mapReconversionTriggerEvent( modelName, eventName ) {
- this._reconversionEventsMapping.set( eventName, modelName );
- }
- /**
- * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume from a given range,
- * assuming that the range has just been inserted to the model.
- *
- * @private
- * @param {module:engine/model/range~Range} range The inserted range.
- * @returns {module:engine/conversion/modelconsumable~ModelConsumable} The values to consume.
- */
- _createInsertConsumable( range ) {
- const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
- for ( const value of range ) {
- const item = value.item;
- consumable.add( item, 'insert' );
- for ( const key of item.getAttributeKeys() ) {
- consumable.add( item, 'attribute:' + key );
- }
- }
- return consumable;
- }
- /**
- * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume for a given range.
- *
- * @private
- * @param {module:engine/model/range~Range} range The affected range.
- * @param {String} type Consumable type.
- * @returns {module:engine/conversion/modelconsumable~ModelConsumable} The values to consume.
- */
- _createConsumableForRange( range, type ) {
- const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
- for ( const item of range.getItems() ) {
- consumable.add( item, type );
- }
- return consumable;
- }
- /**
- * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with selection consumable values.
- *
- * @private
- * @param {module:engine/model/selection~Selection} selection The selection to create the consumable from.
- * @param {Iterable.<module:engine/model/markercollection~Marker>} markers Markers that contain the selection.
- * @returns {module:engine/conversion/modelconsumable~ModelConsumable} The values to consume.
- */
- _createSelectionConsumable( selection, markers ) {
- const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
- consumable.add( selection, 'selection' );
- for ( const marker of markers ) {
- consumable.add( selection, 'addMarker:' + marker.name );
- }
- for ( const key of selection.getAttributeKeys() ) {
- consumable.add( selection, 'attribute:' + key );
- }
- return consumable;
- }
- /**
- * Tests passed `consumable` to check whether given event can be fired and if so, fires it.
- *
- * @private
- * @fires insert
- * @fires attribute
- * @param {String} type Event type.
- * @param {Object} data Event data.
- */
- _testAndFire( type, data ) {
- if ( !this.conversionApi.consumable.test( data.item, type ) ) {
- // Do not fire event if the item was consumed.
- return;
- }
- this.fire( getEventName( type, data ), data, this.conversionApi );
- }
- /**
- * Clears the conversion API object.
- *
- * @private
- */
- _clearConversionApi() {
- delete this.conversionApi.writer;
- delete this.conversionApi.consumable;
- }
- /**
- * Internal method for converting element insertion. It will fire events for the inserted element and events for its attributes.
- *
- * @private
- * @fires insert
- * @fires attribute
- * @param {Object} data Event data.
- */
- _convertInsertWithAttributes( data ) {
- this._testAndFire( 'insert', data );
- // Fire a separate addAttribute event for each attribute that was set on inserted items.
- // This is important because most attributes converters will listen only to add/change/removeAttribute events.
- // If we would not add this part, attributes on inserted nodes would not be converted.
- for ( const key of data.item.getAttributeKeys() ) {
- data.attributeKey = key;
- data.attributeOldValue = null;
- data.attributeNewValue = data.item.getAttribute( key );
- this._testAndFire( `attribute:${ key }`, data );
- }
- }
- /**
- * Returns differ changes together with added "reconvert" type changes for {@link #reconvertElement}. These are defined by
- * a the `triggerBy()` configuration for the
- * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} conversion helper.
- *
- * This method will remove every mapped insert or remove change with a single "reconvert" change.
- *
- * For instance: Having a `triggerBy()` configuration defined for the `<complex>` element that issues this element reconversion on
- * `foo` and `bar` attributes change, and a set of changes for this element:
- *
- * const differChanges = [
- * { type: 'attribute', attributeKey: 'foo', ... },
- * { type: 'attribute', attributeKey: 'bar', ... },
- * { type: 'attribute', attributeKey: 'baz', ... }
- * ];
- *
- * This method will return:
- *
- * const updatedChanges = [
- * { type: 'reconvert', element: complexElementInstance },
- * { type: 'attribute', attributeKey: 'baz', ... }
- * ];
- *
- * In the example above, the `'baz'` attribute change will fire an {@link #event:attribute attribute event}
- *
- * @param {module:engine/model/differ~Differ} differ The differ object with buffered changes.
- * @returns {Array.<Object>} Updated set of changes.
- * @private
- */
- _mapChangesWithAutomaticReconversion( differ ) {
- const itemsToReconvert = new Set();
- const updated = [];
- for ( const entry of differ.getChanges() ) {
- const position = entry.position || entry.range.start;
- // Cached parent - just in case. See https://github.com/ckeditor/ckeditor5/issues/6579.
- const positionParent = position.parent;
- const textNode = Object(_model_position__WEBPACK_IMPORTED_MODULE_2__["getTextNodeAtPosition"])( position, positionParent );
- // Reconversion is done only on elements so skip text changes.
- if ( textNode ) {
- updated.push( entry );
- continue;
- }
- const element = entry.type === 'attribute' ? Object(_model_position__WEBPACK_IMPORTED_MODULE_2__["getNodeAfterPosition"])( position, positionParent, null ) : positionParent;
- // Case of text node set directly in root. For now used only in tests but can be possible when enabled in paragraph-like roots.
- // See: https://github.com/ckeditor/ckeditor5/issues/762.
- if ( element.is( '$text' ) ) {
- updated.push( entry );
- continue;
- }
- let eventName;
- if ( entry.type === 'attribute' ) {
- eventName = `attribute:${ entry.attributeKey }:${ element.name }`;
- } else {
- eventName = `${ entry.type }:${ entry.name }`;
- }
- if ( this._isReconvertTriggerEvent( eventName, element.name ) ) {
- if ( itemsToReconvert.has( element ) ) {
- // Element is already reconverted, so skip this change.
- continue;
- }
- itemsToReconvert.add( element );
- // Add special "reconvert" change.
- updated.push( { type: 'reconvert', element } );
- } else {
- updated.push( entry );
- }
- }
- return updated;
- }
- /**
- * Checks if the resulting change should trigger element reconversion.
- *
- * These are defined by a `triggerBy()` configuration for the
- * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} conversion helper.
- *
- * @private
- * @param {String} eventName The event name to check.
- * @param {String} elementName The element name to check.
- * @returns {Boolean}
- */
- _isReconvertTriggerEvent( eventName, elementName ) {
- return this._reconversionEventsMapping.get( eventName ) === elementName;
- }
- /**
- * Fired for inserted nodes.
- *
- * `insert` is a namespace for a class of events. Names of actually called events follow this pattern:
- * `insert:name`. `name` is either `'$text'`, when {@link module:engine/model/text~Text a text node} has been inserted,
- * or {@link module:engine/model/element~Element#name name} of inserted element.
- *
- * This way listeners can either listen to a general `insert` event or specific event (for example `insert:paragraph`).
- *
- * @event insert
- * @param {Object} data Additional information about the change.
- * @param {module:engine/model/item~Item} data.item Inserted item.
- * @param {module:engine/model/range~Range} data.range Range spanning over inserted item.
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
- * to be used by callback, passed in `DowncastDispatcher` constructor.
- */
- /**
- * Fired for removed nodes.
- *
- * `remove` is a namespace for a class of events. Names of actually called events follow this pattern:
- * `remove:name`. `name` is either `'$text'`, when {@link module:engine/model/text~Text a text node} has been removed,
- * or the {@link module:engine/model/element~Element#name name} of removed element.
- *
- * This way listeners can either listen to a general `remove` event or specific event (for example `remove:paragraph`).
- *
- * @event remove
- * @param {Object} data Additional information about the change.
- * @param {module:engine/model/position~Position} data.position Position from which the node has been removed.
- * @param {Number} data.length Offset size of the removed node.
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
- * to be used by callback, passed in `DowncastDispatcher` constructor.
- */
- /**
- * Fired in the following cases:
- *
- * * when an attribute has been added, changed, or removed from a node,
- * * when a node with an attribute is inserted,
- * * when collapsed model selection attribute is converted.
- *
- * `attribute` is a namespace for a class of events. Names of actually called events follow this pattern:
- * `attribute:attributeKey:name`. `attributeKey` is the key of added/changed/removed attribute.
- * `name` is either `'$text'` if change was on {@link module:engine/model/text~Text a text node},
- * or the {@link module:engine/model/element~Element#name name} of element which attribute has changed.
- *
- * This way listeners can either listen to a general `attribute:bold` event or specific event (for example `attribute:src:image`).
- *
- * @event attribute
- * @param {Object} data Additional information about the change.
- * @param {module:engine/model/item~Item|module:engine/model/documentselection~DocumentSelection} data.item Changed item
- * or converted selection.
- * @param {module:engine/model/range~Range} data.range Range spanning over changed item or selection range.
- * @param {String} data.attributeKey Attribute key.
- * @param {*} data.attributeOldValue Attribute value before the change. This is `null` when selection attribute is converted.
- * @param {*} data.attributeNewValue New attribute value.
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
- * to be used by callback, passed in `DowncastDispatcher` constructor.
- */
- /**
- * Fired for {@link module:engine/model/selection~Selection selection} changes.
- *
- * @event selection
- * @param {module:engine/model/selection~Selection} selection Selection that is converted.
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
- * to be used by callback, passed in `DowncastDispatcher` constructor.
- */
- /**
- * Fired when a new marker is added to the model. Also fired when a collapsed model selection that is inside a marker is converted.
- *
- * `addMarker` is a namespace for a class of events. Names of actually called events follow this pattern:
- * `addMarker:markerName`. By specifying certain marker names, you can make the events even more gradual. For example,
- * if markers are named `foo:abc`, `foo:bar`, then it is possible to listen to `addMarker:foo` or `addMarker:foo:abc` and
- * `addMarker:foo:bar` events.
- *
- * If the marker range is not collapsed:
- *
- * * the event is fired for each item in the marker range one by one,
- * * `conversionApi.consumable` includes each item of the marker range and the consumable value is same as the event name.
- *
- * If the marker range is collapsed:
- *
- * * there is only one event,
- * * `conversionApi.consumable` includes marker range with the event name.
- *
- * If the selection inside a marker is converted:
- *
- * * there is only one event,
- * * `conversionApi.consumable` includes the selection instance with the event name.
- *
- * @event addMarker
- * @param {Object} data Additional information about the change.
- * @param {module:engine/model/item~Item|module:engine/model/selection~Selection} data.item Item inside the new marker or
- * the selection that is being converted.
- * @param {module:engine/model/range~Range} [data.range] Range spanning over converted item. Available only in marker conversion, if
- * the marker range was not collapsed.
- * @param {module:engine/model/range~Range} data.markerRange Marker range.
- * @param {String} data.markerName Marker name.
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
- * to be used by callback, passed in `DowncastDispatcher` constructor.
- */
- /**
- * Fired when a marker is removed from the model.
- *
- * `removeMarker` is a namespace for a class of events. Names of actually called events follow this pattern:
- * `removeMarker:markerName`. By specifying certain marker names, you can make the events even more gradual. For example,
- * if markers are named `foo:abc`, `foo:bar`, then it is possible to listen to `removeMarker:foo` or `removeMarker:foo:abc` and
- * `removeMarker:foo:bar` events.
- *
- * @event removeMarker
- * @param {Object} data Additional information about the change.
- * @param {module:engine/model/range~Range} data.markerRange Marker range.
- * @param {String} data.markerName Marker name.
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
- * to be used by callback, passed in `DowncastDispatcher` constructor.
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_4__["default"])( DowncastDispatcher, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
- // Helper function, checks whether change of `marker` at `modelPosition` should be converted. Marker changes are not
- // converted if they happen inside an element with custom conversion method.
- //
- // @param {module:engine/model/position~Position} modelPosition
- // @param {module:engine/model/markercollection~Marker} marker
- // @param {module:engine/conversion/mapper~Mapper} mapper
- // @returns {Boolean}
- function shouldMarkerChangeBeConverted( modelPosition, marker, mapper ) {
- const range = marker.getRange();
- const ancestors = Array.from( modelPosition.getAncestors() );
- ancestors.shift(); // Remove root element. It cannot be passed to `model.Range#containsItem`.
- ancestors.reverse();
- const hasCustomHandling = ancestors.some( element => {
- if ( range.containsItem( element ) ) {
- const viewElement = mapper.toViewElement( element );
- return !!viewElement.getCustomProperty( 'addHighlight' );
- }
- } );
- return !hasCustomHandling;
- }
- function getEventName( type, data ) {
- const name = data.item.name || '$text';
- return `${ type }:${ name }`;
- }
- function walkerValueToEventData( value ) {
- const item = value.item;
- const itemRange = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( value.previousPosition, value.length );
- return {
- item,
- range: itemRange
- };
- }
- function elementOrTextProxyToView( item, mapper ) {
- if ( item.is( 'textProxy' ) ) {
- const mappedPosition = mapper.toViewPosition( _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( item ) );
- const positionParent = mappedPosition.parent;
- return positionParent.is( '$text' ) ? positionParent : null;
- }
- return mapper.toViewElement( item );
- }
- /**
- * Conversion interface that is registered for given {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}
- * and is passed as one of parameters when {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher dispatcher}
- * fires its events.
- *
- * @interface module:engine/conversion/downcastdispatcher~DowncastConversionApi
- */
- /**
- * The {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} instance.
- *
- * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher} #dispatcher
- */
- /**
- * Stores the information about what parts of a processed model item are still waiting to be handled. After a piece of a model item was
- * converted, an appropriate consumable value should be {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.
- *
- * @member {module:engine/conversion/modelconsumable~ModelConsumable} #consumable
- */
- /**
- * The {@link module:engine/conversion/mapper~Mapper} instance.
- *
- * @member {module:engine/conversion/mapper~Mapper} #mapper
- */
- /**
- * The {@link module:engine/model/schema~Schema} instance set for the model that is downcast.
- *
- * @member {module:engine/model/schema~Schema} #schema
- */
- /**
- * The {@link module:engine/view/downcastwriter~DowncastWriter} instance used to manipulate the data during conversion.
- *
- * @member {module:engine/view/downcastwriter~DowncastWriter} #writer
- */
- /**
- * An object with an additional configuration which can be used during the conversion process. Available only for data downcast conversion.
- *
- * @member {Object} #options
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js ***!
- \***********************************************************************************/
- /*! exports provided: default, insertText, remove, createViewElementFromHighlightDescriptor, convertRangeSelection, convertCollapsedSelection, clearAttributes, wrap, insertElement, insertUIElement */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DowncastHelpers; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertText", function() { return insertText; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return remove; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createViewElementFromHighlightDescriptor", function() { return createViewElementFromHighlightDescriptor; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertRangeSelection", function() { return convertRangeSelection; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertCollapsedSelection", function() { return convertCollapsedSelection; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearAttributes", function() { return clearAttributes; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return wrap; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertElement", function() { return insertElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertUIElement", function() { return insertUIElement; });
- /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _model_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
- /* harmony import */ var _model_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
- /* harmony import */ var _view_attributeelement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../view/attributeelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js");
- /* harmony import */ var _model_documentselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../model/documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
- /* harmony import */ var _conversionhelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./conversionhelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * Contains downcast (model-to-view) converters for {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}.
- *
- * @module engine/conversion/downcasthelpers
- */
- /**
- * Downcast conversion helper functions.
- *
- * @extends module:engine/conversion/conversionhelpers~ConversionHelpers
- */
- class DowncastHelpers extends _conversionhelpers__WEBPACK_IMPORTED_MODULE_5__["default"] {
- /**
- * Model element to view element conversion helper.
- *
- * This conversion results in creating a view element. For example, model `<paragraph>Foo</paragraph>` becomes `<p>Foo</p>` in the view.
- *
- * editor.conversion.for( 'downcast' ).elementToElement( {
- * model: 'paragraph',
- * view: 'p'
- * } );
- *
- * editor.conversion.for( 'downcast' ).elementToElement( {
- * model: 'paragraph',
- * view: 'div',
- * converterPriority: 'high'
- * } );
- *
- * editor.conversion.for( 'downcast' ).elementToElement( {
- * model: 'fancyParagraph',
- * view: {
- * name: 'p',
- * classes: 'fancy'
- * }
- * } );
- *
- * editor.conversion.for( 'downcast' ).elementToElement( {
- * model: 'heading',
- * view: ( modelElement, conversionApi ) => {
- * const { writer } = conversionApi;
- *
- * return writer.createContainerElement( 'h' + modelElement.getAttribute( 'level' ) );
- * }
- * } );
- *
- * The element-to-element conversion supports the reconversion mechanism. This is helpful in the conversion to complex view structures
- * where multiple atomic element-to-element and attribute-to-attribute or attribute-to-element could be used. By specifying
- * `triggerBy()` events you can trigger reconverting the model to full view tree structures at once.
- *
- * editor.conversion.for( 'downcast' ).elementToElement( {
- * model: 'complex',
- * view: ( modelElement, conversionApi ) => createComplexViewFromModel( modelElement, conversionApi ),
- * triggerBy: {
- * attributes: [ 'foo', 'bar' ],
- * children: [ 'slot' ]
- * }
- * } );
- *
- * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
- * to the conversion process.
- *
- * You can read more about element-to-element conversion in the
- * {@glink framework/guides/deep-dive/conversion/custom-element-conversion Custom element conversion} guide.
- *
- * @method #elementToElement
- * @param {Object} config Conversion configuration.
- * @param {String} config.model The name of the model element to convert.
- * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
- * that takes the model element and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
- * as parameters and returns a view container element.
- * @param {Object} [config.triggerBy] Reconversion triggers. At least one trigger must be defined.
- * @param {Array.<String>} config.triggerBy.attributes The name of the element's attributes whose change will trigger element
- * reconversion.
- * @param {Array.<String>} config.triggerBy.children The name of direct children whose adding or removing will trigger element
- * reconversion.
- * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
- */
- elementToElement( config ) {
- return this.add( downcastElementToElement( config ) );
- }
- /**
- * Model attribute to view element conversion helper.
- *
- * This conversion results in wrapping view nodes with a view attribute element. For example, a model text node with
- * `"Foo"` as data and the `bold` attribute becomes `<strong>Foo</strong>` in the view.
- *
- * editor.conversion.for( 'downcast' ).attributeToElement( {
- * model: 'bold',
- * view: 'strong'
- * } );
- *
- * editor.conversion.for( 'downcast' ).attributeToElement( {
- * model: 'bold',
- * view: 'b',
- * converterPriority: 'high'
- * } );
- *
- * editor.conversion.for( 'downcast' ).attributeToElement( {
- * model: 'invert',
- * view: {
- * name: 'span',
- * classes: [ 'font-light', 'bg-dark' ]
- * }
- * } );
- *
- * editor.conversion.for( 'downcast' ).attributeToElement( {
- * model: {
- * key: 'fontSize',
- * values: [ 'big', 'small' ]
- * },
- * view: {
- * big: {
- * name: 'span',
- * styles: {
- * 'font-size': '1.2em'
- * }
- * },
- * small: {
- * name: 'span',
- * styles: {
- * 'font-size': '0.8em'
- * }
- * }
- * }
- * } );
- *
- * editor.conversion.for( 'downcast' ).attributeToElement( {
- * model: 'bold',
- * view: ( modelAttributeValue, conversionApi ) => {
- * const { writer } = conversionApi;
- *
- * return writer.createAttributeElement( 'span', {
- * style: 'font-weight:' + modelAttributeValue
- * } );
- * }
- * } );
- *
- * editor.conversion.for( 'downcast' ).attributeToElement( {
- * model: {
- * key: 'color',
- * name: '$text'
- * },
- * view: ( modelAttributeValue, conversionApi ) => {
- * const { writer } = conversionApi;
- *
- * return writer.createAttributeElement( 'span', {
- * style: 'color:' + modelAttributeValue
- * } );
- * }
- * } );
- *
- * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
- * to the conversion process.
- *
- * @method #attributeToElement
- * @param {Object} config Conversion configuration.
- * @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array
- * of `String`s with possible values if the model attribute is an enumerable.
- * @param {module:engine/view/elementdefinition~ElementDefinition|Function|Object} config.view A view element definition or a function
- * that takes the model attribute value and
- * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as parameters and returns a view
- * attribute element. If `config.model.values` is given, `config.view` should be an object assigning values from `config.model.values`
- * to view element definitions or functions.
- * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
- */
- attributeToElement( config ) {
- return this.add( downcastAttributeToElement( config ) );
- }
- /**
- * Model attribute to view attribute conversion helper.
- *
- * This conversion results in adding an attribute to a view node, basing on an attribute from a model node. For example,
- * `<image src='foo.jpg'></image>` is converted to `<img src='foo.jpg'></img>`.
- *
- * editor.conversion.for( 'downcast' ).attributeToAttribute( {
- * model: 'source',
- * view: 'src'
- * } );
- *
- * editor.conversion.for( 'downcast' ).attributeToAttribute( {
- * model: 'source',
- * view: 'href',
- * converterPriority: 'high'
- * } );
- *
- * editor.conversion.for( 'downcast' ).attributeToAttribute( {
- * model: {
- * name: 'image',
- * key: 'source'
- * },
- * view: 'src'
- * } );
- *
- * editor.conversion.for( 'downcast' ).attributeToAttribute( {
- * model: {
- * name: 'styled',
- * values: [ 'dark', 'light' ]
- * },
- * view: {
- * dark: {
- * key: 'class',
- * value: [ 'styled', 'styled-dark' ]
- * },
- * light: {
- * key: 'class',
- * value: [ 'styled', 'styled-light' ]
- * }
- * }
- * } );
- *
- * editor.conversion.for( 'downcast' ).attributeToAttribute( {
- * model: 'styled',
- * view: modelAttributeValue => ( {
- * key: 'class',
- * value: 'styled-' + modelAttributeValue
- * } )
- * } );
- *
- * **Note**: Downcasting to a style property requires providing `value` as an object:
- *
- * editor.conversion.for( 'downcast' ).attributeToAttribute( {
- * model: 'lineHeight',
- * view: modelAttributeValue => ( {
- * key: 'style',
- * value: {
- * 'line-height': modelAttributeValue,
- * 'border-bottom': '1px dotted #ba2'
- * }
- * } )
- * } );
- *
- * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
- * to the conversion process.
- *
- * @method #attributeToAttribute
- * @param {Object} config Conversion configuration.
- * @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing
- * the attribute key, possible values and, optionally, an element name to convert from.
- * @param {String|Object|Function} config.view A view attribute key, or a `{ key, value }` object or a function that takes
- * the model attribute value and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
- * as parameters and returns a `{ key, value }` object. If `key` is `'class'`, `value` can be a `String` or an
- * array of `String`s. If `key` is `'style'`, `value` is an object with key-value pairs. In other cases, `value` is a `String`.
- * If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to
- * `{ key, value }` objects or a functions.
- * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
- */
- attributeToAttribute( config ) {
- return this.add( downcastAttributeToAttribute( config ) );
- }
- /**
- * Model marker to view element conversion helper.
- *
- * **Note**: This method should be used only for editing downcast. For data downcast, use
- * {@link #markerToData `#markerToData()`} that produces valid HTML data.
- *
- * This conversion results in creating a view element on the boundaries of the converted marker. If the converted marker
- * is collapsed, only one element is created. For example, model marker set like this: `<paragraph>F[oo b]ar</paragraph>`
- * becomes `<p>F<span data-marker="search"></span>oo b<span data-marker="search"></span>ar</p>` in the view.
- *
- * editor.conversion.for( 'editingDowncast' ).markerToElement( {
- * model: 'search',
- * view: 'marker-search'
- * } );
- *
- * editor.conversion.for( 'editingDowncast' ).markerToElement( {
- * model: 'search',
- * view: 'search-result',
- * converterPriority: 'high'
- * } );
- *
- * editor.conversion.for( 'editingDowncast' ).markerToElement( {
- * model: 'search',
- * view: {
- * name: 'span',
- * attributes: {
- * 'data-marker': 'search'
- * }
- * }
- * } );
- *
- * editor.conversion.for( 'editingDowncast' ).markerToElement( {
- * model: 'search',
- * view: ( markerData, conversionApi ) => {
- * const { writer } = conversionApi;
- *
- * return writer.createUIElement( 'span', {
- * 'data-marker': 'search',
- * 'data-start': markerData.isOpening
- * } );
- * }
- * } );
- *
- * If a function is passed as the `config.view` parameter, it will be used to generate both boundary elements. The function
- * receives the `data` object and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
- * as a parameters and should return an instance of the
- * {@link module:engine/view/uielement~UIElement view UI element}. The `data` object and
- * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi `conversionApi`} are passed from
- * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}. Additionally,
- * the `data.isOpening` parameter is passed, which is set to `true` for the marker start boundary element, and `false` to
- * the marker end boundary element.
- *
- * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
- * to the conversion process.
- *
- * @method #markerToElement
- * @param {Object} config Conversion configuration.
- * @param {String} config.model The name of the model marker (or model marker group) to convert.
- * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function that
- * takes the model marker data and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
- * as a parameters and returns a view UI element.
- * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
- */
- markerToElement( config ) {
- return this.add( downcastMarkerToElement( config ) );
- }
- /**
- * Model marker to highlight conversion helper.
- *
- * This conversion results in creating a highlight on view nodes. For this kind of conversion,
- * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} should be provided.
- *
- * For text nodes, a `<span>` {@link module:engine/view/attributeelement~AttributeElement} is created and it wraps all text nodes
- * in the converted marker range. For example, a model marker set like this: `<paragraph>F[oo b]ar</paragraph>` becomes
- * `<p>F<span class="comment">oo b</span>ar</p>` in the view.
- *
- * {@link module:engine/view/containerelement~ContainerElement} may provide a custom way of handling highlight. Most often,
- * the element itself is given classes and attributes described in the highlight descriptor (instead of being wrapped in `<span>`).
- * For example, a model marker set like this: `[<image src="foo.jpg"></image>]` becomes `<img src="foo.jpg" class="comment"></img>`
- * in the view.
- *
- * For container elements, the conversion is two-step. While the converter processes the highlight descriptor and passes it
- * to a container element, it is the container element instance itself that applies values from the highlight descriptor.
- * So, in a sense, the converter takes care of stating what should be applied on what, while the element decides how to apply that.
- *
- * editor.conversion.for( 'downcast' ).markerToHighlight( { model: 'comment', view: { classes: 'comment' } } );
- *
- * editor.conversion.for( 'downcast' ).markerToHighlight( {
- * model: 'comment',
- * view: { classes: 'comment' },
- * converterPriority: 'high'
- * } );
- *
- * editor.conversion.for( 'downcast' ).markerToHighlight( {
- * model: 'comment',
- * view: ( data, conversionApi ) => {
- * // Assuming that the marker name is in a form of comment:commentType:commentId.
- * const [ , commentType, commentId ] = data.markerName.split( ':' );
- *
- * return {
- * classes: [ 'comment', 'comment-' + commentType ],
- * attributes: { 'data-comment-id': commentId }
- * };
- * }
- * } );
- *
- * If a function is passed as the `config.view` parameter, it will be used to generate the highlight descriptor. The function
- * receives the `data` object and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
- * as a parameters and should return a
- * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor}.
- * The `data` object properties are passed from {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}.
- *
- * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
- * to the conversion process.
- *
- * @method #markerToHighlight
- * @param {Object} config Conversion configuration.
- * @param {String} config.model The name of the model marker (or model marker group) to convert.
- * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} config.view A highlight descriptor
- * that will be used for highlighting or a function that takes the model marker data and
- * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as a parameters
- * and returns a highlight descriptor.
- * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
- */
- markerToHighlight( config ) {
- return this.add( downcastMarkerToHighlight( config ) );
- }
- /**
- * Model marker converter for data downcast.
- *
- * This conversion creates a representation for model marker boundaries in the view:
- *
- * * If the marker boundary is before or after a model element, a view attribute is set on a corresponding view element.
- * * In other cases, a view element with the specified tag name is inserted at corresponding view position.
- *
- * Typically, marker names use the `group:uniqueId:otherData` convention. For example: `comment:e34zfk9k2n459df53sjl34:zx32c`.
- * The default configuration for this conversion is that the first part is the `group` part and the rest of
- * the marker name becomes the `name` part.
- *
- * Tag and attribute names and values are generated from the marker name:
- *
- * * Templates for attributes are `data-[group]-start-before="[name]"`, `data-[group]-start-after="[name]"`,
- * `data-[group]-end-before="[name]"` and `data-[group]-end-after="[name]"`.
- * * Templates for view elements are `<[group]-start name="[name]">` and `<[group]-end name="[name]">`.
- *
- * Attributes mark whether the given marker's start or end boundary is before or after the given element.
- * Attributes `data-[group]-start-before` and `data-[group]-end-after` are favored.
- * The other two are used when the former two cannot be used.
- *
- * The conversion configuration can take a function that will generate different group and name parts.
- * If such function is set as the `config.view` parameter, it is passed a marker name and it is expected to return an object with two
- * properties: `group` and `name`. If the function returns a falsy value, the conversion will not take place.
- *
- * Basic usage:
- *
- * // Using the default conversion.
- * // In this case, all markers whose name starts with 'comment:' will be converted.
- * // The `group` parameter will be set to `comment`.
- * // The `name` parameter will be the rest of the marker name (without `:`).
- * editor.conversion.for( 'dataDowncast' ).markerToData( {
- * model: 'comment'
- * } );
- *
- * An example of a view that may be generated by this conversion (assuming a marker with the name `comment:commentId:uid` marked
- * by `[]`):
- *
- * // Model:
- * <paragraph>Foo[bar</paragraph>
- * <image src="abc.jpg"></image>]
- *
- * // View:
- * <p>Foo<comment-start name="commentId:uid"></comment-start>bar</p>
- * <figure data-comment-end-after="commentId:uid" class="image"><img src="abc.jpg" /></figure>
- *
- * In the example above, the comment starts before "bar" and ends after the image.
- *
- * If the `name` part is empty, the following view may be generated:
- *
- * <p>Foo <myMarker-start></myMarker-start>bar</p>
- * <figure data-myMarker-end-after="" class="image"><img src="abc.jpg" /></figure>
- *
- * **Note:** A situation where some markers have the `name` part and some do not have it is incorrect and should be avoided.
- *
- * Examples where `data-group-start-after` and `data-group-end-before` are used:
- *
- * // Model:
- * <blockQuote>[]<paragraph>Foo</paragraph></blockQuote>
- *
- * // View:
- * <blockquote><p data-group-end-before="name" data-group-start-before="name">Foo</p></blockquote>
- *
- * Similarly, when a marker is collapsed after the last element:
- *
- * // Model:
- * <blockQuote><paragraph>Foo</paragraph>[]</blockQuote>
- *
- * // View:
- * <blockquote><p data-group-end-after="name" data-group-start-after="name">Foo</p></blockquote>
- *
- * When there are multiple markers from the same group stored in the same attribute of the same element, their
- * name parts are put together in the attribute value, for example: `data-group-start-before="name1,name2,name3"`.
- *
- * Other examples of usage:
- *
- * // Using a custom function which is the same as the default conversion:
- * editor.conversion.for( 'dataDowncast' ).markerToData( {
- * model: 'comment'
- * view: markerName => ( {
- * group: 'comment',
- * name: markerName.substr( 8 ) // Removes 'comment:' part.
- * } )
- * } );
- *
- * // Using the converter priority:
- * editor.conversion.for( 'dataDowncast' ).markerToData( {
- * model: 'comment'
- * view: markerName => ( {
- * group: 'comment',
- * name: markerName.substr( 8 ) // Removes 'comment:' part.
- * } ),
- * converterPriority: 'high'
- * } );
- *
- * This kind of conversion is useful for saving data into the database, so it should be used in the data conversion pipeline.
- *
- * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
- * to the conversion process.
- *
- * @method #markerToData
- * @param {Object} config Conversion configuration.
- * @param {String} config.model The name of the model marker (or model marker group) to convert.
- * @param {Function} [config.view] A function that takes the model marker name and
- * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as a parameters
- * and returns an object with the `group` and `name` properties.
- * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
- */
- markerToData( config ) {
- return this.add( downcastMarkerToData( config ) );
- }
- }
- /**
- * Function factory that creates a default downcast converter for text insertion changes.
- *
- * The converter automatically consumes the corresponding value from the consumables list and stops the event (see
- * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
- *
- * modelDispatcher.on( 'insert:$text', insertText() );
- *
- * @returns {Function} Insert text event converter.
- */
- function insertText() {
- return ( evt, data, conversionApi ) => {
- if ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {
- return;
- }
- const viewWriter = conversionApi.writer;
- const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
- const viewText = viewWriter.createText( data.item.data );
- viewWriter.insert( viewPosition, viewText );
- };
- }
- /**
- * Function factory that creates a default downcast converter for node remove changes.
- *
- * modelDispatcher.on( 'remove', remove() );
- *
- * @returns {Function} Remove event converter.
- */
- function remove() {
- return ( evt, data, conversionApi ) => {
- // Find view range start position by mapping model position at which the remove happened.
- const viewStart = conversionApi.mapper.toViewPosition( data.position );
- const modelEnd = data.position.getShiftedBy( data.length );
- const viewEnd = conversionApi.mapper.toViewPosition( modelEnd, { isPhantom: true } );
- const viewRange = conversionApi.writer.createRange( viewStart, viewEnd );
- // Trim the range to remove in case some UI elements are on the view range boundaries.
- const removed = conversionApi.writer.remove( viewRange.getTrimmed() );
- // After the range is removed, unbind all view elements from the model.
- // Range inside view document fragment is used to unbind deeply.
- for ( const child of conversionApi.writer.createRangeIn( removed ).getItems() ) {
- conversionApi.mapper.unbindViewElement( child );
- }
- };
- }
- /**
- * Creates a `<span>` {@link module:engine/view/attributeelement~AttributeElement view attribute element} from the information
- * provided by the {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor} object. If a priority
- * is not provided in the descriptor, the default priority will be used.
- *
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer
- * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
- * @returns {module:engine/view/attributeelement~AttributeElement}
- */
- function createViewElementFromHighlightDescriptor( writer, descriptor ) {
- const viewElement = writer.createAttributeElement( 'span', descriptor.attributes );
- if ( descriptor.classes ) {
- viewElement._addClass( descriptor.classes );
- }
- if ( typeof descriptor.priority === 'number' ) {
- viewElement._priority = descriptor.priority;
- }
- viewElement._id = descriptor.id;
- return viewElement;
- }
- /**
- * Function factory that creates a converter which converts a non-collapsed {@link module:engine/model/selection~Selection model selection}
- * to a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate
- * value from the `consumable` object and maps model positions from the selection to view positions.
- *
- * modelDispatcher.on( 'selection', convertRangeSelection() );
- *
- * @returns {Function} Selection converter.
- */
- function convertRangeSelection() {
- return ( evt, data, conversionApi ) => {
- const selection = data.selection;
- if ( selection.isCollapsed ) {
- return;
- }
- if ( !conversionApi.consumable.consume( selection, 'selection' ) ) {
- return;
- }
- const viewRanges = [];
- for ( const range of selection.getRanges() ) {
- const viewRange = conversionApi.mapper.toViewRange( range );
- viewRanges.push( viewRange );
- }
- conversionApi.writer.setSelection( viewRanges, { backward: selection.isBackward } );
- };
- }
- /**
- * Function factory that creates a converter which converts a collapsed {@link module:engine/model/selection~Selection model selection} to
- * a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate
- * value from the `consumable` object, maps the model selection position to the view position and breaks
- * {@link module:engine/view/attributeelement~AttributeElement attribute elements} at the selection position.
- *
- * modelDispatcher.on( 'selection', convertCollapsedSelection() );
- *
- * An example of the view state before and after converting the collapsed selection:
- *
- * <p><strong>f^oo<strong>bar</p>
- * -> <p><strong>f</strong>^<strong>oo</strong>bar</p>
- *
- * By breaking attribute elements like `<strong>`, the selection is in a correct element. Then, when the selection attribute is
- * converted, broken attributes might be merged again, or the position where the selection is may be wrapped
- * with different, appropriate attribute elements.
- *
- * See also {@link module:engine/conversion/downcasthelpers~clearAttributes} which does a clean-up
- * by merging attributes.
- *
- * @returns {Function} Selection converter.
- */
- function convertCollapsedSelection() {
- return ( evt, data, conversionApi ) => {
- const selection = data.selection;
- if ( !selection.isCollapsed ) {
- return;
- }
- if ( !conversionApi.consumable.consume( selection, 'selection' ) ) {
- return;
- }
- const viewWriter = conversionApi.writer;
- const modelPosition = selection.getFirstPosition();
- const viewPosition = conversionApi.mapper.toViewPosition( modelPosition );
- const brokenPosition = viewWriter.breakAttributes( viewPosition );
- viewWriter.setSelection( brokenPosition );
- };
- }
- /**
- * Function factory that creates a converter which clears artifacts after the previous
- * {@link module:engine/model/selection~Selection model selection} conversion. It removes all empty
- * {@link module:engine/view/attributeelement~AttributeElement view attribute elements} and merges sibling attributes at all start and end
- * positions of all ranges.
- *
- * <p><strong>^</strong></p>
- * -> <p>^</p>
- *
- * <p><strong>foo</strong>^<strong>bar</strong>bar</p>
- * -> <p><strong>foo^bar<strong>bar</p>
- *
- * <p><strong>foo</strong><em>^</em><strong>bar</strong>bar</p>
- * -> <p><strong>foo^bar<strong>bar</p>
- *
- * This listener should be assigned before any converter for the new selection:
- *
- * modelDispatcher.on( 'selection', clearAttributes() );
- *
- * See {@link module:engine/conversion/downcasthelpers~convertCollapsedSelection}
- * which does the opposite by breaking attributes in the selection position.
- *
- * @returns {Function} Selection converter.
- */
- function clearAttributes() {
- return ( evt, data, conversionApi ) => {
- const viewWriter = conversionApi.writer;
- const viewSelection = viewWriter.document.selection;
- for ( const range of viewSelection.getRanges() ) {
- // Not collapsed selection should not have artifacts.
- if ( range.isCollapsed ) {
- // Position might be in the node removed by the view writer.
- if ( range.end.parent.isAttached() ) {
- conversionApi.writer.mergeAttributes( range.start );
- }
- }
- }
- viewWriter.setSelection( null );
- };
- }
- /**
- * Function factory that creates a converter which converts set/change/remove attribute changes from the model to the view.
- * It can also be used to convert selection attributes. In that case, an empty attribute element will be created and the
- * selection will be put inside it.
- *
- * Attributes from the model are converted to a view element that will be wrapping these view nodes that are bound to
- * model elements having the given attribute. This is useful for attributes like `bold` that may be set on text nodes in the model
- * but are represented as an element in the view:
- *
- * [paragraph] MODEL ====> VIEW <p>
- * |- a {bold: true} |- <b>
- * |- b {bold: true} | |- ab
- * |- c |- c
- *
- * Passed `Function` will be provided with the attribute value and then all the parameters of the
- * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute` event}.
- * It is expected that the function returns an {@link module:engine/view/element~Element}.
- * The result of the function will be the wrapping element.
- * When the provided `Function` does not return any element, no conversion will take place.
- *
- * The converter automatically consumes the corresponding value from the consumables list and stops the event (see
- * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
- *
- * modelDispatcher.on( 'attribute:bold', wrap( ( modelAttributeValue, { writer } ) => {
- * return writer.createAttributeElement( 'strong' );
- * } );
- *
- * @protected
- * @param {Function} elementCreator Function returning a view element that will be used for wrapping.
- * @returns {Function} Set/change attribute converter.
- */
- function wrap( elementCreator ) {
- return ( evt, data, conversionApi ) => {
- // Recreate current wrapping node. It will be used to unwrap view range if the attribute value has changed
- // or the attribute was removed.
- const oldViewElement = elementCreator( data.attributeOldValue, conversionApi );
- // Create node to wrap with.
- const newViewElement = elementCreator( data.attributeNewValue, conversionApi );
- if ( !oldViewElement && !newViewElement ) {
- return;
- }
- if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
- return;
- }
- const viewWriter = conversionApi.writer;
- const viewSelection = viewWriter.document.selection;
- if ( data.item instanceof _model_selection__WEBPACK_IMPORTED_MODULE_1__["default"] || data.item instanceof _model_documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
- // Selection attribute conversion.
- viewWriter.wrap( viewSelection.getFirstRange(), newViewElement );
- } else {
- // Node attribute conversion.
- let viewRange = conversionApi.mapper.toViewRange( data.range );
- // First, unwrap the range from current wrapper.
- if ( data.attributeOldValue !== null && oldViewElement ) {
- viewRange = viewWriter.unwrap( viewRange, oldViewElement );
- }
- if ( data.attributeNewValue !== null && newViewElement ) {
- viewWriter.wrap( viewRange, newViewElement );
- }
- }
- };
- }
- /**
- * Function factory that creates a converter which converts node insertion changes from the model to the view.
- * The function passed will be provided with all the parameters of the dispatcher's
- * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert` event}.
- * It is expected that the function returns an {@link module:engine/view/element~Element}.
- * The result of the function will be inserted into the view.
- *
- * The converter automatically consumes the corresponding value from the consumables list, stops the event (see
- * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}) and binds the model and view elements.
- *
- * downcastDispatcher.on(
- * 'insert:myElem',
- * insertElement( ( modelItem, { writer } ) => {
- * const text = writer.createText( 'myText' );
- * const myElem = writer.createElement( 'myElem', { myAttr: 'my-' + modelItem.getAttribute( 'myAttr' ) }, text );
- *
- * // Do something fancy with `myElem` using `modelItem` or other parameters.
- *
- * return myElem;
- * }
- * ) );
- *
- * @protected
- * @param {Function} elementCreator Function returning a view element, which will be inserted.
- * @returns {Function} Insert element event converter.
- */
- function insertElement( elementCreator ) {
- return ( evt, data, conversionApi ) => {
- const viewElement = elementCreator( data.item, conversionApi );
- if ( !viewElement ) {
- return;
- }
- if ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {
- return;
- }
- const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
- conversionApi.mapper.bindElements( data.item, viewElement );
- conversionApi.writer.insert( viewPosition, viewElement );
- };
- }
- /**
- * Function factory that creates a converter which converts marker adding change to the
- * {@link module:engine/view/uielement~UIElement view UI element}.
- *
- * The view UI element that will be added to the view depends on the passed parameter. See {@link ~insertElement}.
- * In case of a non-collapsed range, the UI element will not wrap nodes but separate elements will be placed at the beginning
- * and at the end of the range.
- *
- * This converter binds created UI elements with the marker name using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.
- *
- * @protected
- * @param {module:engine/view/uielement~UIElement|Function} elementCreator A view UI element or a function returning the view element
- * that will be inserted.
- * @returns {Function} Insert element event converter.
- */
- function insertUIElement( elementCreator ) {
- return ( evt, data, conversionApi ) => {
- // Create two view elements. One will be inserted at the beginning of marker, one at the end.
- // If marker is collapsed, only "opening" element will be inserted.
- data.isOpening = true;
- const viewStartElement = elementCreator( data, conversionApi );
- data.isOpening = false;
- const viewEndElement = elementCreator( data, conversionApi );
- if ( !viewStartElement || !viewEndElement ) {
- return;
- }
- const markerRange = data.markerRange;
- // Marker that is collapsed has consumable build differently that non-collapsed one.
- // For more information see `addMarker` event description.
- // If marker's range is collapsed - check if it can be consumed.
- if ( markerRange.isCollapsed && !conversionApi.consumable.consume( markerRange, evt.name ) ) {
- return;
- }
- // If marker's range is not collapsed - consume all items inside.
- for ( const value of markerRange ) {
- if ( !conversionApi.consumable.consume( value.item, evt.name ) ) {
- return;
- }
- }
- const mapper = conversionApi.mapper;
- const viewWriter = conversionApi.writer;
- // Add "opening" element.
- viewWriter.insert( mapper.toViewPosition( markerRange.start ), viewStartElement );
- conversionApi.mapper.bindElementToMarker( viewStartElement, data.markerName );
- // Add "closing" element only if range is not collapsed.
- if ( !markerRange.isCollapsed ) {
- viewWriter.insert( mapper.toViewPosition( markerRange.end ), viewEndElement );
- conversionApi.mapper.bindElementToMarker( viewEndElement, data.markerName );
- }
- evt.stop();
- };
- }
- // Function factory that returns a default downcast converter for removing a {@link module:engine/view/uielement~UIElement UI element}
- // based on marker remove change.
- //
- // This converter unbinds elements from the marker name.
- //
- // @returns {Function} Removed UI element converter.
- function removeUIElement() {
- return ( evt, data, conversionApi ) => {
- const elements = conversionApi.mapper.markerNameToElements( data.markerName );
- if ( !elements ) {
- return;
- }
- for ( const element of elements ) {
- conversionApi.mapper.unbindElementFromMarkerName( element, data.markerName );
- conversionApi.writer.clear( conversionApi.writer.createRangeOn( element ), element );
- }
- conversionApi.writer.clearClonedElementsGroup( data.markerName );
- evt.stop();
- };
- }
- // Function factory that creates a default converter for model markers.
- //
- // See {@link DowncastHelpers#markerToData} for more information what type of view is generated.
- //
- // This converter binds created UI elements and affected view elements with the marker name
- // using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.
- //
- // @returns {Function} Add marker converter.
- function insertMarkerData( viewCreator ) {
- return ( evt, data, conversionApi ) => {
- const viewMarkerData = viewCreator( data.markerName, conversionApi );
- if ( !viewMarkerData ) {
- return;
- }
- const markerRange = data.markerRange;
- if ( !conversionApi.consumable.consume( markerRange, evt.name ) ) {
- return;
- }
- // Adding closing data first to keep the proper order in the view.
- handleMarkerBoundary( markerRange, false, conversionApi, data, viewMarkerData );
- handleMarkerBoundary( markerRange, true, conversionApi, data, viewMarkerData );
- evt.stop();
- };
- }
- // Helper function for `insertMarkerData()` that marks a marker boundary at the beginning or end of given `range`.
- function handleMarkerBoundary( range, isStart, conversionApi, data, viewMarkerData ) {
- const modelPosition = isStart ? range.start : range.end;
- const elementAfter = modelPosition.nodeAfter && modelPosition.nodeAfter.is( 'element' ) ? modelPosition.nodeAfter : null;
- const elementBefore = modelPosition.nodeBefore && modelPosition.nodeBefore.is( 'element' ) ? modelPosition.nodeBefore : null;
- if ( elementAfter || elementBefore ) {
- let modelElement;
- let isBefore;
- // If possible, we want to add `data-group-start-before` and `data-group-end-after` attributes.
- if ( isStart && elementAfter || !isStart && !elementBefore ) {
- // [<elementAfter>...</elementAfter> -> <elementAfter data-group-start-before="...">...</elementAfter>
- // <parent>]<elementAfter> -> <parent><elementAfter data-group-end-before="...">
- modelElement = elementAfter;
- isBefore = true;
- } else {
- // <elementBefore>...</elementBefore>] -> <elementBefore data-group-end-after="...">...</elementBefore>
- // </elementBefore>[</parent> -> </elementBefore data-group-start-after="..."></parent>
- modelElement = elementBefore;
- isBefore = false;
- }
- const viewElement = conversionApi.mapper.toViewElement( modelElement );
- // On rare circumstances, the model element could be not mapped to any view element and that would cause an error.
- // One of those situations is a soft break inside code block.
- if ( viewElement ) {
- insertMarkerAsAttribute( viewElement, isStart, isBefore, conversionApi, data, viewMarkerData );
- return;
- }
- }
- const viewPosition = conversionApi.mapper.toViewPosition( modelPosition );
- insertMarkerAsElement( viewPosition, isStart, conversionApi, data, viewMarkerData );
- }
- // Helper function for `insertMarkerData()` that marks a marker boundary in the view as an attribute on a view element.
- function insertMarkerAsAttribute( viewElement, isStart, isBefore, conversionApi, data, viewMarkerData ) {
- const attributeName = `data-${ viewMarkerData.group }-${ isStart ? 'start' : 'end' }-${ isBefore ? 'before' : 'after' }`;
- const markerNames = viewElement.hasAttribute( attributeName ) ? viewElement.getAttribute( attributeName ).split( ',' ) : [];
- // Adding marker name at the beginning to have the same order in the attribute as there is with marker elements.
- markerNames.unshift( viewMarkerData.name );
- conversionApi.writer.setAttribute( attributeName, markerNames.join( ',' ), viewElement );
- conversionApi.mapper.bindElementToMarker( viewElement, data.markerName );
- }
- // Helper function for `insertMarkerData()` that marks a marker boundary in the view as a separate view ui element.
- function insertMarkerAsElement( position, isStart, conversionApi, data, viewMarkerData ) {
- const viewElementName = `${ viewMarkerData.group }-${ isStart ? 'start' : 'end' }`;
- const attrs = viewMarkerData.name ? { 'name': viewMarkerData.name } : null;
- const viewElement = conversionApi.writer.createUIElement( viewElementName, attrs );
- conversionApi.writer.insert( position, viewElement );
- conversionApi.mapper.bindElementToMarker( viewElement, data.markerName );
- }
- // Function factory that creates a converter for removing a model marker data added by the {@link #insertMarkerData} converter.
- //
- // @returns {Function} Remove marker converter.
- function removeMarkerData( viewCreator ) {
- return ( evt, data, conversionApi ) => {
- const viewData = viewCreator( data.markerName, conversionApi );
- if ( !viewData ) {
- return;
- }
- const elements = conversionApi.mapper.markerNameToElements( data.markerName );
- if ( !elements ) {
- return;
- }
- for ( const element of elements ) {
- conversionApi.mapper.unbindElementFromMarkerName( element, data.markerName );
- if ( element.is( 'containerElement' ) ) {
- removeMarkerFromAttribute( `data-${ viewData.group }-start-before`, element );
- removeMarkerFromAttribute( `data-${ viewData.group }-start-after`, element );
- removeMarkerFromAttribute( `data-${ viewData.group }-end-before`, element );
- removeMarkerFromAttribute( `data-${ viewData.group }-end-after`, element );
- } else {
- conversionApi.writer.clear( conversionApi.writer.createRangeOn( element ), element );
- }
- }
- conversionApi.writer.clearClonedElementsGroup( data.markerName );
- evt.stop();
- function removeMarkerFromAttribute( attributeName, element ) {
- if ( element.hasAttribute( attributeName ) ) {
- const markerNames = new Set( element.getAttribute( attributeName ).split( ',' ) );
- markerNames.delete( viewData.name );
- if ( markerNames.size == 0 ) {
- conversionApi.writer.removeAttribute( attributeName, element );
- } else {
- conversionApi.writer.setAttribute( attributeName, Array.from( markerNames ).join( ',' ), element );
- }
- }
- }
- };
- }
- // Function factory that creates a converter which converts set/change/remove attribute changes from the model to the view.
- //
- // Attributes from the model are converted to the view element attributes in the view. You may provide a custom function to generate
- // a key-value attribute pair to add/change/remove. If not provided, model attributes will be converted to view element
- // attributes on a one-to-one basis.
- //
- // *Note:** The provided attribute creator should always return the same `key` for a given attribute from the model.
- //
- // The converter automatically consumes the corresponding value from the consumables list and stops the event (see
- // {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
- //
- // modelDispatcher.on( 'attribute:customAttr:myElem', changeAttribute( ( value, data ) => {
- // // Change attribute key from `customAttr` to `class` in the view.
- // const key = 'class';
- // let value = data.attributeNewValue;
- //
- // // Force attribute value to 'empty' if the model element is empty.
- // if ( data.item.childCount === 0 ) {
- // value = 'empty';
- // }
- //
- // // Return the key-value pair.
- // return { key, value };
- // } ) );
- //
- // @param {Function} [attributeCreator] Function returning an object with two properties: `key` and `value`, which
- // represent the attribute key and attribute value to be set on a {@link module:engine/view/element~Element view element}.
- // The function is passed the model attribute value as the first parameter and additional data about the change as the second parameter.
- // @returns {Function} Set/change attribute converter.
- function changeAttribute( attributeCreator ) {
- return ( evt, data, conversionApi ) => {
- const oldAttribute = attributeCreator( data.attributeOldValue, conversionApi );
- const newAttribute = attributeCreator( data.attributeNewValue, conversionApi );
- if ( !oldAttribute && !newAttribute ) {
- return;
- }
- if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
- return;
- }
- const viewElement = conversionApi.mapper.toViewElement( data.item );
- const viewWriter = conversionApi.writer;
- // If model item cannot be mapped to a view element, it means item is not an `Element` instance but a `TextProxy` node.
- // Only elements can have attributes in a view so do not proceed for anything else (#1587).
- if ( !viewElement ) {
- /**
- * This error occurs when a {@link module:engine/model/textproxy~TextProxy text node's} attribute is to be downcasted
- * by {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `Attribute to Attribute converter`}.
- * In most cases it is caused by converters misconfiguration when only "generic" converter is defined:
- *
- * editor.conversion.for( 'downcast' ).attributeToAttribute( {
- * model: 'attribute-name',
- * view: 'attribute-name'
- * } ) );
- *
- * and given attribute is used on text node, for example:
- *
- * model.change( writer => {
- * writer.insertText( 'Foo', { 'attribute-name': 'bar' }, parent, 0 );
- * } );
- *
- * In such cases, to convert the same attribute for both {@link module:engine/model/element~Element}
- * and {@link module:engine/model/textproxy~TextProxy `Text`} nodes, text specific
- * {@link module:engine/conversion/conversion~Conversion#attributeToElement `Attribute to Element converter`}
- * with higher {@link module:utils/priorities~PriorityString priority} must also be defined:
- *
- * editor.conversion.for( 'downcast' ).attributeToElement( {
- * model: {
- * key: 'attribute-name',
- * name: '$text'
- * },
- * view: ( value, { writer } ) => {
- * return writer.createAttributeElement( 'span', { 'attribute-name': value } );
- * },
- * converterPriority: 'high'
- * } ) );
- *
- * @error conversion-attribute-to-attribute-on-text
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__["default"](
- 'conversion-attribute-to-attribute-on-text',
- [ data, conversionApi ]
- );
- }
- // First remove the old attribute if there was one.
- if ( data.attributeOldValue !== null && oldAttribute ) {
- if ( oldAttribute.key == 'class' ) {
- const classes = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_8__["default"])( oldAttribute.value );
- for ( const className of classes ) {
- viewWriter.removeClass( className, viewElement );
- }
- } else if ( oldAttribute.key == 'style' ) {
- const keys = Object.keys( oldAttribute.value );
- for ( const key of keys ) {
- viewWriter.removeStyle( key, viewElement );
- }
- } else {
- viewWriter.removeAttribute( oldAttribute.key, viewElement );
- }
- }
- // Then set the new attribute.
- if ( data.attributeNewValue !== null && newAttribute ) {
- if ( newAttribute.key == 'class' ) {
- const classes = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_8__["default"])( newAttribute.value );
- for ( const className of classes ) {
- viewWriter.addClass( className, viewElement );
- }
- } else if ( newAttribute.key == 'style' ) {
- const keys = Object.keys( newAttribute.value );
- for ( const key of keys ) {
- viewWriter.setStyle( key, newAttribute.value[ key ], viewElement );
- }
- } else {
- viewWriter.setAttribute( newAttribute.key, newAttribute.value, viewElement );
- }
- }
- };
- }
- // Function factory that creates a converter which converts the text inside marker's range. The converter wraps the text with
- // {@link module:engine/view/attributeelement~AttributeElement} created from the provided descriptor.
- // See {link module:engine/conversion/downcasthelpers~createViewElementFromHighlightDescriptor}.
- //
- // It can also be used to convert the selection that is inside a marker. In that case, an empty attribute element will be
- // created and the selection will be put inside it.
- //
- // If the highlight descriptor does not provide the `priority` property, `10` will be used.
- //
- // If the highlight descriptor does not provide the `id` property, the name of the marker will be used.
- //
- // This converter binds the created {@link module:engine/view/attributeelement~AttributeElement attribute elemens} with the marker name
- // using the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.
- //
- // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
- // @returns {Function}
- function highlightText( highlightDescriptor ) {
- return ( evt, data, conversionApi ) => {
- if ( !data.item ) {
- return;
- }
- if ( !( data.item instanceof _model_selection__WEBPACK_IMPORTED_MODULE_1__["default"] || data.item instanceof _model_documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) && !data.item.is( '$textProxy' ) ) {
- return;
- }
- const descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );
- if ( !descriptor ) {
- return;
- }
- if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
- return;
- }
- const viewWriter = conversionApi.writer;
- const viewElement = createViewElementFromHighlightDescriptor( viewWriter, descriptor );
- const viewSelection = viewWriter.document.selection;
- if ( data.item instanceof _model_selection__WEBPACK_IMPORTED_MODULE_1__["default"] || data.item instanceof _model_documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
- viewWriter.wrap( viewSelection.getFirstRange(), viewElement, viewSelection );
- } else {
- const viewRange = conversionApi.mapper.toViewRange( data.range );
- const rangeAfterWrap = viewWriter.wrap( viewRange, viewElement );
- for ( const element of rangeAfterWrap.getItems() ) {
- if ( element.is( 'attributeElement' ) && element.isSimilar( viewElement ) ) {
- conversionApi.mapper.bindElementToMarker( element, data.markerName );
- // One attribute element is enough, because all of them are bound together by the view writer.
- // Mapper uses this binding to get all the elements no matter how many of them are registered in the mapper.
- break;
- }
- }
- }
- };
- }
- // Converter function factory. It creates a function which applies the marker's highlight to an element inside the marker's range.
- //
- // The converter checks if an element has the `addHighlight` function stored as a
- // {@link module:engine/view/element~Element#_setCustomProperty custom property} and, if so, uses it to apply the highlight.
- // In such case the converter will consume all element's children, assuming that they were handled by the element itself.
- //
- // When the `addHighlight` custom property is not present, the element is not converted in any special way.
- // This means that converters will proceed to convert the element's child nodes.
- //
- // If the highlight descriptor does not provide the `priority` property, `10` will be used.
- //
- // If the highlight descriptor does not provide the `id` property, the name of the marker will be used.
- //
- // This converter binds altered {@link module:engine/view/containerelement~ContainerElement container elements} with the marker name using
- // the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.
- //
- // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
- // @returns {Function}
- function highlightElement( highlightDescriptor ) {
- return ( evt, data, conversionApi ) => {
- if ( !data.item ) {
- return;
- }
- if ( !( data.item instanceof _model_element__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
- return;
- }
- const descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );
- if ( !descriptor ) {
- return;
- }
- if ( !conversionApi.consumable.test( data.item, evt.name ) ) {
- return;
- }
- const viewElement = conversionApi.mapper.toViewElement( data.item );
- if ( viewElement && viewElement.getCustomProperty( 'addHighlight' ) ) {
- // Consume element itself.
- conversionApi.consumable.consume( data.item, evt.name );
- // Consume all children nodes.
- for ( const value of _model_range__WEBPACK_IMPORTED_MODULE_0__["default"]._createIn( data.item ) ) {
- conversionApi.consumable.consume( value.item, evt.name );
- }
- viewElement.getCustomProperty( 'addHighlight' )( viewElement, descriptor, conversionApi.writer );
- conversionApi.mapper.bindElementToMarker( viewElement, data.markerName );
- }
- };
- }
- // Function factory that creates a converter which converts the removing model marker to the view.
- //
- // Both text nodes and elements are handled by this converter but they are handled a bit differently.
- //
- // Text nodes are unwrapped using the {@link module:engine/view/attributeelement~AttributeElement attribute element} created from the
- // provided highlight descriptor. See {link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
- //
- // For elements, the converter checks if an element has the `removeHighlight` function stored as a
- // {@link module:engine/view/element~Element#_setCustomProperty custom property}. If so, it uses it to remove the highlight.
- // In such case, the children of that element will not be converted.
- //
- // When `removeHighlight` is not present, the element is not converted in any special way.
- // The converter will proceed to convert the element's child nodes instead.
- //
- // If the highlight descriptor does not provide the `priority` property, `10` will be used.
- //
- // If the highlight descriptor does not provide the `id` property, the name of the marker will be used.
- //
- // This converter unbinds elements from the marker name.
- //
- // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
- // @returns {Function}
- function removeHighlight( highlightDescriptor ) {
- return ( evt, data, conversionApi ) => {
- // This conversion makes sense only for non-collapsed range.
- if ( data.markerRange.isCollapsed ) {
- return;
- }
- const descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );
- if ( !descriptor ) {
- return;
- }
- // View element that will be used to unwrap `AttributeElement`s.
- const viewHighlightElement = createViewElementFromHighlightDescriptor( conversionApi.writer, descriptor );
- // Get all elements bound with given marker name.
- const elements = conversionApi.mapper.markerNameToElements( data.markerName );
- if ( !elements ) {
- return;
- }
- for ( const element of elements ) {
- conversionApi.mapper.unbindElementFromMarkerName( element, data.markerName );
- if ( element.is( 'attributeElement' ) ) {
- conversionApi.writer.unwrap( conversionApi.writer.createRangeOn( element ), viewHighlightElement );
- } else {
- // if element.is( 'containerElement' ).
- element.getCustomProperty( 'removeHighlight' )( element, descriptor.id, conversionApi.writer );
- }
- }
- conversionApi.writer.clearClonedElementsGroup( data.markerName );
- evt.stop();
- };
- }
- // Model element to view element conversion helper.
- //
- // See {@link ~DowncastHelpers#elementToElement `.elementToElement()` downcast helper} for examples and config params description.
- //
- // @param {Object} config Conversion configuration.
- // @param {String} config.model
- // @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view
- // @param {Object} [config.triggerBy]
- // @param {Array.<String>} [config.triggerBy.attributes]
- // @param {Array.<String>} [config.triggerBy.children]
- // @returns {Function} Conversion helper.
- function downcastElementToElement( config ) {
- config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
- config.view = normalizeToElementConfig( config.view, 'container' );
- return dispatcher => {
- dispatcher.on( 'insert:' + config.model, insertElement( config.view ), { priority: config.converterPriority || 'normal' } );
- if ( config.triggerBy ) {
- if ( config.triggerBy.attributes ) {
- for ( const attributeKey of config.triggerBy.attributes ) {
- dispatcher._mapReconversionTriggerEvent( config.model, `attribute:${ attributeKey }:${ config.model }` );
- }
- }
- if ( config.triggerBy.children ) {
- for ( const childName of config.triggerBy.children ) {
- dispatcher._mapReconversionTriggerEvent( config.model, `insert:${ childName }` );
- dispatcher._mapReconversionTriggerEvent( config.model, `remove:${ childName }` );
- }
- }
- }
- };
- }
- // Model attribute to view element conversion helper.
- //
- // See {@link ~DowncastHelpers#attributeToElement `.attributeToElement()` downcast helper} for examples.
- //
- // @param {Object} config Conversion configuration.
- // @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array
- // of `String`s with possible values if the model attribute is an enumerable.
- // @param {module:engine/view/elementdefinition~ElementDefinition|Function|Object} config.view A view element definition or a function
- // that takes the model attribute value and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}
- // as parameters and returns a view attribute element. If `config.model.values` is
- // given, `config.view` should be an object assigning values from `config.model.values` to view element definitions or functions.
- // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- // @returns {Function} Conversion helper.
- function downcastAttributeToElement( config ) {
- config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
- const modelKey = config.model.key ? config.model.key : config.model;
- let eventName = 'attribute:' + modelKey;
- if ( config.model.name ) {
- eventName += ':' + config.model.name;
- }
- if ( config.model.values ) {
- for ( const modelValue of config.model.values ) {
- config.view[ modelValue ] = normalizeToElementConfig( config.view[ modelValue ], 'attribute' );
- }
- } else {
- config.view = normalizeToElementConfig( config.view, 'attribute' );
- }
- const elementCreator = getFromAttributeCreator( config );
- return dispatcher => {
- dispatcher.on( eventName, wrap( elementCreator ), { priority: config.converterPriority || 'normal' } );
- };
- }
- // Model attribute to view attribute conversion helper.
- //
- // See {@link ~DowncastHelpers#attributeToAttribute `.attributeToAttribute()` downcast helper} for examples.
- //
- // @param {Object} config Conversion configuration.
- // @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing
- // the attribute key, possible values and, optionally, an element name to convert from.
- // @param {String|Object|Function} config.view A view attribute key, or a `{ key, value }` object or a function that takes
- // the model attribute value and returns a `{ key, value }` object. If `key` is `'class'`, `value` can be a `String` or an
- // array of `String`s. If `key` is `'style'`, `value` is an object with key-value pairs. In other cases, `value` is a `String`.
- // If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to
- // `{ key, value }` objects or a functions.
- // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- // @returns {Function} Conversion helper.
- function downcastAttributeToAttribute( config ) {
- config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
- const modelKey = config.model.key ? config.model.key : config.model;
- let eventName = 'attribute:' + modelKey;
- if ( config.model.name ) {
- eventName += ':' + config.model.name;
- }
- if ( config.model.values ) {
- for ( const modelValue of config.model.values ) {
- config.view[ modelValue ] = normalizeToAttributeConfig( config.view[ modelValue ] );
- }
- } else {
- config.view = normalizeToAttributeConfig( config.view );
- }
- const elementCreator = getFromAttributeCreator( config );
- return dispatcher => {
- dispatcher.on( eventName, changeAttribute( elementCreator ), { priority: config.converterPriority || 'normal' } );
- };
- }
- // Model marker to view element conversion helper.
- //
- // See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.
- //
- // @param {Object} config Conversion configuration.
- // @param {String} config.model The name of the model marker (or model marker group) to convert.
- // @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
- // that takes the model marker data as a parameter and returns a view UI element.
- // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- // @returns {Function} Conversion helper.
- function downcastMarkerToElement( config ) {
- config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
- config.view = normalizeToElementConfig( config.view, 'ui' );
- return dispatcher => {
- dispatcher.on( 'addMarker:' + config.model, insertUIElement( config.view ), { priority: config.converterPriority || 'normal' } );
- dispatcher.on( 'removeMarker:' + config.model, removeUIElement( config.view ), { priority: config.converterPriority || 'normal' } );
- };
- }
- // Model marker to view data conversion helper.
- //
- // See {@link ~DowncastHelpers#markerToData `markerToData()` downcast helper} to learn more.
- //
- // @param {Object} config
- // @param {String} config.model
- // @param {Function} [config.view]
- // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal']
- // @returns {Function} Conversion helper.
- function downcastMarkerToData( config ) {
- config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
- const group = config.model;
- // Default conversion.
- if ( !config.view ) {
- config.view = markerName => ( {
- group,
- name: markerName.substr( config.model.length + 1 )
- } );
- }
- return dispatcher => {
- dispatcher.on( 'addMarker:' + group, insertMarkerData( config.view ), { priority: config.converterPriority || 'normal' } );
- dispatcher.on( 'removeMarker:' + group, removeMarkerData( config.view ), { priority: config.converterPriority || 'normal' } );
- };
- }
- // Model marker to highlight conversion helper.
- //
- // See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.
- //
- // @param {Object} config Conversion configuration.
- // @param {String} config.model The name of the model marker (or model marker group) to convert.
- // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} config.view A highlight descriptor
- // that will be used for highlighting or a function that takes the model marker data as a parameter and returns a highlight descriptor.
- // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- // @returns {Function} Conversion helper.
- function downcastMarkerToHighlight( config ) {
- return dispatcher => {
- dispatcher.on( 'addMarker:' + config.model, highlightText( config.view ), { priority: config.converterPriority || 'normal' } );
- dispatcher.on( 'addMarker:' + config.model, highlightElement( config.view ), { priority: config.converterPriority || 'normal' } );
- dispatcher.on( 'removeMarker:' + config.model, removeHighlight( config.view ), { priority: config.converterPriority || 'normal' } );
- };
- }
- // Takes `config.view`, and if it is an {@link module:engine/view/elementdefinition~ElementDefinition}, converts it
- // to a function (because lower level converters accept only element creator functions).
- //
- // @param {module:engine/view/elementdefinition~ElementDefinition|Function} view View configuration.
- // @param {'container'|'attribute'|'ui'} viewElementType View element type to create.
- // @returns {Function} Element creator function to use in lower level converters.
- function normalizeToElementConfig( view, viewElementType ) {
- if ( typeof view == 'function' ) {
- // If `view` is already a function, don't do anything.
- return view;
- }
- return ( modelData, conversionApi ) => createViewElementFromDefinition( view, conversionApi, viewElementType );
- }
- // Creates a view element instance from the provided {@link module:engine/view/elementdefinition~ElementDefinition} and class.
- //
- // @param {module:engine/view/elementdefinition~ElementDefinition} viewElementDefinition
- // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
- // @param {'container'|'attribute'|'ui'} viewElementType
- // @returns {module:engine/view/element~Element}
- function createViewElementFromDefinition( viewElementDefinition, conversionApi, viewElementType ) {
- if ( typeof viewElementDefinition == 'string' ) {
- // If `viewElementDefinition` is given as a `String`, normalize it to an object with `name` property.
- viewElementDefinition = { name: viewElementDefinition };
- }
- let element;
- const viewWriter = conversionApi.writer;
- const attributes = Object.assign( {}, viewElementDefinition.attributes );
- if ( viewElementType == 'container' ) {
- element = viewWriter.createContainerElement( viewElementDefinition.name, attributes );
- } else if ( viewElementType == 'attribute' ) {
- const options = {
- priority: viewElementDefinition.priority || _view_attributeelement__WEBPACK_IMPORTED_MODULE_3__["default"].DEFAULT_PRIORITY
- };
- element = viewWriter.createAttributeElement( viewElementDefinition.name, attributes, options );
- } else {
- // 'ui'.
- element = viewWriter.createUIElement( viewElementDefinition.name, attributes );
- }
- if ( viewElementDefinition.styles ) {
- const keys = Object.keys( viewElementDefinition.styles );
- for ( const key of keys ) {
- viewWriter.setStyle( key, viewElementDefinition.styles[ key ], element );
- }
- }
- if ( viewElementDefinition.classes ) {
- const classes = viewElementDefinition.classes;
- if ( typeof classes == 'string' ) {
- viewWriter.addClass( classes, element );
- } else {
- for ( const className of classes ) {
- viewWriter.addClass( className, element );
- }
- }
- }
- return element;
- }
- function getFromAttributeCreator( config ) {
- if ( config.model.values ) {
- return ( modelAttributeValue, conversionApi ) => {
- const view = config.view[ modelAttributeValue ];
- if ( view ) {
- return view( modelAttributeValue, conversionApi );
- }
- return null;
- };
- } else {
- return config.view;
- }
- }
- // Takes the configuration, adds default parameters if they do not exist and normalizes other parameters to be used in downcast converters
- // for generating a view attribute.
- //
- // @param {Object} view View configuration.
- function normalizeToAttributeConfig( view ) {
- if ( typeof view == 'string' ) {
- return modelAttributeValue => ( { key: view, value: modelAttributeValue } );
- } else if ( typeof view == 'object' ) {
- // { key, value, ... }
- if ( view.value ) {
- return () => view;
- }
- // { key, ... }
- else {
- return modelAttributeValue => ( { key: view.key, value: modelAttributeValue } );
- }
- } else {
- // function.
- return view;
- }
- }
- // Helper function for `highlight`. Prepares the actual descriptor object using value passed to the converter.
- function prepareDescriptor( highlightDescriptor, data, conversionApi ) {
- // If passed descriptor is a creator function, call it. If not, just use passed value.
- const descriptor = typeof highlightDescriptor == 'function' ?
- highlightDescriptor( data, conversionApi ) :
- highlightDescriptor;
- if ( !descriptor ) {
- return null;
- }
- // Apply default descriptor priority.
- if ( !descriptor.priority ) {
- descriptor.priority = 10;
- }
- // Default descriptor id is marker name.
- if ( !descriptor.id ) {
- descriptor.id = data.markerName;
- }
- return descriptor;
- }
- /**
- * An object describing how the marker highlight should be represented in the view.
- *
- * Each text node contained in a highlighted range will be wrapped in a `<span>`
- * {@link module:engine/view/attributeelement~AttributeElement view attribute element} with CSS class(es), attributes and a priority
- * described by this object.
- *
- * Additionally, each {@link module:engine/view/containerelement~ContainerElement container element} can handle displaying the highlight
- * separately by providing the `addHighlight` and `removeHighlight` custom properties. In this case:
- *
- * * The `HighlightDescriptor` object is passed to the `addHighlight` function upon conversion and should be used to apply the highlight to
- * the element.
- * * The descriptor `id` is passed to the `removeHighlight` function upon conversion and should be used to remove the highlight with the
- * given ID from the element.
- *
- * @typedef {Object} module:engine/conversion/downcasthelpers~HighlightDescriptor
- *
- * @property {String|Array.<String>} classes A CSS class or an array of classes to set. If the descriptor is used to
- * create an {@link module:engine/view/attributeelement~AttributeElement attribute element} over text nodes, these classes will be set
- * on that attribute element. If the descriptor is applied to an element, usually these classes will be set on that element, however,
- * this depends on how the element converts the descriptor.
- *
- * @property {String} [id] Descriptor identifier. If not provided, it defaults to the converted marker's name.
- *
- * @property {Number} [priority] Descriptor priority. If not provided, it defaults to `10`. If the descriptor is used to create
- * an {@link module:engine/view/attributeelement~AttributeElement attribute element}, it will be that element's
- * {@link module:engine/view/attributeelement~AttributeElement#priority priority}. If the descriptor is applied to an element,
- * the priority will be used to determine which descriptor is more important.
- *
- * @property {Object} [attributes] Attributes to set. If the descriptor is used to create
- * an {@link module:engine/view/attributeelement~AttributeElement attribute element} over text nodes, these attributes will be set on that
- * attribute element. If the descriptor is applied to an element, usually these attributes will be set on that element, however,
- * this depends on how the element converts the descriptor.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Mapper; });
- /* harmony import */ var _model_position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _view_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../view/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
- /* harmony import */ var _view_range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../view/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
- /* harmony import */ var _view_text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../view/text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/conversion/mapper
- */
- /**
- * Maps elements, positions and markers between {@link module:engine/view/document~Document the view} and
- * {@link module:engine/model/model the model}.
- *
- * The instance of the Mapper used for the editing pipeline is available in
- * {@link module:engine/controller/editingcontroller~EditingController#mapper `editor.editing.mapper`}.
- *
- * Mapper uses bound elements to find corresponding elements and positions, so, to get proper results,
- * all model elements should be {@link module:engine/conversion/mapper~Mapper#bindElements bound}.
- *
- * To map complex model to/from view relations, you may provide custom callbacks for
- * {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition modelToViewPosition event} and
- * {@link module:engine/conversion/mapper~Mapper#event:viewToModelPosition viewToModelPosition event} that are fired whenever
- * a position mapping request occurs.
- * Those events are fired by {@link module:engine/conversion/mapper~Mapper#toViewPosition toViewPosition}
- * and {@link module:engine/conversion/mapper~Mapper#toModelPosition toModelPosition} methods. `Mapper` adds it's own default callbacks
- * with `'lowest'` priority. To override default `Mapper` mapping, add custom callback with higher priority and
- * stop the event.
- */
- class Mapper {
- /**
- * Creates an instance of the mapper.
- */
- constructor() {
- /**
- * Model element to view element mapping.
- *
- * @private
- * @member {WeakMap}
- */
- this._modelToViewMapping = new WeakMap();
- /**
- * View element to model element mapping.
- *
- * @private
- * @member {WeakMap}
- */
- this._viewToModelMapping = new WeakMap();
- /**
- * A map containing callbacks between view element names and functions evaluating length of view elements
- * in model.
- *
- * @private
- * @member {Map}
- */
- this._viewToModelLengthCallbacks = new Map();
- /**
- * Model marker name to view elements mapping.
- *
- * Keys are `String`s while values are `Set`s with {@link module:engine/view/element~Element view elements}.
- * One marker (name) can be mapped to multiple elements.
- *
- * @private
- * @member {Map}
- */
- this._markerNameToElements = new Map();
- /**
- * View element to model marker names mapping.
- *
- * This is reverse to {@link ~Mapper#_markerNameToElements} map.
- *
- * @private
- * @member {Map}
- */
- this._elementToMarkerNames = new Map();
- /**
- * Stores marker names of markers which has changed due to unbinding a view element (so it is assumed that the view element
- * has been removed, moved or renamed).
- *
- * @private
- * @member {Set.<module:engine/model/markercollection~Marker>}
- */
- this._unboundMarkerNames = new Set();
- // Default mapper algorithm for mapping model position to view position.
- this.on( 'modelToViewPosition', ( evt, data ) => {
- if ( data.viewPosition ) {
- return;
- }
- const viewContainer = this._modelToViewMapping.get( data.modelPosition.parent );
- data.viewPosition = this.findPositionIn( viewContainer, data.modelPosition.offset );
- }, { priority: 'low' } );
- // Default mapper algorithm for mapping view position to model position.
- this.on( 'viewToModelPosition', ( evt, data ) => {
- if ( data.modelPosition ) {
- return;
- }
- const viewBlock = this.findMappedViewAncestor( data.viewPosition );
- const modelParent = this._viewToModelMapping.get( viewBlock );
- const modelOffset = this._toModelOffset( data.viewPosition.parent, data.viewPosition.offset, viewBlock );
- data.modelPosition = _model_position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( modelParent, modelOffset );
- }, { priority: 'low' } );
- }
- /**
- * Marks model and view elements as corresponding. Corresponding elements can be retrieved by using
- * the {@link module:engine/conversion/mapper~Mapper#toModelElement toModelElement} and
- * {@link module:engine/conversion/mapper~Mapper#toViewElement toViewElement} methods.
- * The information that elements are bound is also used to translate positions.
- *
- * @param {module:engine/model/element~Element} modelElement Model element.
- * @param {module:engine/view/element~Element} viewElement View element.
- */
- bindElements( modelElement, viewElement ) {
- this._modelToViewMapping.set( modelElement, viewElement );
- this._viewToModelMapping.set( viewElement, modelElement );
- }
- /**
- * Unbinds given {@link module:engine/view/element~Element view element} from the map.
- *
- * **Note:** view-to-model binding will be removed, if it existed. However, corresponding model-to-view binding
- * will be removed only if model element is still bound to passed `viewElement`.
- *
- * This behavior lets for re-binding model element to another view element without fear of losing the new binding
- * when the previously bound view element is unbound.
- *
- * @param {module:engine/view/element~Element} viewElement View element to unbind.
- */
- unbindViewElement( viewElement ) {
- const modelElement = this.toModelElement( viewElement );
- this._viewToModelMapping.delete( viewElement );
- if ( this._elementToMarkerNames.has( viewElement ) ) {
- for ( const markerName of this._elementToMarkerNames.get( viewElement ) ) {
- this._unboundMarkerNames.add( markerName );
- }
- }
- if ( this._modelToViewMapping.get( modelElement ) == viewElement ) {
- this._modelToViewMapping.delete( modelElement );
- }
- }
- /**
- * Unbinds given {@link module:engine/model/element~Element model element} from the map.
- *
- * **Note:** model-to-view binding will be removed, if it existed. However, corresponding view-to-model binding
- * will be removed only if view element is still bound to passed `modelElement`.
- *
- * This behavior lets for re-binding view element to another model element without fear of losing the new binding
- * when the previously bound model element is unbound.
- *
- * @param {module:engine/model/element~Element} modelElement Model element to unbind.
- */
- unbindModelElement( modelElement ) {
- const viewElement = this.toViewElement( modelElement );
- this._modelToViewMapping.delete( modelElement );
- if ( this._viewToModelMapping.get( viewElement ) == modelElement ) {
- this._viewToModelMapping.delete( viewElement );
- }
- }
- /**
- * Binds given marker name with given {@link module:engine/view/element~Element view element}. The element
- * will be added to the current set of elements bound with given marker name.
- *
- * @param {module:engine/view/element~Element} element Element to bind.
- * @param {String} name Marker name.
- */
- bindElementToMarker( element, name ) {
- const elements = this._markerNameToElements.get( name ) || new Set();
- elements.add( element );
- const names = this._elementToMarkerNames.get( element ) || new Set();
- names.add( name );
- this._markerNameToElements.set( name, elements );
- this._elementToMarkerNames.set( element, names );
- }
- /**
- * Unbinds an element from given marker name.
- *
- * @param {module:engine/view/element~Element} element Element to unbind.
- * @param {String} name Marker name.
- */
- unbindElementFromMarkerName( element, name ) {
- const nameToElements = this._markerNameToElements.get( name );
- if ( nameToElements ) {
- nameToElements.delete( element );
- if ( nameToElements.size == 0 ) {
- this._markerNameToElements.delete( name );
- }
- }
- const elementToNames = this._elementToMarkerNames.get( element );
- if ( elementToNames ) {
- elementToNames.delete( name );
- if ( elementToNames.size == 0 ) {
- this._elementToMarkerNames.delete( element );
- }
- }
- }
- /**
- * Returns all marker names of markers which has changed due to unbinding a view element (so it is assumed that the view element
- * has been removed, moved or renamed) since the last flush. After returning, the marker names list is cleared.
- *
- * @returns {Array.<String>}
- */
- flushUnboundMarkerNames() {
- const markerNames = Array.from( this._unboundMarkerNames );
- this._unboundMarkerNames.clear();
- return markerNames;
- }
- /**
- * Removes all model to view and view to model bindings.
- */
- clearBindings() {
- this._modelToViewMapping = new WeakMap();
- this._viewToModelMapping = new WeakMap();
- this._markerNameToElements = new Map();
- this._elementToMarkerNames = new Map();
- this._unboundMarkerNames = new Set();
- }
- /**
- * Gets the corresponding model element.
- *
- * **Note:** {@link module:engine/view/uielement~UIElement} does not have corresponding element in model.
- *
- * @param {module:engine/view/element~Element} viewElement View element.
- * @returns {module:engine/model/element~Element|undefined} Corresponding model element or `undefined` if not found.
- */
- toModelElement( viewElement ) {
- return this._viewToModelMapping.get( viewElement );
- }
- /**
- * Gets the corresponding view element.
- *
- * @param {module:engine/model/element~Element} modelElement Model element.
- * @returns {module:engine/view/element~Element|undefined} Corresponding view element or `undefined` if not found.
- */
- toViewElement( modelElement ) {
- return this._modelToViewMapping.get( modelElement );
- }
- /**
- * Gets the corresponding model range.
- *
- * @param {module:engine/view/range~Range} viewRange View range.
- * @returns {module:engine/model/range~Range} Corresponding model range.
- */
- toModelRange( viewRange ) {
- return new _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]( this.toModelPosition( viewRange.start ), this.toModelPosition( viewRange.end ) );
- }
- /**
- * Gets the corresponding view range.
- *
- * @param {module:engine/model/range~Range} modelRange Model range.
- * @returns {module:engine/view/range~Range} Corresponding view range.
- */
- toViewRange( modelRange ) {
- return new _view_range__WEBPACK_IMPORTED_MODULE_3__["default"]( this.toViewPosition( modelRange.start ), this.toViewPosition( modelRange.end ) );
- }
- /**
- * Gets the corresponding model position.
- *
- * @fires viewToModelPosition
- * @param {module:engine/view/position~Position} viewPosition View position.
- * @returns {module:engine/model/position~Position} Corresponding model position.
- */
- toModelPosition( viewPosition ) {
- const data = {
- viewPosition,
- mapper: this
- };
- this.fire( 'viewToModelPosition', data );
- return data.modelPosition;
- }
- /**
- * Gets the corresponding view position.
- *
- * @fires modelToViewPosition
- * @param {module:engine/model/position~Position} modelPosition Model position.
- * @param {Object} [options] Additional options for position mapping process.
- * @param {Boolean} [options.isPhantom=false] Should be set to `true` if the model position to map is pointing to a place
- * in model tree which no longer exists. For example, it could be an end of a removed model range.
- * @returns {module:engine/view/position~Position} Corresponding view position.
- */
- toViewPosition( modelPosition, options = { isPhantom: false } ) {
- const data = {
- modelPosition,
- mapper: this,
- isPhantom: options.isPhantom
- };
- this.fire( 'modelToViewPosition', data );
- return data.viewPosition;
- }
- /**
- * Gets all view elements bound to the given marker name.
- *
- * @param {String} name Marker name.
- * @returns {Set.<module:engine/view/element~Element>|null} View elements bound with given marker name or `null`
- * if no elements are bound to given marker name.
- */
- markerNameToElements( name ) {
- const boundElements = this._markerNameToElements.get( name );
- if ( !boundElements ) {
- return null;
- }
- const elements = new Set();
- for ( const element of boundElements ) {
- if ( element.is( 'attributeElement' ) ) {
- for ( const clone of element.getElementsWithSameId() ) {
- elements.add( clone );
- }
- } else {
- elements.add( element );
- }
- }
- return elements;
- }
- /**
- * Registers a callback that evaluates the length in the model of a view element with given name.
- *
- * The callback is fired with one argument, which is a view element instance. The callback is expected to return
- * a number representing the length of view element in model.
- *
- * // List item in view may contain nested list, which have other list items. In model though,
- * // the lists are represented by flat structure. Because of those differences, length of list view element
- * // may be greater than one. In the callback it's checked how many nested list items are in evaluated list item.
- *
- * function getViewListItemLength( element ) {
- * let length = 1;
- *
- * for ( let child of element.getChildren() ) {
- * if ( child.name == 'ul' || child.name == 'ol' ) {
- * for ( let item of child.getChildren() ) {
- * length += getViewListItemLength( item );
- * }
- * }
- * }
- *
- * return length;
- * }
- *
- * mapper.registerViewToModelLength( 'li', getViewListItemLength );
- *
- * @param {String} viewElementName Name of view element for which callback is registered.
- * @param {Function} lengthCallback Function return a length of view element instance in model.
- */
- registerViewToModelLength( viewElementName, lengthCallback ) {
- this._viewToModelLengthCallbacks.set( viewElementName, lengthCallback );
- }
- /**
- * For given `viewPosition`, finds and returns the closest ancestor of this position that has a mapping to
- * the model.
- *
- * @param {module:engine/view/position~Position} viewPosition Position for which mapped ancestor should be found.
- * @returns {module:engine/view/element~Element}
- */
- findMappedViewAncestor( viewPosition ) {
- let parent = viewPosition.parent;
- while ( !this._viewToModelMapping.has( parent ) ) {
- parent = parent.parent;
- }
- return parent;
- }
- /**
- * Calculates model offset based on the view position and the block element.
- *
- * Example:
- *
- * <p>foo<b>ba|r</b></p> // _toModelOffset( b, 2, p ) -> 5
- *
- * Is a sum of:
- *
- * <p>foo|<b>bar</b></p> // _toModelOffset( p, 3, p ) -> 3
- * <p>foo<b>ba|r</b></p> // _toModelOffset( b, 2, b ) -> 2
- *
- * @private
- * @param {module:engine/view/element~Element} viewParent Position parent.
- * @param {Number} viewOffset Position offset.
- * @param {module:engine/view/element~Element} viewBlock Block used as a base to calculate offset.
- * @returns {Number} Offset in the model.
- */
- _toModelOffset( viewParent, viewOffset, viewBlock ) {
- if ( viewBlock != viewParent ) {
- // See example.
- const offsetToParentStart = this._toModelOffset( viewParent.parent, viewParent.index, viewBlock );
- const offsetInParent = this._toModelOffset( viewParent, viewOffset, viewParent );
- return offsetToParentStart + offsetInParent;
- }
- // viewBlock == viewParent, so we need to calculate the offset in the parent element.
- // If the position is a text it is simple ("ba|r" -> 2).
- if ( viewParent.is( '$text' ) ) {
- return viewOffset;
- }
- // If the position is in an element we need to sum lengths of siblings ( <b> bar </b> foo | -> 3 + 3 = 6 ).
- let modelOffset = 0;
- for ( let i = 0; i < viewOffset; i++ ) {
- modelOffset += this.getModelLength( viewParent.getChild( i ) );
- }
- return modelOffset;
- }
- /**
- * Gets the length of the view element in the model.
- *
- * The length is calculated as follows:
- * * if {@link #registerViewToModelLength length mapping callback} is provided for given `viewNode` it is used to
- * evaluate model length (`viewNode` is used as first and only parameter passed to the callback),
- * * length of a {@link module:engine/view/text~Text text node} is equal to the length of it's
- * {@link module:engine/view/text~Text#data data},
- * * length of a {@link module:engine/view/uielement~UIElement ui element} is equal to 0,
- * * length of a mapped {@link module:engine/view/element~Element element} is equal to 1,
- * * length of a not-mapped {@link module:engine/view/element~Element element} is equal to the length of it's children.
- *
- * Examples:
- *
- * foo -> 3 // Text length is equal to it's data length.
- * <p>foo</p> -> 1 // Length of an element which is mapped is by default equal to 1.
- * <b>foo</b> -> 3 // Length of an element which is not mapped is a length of its children.
- * <div><p>x</p><p>y</p></div> -> 2 // Assuming that <div> is not mapped and <p> are mapped.
- *
- * @param {module:engine/view/element~Element} viewNode View node.
- * @returns {Number} Length of the node in the tree model.
- */
- getModelLength( viewNode ) {
- if ( this._viewToModelLengthCallbacks.get( viewNode.name ) ) {
- const callback = this._viewToModelLengthCallbacks.get( viewNode.name );
- return callback( viewNode );
- } else if ( this._viewToModelMapping.has( viewNode ) ) {
- return 1;
- } else if ( viewNode.is( '$text' ) ) {
- return viewNode.data.length;
- } else if ( viewNode.is( 'uiElement' ) ) {
- return 0;
- } else {
- let len = 0;
- for ( const child of viewNode.getChildren() ) {
- len += this.getModelLength( child );
- }
- return len;
- }
- }
- /**
- * Finds the position in the view node (or its children) with the expected model offset.
- *
- * Example:
- *
- * <p>fo<b>bar</b>bom</p> -> expected offset: 4
- *
- * findPositionIn( p, 4 ):
- * <p>|fo<b>bar</b>bom</p> -> expected offset: 4, actual offset: 0
- * <p>fo|<b>bar</b>bom</p> -> expected offset: 4, actual offset: 2
- * <p>fo<b>bar</b>|bom</p> -> expected offset: 4, actual offset: 5 -> we are too far
- *
- * findPositionIn( b, 4 - ( 5 - 3 ) ):
- * <p>fo<b>|bar</b>bom</p> -> expected offset: 2, actual offset: 0
- * <p>fo<b>bar|</b>bom</p> -> expected offset: 2, actual offset: 3 -> we are too far
- *
- * findPositionIn( bar, 2 - ( 3 - 3 ) ):
- * We are in the text node so we can simple find the offset.
- * <p>fo<b>ba|r</b>bom</p> -> expected offset: 2, actual offset: 2 -> position found
- *
- * @param {module:engine/view/element~Element} viewParent Tree view element in which we are looking for the position.
- * @param {Number} expectedOffset Expected offset.
- * @returns {module:engine/view/position~Position} Found position.
- */
- findPositionIn( viewParent, expectedOffset ) {
- // Last scanned view node.
- let viewNode;
- // Length of the last scanned view node.
- let lastLength = 0;
- let modelOffset = 0;
- let viewOffset = 0;
- // In the text node it is simple: offset in the model equals offset in the text.
- if ( viewParent.is( '$text' ) ) {
- return new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, expectedOffset );
- }
- // In other cases we add lengths of child nodes to find the proper offset.
- // If it is smaller we add the length.
- while ( modelOffset < expectedOffset ) {
- viewNode = viewParent.getChild( viewOffset );
- lastLength = this.getModelLength( viewNode );
- modelOffset += lastLength;
- viewOffset++;
- }
- // If it equals we found the position.
- if ( modelOffset == expectedOffset ) {
- return this._moveViewPositionToTextNode( new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, viewOffset ) );
- }
- // If it is higher we need to enter last child.
- else {
- // ( modelOffset - lastLength ) is the offset to the child we enter,
- // so we subtract it from the expected offset to fine the offset in the child.
- return this.findPositionIn( viewNode, expectedOffset - ( modelOffset - lastLength ) );
- }
- }
- /**
- * Because we prefer positions in text nodes over positions next to text node moves view position to the text node
- * if it was next to it.
- *
- * <p>[]<b>foo</b></p> -> <p>[]<b>foo</b></p> // do not touch if position is not directly next to text
- * <p>foo[]<b>foo</b></p> -> <p>foo{}<b>foo</b></p> // move to text node
- * <p><b>[]foo</b></p> -> <p><b>{}foo</b></p> // move to text node
- *
- * @private
- * @param {module:engine/view/position~Position} viewPosition Position potentially next to text node.
- * @returns {module:engine/view/position~Position} Position in text node if possible.
- */
- _moveViewPositionToTextNode( viewPosition ) {
- // If the position is just after text node, put it at the end of that text node.
- // If the position is just before text node, put it at the beginning of that text node.
- const nodeBefore = viewPosition.nodeBefore;
- const nodeAfter = viewPosition.nodeAfter;
- if ( nodeBefore instanceof _view_text__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
- return new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( nodeBefore, nodeBefore.data.length );
- } else if ( nodeAfter instanceof _view_text__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
- return new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( nodeAfter, 0 );
- }
- // Otherwise, just return the given position.
- return viewPosition;
- }
- /**
- * Fired for each model-to-view position mapping request. The purpose of this event is to enable custom model-to-view position
- * mapping. Callbacks added to this event take {@link module:engine/model/position~Position model position} and are expected to
- * calculate {@link module:engine/view/position~Position view position}. Calculated view position should be added as `viewPosition`
- * value in `data` object that is passed as one of parameters to the event callback.
- *
- * // Assume that "captionedImage" model element is converted to <img> and following <span> elements in view,
- * // and the model element is bound to <img> element. Force mapping model positions inside "captionedImage" to that
- * // <span> element.
- * mapper.on( 'modelToViewPosition', ( evt, data ) => {
- * const positionParent = modelPosition.parent;
- *
- * if ( positionParent.name == 'captionedImage' ) {
- * const viewImg = data.mapper.toViewElement( positionParent );
- * const viewCaption = viewImg.nextSibling; // The <span> element.
- *
- * data.viewPosition = new ViewPosition( viewCaption, modelPosition.offset );
- *
- * // Stop the event if other callbacks should not modify calculated value.
- * evt.stop();
- * }
- * } );
- *
- * **Note:** keep in mind that sometimes a "phantom" model position is being converted. "Phantom" model position is
- * a position that points to a non-existing place in model. Such position might still be valid for conversion, though
- * (it would point to a correct place in view when converted). One example of such situation is when a range is
- * removed from model, there may be a need to map the range's end (which is no longer valid model position). To
- * handle such situation, check `data.isPhantom` flag:
- *
- * // Assume that there is "customElement" model element and whenever position is before it, we want to move it
- * // to the inside of the view element bound to "customElement".
- * mapper.on( 'modelToViewPosition', ( evt, data ) => {
- * if ( data.isPhantom ) {
- * return;
- * }
- *
- * // Below line might crash for phantom position that does not exist in model.
- * const sibling = data.modelPosition.nodeBefore;
- *
- * // Check if this is the element we are interested in.
- * if ( !sibling.is( 'element', 'customElement' ) ) {
- * return;
- * }
- *
- * const viewElement = data.mapper.toViewElement( sibling );
- *
- * data.viewPosition = new ViewPosition( sibling, 0 );
- *
- * evt.stop();
- * } );
- *
- * **Note:** default mapping callback is provided with `low` priority setting and does not cancel the event, so it is possible to
- * attach a custom callback after default callback and also use `data.viewPosition` calculated by default callback
- * (for example to fix it).
- *
- * **Note:** default mapping callback will not fire if `data.viewPosition` is already set.
- *
- * **Note:** these callbacks are called **very often**. For efficiency reasons, it is advised to use them only when position
- * mapping between given model and view elements is unsolvable using just elements mapping and default algorithm. Also,
- * the condition that checks if special case scenario happened should be as simple as possible.
- *
- * @event modelToViewPosition
- * @param {Object} data Data pipeline object that can store and pass data between callbacks. The callback should add
- * `viewPosition` value to that object with calculated {@link module:engine/view/position~Position view position}.
- * @param {module:engine/conversion/mapper~Mapper} data.mapper Mapper instance that fired the event.
- */
- /**
- * Fired for each view-to-model position mapping request. See {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition}.
- *
- * // See example in `modelToViewPosition` event description.
- * // This custom mapping will map positions from <span> element next to <img> to the "captionedImage" element.
- * mapper.on( 'viewToModelPosition', ( evt, data ) => {
- * const positionParent = viewPosition.parent;
- *
- * if ( positionParent.hasClass( 'image-caption' ) ) {
- * const viewImg = positionParent.previousSibling;
- * const modelImg = data.mapper.toModelElement( viewImg );
- *
- * data.modelPosition = new ModelPosition( modelImg, viewPosition.offset );
- * evt.stop();
- * }
- * } );
- *
- * **Note:** default mapping callback is provided with `low` priority setting and does not cancel the event, so it is possible to
- * attach a custom callback after default callback and also use `data.modelPosition` calculated by default callback
- * (for example to fix it).
- *
- * **Note:** default mapping callback will not fire if `data.modelPosition` is already set.
- *
- * **Note:** these callbacks are called **very often**. For efficiency reasons, it is advised to use them only when position
- * mapping between given model and view elements is unsolvable using just elements mapping and default algorithm. Also,
- * the condition that checks if special case scenario happened should be as simple as possible.
- *
- * @event viewToModelPosition
- * @param {Object} data Data pipeline object that can store and pass data between callbacks. The callback should add
- * `modelPosition` value to that object with calculated {@link module:engine/model/position~Position model position}.
- * @param {module:engine/conversion/mapper~Mapper} data.mapper Mapper instance that fired the event.
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( Mapper, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ModelConsumable; });
- /* harmony import */ var _model_textproxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model/textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/conversion/modelconsumable
- */
- /**
- * Manages a list of consumable values for {@link module:engine/model/item~Item model items}.
- *
- * Consumables are various aspects of the model. A model item can be broken down into singular properties that might be
- * taken into consideration when converting that item.
- *
- * `ModelConsumable` is used by {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} while analyzing changed
- * parts of {@link module:engine/model/document~Document the document}. The added / changed / removed model items are broken down
- * into singular properties (the item itself and it's attributes). All those parts are saved in `ModelConsumable`. Then,
- * during conversion, when given part of model item is converted (i.e. the view element has been inserted into the view,
- * but without attributes), consumable value is removed from `ModelConsumable`.
- *
- * For model items, `ModelConsumable` stores consumable values of one of following types: `insert`, `addattribute:<attributeKey>`,
- * `changeattributes:<attributeKey>`, `removeattributes:<attributeKey>`.
- *
- * In most cases, it is enough to let {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}
- * gather consumable values, so there is no need to use
- * {@link module:engine/conversion/modelconsumable~ModelConsumable#add add method} directly.
- * However, it is important to understand how consumable values can be
- * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.
- * See {@link module:engine/conversion/downcasthelpers default downcast converters} for more information.
- *
- * Keep in mind, that one conversion event may have multiple callbacks (converters) attached to it. Each of those is
- * able to convert one or more parts of the model. However, when one of those callbacks actually converts
- * something, other should not, because they would duplicate the results. Using `ModelConsumable` helps avoiding
- * this situation, because callbacks should only convert those values, which were not yet consumed from `ModelConsumable`.
- *
- * Consuming multiple values in a single callback:
- *
- * // Converter for custom `image` element that might have a `caption` element inside which changes
- * // how the image is displayed in the view:
- * //
- * // Model:
- * //
- * // [image]
- * // └─ [caption]
- * // └─ foo
- * //
- * // View:
- * //
- * // <figure>
- * // ├─ <img />
- * // └─ <caption>
- * // └─ foo
- * modelConversionDispatcher.on( 'insert:image', ( evt, data, conversionApi ) => {
- * // First, consume the `image` element.
- * conversionApi.consumable.consume( data.item, 'insert' );
- *
- * // Just create normal image element for the view.
- * // Maybe it will be "decorated" later.
- * const viewImage = new ViewElement( 'img' );
- * const insertPosition = conversionApi.mapper.toViewPosition( data.range.start );
- * const viewWriter = conversionApi.writer;
- *
- * // Check if the `image` element has children.
- * if ( data.item.childCount > 0 ) {
- * const modelCaption = data.item.getChild( 0 );
- *
- * // `modelCaption` insertion change is consumed from consumable values.
- * // It will not be converted by other converters, but it's children (probably some text) will be.
- * // Through mapping, converters for text will know where to insert contents of `modelCaption`.
- * if ( conversionApi.consumable.consume( modelCaption, 'insert' ) ) {
- * const viewCaption = new ViewElement( 'figcaption' );
- *
- * const viewImageHolder = new ViewElement( 'figure', null, [ viewImage, viewCaption ] );
- *
- * conversionApi.mapper.bindElements( modelCaption, viewCaption );
- * conversionApi.mapper.bindElements( data.item, viewImageHolder );
- * viewWriter.insert( insertPosition, viewImageHolder );
- * }
- * } else {
- * conversionApi.mapper.bindElements( data.item, viewImage );
- * viewWriter.insert( insertPosition, viewImage );
- * }
- *
- * evt.stop();
- * } );
- */
- class ModelConsumable {
- /**
- * Creates an empty consumables list.
- */
- constructor() {
- /**
- * Contains list of consumable values.
- *
- * @private
- * @member {Map} module:engine/conversion/modelconsumable~ModelConsumable#_consumable
- */
- this._consumable = new Map();
- /**
- * For each {@link module:engine/model/textproxy~TextProxy} added to `ModelConsumable`, this registry holds parent
- * of that `TextProxy` and start and end indices of that `TextProxy`. This allows identification of `TextProxy`
- * instances that points to the same part of the model but are different instances. Each distinct `TextProxy`
- * is given unique `Symbol` which is then registered as consumable. This process is transparent for `ModelConsumable`
- * API user because whenever `TextProxy` is added, tested, consumed or reverted, internal mechanisms of
- * `ModelConsumable` translates `TextProxy` to that unique `Symbol`.
- *
- * @private
- * @member {Map} module:engine/conversion/modelconsumable~ModelConsumable#_textProxyRegistry
- */
- this._textProxyRegistry = new Map();
- }
- /**
- * Adds a consumable value to the consumables list and links it with given model item.
- *
- * modelConsumable.add( modelElement, 'insert' ); // Add `modelElement` insertion change to consumable values.
- * modelConsumable.add( modelElement, 'addAttribute:bold' ); // Add `bold` attribute insertion on `modelElement` change.
- * modelConsumable.add( modelElement, 'removeAttribute:bold' ); // Add `bold` attribute removal on `modelElement` change.
- * modelConsumable.add( modelSelection, 'selection' ); // Add `modelSelection` to consumable values.
- * modelConsumable.add( modelRange, 'range' ); // Add `modelRange` to consumable values.
- *
- * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
- * Model item, range or selection that has the consumable.
- * @param {String} type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
- * Second colon and everything after will be cut. Passing event name is a safe and good practice.
- */
- add( item, type ) {
- type = _normalizeConsumableType( type );
- if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- item = this._getSymbolForTextProxy( item );
- }
- if ( !this._consumable.has( item ) ) {
- this._consumable.set( item, new Map() );
- }
- this._consumable.get( item ).set( type, true );
- }
- /**
- * Removes given consumable value from given model item.
- *
- * modelConsumable.consume( modelElement, 'insert' ); // Remove `modelElement` insertion change from consumable values.
- * modelConsumable.consume( modelElement, 'addAttribute:bold' ); // Remove `bold` attribute insertion on `modelElement` change.
- * modelConsumable.consume( modelElement, 'removeAttribute:bold' ); // Remove `bold` attribute removal on `modelElement` change.
- * modelConsumable.consume( modelSelection, 'selection' ); // Remove `modelSelection` from consumable values.
- * modelConsumable.consume( modelRange, 'range' ); // Remove 'modelRange' from consumable values.
- *
- * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
- * Model item, range or selection from which consumable will be consumed.
- * @param {String} type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
- * Second colon and everything after will be cut. Passing event name is a safe and good practice.
- * @returns {Boolean} `true` if consumable value was available and was consumed, `false` otherwise.
- */
- consume( item, type ) {
- type = _normalizeConsumableType( type );
- if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- item = this._getSymbolForTextProxy( item );
- }
- if ( this.test( item, type ) ) {
- this._consumable.get( item ).set( type, false );
- return true;
- } else {
- return false;
- }
- }
- /**
- * Tests whether there is a consumable value of given type connected with given model item.
- *
- * modelConsumable.test( modelElement, 'insert' ); // Check for `modelElement` insertion change.
- * modelConsumable.test( modelElement, 'addAttribute:bold' ); // Check for `bold` attribute insertion on `modelElement` change.
- * modelConsumable.test( modelElement, 'removeAttribute:bold' ); // Check for `bold` attribute removal on `modelElement` change.
- * modelConsumable.test( modelSelection, 'selection' ); // Check if `modelSelection` is consumable.
- * modelConsumable.test( modelRange, 'range' ); // Check if `modelRange` is consumable.
- *
- * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
- * Model item, range or selection to be tested.
- * @param {String} type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
- * Second colon and everything after will be cut. Passing event name is a safe and good practice.
- * @returns {null|Boolean} `null` if such consumable was never added, `false` if the consumable values was
- * already consumed or `true` if it was added and not consumed yet.
- */
- test( item, type ) {
- type = _normalizeConsumableType( type );
- if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- item = this._getSymbolForTextProxy( item );
- }
- const itemConsumables = this._consumable.get( item );
- if ( itemConsumables === undefined ) {
- return null;
- }
- const value = itemConsumables.get( type );
- if ( value === undefined ) {
- return null;
- }
- return value;
- }
- /**
- * Reverts consuming of consumable value.
- *
- * modelConsumable.revert( modelElement, 'insert' ); // Revert consuming `modelElement` insertion change.
- * modelConsumable.revert( modelElement, 'addAttribute:bold' ); // Revert consuming `bold` attribute insert from `modelElement`.
- * modelConsumable.revert( modelElement, 'removeAttribute:bold' ); // Revert consuming `bold` attribute remove from `modelElement`.
- * modelConsumable.revert( modelSelection, 'selection' ); // Revert consuming `modelSelection`.
- * modelConsumable.revert( modelRange, 'range' ); // Revert consuming `modelRange`.
- *
- * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
- * Model item, range or selection to be reverted.
- * @param {String} type Consumable type.
- * @returns {null|Boolean} `true` if consumable has been reversed, `false` otherwise. `null` if the consumable has
- * never been added.
- */
- revert( item, type ) {
- type = _normalizeConsumableType( type );
- if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- item = this._getSymbolForTextProxy( item );
- }
- const test = this.test( item, type );
- if ( test === false ) {
- this._consumable.get( item ).set( type, true );
- return true;
- } else if ( test === true ) {
- return false;
- }
- return null;
- }
- /**
- * Gets a unique symbol for passed {@link module:engine/model/textproxy~TextProxy} instance. All `TextProxy` instances that
- * have same parent, same start index and same end index will get the same symbol.
- *
- * Used internally to correctly consume `TextProxy` instances.
- *
- * @private
- * @param {module:engine/model/textproxy~TextProxy} textProxy `TextProxy` instance to get a symbol for.
- * @returns {Symbol} Symbol representing all equal instances of `TextProxy`.
- */
- _getSymbolForTextProxy( textProxy ) {
- let symbol = null;
- const startMap = this._textProxyRegistry.get( textProxy.startOffset );
- if ( startMap ) {
- const endMap = startMap.get( textProxy.endOffset );
- if ( endMap ) {
- symbol = endMap.get( textProxy.parent );
- }
- }
- if ( !symbol ) {
- symbol = this._addSymbolForTextProxy( textProxy.startOffset, textProxy.endOffset, textProxy.parent );
- }
- return symbol;
- }
- /**
- * Adds a symbol for given properties that characterizes a {@link module:engine/model/textproxy~TextProxy} instance.
- *
- * Used internally to correctly consume `TextProxy` instances.
- *
- * @private
- * @param {Number} startIndex Text proxy start index in it's parent.
- * @param {Number} endIndex Text proxy end index in it's parent.
- * @param {module:engine/model/element~Element} parent Text proxy parent.
- * @returns {Symbol} Symbol generated for given properties.
- */
- _addSymbolForTextProxy( start, end, parent ) {
- const symbol = Symbol( 'textProxySymbol' );
- let startMap, endMap;
- startMap = this._textProxyRegistry.get( start );
- if ( !startMap ) {
- startMap = new Map();
- this._textProxyRegistry.set( start, startMap );
- }
- endMap = startMap.get( end );
- if ( !endMap ) {
- endMap = new Map();
- startMap.set( end, endMap );
- }
- endMap.set( parent, symbol );
- return symbol;
- }
- }
- // Returns a normalized consumable type name from given string. A normalized consumable type name is a string that has
- // at most one colon, for example: `insert` or `addMarker:highlight`. If string to normalize has more "parts" (more colons),
- // the other parts are dropped, for example: `addattribute:bold:$text` -> `addattributes:bold`.
- //
- // @param {String} type Consumable type.
- // @returns {String} Normalized consumable type.
- function _normalizeConsumableType( type ) {
- const parts = type.split( ':' );
- return parts.length > 1 ? parts[ 0 ] + ':' + parts[ 1 ] : parts[ 0 ];
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpcastDispatcher; });
- /* harmony import */ var _viewconsumable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./viewconsumable */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js");
- /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _model_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _model_schema__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../model/schema */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js");
- /* harmony import */ var _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../model/utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/conversion/upcastdispatcher
- */
- /**
- * Upcast dispatcher is a central point of the view-to-model conversion, which is a process of
- * converting a given {@link module:engine/view/documentfragment~DocumentFragment view document fragment} or
- * {@link module:engine/view/element~Element view element} into a correct model structure.
- *
- * During the conversion process, the dispatcher fires events for all {@link module:engine/view/node~Node view nodes}
- * from the converted view document fragment.
- * Special callbacks called "converters" should listen to these events in order to convert the view nodes.
- *
- * The second parameter of the callback is the `data` object with the following properties:
- *
- * * `data.viewItem` contains a {@link module:engine/view/node~Node view node} or a
- * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}
- * that is converted at the moment and might be handled by the callback.
- * * `data.modelRange` is used to point to the result
- * of the current conversion (e.g. the element that is being inserted)
- * and is always a {@link module:engine/model/range~Range} when the conversion succeeds.
- * * `data.modelCursor` is a {@link module:engine/model/position~Position position} on which the converter should insert
- * the newly created items.
- *
- * The third parameter of the callback is an instance of {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi}
- * which provides additional tools for converters.
- *
- * You can read more about conversion in the following guides:
- *
- * * {@glink framework/guides/deep-dive/conversion/conversion-introduction Advanced conversion concepts — attributes}
- * * {@glink framework/guides/deep-dive/conversion/custom-element-conversion Custom element conversion}
- *
- * Examples of event-based converters:
- *
- * // A converter for links (<a>).
- * editor.data.upcastDispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
- * if ( conversionApi.consumable.consume( data.viewItem, { name: true, attributes: [ 'href' ] } ) ) {
- * // The <a> element is inline and is represented by an attribute in the model.
- * // This is why you need to convert only children.
- * const { modelRange } = conversionApi.convertChildren( data.viewItem, data.modelCursor );
- *
- * for ( let item of modelRange.getItems() ) {
- * if ( conversionApi.schema.checkAttribute( item, 'linkHref' ) ) {
- * conversionApi.writer.setAttribute( 'linkHref', data.viewItem.getAttribute( 'href' ), item );
- * }
- * }
- * }
- * } );
- *
- * // Convert <p> element's font-size style.
- * // Note: You should use a low-priority observer in order to ensure that
- * // it is executed after the element-to-element converter.
- * editor.data.upcastDispatcher.on( 'element:p', ( evt, data, conversionApi ) => {
- * const { consumable, schema, writer } = conversionApi;
- *
- * if ( !consumable.consume( data.viewItem, { style: 'font-size' } ) ) {
- * return;
- * }
- *
- * const fontSize = data.viewItem.getStyle( 'font-size' );
- *
- * // Do not go for the model element after data.modelCursor because it might happen
- * // that a single view element was converted to multiple model elements. Get all of them.
- * for ( const item of data.modelRange.getItems( { shallow: true } ) ) {
- * if ( schema.checkAttribute( item, 'fontSize' ) ) {
- * writer.setAttribute( 'fontSize', fontSize, item );
- * }
- * }
- * }, { priority: 'low' } );
- *
- * // Convert all elements which have no custom converter into a paragraph (autoparagraphing).
- * editor.data.upcastDispatcher.on( 'element', ( evt, data, conversionApi ) => {
- * // Check if an element can be converted.
- * if ( !conversionApi.consumable.test( data.viewItem, { name: data.viewItem.name } ) ) {
- * // When an element is already consumed by higher priority converters, do nothing.
- * return;
- * }
- *
- * const paragraph = conversionApi.writer.createElement( 'paragraph' );
- *
- * // Try to safely insert a paragraph at the model cursor - it will find an allowed parent for the current element.
- * if ( !conversionApi.safeInsert( paragraph, data.modelCursor ) ) {
- * // When an element was not inserted, it means that you cannot insert a paragraph at this position.
- * return;
- * }
- *
- * // Consume the inserted element.
- * conversionApi.consumable.consume( data.viewItem, { name: data.viewItem.name } ) );
- *
- * // Convert the children to a paragraph.
- * const { modelRange } = conversionApi.convertChildren( data.viewItem, paragraph ) );
- *
- * // Update `modelRange` and `modelCursor` in the `data` as a conversion result.
- * conversionApi.updateConversionResult( paragraph, data );
- * }, { priority: 'low' } );
- *
- * @mixes module:utils/emittermixin~EmitterMixin
- * @fires viewCleanup
- * @fires element
- * @fires text
- * @fires documentFragment
- */
- class UpcastDispatcher {
- /**
- * Creates an upcast dispatcher that operates using the passed API.
- *
- * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi
- * @param {Object} [conversionApi] Additional properties for an interface that will be passed to events fired
- * by the upcast dispatcher.
- */
- constructor( conversionApi = {} ) {
- /**
- * The list of elements that were created during splitting.
- *
- * After the conversion process the list is cleared.
- *
- * @private
- * @type {Map.<module:engine/model/element~Element,Array.<module:engine/model/element~Element>>}
- */
- this._splitParts = new Map();
- /**
- * The list of cursor parent elements that were created during splitting.
- *
- * After the conversion process the list is cleared.
- *
- * @private
- * @type {Map.<module:engine/model/element~Element,Array.<module:engine/model/element~Element>>}
- */
- this._cursorParents = new Map();
- /**
- * The position in the temporary structure where the converted content is inserted. The structure reflects the context of
- * the target position where the content will be inserted. This property is built based on the context parameter of the
- * convert method.
- *
- * @private
- * @type {module:engine/model/position~Position|null}
- */
- this._modelCursor = null;
- /**
- * An interface passed by the dispatcher to the event callbacks.
- *
- * @member {module:engine/conversion/upcastdispatcher~UpcastConversionApi}
- */
- this.conversionApi = Object.assign( {}, conversionApi );
- // The below methods are bound to this `UpcastDispatcher` instance and set on `conversionApi`.
- // This way only a part of `UpcastDispatcher` API is exposed.
- this.conversionApi.convertItem = this._convertItem.bind( this );
- this.conversionApi.convertChildren = this._convertChildren.bind( this );
- this.conversionApi.safeInsert = this._safeInsert.bind( this );
- this.conversionApi.updateConversionResult = this._updateConversionResult.bind( this );
- // Advanced API - use only if custom position handling is needed.
- this.conversionApi.splitToAllowedParent = this._splitToAllowedParent.bind( this );
- this.conversionApi.getSplitParts = this._getSplitParts.bind( this );
- }
- /**
- * Starts the conversion process. The entry point for the conversion.
- *
- * @fires element
- * @fires text
- * @fires documentFragment
- * @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/element~Element} viewItem
- * The part of the view to be converted.
- * @param {module:engine/model/writer~Writer} writer An instance of the model writer.
- * @param {module:engine/model/schema~SchemaContextDefinition} [context=['$root']] Elements will be converted according to this context.
- * @returns {module:engine/model/documentfragment~DocumentFragment} Model data that is the result of the conversion process
- * wrapped in `DocumentFragment`. Converted marker elements will be set as the document fragment's
- * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
- */
- convert( viewItem, writer, context = [ '$root' ] ) {
- this.fire( 'viewCleanup', viewItem );
- // Create context tree and set position in the top element.
- // Items will be converted according to this position.
- this._modelCursor = createContextTree( context, writer );
- // Store writer in conversion as a conversion API
- // to be sure that conversion process will use the same batch.
- this.conversionApi.writer = writer;
- // Create consumable values list for conversion process.
- this.conversionApi.consumable = _viewconsumable__WEBPACK_IMPORTED_MODULE_0__["default"].createFrom( viewItem );
- // Custom data stored by converter for conversion process.
- this.conversionApi.store = {};
- // Do the conversion.
- const { modelRange } = this._convertItem( viewItem, this._modelCursor );
- // Conversion result is always a document fragment so let's create it.
- const documentFragment = writer.createDocumentFragment();
- // When there is a conversion result.
- if ( modelRange ) {
- // Remove all empty elements that were create while splitting.
- this._removeEmptyElements();
- // Move all items that were converted in context tree to the document fragment.
- for ( const item of Array.from( this._modelCursor.parent.getChildren() ) ) {
- writer.append( item, documentFragment );
- }
- // Extract temporary markers elements from model and set as static markers collection.
- documentFragment.markers = extractMarkersFromModelFragment( documentFragment, writer );
- }
- // Clear context position.
- this._modelCursor = null;
- // Clear split elements & parents lists.
- this._splitParts.clear();
- this._cursorParents.clear();
- // Clear conversion API.
- this.conversionApi.writer = null;
- this.conversionApi.store = null;
- // Return fragment as conversion result.
- return documentFragment;
- }
- /**
- * @private
- * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertItem
- */
- _convertItem( viewItem, modelCursor ) {
- const data = Object.assign( { viewItem, modelCursor, modelRange: null } );
- if ( viewItem.is( 'element' ) ) {
- this.fire( 'element:' + viewItem.name, data, this.conversionApi );
- } else if ( viewItem.is( '$text' ) ) {
- this.fire( 'text', data, this.conversionApi );
- } else {
- this.fire( 'documentFragment', data, this.conversionApi );
- }
- // Handle incorrect conversion result.
- if ( data.modelRange && !( data.modelRange instanceof _model_range__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
- /**
- * Incorrect conversion result was dropped.
- *
- * {@link module:engine/model/range~Range Model range} should be a conversion result.
- *
- * @error view-conversion-dispatcher-incorrect-result
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'view-conversion-dispatcher-incorrect-result', this );
- }
- return { modelRange: data.modelRange, modelCursor: data.modelCursor };
- }
- /**
- * @private
- * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertChildren
- */
- _convertChildren( viewItem, elementOrModelCursor ) {
- let nextModelCursor = elementOrModelCursor.is( 'position' ) ?
- elementOrModelCursor : _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( elementOrModelCursor, 0 );
- const modelRange = new _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]( nextModelCursor );
- for ( const viewChild of Array.from( viewItem.getChildren() ) ) {
- const result = this._convertItem( viewChild, nextModelCursor );
- if ( result.modelRange instanceof _model_range__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
- modelRange.end = result.modelRange.end;
- nextModelCursor = result.modelCursor;
- }
- }
- return { modelRange, modelCursor: nextModelCursor };
- }
- /**
- * @private
- * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#safeInsert
- */
- _safeInsert( modelElement, position ) {
- // Find allowed parent for element that we are going to insert.
- // If current parent does not allow to insert element but one of the ancestors does
- // then split nodes to allowed parent.
- const splitResult = this._splitToAllowedParent( modelElement, position );
- // When there is no split result it means that we can't insert element to model tree, so let's skip it.
- if ( !splitResult ) {
- return false;
- }
- // Insert element on allowed position.
- this.conversionApi.writer.insert( modelElement, splitResult.position );
- return true;
- }
- /**
- * @private
- * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#updateConversionResult
- */
- _updateConversionResult( modelElement, data ) {
- const parts = this._getSplitParts( modelElement );
- const writer = this.conversionApi.writer;
- // Set conversion result range - only if not set already.
- if ( !data.modelRange ) {
- data.modelRange = writer.createRange(
- writer.createPositionBefore( modelElement ),
- writer.createPositionAfter( parts[ parts.length - 1 ] )
- );
- }
- const savedCursorParent = this._cursorParents.get( modelElement );
- // Now we need to check where the `modelCursor` should be.
- if ( savedCursorParent ) {
- // If we split parent to insert our element then we want to continue conversion in the new part of the split parent.
- //
- // before: <allowed><notAllowed>foo[]</notAllowed></allowed>
- // after: <allowed><notAllowed>foo</notAllowed> <converted></converted> <notAllowed>[]</notAllowed></allowed>
- data.modelCursor = writer.createPositionAt( savedCursorParent, 0 );
- } else {
- // Otherwise just continue after inserted element.
- data.modelCursor = data.modelRange.end;
- }
- }
- /**
- * @private
- * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#splitToAllowedParent
- */
- _splitToAllowedParent( node, modelCursor ) {
- const { schema, writer } = this.conversionApi;
- // Try to find allowed parent.
- let allowedParent = schema.findAllowedParent( modelCursor, node );
- if ( allowedParent ) {
- // When current position parent allows to insert node then return this position.
- if ( allowedParent === modelCursor.parent ) {
- return { position: modelCursor };
- }
- // When allowed parent is in context tree (it's outside the converted tree).
- if ( this._modelCursor.parent.getAncestors().includes( allowedParent ) ) {
- allowedParent = null;
- }
- }
- if ( !allowedParent ) {
- // Check if the node wrapped with a paragraph would be accepted by the schema.
- if ( !Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__["isParagraphable"])( modelCursor, node, schema ) ) {
- return null;
- }
- return {
- position: Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__["wrapInParagraph"])( modelCursor, writer )
- };
- }
- // Split element to allowed parent.
- const splitResult = this.conversionApi.writer.split( modelCursor, allowedParent );
- // Using the range returned by `model.Writer#split`, we will pair original elements with their split parts.
- //
- // The range returned from the writer spans "over the split" or, precisely saying, from the end of the original element (the one
- // that got split) to the beginning of the other part of that element:
- //
- // <limit><a><b><c>X[]Y</c></b><a></limit> ->
- // <limit><a><b><c>X[</c></b></a><a><b><c>]Y</c></b></a>
- //
- // After the split there cannot be any full node between the positions in `splitRange`. The positions are touching.
- // Also, because of how splitting works, it is easy to notice, that "closing tags" are in the reverse order than "opening tags".
- // Also, since we split all those elements, each of them has to have the other part.
- //
- // With those observations in mind, we will pair the original elements with their split parts by saving "closing tags" and matching
- // them with "opening tags" in the reverse order. For that we can use a stack.
- const stack = [];
- for ( const treeWalkerValue of splitResult.range.getWalker() ) {
- if ( treeWalkerValue.type == 'elementEnd' ) {
- stack.push( treeWalkerValue.item );
- } else {
- // There should not be any text nodes after the element is split, so the only other value is `elementStart`.
- const originalPart = stack.pop();
- const splitPart = treeWalkerValue.item;
- this._registerSplitPair( originalPart, splitPart );
- }
- }
- const cursorParent = splitResult.range.end.parent;
- this._cursorParents.set( node, cursorParent );
- return {
- position: splitResult.position,
- cursorParent
- };
- }
- /**
- * Registers that a `splitPart` element is a split part of the `originalPart` element.
- *
- * The data set by this method is used by {@link #_getSplitParts} and {@link #_removeEmptyElements}.
- *
- * @private
- * @param {module:engine/model/element~Element} originalPart
- * @param {module:engine/model/element~Element} splitPart
- */
- _registerSplitPair( originalPart, splitPart ) {
- if ( !this._splitParts.has( originalPart ) ) {
- this._splitParts.set( originalPart, [ originalPart ] );
- }
- const list = this._splitParts.get( originalPart );
- this._splitParts.set( splitPart, list );
- list.push( splitPart );
- }
- /**
- * @private
- * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#getSplitParts
- */
- _getSplitParts( element ) {
- let parts;
- if ( !this._splitParts.has( element ) ) {
- parts = [ element ];
- } else {
- parts = this._splitParts.get( element );
- }
- return parts;
- }
- /**
- * Checks if there are any empty elements created while splitting and removes them.
- *
- * This method works recursively to re-check empty elements again after at least one element was removed in the initial call,
- * as some elements might have become empty after other empty elements were removed from them.
- *
- * @private
- */
- _removeEmptyElements() {
- let anyRemoved = false;
- for ( const element of this._splitParts.keys() ) {
- if ( element.isEmpty ) {
- this.conversionApi.writer.remove( element );
- this._splitParts.delete( element );
- anyRemoved = true;
- }
- }
- if ( anyRemoved ) {
- this._removeEmptyElements();
- }
- }
- /**
- * Fired before the first conversion event, at the beginning of the upcast (view-to-model conversion) process.
- *
- * @event viewCleanup
- * @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/element~Element}
- * viewItem A part of the view to be converted.
- */
- /**
- * Fired when an {@link module:engine/view/element~Element} is converted.
- *
- * `element` is a namespace event for a class of events. Names of actually called events follow the pattern of
- * `element:<elementName>` where `elementName` is the name of the converted element. This way listeners may listen to
- * a conversion of all or just specific elements.
- *
- * @event element
- * @param {module:engine/conversion/upcastdispatcher~UpcastConversionData} data The conversion data. Keep in mind that this object is
- * shared by reference between all callbacks that will be called. This means that callbacks can override values if needed, and these
- * values will be available in other callbacks.
- * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion utilities to be used by the
- * callback.
- */
- /**
- * Fired when a {@link module:engine/view/text~Text} is converted.
- *
- * @event text
- * @see #event:element
- */
- /**
- * Fired when a {@link module:engine/view/documentfragment~DocumentFragment} is converted.
- *
- * @event documentFragment
- * @see #event:element
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__["default"])( UpcastDispatcher, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_6__["default"] );
- // Traverses given model item and searches elements which marks marker range. Found element is removed from
- // DocumentFragment but path of this element is stored in a Map which is then returned.
- //
- // @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/node~Node} modelItem Fragment of model.
- // @returns {Map<String, module:engine/model/range~Range>} List of static markers.
- function extractMarkersFromModelFragment( modelItem, writer ) {
- const markerElements = new Set();
- const markers = new Map();
- // Create ModelTreeWalker.
- const range = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( modelItem ).getItems();
- // Walk through DocumentFragment and collect marker elements.
- for ( const item of range ) {
- // Check if current element is a marker.
- if ( item.name == '$marker' ) {
- markerElements.add( item );
- }
- }
- // Walk through collected marker elements store its path and remove its from the DocumentFragment.
- for ( const markerElement of markerElements ) {
- const markerName = markerElement.getAttribute( 'data-name' );
- const currentPosition = writer.createPositionBefore( markerElement );
- // When marker of given name is not stored it means that we have found the beginning of the range.
- if ( !markers.has( markerName ) ) {
- markers.set( markerName, new _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]( currentPosition.clone() ) );
- // Otherwise is means that we have found end of the marker range.
- } else {
- markers.get( markerName ).end = currentPosition.clone();
- }
- // Remove marker element from DocumentFragment.
- writer.remove( markerElement );
- }
- return markers;
- }
- // Creates model fragment according to given context and returns position in the bottom (the deepest) element.
- function createContextTree( contextDefinition, writer ) {
- let position;
- for ( const item of new _model_schema__WEBPACK_IMPORTED_MODULE_3__["SchemaContext"]( contextDefinition ) ) {
- const attributes = {};
- for ( const key of item.getAttributeKeys() ) {
- attributes[ key ] = item.getAttribute( key );
- }
- const current = writer.createElement( item.name, attributes );
- if ( position ) {
- writer.append( current, position );
- }
- position = _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( current, 0 );
- }
- return position;
- }
- /**
- * A set of conversion utilities available as the third parameter of the
- * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher upcast dispatcher}'s events.
- *
- * @interface module:engine/conversion/upcastdispatcher~UpcastConversionApi
- */
- /**
- * Starts the conversion of a given item by firing an appropriate event.
- *
- * Every fired event is passed (as the first parameter) an object with the `modelRange` property. Every event may set and/or
- * modify that property. When all callbacks are done, the final value of the `modelRange` property is returned by this method.
- * The `modelRange` must be a {@link module:engine/model/range~Range model range} or `null` (as set by default).
- *
- * @method #convertItem
- * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
- * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:text
- * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:documentFragment
- * @param {module:engine/view/item~Item} viewItem Item to convert.
- * @param {module:engine/model/position~Position} modelCursor The conversion position.
- * @returns {Object} result The conversion result.
- * @returns {module:engine/model/range~Range|null} result.modelRange The model range containing the result of the item conversion,
- * created and modified by callbacks attached to the fired event, or `null` if the conversion result was incorrect.
- * @returns {module:engine/model/position~Position} result.modelCursor The position where the conversion should be continued.
- */
- /**
- * Starts the conversion of all children of a given item by firing appropriate events for all the children.
- *
- * @method #convertChildren
- * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
- * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:text
- * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:documentFragment
- * @param {module:engine/view/item~Item} viewItem An element whose children should be converted.
- * @param {module:engine/model/position~Position|module:engine/model/element~Element} positionOrElement A position or an element of
- * the conversion.
- * @returns {Object} result The conversion result.
- * @returns {module:engine/model/range~Range} result.modelRange The model range containing the results of the conversion of all children
- * of the given item. When no child was converted, the range is collapsed.
- * @returns {module:engine/model/position~Position} result.modelCursor The position where the conversion should be continued.
- */
- /**
- * Safely inserts an element to the document, checking the {@link module:engine/model/schema~Schema schema} to find an allowed parent for
- * an element that you are going to insert, starting from the given position. If the current parent does not allow to insert the element
- * but one of the ancestors does, then splits the nodes to allowed parent.
- *
- * If the schema allows to insert the node in a given position, nothing is split.
- *
- * If it was not possible to find an allowed parent, `false` is returned and nothing is split.
- *
- * Otherwise, ancestors are split.
- *
- * For instance, if `<image>` is not allowed in `<paragraph>` but is allowed in `$root`:
- *
- * <paragraph>foo[]bar</paragraph>
- *
- * -> safe insert for `<image>` will split ->
- *
- * <paragraph>foo</paragraph>[]<paragraph>bar</paragraph>
- *
- * Example usage:
- *
- * const myElement = conversionApi.writer.createElement( 'myElement' );
- *
- * if ( !conversionApi.safeInsert( myElement, data.modelCursor ) ) {
- * return;
- * }
- *
- * The split result is saved and {@link #updateConversionResult} should be used to update the
- * {@link module:engine/conversion/upcastdispatcher~UpcastConversionData conversion data}.
- *
- * @method #safeInsert
- * @param {module:engine/model/node~Node} node The node to insert.
- * @param {module:engine/model/position~Position} position The position where an element is going to be inserted.
- * @returns {Boolean} The split result. If it was not possible to find an allowed position, `false` is returned.
- */
- /**
- * Updates the conversion result and sets a proper {@link module:engine/conversion/upcastdispatcher~UpcastConversionData#modelRange} and
- * the next {@link module:engine/conversion/upcastdispatcher~UpcastConversionData#modelCursor} after the conversion.
- * Used together with {@link #safeInsert}, it enables you to easily convert elements without worrying if the node was split
- * during the conversion of its children.
- *
- * A usage example in converter code:
- *
- * const myElement = conversionApi.writer.createElement( 'myElement' );
- *
- * if ( !conversionApi.safeInsert( myElement, data.modelCursor ) ) {
- * return;
- * }
- *
- * // Children conversion may split `myElement`.
- * conversionApi.convertChildren( data.viewItem, myElement );
- *
- * conversionApi.updateConversionResult( myElement, data );
- *
- * @method #updateConversionResult
- * @param {module:engine/model/element~Element} element
- * @param {module:engine/conversion/upcastdispatcher~UpcastConversionData} data Conversion data.
- * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion utilities to be used by the callback.
- */
- /**
- * Checks the {@link module:engine/model/schema~Schema schema} to find an allowed parent for an element that is going to be inserted
- * starting from the given position. If the current parent does not allow inserting an element but one of the ancestors does, the method
- * splits nodes to allowed parent.
- *
- * If the schema allows inserting the node in the given position, nothing is split and an object with that position is returned.
- *
- * If it was not possible to find an allowed parent, `null` is returned and nothing is split.
- *
- * Otherwise, ancestors are split and an object with a position and the copy of the split element is returned.
- *
- * For instance, if `<image>` is not allowed in `<paragraph>` but is allowed in `$root`:
- *
- * <paragraph>foo[]bar</paragraph>
- *
- * -> split for `<image>` ->
- *
- * <paragraph>foo</paragraph>[]<paragraph>bar</paragraph>
- *
- * In the example above, the position between `<paragraph>` elements will be returned as `position` and the second `paragraph`
- * as `cursorParent`.
- *
- * **Note:** This is an advanced method. For most cases {@link #safeInsert} and {@link #updateConversionResult} should be used.
- *
- * @method #splitToAllowedParent
- * @param {module:engine/model/position~Position} position The position where the element is going to be inserted.
- * @param {module:engine/model/node~Node} node The node to insert.
- * @returns {Object|null} The split result. If it was not possible to find an allowed position, `null` is returned.
- * @returns {module:engine/model/position~Position} The position between split elements.
- * @returns {module:engine/model/element~Element} [cursorParent] The element inside which the cursor should be placed to
- * continue the conversion. When the element is not defined it means that there was no split.
- */
- /**
- * Returns all the split parts of the given `element` that were created during upcasting through using {@link #splitToAllowedParent}.
- * It enables you to easily track these elements and continue processing them after they are split during the conversion of their children.
- *
- * <paragraph>Foo<image />bar<image />baz</paragraph> ->
- * <paragraph>Foo</paragraph><image /><paragraph>bar</paragraph><image /><paragraph>baz</paragraph>
- *
- * For a reference to any of above paragraphs, the function will return all three paragraphs (the original element included),
- * sorted in the order of their creation (the original element is the first one).
- *
- * If the given `element` was not split, an array with a single element is returned.
- *
- * A usage example in the converter code:
- *
- * const myElement = conversionApi.writer.createElement( 'myElement' );
- *
- * // Children conversion may split `myElement`.
- * conversionApi.convertChildren( data.viewItem, data.modelCursor );
- *
- * const splitParts = conversionApi.getSplitParts( myElement );
- * const lastSplitPart = splitParts[ splitParts.length - 1 ];
- *
- * // Setting `data.modelRange` basing on split parts:
- * data.modelRange = conversionApi.writer.createRange(
- * conversionApi.writer.createPositionBefore( myElement ),
- * conversionApi.writer.createPositionAfter( lastSplitPart )
- * );
- *
- * // Setting `data.modelCursor` to continue after the last split element:
- * data.modelCursor = conversionApi.writer.createPositionAfter( lastSplitPart );
- *
- * **Tip:** If you are unable to get a reference to the original element (for example because the code is split into multiple converters
- * or even classes) but it has already been converted, you may want to check the first element in `data.modelRange`. This is a common
- * situation if an attribute converter is separated from an element converter.
- *
- * **Note:** This is an advanced method. For most cases {@link #safeInsert} and {@link #updateConversionResult} should be used.
- *
- * @method #getSplitParts
- * @param {module:engine/model/element~Element} element
- * @returns {Array.<module:engine/model/element~Element>}
- */
- /**
- * Stores information about what parts of the processed view item are still waiting to be handled. After a piece of view item
- * was converted, an appropriate consumable value should be
- * {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consumed}.
- *
- * @member {module:engine/conversion/viewconsumable~ViewConsumable} #consumable
- */
- /**
- * Custom data stored by converters for the conversion process. Custom properties of this object can be defined and use to
- * pass parameters between converters.
- *
- * The difference between this property and the `data` parameter of
- * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element} is that the `data` parameters allow you
- * to pass parameters within a single event and `store` within the whole conversion.
- *
- * @member {Object} #store
- */
- /**
- * The model's schema instance.
- *
- * @member {module:engine/model/schema~Schema} #schema
- */
- /**
- * The {@link module:engine/model/writer~Writer} instance used to manipulate the data during conversion.
- *
- * @member {module:engine/model/writer~Writer} #writer
- */
- /**
- * Conversion data.
- *
- * **Note:** Keep in mind that this object is shared by reference between all conversion callbacks that will be called.
- * This means that callbacks can override values if needed, and these values will be available in other callbacks.
- *
- * @typedef {Object} module:engine/conversion/upcastdispatcher~UpcastConversionData
- *
- * @property {module:engine/view/item~Item} viewItem The converted item.
- * @property {module:engine/model/position~Position} modelCursor The position where the converter should start changes.
- * Change this value for the next converter to tell where the conversion should continue.
- * @property {module:engine/model/range~Range} [modelRange] The current state of conversion result. Every change to
- * the converted element should be reflected by setting or modifying this property.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js ***!
- \*********************************************************************************/
- /*! exports provided: default, convertToModelFragment, convertText, convertSelectionChange */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpcastHelpers; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToModelFragment", function() { return convertToModelFragment; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertText", function() { return convertText; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSelectionChange", function() { return convertSelectionChange; });
- /* harmony import */ var _view_matcher__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view/matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
- /* harmony import */ var _conversionhelpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./conversionhelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
- /* harmony import */ var _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../model/utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * Contains {@link module:engine/view/view view} to {@link module:engine/model/model model} converters for
- * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}.
- *
- * @module engine/conversion/upcasthelpers
- */
- /**
- * Upcast conversion helper functions.
- *
- * @extends module:engine/conversion/conversionhelpers~ConversionHelpers
- */
- class UpcastHelpers extends _conversionhelpers__WEBPACK_IMPORTED_MODULE_1__["default"] {
- /**
- * View element to model element conversion helper.
- *
- * This conversion results in creating a model element. For example,
- * view `<p>Foo</p>` becomes `<paragraph>Foo</paragraph>` in the model.
- *
- * Keep in mind that the element will be inserted only if it is allowed
- * by {@link module:engine/model/schema~Schema schema} configuration.
- *
- * editor.conversion.for( 'upcast' ).elementToElement( {
- * view: 'p',
- * model: 'paragraph'
- * } );
- *
- * editor.conversion.for( 'upcast' ).elementToElement( {
- * view: 'p',
- * model: 'paragraph',
- * converterPriority: 'high'
- * } );
- *
- * editor.conversion.for( 'upcast' ).elementToElement( {
- * view: {
- * name: 'p',
- * classes: 'fancy'
- * },
- * model: 'fancyParagraph'
- * } );
- *
- * editor.conversion.for( 'upcast' ).elementToElement( {
- * view: {
- * name: 'p',
- * classes: 'heading'
- * },
- * model: ( viewElement, conversionApi ) => {
- * const modelWriter = conversionApi.writer;
- *
- * return modelWriter.createElement( 'heading', { level: viewElement.getAttribute( 'data-level' ) } );
- * }
- * } );
- *
- * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
- * to the conversion process.
- *
- * @method #elementToElement
- * @param {Object} config Conversion configuration.
- * @param {module:engine/view/matcher~MatcherPattern} [config.view] Pattern matching all view elements which should be converted. If not
- * set, the converter will fire for every view element.
- * @param {String|module:engine/model/element~Element|Function} config.model Name of the model element, a model element instance or a
- * function that takes a view element and {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API}
- * and returns a model element. The model element will be inserted in the model.
- * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
- */
- elementToElement( config ) {
- return this.add( upcastElementToElement( config ) );
- }
- /**
- * View element to model attribute conversion helper.
- *
- * This conversion results in setting an attribute on a model node. For example, view `<strong>Foo</strong>` becomes
- * `Foo` {@link module:engine/model/text~Text model text node} with `bold` attribute set to `true`.
- *
- * This helper is meant to set a model attribute on all the elements that are inside the converted element:
- *
- * <strong>Foo</strong> --> <strong><p>Foo</p></strong> --> <paragraph><$text bold="true">Foo</$text></paragraph>
- *
- * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).
- * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text. See
- * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute} for comparison.
- *
- * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
- *
- * editor.conversion.for( 'upcast' ).elementToAttribute( {
- * view: 'strong',
- * model: 'bold'
- * } );
- *
- * editor.conversion.for( 'upcast' ).elementToAttribute( {
- * view: 'strong',
- * model: 'bold',
- * converterPriority: 'high'
- * } );
- *
- * editor.conversion.for( 'upcast' ).elementToAttribute( {
- * view: {
- * name: 'span',
- * classes: 'bold'
- * },
- * model: 'bold'
- * } );
- *
- * editor.conversion.for( 'upcast' ).elementToAttribute( {
- * view: {
- * name: 'span',
- * classes: [ 'styled', 'styled-dark' ]
- * },
- * model: {
- * key: 'styled',
- * value: 'dark'
- * }
- * } );
- *
- * editor.conversion.for( 'upcast' ).elementToAttribute( {
- * view: {
- * name: 'span',
- * styles: {
- * 'font-size': /[\s\S]+/
- * }
- * },
- * model: {
- * key: 'fontSize',
- * value: ( viewElement, conversionApi ) => {
- * const fontSize = viewElement.getStyle( 'font-size' );
- * const value = fontSize.substr( 0, fontSize.length - 2 );
- *
- * if ( value <= 10 ) {
- * return 'small';
- * } else if ( value > 12 ) {
- * return 'big';
- * }
- *
- * return null;
- * }
- * }
- * } );
- *
- * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
- * to the conversion process.
- *
- * @method #elementToAttribute
- * @param {Object} config Conversion configuration.
- * @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
- * @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
- * the model attribute. `value` property may be set as a function that takes a view element and
- * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the value.
- * If `String` is given, the model attribute value will be set to `true`.
- * @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
- * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
- */
- elementToAttribute( config ) {
- return this.add( upcastElementToAttribute( config ) );
- }
- /**
- * View attribute to model attribute conversion helper.
- *
- * This conversion results in setting an attribute on a model node. For example, view `<img src="foo.jpg"></img>` becomes
- * `<image source="foo.jpg"></image>` in the model.
- *
- * This helper is meant to convert view attributes from view elements which got converted to the model, so the view attribute
- * is set only on the corresponding model node:
- *
- * <div class="dark"><div>foo</div></div> --> <div dark="true"><div>foo</div></div>
- *
- * Above, `class="dark"` attribute is added only to the `<div>` elements that has it. This is in contrary to
- * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute} which sets attributes for
- * all the children in the model:
- *
- * <strong>Foo</strong> --> <strong><p>Foo</p></strong> --> <paragraph><$text bold="true">Foo</$text></paragraph>
- *
- * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).
- * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text.
- *
- * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
- *
- * editor.conversion.for( 'upcast' ).attributeToAttribute( {
- * view: 'src',
- * model: 'source'
- * } );
- *
- * editor.conversion.for( 'upcast' ).attributeToAttribute( {
- * view: { key: 'src' },
- * model: 'source'
- * } );
- *
- * editor.conversion.for( 'upcast' ).attributeToAttribute( {
- * view: { key: 'src' },
- * model: 'source',
- * converterPriority: 'normal'
- * } );
- *
- * editor.conversion.for( 'upcast' ).attributeToAttribute( {
- * view: {
- * key: 'data-style',
- * value: /[\s\S]+/
- * },
- * model: 'styled'
- * } );
- *
- * editor.conversion.for( 'upcast' ).attributeToAttribute( {
- * view: {
- * name: 'img',
- * key: 'class',
- * value: 'styled-dark'
- * },
- * model: {
- * key: 'styled',
- * value: 'dark'
- * }
- * } );
- *
- * editor.conversion.for( 'upcast' ).attributeToAttribute( {
- * view: {
- * key: 'class',
- * value: /styled-[\S]+/
- * },
- * model: {
- * key: 'styled'
- * value: ( viewElement, conversionApi ) => {
- * const regexp = /styled-([\S]+)/;
- * const match = viewElement.getAttribute( 'class' ).match( regexp );
- *
- * return match[ 1 ];
- * }
- * }
- * } );
- *
- * Converting styles works a bit differently as it requires `view.styles` to be an object and by default
- * a model attribute will be set to `true` by such a converter. You can set the model attribute to any value by providing the `value`
- * callback that returns the desired value.
- *
- * // Default conversion of font-weight style will result in setting bold attribute to true.
- * editor.conversion.for( 'upcast' ).attributeToAttribute( {
- * view: {
- * styles: {
- * 'font-weight': 'bold'
- * }
- * },
- * model: 'bold'
- * } );
- *
- * // This converter will pass any style value to the `lineHeight` model attribute.
- * editor.conversion.for( 'upcast' ).attributeToAttribute( {
- * view: {
- * styles: {
- * 'line-height': /[\s\S]+/
- * }
- * },
- * model: {
- * key: 'lineHeight',
- * value: ( viewElement, conversionApi ) => viewElement.getStyle( 'line-height' )
- * }
- * } );
- *
- * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
- * to the conversion process.
- *
- * @method #attributeToAttribute
- * @param {Object} config Conversion configuration.
- * @param {String|Object} config.view Specifies which view attribute will be converted. If a `String` is passed,
- * attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,
- * specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`
- * property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,
- * a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.
- * @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
- * the model attribute. `value` property may be set as a function that takes a view element and
- * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the value.
- * If `String` is given, the model attribute value will be same as view attribute value.
- * @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
- * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
- */
- attributeToAttribute( config ) {
- return this.add( upcastAttributeToAttribute( config ) );
- }
- /**
- * View element to model marker conversion helper.
- *
- * **Note**: This method was deprecated. Please use {@link #dataToMarker} instead.
- *
- * This conversion results in creating a model marker. For example, if the marker was stored in a view as an element:
- * `<p>Fo<span data-marker="comment" data-comment-id="7"></span>o</p><p>B<span data-marker="comment" data-comment-id="7"></span>ar</p>`,
- * after the conversion is done, the marker will be available in
- * {@link module:engine/model/model~Model#markers model document markers}.
- *
- * editor.conversion.for( 'upcast' ).elementToMarker( {
- * view: 'marker-search',
- * model: 'search'
- * } );
- *
- * editor.conversion.for( 'upcast' ).elementToMarker( {
- * view: 'marker-search',
- * model: 'search',
- * converterPriority: 'high'
- * } );
- *
- * editor.conversion.for( 'upcast' ).elementToMarker( {
- * view: 'marker-search',
- * model: ( viewElement, conversionApi ) => 'comment:' + viewElement.getAttribute( 'data-comment-id' )
- * } );
- *
- * editor.conversion.for( 'upcast' ).elementToMarker( {
- * view: {
- * name: 'span',
- * attributes: {
- * 'data-marker': 'search'
- * }
- * },
- * model: 'search'
- * } );
- *
- * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
- * to the conversion process.
- *
- * @deprecated
- * @method #elementToMarker
- * @param {Object} config Conversion configuration.
- * @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
- * @param {String|Function} config.model Name of the model marker, or a function that takes a view element and returns
- * a model marker name.
- * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
- */
- elementToMarker( config ) {
- /**
- * The {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToMarker `UpcastHelpers#elementToMarker()`}
- * method was deprecated and will be removed in the near future.
- * Please use {@link module:engine/conversion/upcasthelpers~UpcastHelpers#dataToMarker `UpcastHelpers#dataToMarker()`} instead.
- *
- * @error upcast-helpers-element-to-marker-deprecated
- */
- Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["logWarning"])( 'upcast-helpers-element-to-marker-deprecated' );
- return this.add( upcastElementToMarker( config ) );
- }
- /**
- * View-to-model marker conversion helper.
- *
- * Converts view data created by {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`}
- * back to a model marker.
- *
- * This converter looks for specific view elements and view attributes that mark marker boundaries. See
- * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`} to learn what view data
- * is expected by this converter.
- *
- * The `config.view` property is equal to the marker group name to convert.
- *
- * By default, this converter creates markers with the `group:name` name convention (to match the default `markerToData` conversion).
- *
- * The conversion configuration can take a function that will generate a marker name.
- * If such function is set as the `config.model` parameter, it is passed the `name` part from the view element or attribute and it is
- * expected to return a string with the marker name.
- *
- * Basic usage:
- *
- * // Using the default conversion.
- * // In this case, all markers from the `comment` group will be converted.
- * // The conversion will look for `<comment-start>` and `<comment-end>` tags and
- * // `data-comment-start-before`, `data-comment-start-after`,
- * // `data-comment-end-before` and `data-comment-end-after` attributes.
- * editor.conversion.for( 'upcast' ).dataToMarker( {
- * view: 'comment'
- * } );
- *
- * An example of a model that may be generated by this conversion:
- *
- * // View:
- * <p>Foo<comment-start name="commentId:uid"></comment-start>bar</p>
- * <figure data-comment-end-after="commentId:uid" class="image"><img src="abc.jpg" /></figure>
- *
- * // Model:
- * <paragraph>Foo[bar</paragraph>
- * <image src="abc.jpg"></image>]
- *
- * Where `[]` are boundaries of a marker that will receive the `comment:commentId:uid` name.
- *
- * Other examples of usage:
- *
- * // Using a custom function which is the same as the default conversion:
- * editor.conversion.for( 'upcast' ).dataToMarker( {
- * view: 'comment',
- * model: ( name, conversionApi ) => 'comment:' + name,
- * } );
- *
- * // Using the converter priority:
- * editor.conversion.for( 'upcast' ).dataToMarker( {
- * view: 'comment',
- * model: ( name, conversionApi ) => 'comment:' + name,
- * converterPriority: 'high'
- * } );
- *
- * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
- * to the conversion process.
- *
- * @method #dataToMarker
- * @param {Object} config Conversion configuration.
- * @param {String} config.view The marker group name to convert.
- * @param {Function} [config.model] A function that takes the `name` part from the view element or attribute and
- * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the marker name.
- * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
- */
- dataToMarker( config ) {
- return this.add( upcastDataToMarker( config ) );
- }
- }
- /**
- * Function factory, creates a converter that converts {@link module:engine/view/documentfragment~DocumentFragment view document fragment}
- * or all children of {@link module:engine/view/element~Element} into
- * {@link module:engine/model/documentfragment~DocumentFragment model document fragment}.
- * This is the "entry-point" converter for upcast (view to model conversion). This converter starts the conversion of all children
- * of passed view document fragment. Those children {@link module:engine/view/node~Node view nodes} are then handled by other converters.
- *
- * This also a "default", last resort converter for all view elements that has not been converted by other converters.
- * When a view element is being converted to the model but it does not have converter specified, that view element
- * will be converted to {@link module:engine/model/documentfragment~DocumentFragment model document fragment} and returned.
- *
- * @returns {Function} Universal converter for view {@link module:engine/view/documentfragment~DocumentFragment fragments} and
- * {@link module:engine/view/element~Element elements} that returns
- * {@link module:engine/model/documentfragment~DocumentFragment model fragment} with children of converted view item.
- */
- function convertToModelFragment() {
- return ( evt, data, conversionApi ) => {
- // Second argument in `consumable.consume` is discarded for ViewDocumentFragment but is needed for ViewElement.
- if ( !data.modelRange && conversionApi.consumable.consume( data.viewItem, { name: true } ) ) {
- const { modelRange, modelCursor } = conversionApi.convertChildren( data.viewItem, data.modelCursor );
- data.modelRange = modelRange;
- data.modelCursor = modelCursor;
- }
- };
- }
- /**
- * Function factory, creates a converter that converts {@link module:engine/view/text~Text} to {@link module:engine/model/text~Text}.
- *
- * @returns {Function} {@link module:engine/view/text~Text View text} converter.
- */
- function convertText() {
- return ( evt, data, { schema, consumable, writer } ) => {
- let position = data.modelCursor;
- // When node is already converted then do nothing.
- if ( !consumable.test( data.viewItem ) ) {
- return;
- }
- if ( !schema.checkChild( position, '$text' ) ) {
- if ( !Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_5__["isParagraphable"])( position, '$text', schema ) ) {
- return;
- }
- position = Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_5__["wrapInParagraph"])( position, writer );
- }
- consumable.consume( data.viewItem );
- const text = writer.createText( data.viewItem.data );
- writer.insert( text, position );
- data.modelRange = writer.createRange(
- position,
- position.getShiftedBy( text.offsetSize )
- );
- data.modelCursor = data.modelRange.end;
- };
- }
- /**
- * Function factory, creates a callback function which converts a {@link module:engine/view/selection~Selection
- * view selection} taken from the {@link module:engine/view/document~Document#event:selectionChange} event
- * and sets in on the {@link module:engine/model/document~Document#selection model}.
- *
- * **Note**: because there is no view selection change dispatcher nor any other advanced view selection to model
- * conversion mechanism, the callback should be set directly on view document.
- *
- * view.document.on( 'selectionChange', convertSelectionChange( modelDocument, mapper ) );
- *
- * @param {module:engine/model/model~Model} model Data model.
- * @param {module:engine/conversion/mapper~Mapper} mapper Conversion mapper.
- * @returns {Function} {@link module:engine/view/document~Document#event:selectionChange} callback function.
- */
- function convertSelectionChange( model, mapper ) {
- return ( evt, data ) => {
- const viewSelection = data.newSelection;
- const ranges = [];
- for ( const viewRange of viewSelection.getRanges() ) {
- ranges.push( mapper.toModelRange( viewRange ) );
- }
- const modelSelection = model.createSelection( ranges, { backward: viewSelection.isBackward } );
- if ( !modelSelection.isEqual( model.document.selection ) ) {
- model.change( writer => {
- writer.setSelection( modelSelection );
- } );
- }
- };
- }
- // View element to model element conversion helper.
- //
- // See {@link ~UpcastHelpers#elementToElement `.elementToElement()` upcast helper} for examples.
- //
- // @param {Object} config Conversion configuration.
- // @param {module:engine/view/matcher~MatcherPattern} [config.view] Pattern matching all view elements which should be converted. If not
- // set, the converter will fire for every view element.
- // @param {String|module:engine/model/element~Element|Function} config.model Name of the model element, a model element
- // instance or a function that takes a view element and returns a model element. The model element will be inserted in the model.
- // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- // @returns {Function} Conversion helper.
- function upcastElementToElement( config ) {
- config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
- const converter = prepareToElementConverter( config );
- const elementName = getViewElementNameFromConfig( config.view );
- const eventName = elementName ? 'element:' + elementName : 'element';
- return dispatcher => {
- dispatcher.on( eventName, converter, { priority: config.converterPriority || 'normal' } );
- };
- }
- // View element to model attribute conversion helper.
- //
- // See {@link ~UpcastHelpers#elementToAttribute `.elementToAttribute()` upcast helper} for examples.
- //
- // @param {Object} config Conversion configuration.
- // @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
- // @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
- // the model attribute. `value` property may be set as a function that takes a view element and returns the value.
- // If `String` is given, the model attribute value will be set to `true`.
- // @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
- // @returns {Function} Conversion helper.
- function upcastElementToAttribute( config ) {
- config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
- normalizeModelAttributeConfig( config );
- const converter = prepareToAttributeConverter( config, false );
- const elementName = getViewElementNameFromConfig( config.view );
- const eventName = elementName ? 'element:' + elementName : 'element';
- return dispatcher => {
- dispatcher.on( eventName, converter, { priority: config.converterPriority || 'low' } );
- };
- }
- // View attribute to model attribute conversion helper.
- //
- // See {@link ~UpcastHelpers#attributeToAttribute `.attributeToAttribute()` upcast helper} for examples.
- //
- // @param {Object} config Conversion configuration.
- // @param {String|Object} config.view Specifies which view attribute will be converted. If a `String` is passed,
- // attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,
- // specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`
- // property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,
- // a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.
- // @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
- // the model attribute. `value` property may be set as a function that takes a view element and returns the value.
- // If `String` is given, the model attribute value will be same as view attribute value.
- // @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
- // @returns {Function} Conversion helper.
- function upcastAttributeToAttribute( config ) {
- config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
- let viewKey = null;
- if ( typeof config.view == 'string' || config.view.key ) {
- viewKey = normalizeViewAttributeKeyValueConfig( config );
- }
- normalizeModelAttributeConfig( config, viewKey );
- const converter = prepareToAttributeConverter( config, true );
- return dispatcher => {
- dispatcher.on( 'element', converter, { priority: config.converterPriority || 'low' } );
- };
- }
- // View element to model marker conversion helper.
- //
- // See {@link ~UpcastHelpers#elementToMarker `.elementToMarker()` upcast helper} for examples.
- //
- // @param {Object} config Conversion configuration.
- // @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
- // @param {String|Function} config.model Name of the model marker, or a function that takes a view element and returns
- // a model marker name.
- // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
- // @returns {Function} Conversion helper.
- function upcastElementToMarker( config ) {
- config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
- normalizeElementToMarkerConfig( config );
- return upcastElementToElement( config );
- }
- // View data to model marker conversion helper.
- //
- // See {@link ~UpcastHelpers#dataToMarker} to learn more.
- //
- // @param {Object} config
- // @param {String} config.view
- // @param {Function} [config.model]
- // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal']
- // @returns {Function} Conversion helper.
- function upcastDataToMarker( config ) {
- config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
- // Default conversion.
- if ( !config.model ) {
- config.model = name => {
- return name ? config.view + ':' + name : config.view;
- };
- }
- const converterStart = prepareToElementConverter( normalizeDataToMarkerConfig( config, 'start' ) );
- const converterEnd = prepareToElementConverter( normalizeDataToMarkerConfig( config, 'end' ) );
- return dispatcher => {
- dispatcher.on( 'element:' + config.view + '-start', converterStart, { priority: config.converterPriority || 'normal' } );
- dispatcher.on( 'element:' + config.view + '-end', converterEnd, { priority: config.converterPriority || 'normal' } );
- // Below is a hack that is needed to properly handle `converterPriority` for both elements and attributes.
- // Attribute conversion needs to be performed *after* element conversion.
- // This converter handles both element conversion and attribute conversion, which means that if a single
- // `config.converterPriority` is used, it will lead to problems. For example, if `'high'` priority is used,
- // then attribute conversion will be performed before a lot of element upcast converters.
- // On the other hand we want to support `config.converterPriority` and overwriting converters.
- //
- // To have it work, we need to do some extra processing for priority for attribute converter.
- // Priority `'low'` value should be the base value and then we will change it depending on `config.converterPriority` value.
- //
- // This hack probably would not be needed if attributes are upcasted separately.
- //
- const basePriority = _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_4__["default"].get( 'low' );
- const maxPriority = _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_4__["default"].get( 'highest' );
- const priorityFactor = _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_4__["default"].get( config.converterPriority ) / maxPriority; // Number in range [ -1, 1 ].
- dispatcher.on( 'element', upcastAttributeToMarker( config ), { priority: basePriority + priorityFactor } );
- };
- }
- // Function factory, returns a callback function which converts view attributes to a model marker.
- //
- // The converter looks for elements with `data-group-start-before`, `data-group-start-after`, `data-group-end-before`
- // and `data-group-end-after` attributes and inserts `$marker` model elements before/after those elements.
- // `group` part is specified in `config.view`.
- //
- // @param {Object} config
- // @param {String} config.view
- // @param {Function} [config.model]
- // @returns {Function} Marker converter.
- function upcastAttributeToMarker( config ) {
- return ( evt, data, conversionApi ) => {
- const attrName = `data-${ config.view }`;
- // Check if any attribute for the given view item can be consumed before changing the conversion data
- // and consuming view items with these attributes.
- if (
- !conversionApi.consumable.test( data.viewItem, { attributes: attrName + '-end-after' } ) &&
- !conversionApi.consumable.test( data.viewItem, { attributes: attrName + '-start-after' } ) &&
- !conversionApi.consumable.test( data.viewItem, { attributes: attrName + '-end-before' } ) &&
- !conversionApi.consumable.test( data.viewItem, { attributes: attrName + '-start-before' } )
- ) {
- return;
- }
- // This converter wants to add a model element, marking a marker, before/after an element (or maybe even group of elements).
- // To do that, we can use `data.modelRange` which is set on an element (or a group of elements) that has been upcasted.
- // But, if the processed view element has not been upcasted yet (it does not have been converted), we need to
- // fire conversion for its children first, then we will have `data.modelRange` available.
- if ( !data.modelRange ) {
- Object.assign( data, conversionApi.convertChildren( data.viewItem, data.modelCursor ) );
- }
- if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-end-after' } ) ) {
- addMarkerElements( data.modelRange.end, data.viewItem.getAttribute( attrName + '-end-after' ).split( ',' ) );
- }
- if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-start-after' } ) ) {
- addMarkerElements( data.modelRange.end, data.viewItem.getAttribute( attrName + '-start-after' ).split( ',' ) );
- }
- if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-end-before' } ) ) {
- addMarkerElements( data.modelRange.start, data.viewItem.getAttribute( attrName + '-end-before' ).split( ',' ) );
- }
- if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-start-before' } ) ) {
- addMarkerElements( data.modelRange.start, data.viewItem.getAttribute( attrName + '-start-before' ).split( ',' ) );
- }
- function addMarkerElements( position, markerViewNames ) {
- for ( const markerViewName of markerViewNames ) {
- const markerName = config.model( markerViewName, conversionApi );
- const element = conversionApi.writer.createElement( '$marker', { 'data-name': markerName } );
- conversionApi.writer.insert( element, position );
- if ( data.modelCursor.isEqual( position ) ) {
- data.modelCursor = data.modelCursor.getShiftedBy( 1 );
- } else {
- data.modelCursor = data.modelCursor._getTransformedByInsertion( position, 1 );
- }
- data.modelRange = data.modelRange._getTransformedByInsertion( position, 1 )[ 0 ];
- }
- }
- };
- }
- // Helper function for from-view-element conversion. Checks if `config.view` directly specifies converted view element's name
- // and if so, returns it.
- //
- // @param {Object} config Conversion view config.
- // @returns {String|null} View element name or `null` if name is not directly set.
- function getViewElementNameFromConfig( viewConfig ) {
- if ( typeof viewConfig == 'string' ) {
- return viewConfig;
- }
- if ( typeof viewConfig == 'object' && typeof viewConfig.name == 'string' ) {
- return viewConfig.name;
- }
- return null;
- }
- // Helper for to-model-element conversion. Takes a config object and returns a proper converter function.
- //
- // @param {Object} config Conversion configuration.
- // @returns {Function} View to model converter.
- function prepareToElementConverter( config ) {
- const matcher = new _view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( config.view );
- return ( evt, data, conversionApi ) => {
- const matcherResult = matcher.match( data.viewItem );
- if ( !matcherResult ) {
- return;
- }
- const match = matcherResult.match;
- // Force consuming element's name.
- match.name = true;
- if ( !conversionApi.consumable.test( data.viewItem, match ) ) {
- return;
- }
- const modelElement = getModelElement( config.model, data.viewItem, conversionApi );
- if ( !modelElement ) {
- return;
- }
- if ( !conversionApi.safeInsert( modelElement, data.modelCursor ) ) {
- return;
- }
- conversionApi.consumable.consume( data.viewItem, match );
- conversionApi.convertChildren( data.viewItem, modelElement );
- conversionApi.updateConversionResult( modelElement, data );
- };
- }
- // Helper function for upcasting-to-element converter. Takes the model configuration, the converted view element
- // and a writer instance and returns a model element instance to be inserted in the model.
- //
- // @param {String|Function|module:engine/model/element~Element} model Model conversion configuration.
- // @param {module:engine/view/node~Node} input The converted view node.
- // @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi The upcast conversion API.
- function getModelElement( model, input, conversionApi ) {
- if ( model instanceof Function ) {
- return model( input, conversionApi );
- } else {
- return conversionApi.writer.createElement( model );
- }
- }
- // Helper function view-attribute-to-model-attribute helper. Normalizes `config.view` which was set as `String` or
- // as an `Object` with `key`, `value` and `name` properties. Normalized `config.view` has is compatible with
- // {@link module:engine/view/matcher~MatcherPattern}.
- //
- // @param {Object} config Conversion config.
- // @returns {String} Key of the converted view attribute.
- function normalizeViewAttributeKeyValueConfig( config ) {
- if ( typeof config.view == 'string' ) {
- config.view = { key: config.view };
- }
- const key = config.view.key;
- let normalized;
- if ( key == 'class' || key == 'style' ) {
- const keyName = key == 'class' ? 'classes' : 'styles';
- normalized = {
- [ keyName ]: config.view.value
- };
- } else {
- const value = typeof config.view.value == 'undefined' ? /[\s\S]*/ : config.view.value;
- normalized = {
- attributes: {
- [ key ]: value
- }
- };
- }
- if ( config.view.name ) {
- normalized.name = config.view.name;
- }
- config.view = normalized;
- return key;
- }
- // Helper function that normalizes `config.model` in from-model-attribute conversion. `config.model` can be set
- // as a `String`, an `Object` with only `key` property or an `Object` with `key` and `value` properties. Normalized
- // `config.model` is an `Object` with `key` and `value` properties.
- //
- // @param {Object} config Conversion config.
- // @param {String} viewAttributeKeyToCopy Key of the converted view attribute. If it is set, model attribute value
- // will be equal to view attribute value.
- function normalizeModelAttributeConfig( config, viewAttributeKeyToCopy = null ) {
- const defaultModelValue = viewAttributeKeyToCopy === null ? true : viewElement => viewElement.getAttribute( viewAttributeKeyToCopy );
- const key = typeof config.model != 'object' ? config.model : config.model.key;
- const value = typeof config.model != 'object' || typeof config.model.value == 'undefined' ? defaultModelValue : config.model.value;
- config.model = { key, value };
- }
- // Helper for to-model-attribute conversion. Takes the model attribute name and conversion configuration and returns
- // a proper converter function.
- //
- // @param {String} modelAttributeKey The key of the model attribute to set on a model node.
- // @param {Object|Array.<Object>} config Conversion configuration. It is possible to provide multiple configurations in an array.
- // @param {Boolean} shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set
- // on all elements in the range.
- function prepareToAttributeConverter( config, shallow ) {
- const matcher = new _view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( config.view );
- return ( evt, data, conversionApi ) => {
- const match = matcher.match( data.viewItem );
- // If there is no match, this callback should not do anything.
- if ( !match ) {
- return;
- }
- if ( onlyViewNameIsDefined( config.view, data.viewItem ) ) {
- match.match.name = true;
- } else {
- // Do not test or consume `name` consumable.
- delete match.match.name;
- }
- // Try to consume appropriate values from consumable values list.
- if ( !conversionApi.consumable.test( data.viewItem, match.match ) ) {
- return;
- }
- const modelKey = config.model.key;
- const modelValue = typeof config.model.value == 'function' ?
- config.model.value( data.viewItem, conversionApi ) : config.model.value;
- // Do not convert if attribute building function returned falsy value.
- if ( modelValue === null ) {
- return;
- }
- // Since we are converting to attribute we need a range on which we will set the attribute.
- // If the range is not created yet, let's create it by converting children of the current node first.
- if ( !data.modelRange ) {
- // Convert children and set conversion result as a current data.
- Object.assign( data, conversionApi.convertChildren( data.viewItem, data.modelCursor ) );
- }
- // Set attribute on current `output`. `Schema` is checked inside this helper function.
- const attributeWasSet = setAttributeOn( data.modelRange, { key: modelKey, value: modelValue }, shallow, conversionApi );
- // It may happen that a converter will try to set an attribute that is not allowed in the given context.
- // In such a situation we cannot consume the attribute. See: https://github.com/ckeditor/ckeditor5/pull/9249#issuecomment-815658459.
- if ( attributeWasSet ) {
- conversionApi.consumable.consume( data.viewItem, match.match );
- }
- };
- }
- // Helper function that checks if element name should be consumed in attribute converters.
- //
- // @param {Object} config Conversion view config.
- // @returns {Boolean}
- function onlyViewNameIsDefined( viewConfig, viewItem ) {
- // https://github.com/ckeditor/ckeditor5-engine/issues/1786
- const configToTest = typeof viewConfig == 'function' ? viewConfig( viewItem ) : viewConfig;
- if ( typeof configToTest == 'object' && !getViewElementNameFromConfig( configToTest ) ) {
- return false;
- }
- return !configToTest.classes && !configToTest.attributes && !configToTest.styles;
- }
- // Helper function for to-model-attribute converter. Sets model attribute on given range. Checks {@link module:engine/model/schema~Schema}
- // to ensure proper model structure.
- //
- // If any node on the given range has already defined an attribute with the same name, its value will not be updated.
- //
- // @param {module:engine/model/range~Range} modelRange Model range on which attribute should be set.
- // @param {Object} modelAttribute Model attribute to set.
- // @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion API.
- // @param {Boolean} shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set
- // on all elements in the range.
- // @returns {Boolean} `true` if attribute was set on at least one node from given `modelRange`.
- function setAttributeOn( modelRange, modelAttribute, shallow, conversionApi ) {
- let result = false;
- // Set attribute on each item in range according to Schema.
- for ( const node of Array.from( modelRange.getItems( { shallow } ) ) ) {
- // Skip if not allowed.
- if ( !conversionApi.schema.checkAttribute( node, modelAttribute.key ) ) {
- continue;
- }
- // Mark the node as consumed even if the attribute will not be updated because it's in a valid context (schema)
- // and would be converted if the attribute wouldn't be present. See #8921.
- result = true;
- // Do not override the attribute if it's already present.
- if ( node.hasAttribute( modelAttribute.key ) ) {
- continue;
- }
- conversionApi.writer.setAttribute( modelAttribute.key, modelAttribute.value, node );
- }
- return result;
- }
- // Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastElementToMarker()`
- // function and converts it to a format that is supported by `upcastElementToElement()` function.
- //
- // @param {Object} config Conversion configuration.
- function normalizeElementToMarkerConfig( config ) {
- const oldModel = config.model;
- config.model = ( viewElement, conversionApi ) => {
- const markerName = typeof oldModel == 'string' ? oldModel : oldModel( viewElement, conversionApi );
- return conversionApi.writer.createElement( '$marker', { 'data-name': markerName } );
- };
- }
- // Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastDataToMarker()`
- // function and converts it to a format that is supported by `upcastElementToElement()` function.
- //
- // @param {Object} config Conversion configuration.
- function normalizeDataToMarkerConfig( config, type ) {
- const configForElements = {};
- // Upcast <markerGroup-start> and <markerGroup-end> elements.
- configForElements.view = config.view + '-' + type;
- configForElements.model = ( viewElement, conversionApi ) => {
- const viewName = viewElement.getAttribute( 'name' );
- const markerName = config.model( viewName, conversionApi );
- return conversionApi.writer.createElement( '$marker', { 'data-name': markerName } );
- };
- return configForElements;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ViewConsumable; });
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/conversion/viewconsumable
- */
- /**
- * Class used for handling consumption of view {@link module:engine/view/element~Element elements},
- * {@link module:engine/view/text~Text text nodes} and {@link module:engine/view/documentfragment~DocumentFragment document fragments}.
- * Element's name and its parts (attributes, classes and styles) can be consumed separately. Consuming an element's name
- * does not consume its attributes, classes and styles.
- * To add items for consumption use {@link module:engine/conversion/viewconsumable~ViewConsumable#add add method}.
- * To test items use {@link module:engine/conversion/viewconsumable~ViewConsumable#test test method}.
- * To consume items use {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consume method}.
- * To revert already consumed items use {@link module:engine/conversion/viewconsumable~ViewConsumable#revert revert method}.
- *
- * viewConsumable.add( element, { name: true } ); // Adds element's name as ready to be consumed.
- * viewConsumable.add( textNode ); // Adds text node for consumption.
- * viewConsumable.add( docFragment ); // Adds document fragment for consumption.
- * viewConsumable.test( element, { name: true } ); // Tests if element's name can be consumed.
- * viewConsumable.test( textNode ); // Tests if text node can be consumed.
- * viewConsumable.test( docFragment ); // Tests if document fragment can be consumed.
- * viewConsumable.consume( element, { name: true } ); // Consume element's name.
- * viewConsumable.consume( textNode ); // Consume text node.
- * viewConsumable.consume( docFragment ); // Consume document fragment.
- * viewConsumable.revert( element, { name: true } ); // Revert already consumed element's name.
- * viewConsumable.revert( textNode ); // Revert already consumed text node.
- * viewConsumable.revert( docFragment ); // Revert already consumed document fragment.
- */
- class ViewConsumable {
- /**
- * Creates new ViewConsumable.
- */
- constructor() {
- /**
- * Map of consumable elements. If {@link module:engine/view/element~Element element} is used as a key,
- * {@link module:engine/conversion/viewconsumable~ViewElementConsumables ViewElementConsumables} instance is stored as value.
- * For {@link module:engine/view/text~Text text nodes} and
- * {@link module:engine/view/documentfragment~DocumentFragment document fragments} boolean value is stored as value.
- *
- * @protected
- * @member {Map.<module:engine/conversion/viewconsumable~ViewElementConsumables|Boolean>}
- */
- this._consumables = new Map();
- }
- /**
- * Adds {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
- * {@link module:engine/view/documentfragment~DocumentFragment document fragment} as ready to be consumed.
- *
- * viewConsumable.add( p, { name: true } ); // Adds element's name to consume.
- * viewConsumable.add( p, { attributes: 'name' } ); // Adds element's attribute.
- * viewConsumable.add( p, { classes: 'foobar' } ); // Adds element's class.
- * viewConsumable.add( p, { styles: 'color' } ); // Adds element's style
- * viewConsumable.add( p, { attributes: 'name', styles: 'color' } ); // Adds attribute and style.
- * viewConsumable.add( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be provided.
- * viewConsumable.add( textNode ); // Adds text node to consume.
- * viewConsumable.add( docFragment ); // Adds document fragment to consume.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
- * attribute is provided - it should be handled separately by providing actual style/class.
- *
- * viewConsumable.add( p, { attributes: 'style' } ); // This call will throw an exception.
- * viewConsumable.add( p, { styles: 'color' } ); // This is properly handled style.
- *
- * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
- * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
- * @param {Boolean} consumables.name If set to true element's name will be included.
- * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
- * @param {String|Array.<String>} consumables.classes Class name or array of class names.
- * @param {String|Array.<String>} consumables.styles Style name or array of style names.
- */
- add( element, consumables ) {
- let elementConsumables;
- // For text nodes and document fragments just mark them as consumable.
- if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
- this._consumables.set( element, true );
- return;
- }
- // For elements create new ViewElementConsumables or update already existing one.
- if ( !this._consumables.has( element ) ) {
- elementConsumables = new ViewElementConsumables( element );
- this._consumables.set( element, elementConsumables );
- } else {
- elementConsumables = this._consumables.get( element );
- }
- elementConsumables.add( consumables );
- }
- /**
- * Tests if {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
- * {@link module:engine/view/documentfragment~DocumentFragment document fragment} can be consumed.
- * It returns `true` when all items included in method's call can be consumed. Returns `false` when
- * first already consumed item is found and `null` when first non-consumable item is found.
- *
- * viewConsumable.test( p, { name: true } ); // Tests element's name.
- * viewConsumable.test( p, { attributes: 'name' } ); // Tests attribute.
- * viewConsumable.test( p, { classes: 'foobar' } ); // Tests class.
- * viewConsumable.test( p, { styles: 'color' } ); // Tests style.
- * viewConsumable.test( p, { attributes: 'name', styles: 'color' } ); // Tests attribute and style.
- * viewConsumable.test( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be tested.
- * viewConsumable.test( textNode ); // Tests text node.
- * viewConsumable.test( docFragment ); // Tests document fragment.
- *
- * Testing classes and styles as attribute will test if all added classes/styles can be consumed.
- *
- * viewConsumable.test( p, { attributes: 'class' } ); // Tests if all added classes can be consumed.
- * viewConsumable.test( p, { attributes: 'style' } ); // Tests if all added styles can be consumed.
- *
- * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
- * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
- * @param {Boolean} consumables.name If set to true element's name will be included.
- * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
- * @param {String|Array.<String>} consumables.classes Class name or array of class names.
- * @param {String|Array.<String>} consumables.styles Style name or array of style names.
- * @returns {Boolean|null} Returns `true` when all items included in method's call can be consumed. Returns `false`
- * when first already consumed item is found and `null` when first non-consumable item is found.
- */
- test( element, consumables ) {
- const elementConsumables = this._consumables.get( element );
- if ( elementConsumables === undefined ) {
- return null;
- }
- // For text nodes and document fragments return stored boolean value.
- if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
- return elementConsumables;
- }
- // For elements test consumables object.
- return elementConsumables.test( consumables );
- }
- /**
- * Consumes {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
- * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
- * It returns `true` when all items included in method's call can be consumed, otherwise returns `false`.
- *
- * viewConsumable.consume( p, { name: true } ); // Consumes element's name.
- * viewConsumable.consume( p, { attributes: 'name' } ); // Consumes element's attribute.
- * viewConsumable.consume( p, { classes: 'foobar' } ); // Consumes element's class.
- * viewConsumable.consume( p, { styles: 'color' } ); // Consumes element's style.
- * viewConsumable.consume( p, { attributes: 'name', styles: 'color' } ); // Consumes attribute and style.
- * viewConsumable.consume( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be consumed.
- * viewConsumable.consume( textNode ); // Consumes text node.
- * viewConsumable.consume( docFragment ); // Consumes document fragment.
- *
- * Consuming classes and styles as attribute will test if all added classes/styles can be consumed.
- *
- * viewConsumable.consume( p, { attributes: 'class' } ); // Consume only if all added classes can be consumed.
- * viewConsumable.consume( p, { attributes: 'style' } ); // Consume only if all added styles can be consumed.
- *
- * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
- * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
- * @param {Boolean} consumables.name If set to true element's name will be included.
- * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
- * @param {String|Array.<String>} consumables.classes Class name or array of class names.
- * @param {String|Array.<String>} consumables.styles Style name or array of style names.
- * @returns {Boolean} Returns `true` when all items included in method's call can be consumed,
- * otherwise returns `false`.
- */
- consume( element, consumables ) {
- if ( this.test( element, consumables ) ) {
- if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
- // For text nodes and document fragments set value to false.
- this._consumables.set( element, false );
- } else {
- // For elements - consume consumables object.
- this._consumables.get( element ).consume( consumables );
- }
- return true;
- }
- return false;
- }
- /**
- * Reverts {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
- * {@link module:engine/view/documentfragment~DocumentFragment document fragment} so they can be consumed once again.
- * Method does not revert items that were never previously added for consumption, even if they are included in
- * method's call.
- *
- * viewConsumable.revert( p, { name: true } ); // Reverts element's name.
- * viewConsumable.revert( p, { attributes: 'name' } ); // Reverts element's attribute.
- * viewConsumable.revert( p, { classes: 'foobar' } ); // Reverts element's class.
- * viewConsumable.revert( p, { styles: 'color' } ); // Reverts element's style.
- * viewConsumable.revert( p, { attributes: 'name', styles: 'color' } ); // Reverts attribute and style.
- * viewConsumable.revert( p, { classes: [ 'baz', 'bar' ] } ); // Multiple names can be reverted.
- * viewConsumable.revert( textNode ); // Reverts text node.
- * viewConsumable.revert( docFragment ); // Reverts document fragment.
- *
- * Reverting classes and styles as attribute will revert all classes/styles that were previously added for
- * consumption.
- *
- * viewConsumable.revert( p, { attributes: 'class' } ); // Reverts all classes added for consumption.
- * viewConsumable.revert( p, { attributes: 'style' } ); // Reverts all styles added for consumption.
- *
- * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
- * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
- * @param {Boolean} consumables.name If set to true element's name will be included.
- * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
- * @param {String|Array.<String>} consumables.classes Class name or array of class names.
- * @param {String|Array.<String>} consumables.styles Style name or array of style names.
- */
- revert( element, consumables ) {
- const elementConsumables = this._consumables.get( element );
- if ( elementConsumables !== undefined ) {
- if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
- // For text nodes and document fragments - set consumable to true.
- this._consumables.set( element, true );
- } else {
- // For elements - revert items from consumables object.
- elementConsumables.revert( consumables );
- }
- }
- }
- /**
- * Creates consumable object from {@link module:engine/view/element~Element view element}. Consumable object will include
- * element's name and all its attributes, classes and styles.
- *
- * @static
- * @param {module:engine/view/element~Element} element
- * @returns {Object} consumables
- */
- static consumablesFromElement( element ) {
- const consumables = {
- element,
- name: true,
- attributes: [],
- classes: [],
- styles: []
- };
- const attributes = element.getAttributeKeys();
- for ( const attribute of attributes ) {
- // Skip classes and styles - will be added separately.
- if ( attribute == 'style' || attribute == 'class' ) {
- continue;
- }
- consumables.attributes.push( attribute );
- }
- const classes = element.getClassNames();
- for ( const className of classes ) {
- consumables.classes.push( className );
- }
- const styles = element.getStyleNames();
- for ( const style of styles ) {
- consumables.styles.push( style );
- }
- return consumables;
- }
- /**
- * Creates {@link module:engine/conversion/viewconsumable~ViewConsumable ViewConsumable} instance from
- * {@link module:engine/view/node~Node node} or {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
- * Instance will contain all elements, child nodes, attributes, styles and classes added for consumption.
- *
- * @static
- * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} from View node or document fragment
- * from which `ViewConsumable` will be created.
- * @param {module:engine/conversion/viewconsumable~ViewConsumable} [instance] If provided, given `ViewConsumable` instance will be used
- * to add all consumables. It will be returned instead of a new instance.
- */
- static createFrom( from, instance ) {
- if ( !instance ) {
- instance = new ViewConsumable( from );
- }
- if ( from.is( '$text' ) ) {
- instance.add( from );
- return instance;
- }
- // Add `from` itself, if it is an element.
- if ( from.is( 'element' ) ) {
- instance.add( from, ViewConsumable.consumablesFromElement( from ) );
- }
- if ( from.is( 'documentFragment' ) ) {
- instance.add( from );
- }
- for ( const child of from.getChildren() ) {
- instance = ViewConsumable.createFrom( child, instance );
- }
- return instance;
- }
- }
- /**
- * This is a private helper-class for {@link module:engine/conversion/viewconsumable~ViewConsumable}.
- * It represents and manipulates consumable parts of a single {@link module:engine/view/element~Element}.
- *
- * @private
- */
- class ViewElementConsumables {
- /**
- * Creates ViewElementConsumables instance.
- *
- * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} from View node or document fragment
- * from which `ViewElementConsumables` is being created.
- */
- constructor( from ) {
- /**
- * @readonly
- * @member {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
- */
- this.element = from;
- /**
- * Flag indicating if name of the element can be consumed.
- *
- * @private
- * @member {Boolean}
- */
- this._canConsumeName = null;
- /**
- * Contains maps of element's consumables: attributes, classes and styles.
- *
- * @private
- * @member {Object}
- */
- this._consumables = {
- attributes: new Map(),
- styles: new Map(),
- classes: new Map()
- };
- }
- /**
- * Adds consumable parts of the {@link module:engine/view/element~Element view element}.
- * Element's name itself can be marked to be consumed (when element's name is consumed its attributes, classes and
- * styles still could be consumed):
- *
- * consumables.add( { name: true } );
- *
- * Attributes classes and styles:
- *
- * consumables.add( { attributes: 'title', classes: 'foo', styles: 'color' } );
- * consumables.add( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
- * attribute is provided - it should be handled separately by providing `style` and `class` in consumables object.
- *
- * @param {Object} consumables Object describing which parts of the element can be consumed.
- * @param {Boolean} consumables.name If set to `true` element's name will be added as consumable.
- * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to add as consumable.
- * @param {String|Array.<String>} consumables.classes Class name or array of class names to add as consumable.
- * @param {String|Array.<String>} consumables.styles Style name or array of style names to add as consumable.
- */
- add( consumables ) {
- if ( consumables.name ) {
- this._canConsumeName = true;
- }
- for ( const type in this._consumables ) {
- if ( type in consumables ) {
- this._add( type, consumables[ type ] );
- }
- }
- }
- /**
- * Tests if parts of the {@link module:engine/view/node~Node view node} can be consumed.
- *
- * Element's name can be tested:
- *
- * consumables.test( { name: true } );
- *
- * Attributes classes and styles:
- *
- * consumables.test( { attributes: 'title', classes: 'foo', styles: 'color' } );
- * consumables.test( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
- *
- * @param {Object} consumables Object describing which parts of the element should be tested.
- * @param {Boolean} consumables.name If set to `true` element's name will be tested.
- * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to test.
- * @param {String|Array.<String>} consumables.classes Class name or array of class names to test.
- * @param {String|Array.<String>} consumables.styles Style name or array of style names to test.
- * @returns {Boolean|null} `true` when all tested items can be consumed, `null` when even one of the items
- * was never marked for consumption and `false` when even one of the items was already consumed.
- */
- test( consumables ) {
- // Check if name can be consumed.
- if ( consumables.name && !this._canConsumeName ) {
- return this._canConsumeName;
- }
- for ( const type in this._consumables ) {
- if ( type in consumables ) {
- const value = this._test( type, consumables[ type ] );
- if ( value !== true ) {
- return value;
- }
- }
- }
- // Return true only if all can be consumed.
- return true;
- }
- /**
- * Consumes parts of {@link module:engine/view/element~Element view element}. This function does not check if consumable item
- * is already consumed - it consumes all consumable items provided.
- * Element's name can be consumed:
- *
- * consumables.consume( { name: true } );
- *
- * Attributes classes and styles:
- *
- * consumables.consume( { attributes: 'title', classes: 'foo', styles: 'color' } );
- * consumables.consume( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
- *
- * @param {Object} consumables Object describing which parts of the element should be consumed.
- * @param {Boolean} consumables.name If set to `true` element's name will be consumed.
- * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to consume.
- * @param {String|Array.<String>} consumables.classes Class name or array of class names to consume.
- * @param {String|Array.<String>} consumables.styles Style name or array of style names to consume.
- */
- consume( consumables ) {
- if ( consumables.name ) {
- this._canConsumeName = false;
- }
- for ( const type in this._consumables ) {
- if ( type in consumables ) {
- this._consume( type, consumables[ type ] );
- }
- }
- }
- /**
- * Revert already consumed parts of {@link module:engine/view/element~Element view Element}, so they can be consumed once again.
- * Element's name can be reverted:
- *
- * consumables.revert( { name: true } );
- *
- * Attributes classes and styles:
- *
- * consumables.revert( { attributes: 'title', classes: 'foo', styles: 'color' } );
- * consumables.revert( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
- *
- * @param {Object} consumables Object describing which parts of the element should be reverted.
- * @param {Boolean} consumables.name If set to `true` element's name will be reverted.
- * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to revert.
- * @param {String|Array.<String>} consumables.classes Class name or array of class names to revert.
- * @param {String|Array.<String>} consumables.styles Style name or array of style names to revert.
- */
- revert( consumables ) {
- if ( consumables.name ) {
- this._canConsumeName = true;
- }
- for ( const type in this._consumables ) {
- if ( type in consumables ) {
- this._revert( type, consumables[ type ] );
- }
- }
- }
- /**
- * Helper method that adds consumables of a given type: attribute, class or style.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
- * type is provided - it should be handled separately by providing actual style/class type.
- *
- * @private
- * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.
- * @param {String|Array.<String>} item Consumable item or array of items.
- */
- _add( type, item ) {
- const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
- const consumables = this._consumables[ type ];
- for ( const name of items ) {
- if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
- /**
- * Class and style attributes should be handled separately in
- * {@link module:engine/conversion/viewconsumable~ViewConsumable#add `ViewConsumable#add()`}.
- *
- * What you have done is trying to use:
- *
- * consumables.add( { attributes: [ 'class', 'style' ] } );
- *
- * While each class and style should be registered separately:
- *
- * consumables.add( { classes: 'some-class', styles: 'font-weight' } );
- *
- * @error viewconsumable-invalid-attribute
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'viewconsumable-invalid-attribute', this );
- }
- consumables.set( name, true );
- if ( type === 'styles' ) {
- for ( const alsoName of this.element.document.stylesProcessor.getRelatedStyles( name ) ) {
- consumables.set( alsoName, true );
- }
- }
- }
- }
- /**
- * Helper method that tests consumables of a given type: attribute, class or style.
- *
- * @private
- * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.
- * @param {String|Array.<String>} item Consumable item or array of items.
- * @returns {Boolean|null} Returns `true` if all items can be consumed, `null` when one of the items cannot be
- * consumed and `false` when one of the items is already consumed.
- */
- _test( type, item ) {
- const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
- const consumables = this._consumables[ type ];
- for ( const name of items ) {
- if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
- const consumableName = name == 'class' ? 'classes' : 'styles';
- // Check all classes/styles if class/style attribute is tested.
- const value = this._test( consumableName, [ ...this._consumables[ consumableName ].keys() ] );
- if ( value !== true ) {
- return value;
- }
- } else {
- const value = consumables.get( name );
- // Return null if attribute is not found.
- if ( value === undefined ) {
- return null;
- }
- if ( !value ) {
- return false;
- }
- }
- }
- return true;
- }
- /**
- * Helper method that consumes items of a given type: attribute, class or style.
- *
- * @private
- * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.
- * @param {String|Array.<String>} item Consumable item or array of items.
- */
- _consume( type, item ) {
- const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
- const consumables = this._consumables[ type ];
- for ( const name of items ) {
- if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
- const consumableName = name == 'class' ? 'classes' : 'styles';
- // If class or style is provided for consumption - consume them all.
- this._consume( consumableName, [ ...this._consumables[ consumableName ].keys() ] );
- } else {
- consumables.set( name, false );
- if ( type == 'styles' ) {
- for ( const toConsume of this.element.document.stylesProcessor.getRelatedStyles( name ) ) {
- consumables.set( toConsume, false );
- }
- }
- }
- }
- }
- /**
- * Helper method that reverts items of a given type: attribute, class or style.
- *
- * @private
- * @param {String} type Type of the consumable item: `attributes`, `classes` or , `styles`.
- * @param {String|Array.<String>} item Consumable item or array of items.
- */
- _revert( type, item ) {
- const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
- const consumables = this._consumables[ type ];
- for ( const name of items ) {
- if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
- const consumableName = name == 'class' ? 'classes' : 'styles';
- // If class or style is provided for reverting - revert them all.
- this._revert( consumableName, [ ...this._consumables[ consumableName ].keys() ] );
- } else {
- const value = consumables.get( name );
- if ( value === false ) {
- consumables.set( name, true );
- }
- }
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js ***!
- \**************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BasicHtmlWriter; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/dataprocessor/basichtmlwriter
- */
- /* globals document */
- /**
- * Basic HTML writer. It uses the native `innerHTML` property for basic conversion
- * from a document fragment to an HTML string.
- *
- * @implements module:engine/dataprocessor/htmlwriter~HtmlWriter
- */
- class BasicHtmlWriter {
- /**
- * Returns an HTML string created from the document fragment.
- *
- * @param {DocumentFragment} fragment
- * @returns {String}
- */
- getHtml( fragment ) {
- const doc = document.implementation.createHTMLDocument( '' );
- const container = doc.createElement( 'div' );
- container.appendChild( fragment );
- return container.innerHTML;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js ***!
- \****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlDataProcessor; });
- /* harmony import */ var _basichtmlwriter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basichtmlwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js");
- /* harmony import */ var _view_domconverter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../view/domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/dataprocessor/htmldataprocessor
- */
- /* globals document, DOMParser */
- /**
- * The HTML data processor class.
- * This data processor implementation uses HTML as input and output data.
- *
- * @implements module:engine/dataprocessor/dataprocessor~DataProcessor
- */
- class HtmlDataProcessor {
- /**
- * Creates a new instance of the HTML data processor class.
- *
- * @param {module:engine/view/document~Document} document The view document instance.
- */
- constructor( document ) {
- /**
- * A DOM parser instance used to parse an HTML string to an HTML document.
- *
- * @private
- * @member {DOMParser}
- */
- this._domParser = new DOMParser();
- /**
- * A DOM converter used to convert DOM elements to view elements.
- *
- * @private
- * @member {module:engine/view/domconverter~DomConverter}
- */
- this._domConverter = new _view_domconverter__WEBPACK_IMPORTED_MODULE_1__["default"]( document, { blockFillerMode: 'nbsp' } );
- /**
- * A basic HTML writer instance used to convert DOM elements to an HTML string.
- *
- * @private
- * @member {module:engine/dataprocessor/basichtmlwriter~BasicHtmlWriter}
- */
- this._htmlWriter = new _basichtmlwriter__WEBPACK_IMPORTED_MODULE_0__["default"]();
- }
- /**
- * Converts a provided {@link module:engine/view/documentfragment~DocumentFragment document fragment}
- * to data format — in this case to an HTML string.
- *
- * @param {module:engine/view/documentfragment~DocumentFragment} viewFragment
- * @returns {String} HTML string.
- */
- toData( viewFragment ) {
- // Convert view DocumentFragment to DOM DocumentFragment.
- const domFragment = this._domConverter.viewToDom( viewFragment, document );
- // Convert DOM DocumentFragment to HTML output.
- return this._htmlWriter.getHtml( domFragment );
- }
- /**
- * Converts the provided HTML string to a view tree.
- *
- * @param {String} data An HTML string.
- * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null} A converted view element.
- */
- toView( data ) {
- // Convert input HTML data to DOM DocumentFragment.
- const domFragment = this._toDom( data );
- // Convert DOM DocumentFragment to view DocumentFragment.
- return this._domConverter.domToView( domFragment );
- }
- /**
- * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data
- * and not processed during the conversion from the DOM to the view elements.
- *
- * The raw data can be later accessed by a
- * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `"$rawContent"`.
- *
- * @param {module:engine/view/matcher~MatcherPattern} pattern Pattern matching all view elements whose content should
- * be treated as raw data.
- */
- registerRawContentMatcher( pattern ) {
- this._domConverter.registerRawContentMatcher( pattern );
- }
- /**
- * If the processor is set to use marked fillers, it will insert ` ` fillers wrapped in `<span>` elements
- * (`<span data-cke-filler="true"> </span>`) instead of regular ` ` characters.
- *
- * This mode allows for more precise handling of block fillers (so they do not leak into the editor content) but bloats the
- * editor data with additional markup.
- *
- * This mode may be required by some features and will be turned on by them automatically.
- *
- * @param {'default'|'marked'} type Whether to use the default or marked ` ` block fillers.
- */
- useFillerType( type ) {
- this._domConverter.blockFillerMode = type == 'marked' ? 'markedNbsp' : 'nbsp';
- }
- /**
- * Converts an HTML string to its DOM representation. Returns a document fragment containing nodes parsed from
- * the provided data.
- *
- * @private
- * @param {String} data
- * @returns {DocumentFragment}
- */
- _toDom( data ) {
- const document = this._domParser.parseFromString( data, 'text/html' );
- const fragment = document.createDocumentFragment();
- const nodes = document.body.childNodes;
- while ( nodes.length > 0 ) {
- fragment.appendChild( nodes[ 0 ] );
- }
- return fragment;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/index.js":
- /*!**************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/index.js ***!
- \**************************************************************/
- /*! exports provided: enablePlaceholder, disablePlaceholder, showPlaceholder, hidePlaceholder, needsPlaceholder, EditingController, DataController, Conversion, HtmlDataProcessor, InsertOperation, MarkerOperation, OperationFactory, transformSets, DocumentSelection, Range, LiveRange, LivePosition, Model, TreeWalker, Element, DomConverter, ViewDocument, getFillerOffset, Observer, ClickObserver, DomEventObserver, MouseObserver, DowncastWriter, UpcastWriter, Matcher, DomEventData, StylesProcessor, addBackgroundRules, addBorderRules, addMarginRules, addPaddingRules, isColor, isLineStyle, isLength, isPercentage, isRepeat, isPosition, isAttachment, isURL, getBoxSidesValues, getBoxSidesValueReducer, getBoxSidesShorthandValue, getPositionShorthandNormalizer, getShorthandValues */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _view_placeholder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./view/placeholder */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enablePlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["enablePlaceholder"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "disablePlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["disablePlaceholder"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showPlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["showPlaceholder"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hidePlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["hidePlaceholder"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "needsPlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["needsPlaceholder"]; });
- /* harmony import */ var _controller_editingcontroller__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./controller/editingcontroller */ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditingController", function() { return _controller_editingcontroller__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _controller_datacontroller__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./controller/datacontroller */ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataController", function() { return _controller_datacontroller__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _conversion_conversion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conversion/conversion */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Conversion", function() { return _conversion_conversion__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dataprocessor/htmldataprocessor */ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HtmlDataProcessor", function() { return _dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _model_operation_insertoperation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./model/operation/insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InsertOperation", function() { return _model_operation_insertoperation__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _model_operation_markeroperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model/operation/markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkerOperation", function() { return _model_operation_markeroperation__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _model_operation_operationfactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./model/operation/operationfactory */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OperationFactory", function() { return _model_operation_operationfactory__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _model_operation_transform__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./model/operation/transform */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transformSets", function() { return _model_operation_transform__WEBPACK_IMPORTED_MODULE_8__["transformSets"]; });
- /* harmony import */ var _model_documentselection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./model/documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentSelection", function() { return _model_documentselection__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return _model_range__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _model_liverange__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./model/liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LiveRange", function() { return _model_liverange__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _model_liveposition__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./model/liveposition */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LivePosition", function() { return _model_liveposition__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _model_model__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./model/model */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Model", function() { return _model_model__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _model_treewalker__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./model/treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TreeWalker", function() { return _model_treewalker__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _model_element__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./model/element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return _model_element__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /* harmony import */ var _view_domconverter__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./view/domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomConverter", function() { return _view_domconverter__WEBPACK_IMPORTED_MODULE_16__["default"]; });
- /* harmony import */ var _view_document__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./view/document */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewDocument", function() { return _view_document__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony import */ var _view_containerelement__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./view/containerelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFillerOffset", function() { return _view_containerelement__WEBPACK_IMPORTED_MODULE_18__["getFillerOffset"]; });
- /* harmony import */ var _view_observer_observer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./view/observer/observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observer", function() { return _view_observer_observer__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _view_observer_clickobserver__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./view/observer/clickobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClickObserver", function() { return _view_observer_clickobserver__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /* harmony import */ var _view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./view/observer/domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEventObserver", function() { return _view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_21__["default"]; });
- /* harmony import */ var _view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MouseObserver", function() { return _view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_22__["default"]; });
- /* harmony import */ var _view_downcastwriter__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./view/downcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DowncastWriter", function() { return _view_downcastwriter__WEBPACK_IMPORTED_MODULE_23__["default"]; });
- /* harmony import */ var _view_upcastwriter__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./view/upcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UpcastWriter", function() { return _view_upcastwriter__WEBPACK_IMPORTED_MODULE_24__["default"]; });
- /* harmony import */ var _view_matcher__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./view/matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Matcher", function() { return _view_matcher__WEBPACK_IMPORTED_MODULE_25__["default"]; });
- /* harmony import */ var _view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./view/observer/domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEventData", function() { return _view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_26__["default"]; });
- /* harmony import */ var _view_stylesmap__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./view/stylesmap */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StylesProcessor", function() { return _view_stylesmap__WEBPACK_IMPORTED_MODULE_27__["StylesProcessor"]; });
- /* harmony import */ var _view_styles_background__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./view/styles/background */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBackgroundRules", function() { return _view_styles_background__WEBPACK_IMPORTED_MODULE_28__["addBackgroundRules"]; });
- /* harmony import */ var _view_styles_border__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./view/styles/border */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBorderRules", function() { return _view_styles_border__WEBPACK_IMPORTED_MODULE_29__["addBorderRules"]; });
- /* harmony import */ var _view_styles_margin__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./view/styles/margin */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/margin.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addMarginRules", function() { return _view_styles_margin__WEBPACK_IMPORTED_MODULE_30__["addMarginRules"]; });
- /* harmony import */ var _view_styles_padding__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./view/styles/padding */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addPaddingRules", function() { return _view_styles_padding__WEBPACK_IMPORTED_MODULE_31__["addPaddingRules"]; });
- /* harmony import */ var _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./view/styles/utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isColor", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isColor"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLineStyle", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isLineStyle"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isLength"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPercentage", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isPercentage"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRepeat", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isRepeat"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPosition", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isPosition"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isAttachment", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isAttachment"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["isURL"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValues", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["getBoxSidesValues"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValueReducer", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["getBoxSidesValueReducer"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesShorthandValue", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["getBoxSidesShorthandValue"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPositionShorthandNormalizer", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["getPositionShorthandNormalizer"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getShorthandValues", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_32__["getShorthandValues"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Batch; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/batch
- */
- /**
- * A batch instance groups model changes ({@link module:engine/model/operation/operation~Operation operations}). All operations
- * grouped in a single batch can be reverted together, so you can also think about a batch as of a single undo step. If you want
- * to extend a given undo step, you can add more changes to the batch using {@link module:engine/model/model~Model#enqueueChange}:
- *
- * model.enqueueChange( batch, writer => {
- * writer.insertText( 'foo', paragraph, 'end' );
- * } );
- *
- * @see module:engine/model/model~Model#enqueueChange
- * @see module:engine/model/model~Model#change
- */
- class Batch {
- /**
- * Creates a batch instance.
- *
- * @see module:engine/model/model~Model#enqueueChange
- * @see module:engine/model/model~Model#change
- * @param {'transparent'|'default'} [type='default'] The type of the batch.
- */
- constructor( type = 'default' ) {
- /**
- * An array of operations that compose this batch.
- *
- * @readonly
- * @type {Array.<module:engine/model/operation/operation~Operation>}
- */
- this.operations = [];
- /**
- * The type of the batch.
- *
- * It can be one of the following values:
- * * `'default'` – All "normal" batches. This is the most commonly used type.
- * * `'transparent'` – A batch that should be ignored by other features, i.e. an initial batch or collaborative editing
- * changes.
- *
- * @readonly
- * @type {'transparent'|'default'}
- */
- this.type = type;
- }
- /**
- * Returns the base version of this batch, which is equal to the base version of the first operation in the batch.
- * If there are no operations in the batch or neither operation has the base version set, it returns `null`.
- *
- * @readonly
- * @type {Number|null}
- */
- get baseVersion() {
- for ( const op of this.operations ) {
- if ( op.baseVersion !== null ) {
- return op.baseVersion;
- }
- }
- return null;
- }
- /**
- * Adds an operation to the batch instance.
- *
- * @param {module:engine/model/operation/operation~Operation} operation An operation to add.
- * @returns {module:engine/model/operation/operation~Operation} The added operation.
- */
- addOperation( operation ) {
- operation.batch = this;
- this.operations.push( operation );
- return operation;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Differ; });
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/differ
- */
- /**
- * Calculates the difference between two model states.
- *
- * Receives operations that are to be applied on the model document. Marks parts of the model document tree which
- * are changed and saves the state of these elements before the change. Then, it compares saved elements with the
- * changed elements, after all changes are applied on the model document. Calculates the diff between saved
- * elements and new ones and returns a change set.
- */
- class Differ {
- /**
- * Creates a `Differ` instance.
- *
- * @param {module:engine/model/markercollection~MarkerCollection} markerCollection Model's marker collection.
- */
- constructor( markerCollection ) {
- /**
- * Reference to the model's marker collection.
- *
- * @private
- * @type {module:engine/model/markercollection~MarkerCollection}
- */
- this._markerCollection = markerCollection;
- /**
- * A map that stores changes that happened in a given element.
- *
- * The keys of the map are references to the model elements.
- * The values of the map are arrays with changes that were done on this element.
- *
- * @private
- * @type {Map}
- */
- this._changesInElement = new Map();
- /**
- * A map that stores "element's children snapshots". A snapshot is representing children of a given element before
- * the first change was applied on that element. Snapshot items are objects with two properties: `name`,
- * containing the element name (or `'$text'` for a text node) and `attributes` which is a map of the node's attributes.
- *
- * @private
- * @type {Map}
- */
- this._elementSnapshots = new Map();
- /**
- * A map that stores all changed markers.
- *
- * The keys of the map are marker names.
- * The values of the map are objects with the `oldRange` and `newRange` properties. They store the marker range
- * state before and after the change.
- *
- * @private
- * @type {Map}
- */
- this._changedMarkers = new Map();
- /**
- * Stores the number of changes that were processed. Used to order the changes chronologically. It is important
- * when changes are sorted.
- *
- * @private
- * @type {Number}
- */
- this._changeCount = 0;
- /**
- * For efficiency purposes, `Differ` stores the change set returned by the differ after {@link #getChanges} call.
- * Cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will
- * return the cached value instead of calculating it again.
- *
- * This property stores those changes that did not take place in graveyard root.
- *
- * @private
- * @type {Array.<Object>|null}
- */
- this._cachedChanges = null;
- /**
- * For efficiency purposes, `Differ` stores the change set returned by the differ after the {@link #getChanges} call.
- * The cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will
- * return the cached value instead of calculating it again.
- *
- * This property stores all changes evaluated by `Differ`, including those that took place in the graveyard.
- *
- * @private
- * @type {Array.<Object>|null}
- */
- this._cachedChangesWithGraveyard = null;
- }
- /**
- * Informs whether there are any changes buffered in `Differ`.
- *
- * @readonly
- * @type {Boolean}
- */
- get isEmpty() {
- return this._changesInElement.size == 0 && this._changedMarkers.size == 0;
- }
- /**
- * Marks given `item` in differ to be "refreshed". It means that the item will be marked as removed and inserted in the differ changes
- * set, so it will be effectively re-converted when differ changes will be handled by a dispatcher.
- *
- * @param {module:engine/model/item~Item} item Item to refresh.
- */
- refreshItem( item ) {
- if ( this._isInInsertedElement( item.parent ) ) {
- return;
- }
- this._markRemove( item.parent, item.startOffset, item.offsetSize );
- this._markInsert( item.parent, item.startOffset, item.offsetSize );
- const range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item );
- for ( const marker of this._markerCollection.getMarkersIntersectingRange( range ) ) {
- const markerRange = marker.getRange();
- this.bufferMarkerChange( marker.name, markerRange, markerRange, marker.affectsData );
- }
- // Clear cache after each buffered operation as it is no longer valid.
- this._cachedChanges = null;
- }
- /**
- * Buffers the given operation. An operation has to be buffered before it is executed.
- *
- * Operation type is checked and it is checked which nodes it will affect. These nodes are then stored in `Differ`
- * in the state before the operation is executed.
- *
- * @param {module:engine/model/operation/operation~Operation} operation An operation to buffer.
- */
- bufferOperation( operation ) {
- // Below we take an operation, check its type, then use its parameters in marking (private) methods.
- // The general rule is to not mark elements inside inserted element. All inserted elements are re-rendered.
- // Marking changes in them would cause a "double" changing then.
- //
- switch ( operation.type ) {
- case 'insert': {
- if ( this._isInInsertedElement( operation.position.parent ) ) {
- return;
- }
- this._markInsert( operation.position.parent, operation.position.offset, operation.nodes.maxOffset );
- break;
- }
- case 'addAttribute':
- case 'removeAttribute':
- case 'changeAttribute': {
- for ( const item of operation.range.getItems( { shallow: true } ) ) {
- if ( this._isInInsertedElement( item.parent ) ) {
- continue;
- }
- this._markAttribute( item );
- }
- break;
- }
- case 'remove':
- case 'move':
- case 'reinsert': {
- // When range is moved to the same position then not mark it as a change.
- // See: https://github.com/ckeditor/ckeditor5-engine/issues/1664.
- if (
- operation.sourcePosition.isEqual( operation.targetPosition ) ||
- operation.sourcePosition.getShiftedBy( operation.howMany ).isEqual( operation.targetPosition )
- ) {
- return;
- }
- const sourceParentInserted = this._isInInsertedElement( operation.sourcePosition.parent );
- const targetParentInserted = this._isInInsertedElement( operation.targetPosition.parent );
- if ( !sourceParentInserted ) {
- this._markRemove( operation.sourcePosition.parent, operation.sourcePosition.offset, operation.howMany );
- }
- if ( !targetParentInserted ) {
- this._markInsert( operation.targetPosition.parent, operation.getMovedRangeStart().offset, operation.howMany );
- }
- break;
- }
- case 'rename': {
- if ( this._isInInsertedElement( operation.position.parent ) ) {
- return;
- }
- this._markRemove( operation.position.parent, operation.position.offset, 1 );
- this._markInsert( operation.position.parent, operation.position.offset, 1 );
- const range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( operation.position, 1 );
- for ( const marker of this._markerCollection.getMarkersIntersectingRange( range ) ) {
- const markerRange = marker.getRange();
- this.bufferMarkerChange( marker.name, markerRange, markerRange, marker.affectsData );
- }
- break;
- }
- case 'split': {
- const splitElement = operation.splitPosition.parent;
- // Mark that children of the split element were removed.
- if ( !this._isInInsertedElement( splitElement ) ) {
- this._markRemove( splitElement, operation.splitPosition.offset, operation.howMany );
- }
- // Mark that the new element (split copy) was inserted.
- if ( !this._isInInsertedElement( operation.insertionPosition.parent ) ) {
- this._markInsert( operation.insertionPosition.parent, operation.insertionPosition.offset, 1 );
- }
- // If the split took the element from the graveyard, mark that the element from the graveyard was removed.
- if ( operation.graveyardPosition ) {
- this._markRemove( operation.graveyardPosition.parent, operation.graveyardPosition.offset, 1 );
- }
- break;
- }
- case 'merge': {
- // Mark that the merged element was removed.
- const mergedElement = operation.sourcePosition.parent;
- if ( !this._isInInsertedElement( mergedElement.parent ) ) {
- this._markRemove( mergedElement.parent, mergedElement.startOffset, 1 );
- }
- // Mark that the merged element was inserted into graveyard.
- const graveyardParent = operation.graveyardPosition.parent;
- this._markInsert( graveyardParent, operation.graveyardPosition.offset, 1 );
- // Mark that children of merged element were inserted at new parent.
- const mergedIntoElement = operation.targetPosition.parent;
- if ( !this._isInInsertedElement( mergedIntoElement ) ) {
- this._markInsert( mergedIntoElement, operation.targetPosition.offset, mergedElement.maxOffset );
- }
- break;
- }
- }
- // Clear cache after each buffered operation as it is no longer valid.
- this._cachedChanges = null;
- }
- /**
- * Buffers a marker change.
- *
- * @param {String} markerName The name of the marker that changed.
- * @param {module:engine/model/range~Range|null} oldRange Marker range before the change or `null` if the marker has just
- * been created.
- * @param {module:engine/model/range~Range|null} newRange Marker range after the change or `null` if the marker was removed.
- * @param {Boolean} affectsData Flag indicating whether marker affects the editor data.
- */
- bufferMarkerChange( markerName, oldRange, newRange, affectsData ) {
- const buffered = this._changedMarkers.get( markerName );
- if ( !buffered ) {
- this._changedMarkers.set( markerName, {
- oldRange,
- newRange,
- affectsData
- } );
- } else {
- buffered.newRange = newRange;
- buffered.affectsData = affectsData;
- if ( buffered.oldRange == null && buffered.newRange == null ) {
- // The marker is going to be removed (`newRange == null`) but it did not exist before the first buffered change
- // (`buffered.oldRange == null`). In this case, do not keep the marker in buffer at all.
- this._changedMarkers.delete( markerName );
- }
- }
- }
- /**
- * Returns all markers that should be removed as a result of buffered changes.
- *
- * @returns {Array.<Object>} Markers to remove. Each array item is an object containing the `name` and `range` properties.
- */
- getMarkersToRemove() {
- const result = [];
- for ( const [ name, change ] of this._changedMarkers ) {
- if ( change.oldRange != null ) {
- result.push( { name, range: change.oldRange } );
- }
- }
- return result;
- }
- /**
- * Returns all markers which should be added as a result of buffered changes.
- *
- * @returns {Array.<Object>} Markers to add. Each array item is an object containing the `name` and `range` properties.
- */
- getMarkersToAdd() {
- const result = [];
- for ( const [ name, change ] of this._changedMarkers ) {
- if ( change.newRange != null ) {
- result.push( { name, range: change.newRange } );
- }
- }
- return result;
- }
- /**
- * Returns all markers which changed.
- *
- * @returns {Array.<Object>}
- */
- getChangedMarkers() {
- return Array.from( this._changedMarkers ).map( item => (
- {
- name: item[ 0 ],
- data: {
- oldRange: item[ 1 ].oldRange,
- newRange: item[ 1 ].newRange
- }
- }
- ) );
- }
- /**
- * Checks whether some of the buffered changes affect the editor data.
- *
- * Types of changes which affect the editor data:
- *
- * * model structure changes,
- * * attribute changes,
- * * changes of markers which were defined as `affectingData`.
- *
- * @returns {Boolean}
- */
- hasDataChanges() {
- for ( const [ , change ] of this._changedMarkers ) {
- if ( change.affectsData ) {
- return true;
- }
- }
- // If markers do not affect the data, check whether there are some changes in elements.
- return this._changesInElement.size > 0;
- }
- /**
- * Calculates the diff between the old model tree state (the state before the first buffered operations since the last {@link #reset}
- * call) and the new model tree state (actual one). It should be called after all buffered operations are executed.
- *
- * The diff set is returned as an array of {@link module:engine/model/differ~DiffItem diff items}, each describing a change done
- * on the model. The items are sorted by the position on which the change happened. If a position
- * {@link module:engine/model/position~Position#isBefore is before} another one, it will be on an earlier index in the diff set.
- *
- * **Note**: Elements inside inserted element will not have a separate diff item, only the top most element change will be reported.
- *
- * Because calculating the diff is a costly operation, the result is cached. If no new operation was buffered since the
- * previous {@link #getChanges} call, the next call will return the cached value.
- *
- * @param {Object} options Additional options.
- * @param {Boolean} [options.includeChangesInGraveyard=false] If set to `true`, also changes that happened
- * in the graveyard root will be returned. By default, changes in the graveyard root are not returned.
- * @returns {Array.<module:engine/model/differ~DiffItem>} Diff between the old and the new model tree state.
- */
- getChanges( options = { includeChangesInGraveyard: false } ) {
- // If there are cached changes, just return them instead of calculating changes again.
- if ( this._cachedChanges ) {
- if ( options.includeChangesInGraveyard ) {
- return this._cachedChangesWithGraveyard.slice();
- } else {
- return this._cachedChanges.slice();
- }
- }
- // Will contain returned results.
- let diffSet = [];
- // Check all changed elements.
- for ( const element of this._changesInElement.keys() ) {
- // Get changes for this element and sort them.
- const changes = this._changesInElement.get( element ).sort( ( a, b ) => {
- if ( a.offset === b.offset ) {
- if ( a.type != b.type ) {
- // If there are multiple changes at the same position, "remove" change should be first.
- // If the order is different, for example, we would first add some nodes and then removed them
- // (instead of the nodes that we should remove).
- return a.type == 'remove' ? -1 : 1;
- }
- return 0;
- }
- return a.offset < b.offset ? -1 : 1;
- } );
- // Get children of this element before any change was applied on it.
- const snapshotChildren = this._elementSnapshots.get( element );
- // Get snapshot of current element's children.
- const elementChildren = _getChildrenSnapshot( element.getChildren() );
- // Generate actions basing on changes done on element.
- const actions = _generateActionsFromChanges( snapshotChildren.length, changes );
- let i = 0; // Iterator in `elementChildren` array -- iterates through current children of element.
- let j = 0; // Iterator in `snapshotChildren` array -- iterates through old children of element.
- // Process every action.
- for ( const action of actions ) {
- if ( action === 'i' ) {
- // Generate diff item for this element and insert it into the diff set.
- diffSet.push( this._getInsertDiff( element, i, elementChildren[ i ].name ) );
- i++;
- } else if ( action === 'r' ) {
- // Generate diff item for this element and insert it into the diff set.
- diffSet.push( this._getRemoveDiff( element, i, snapshotChildren[ j ].name ) );
- j++;
- } else if ( action === 'a' ) {
- // Take attributes from saved and current children.
- const elementAttributes = elementChildren[ i ].attributes;
- const snapshotAttributes = snapshotChildren[ j ].attributes;
- let range;
- if ( elementChildren[ i ].name == '$text' ) {
- range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, i ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, i + 1 ) );
- } else {
- const index = element.offsetToIndex( i );
- range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, i ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element.getChild( index ), 0 ) );
- }
- // Generate diff items for this change (there might be multiple attributes changed and
- // there is a single diff for each of them) and insert them into the diff set.
- diffSet.push( ...this._getAttributesDiff( range, snapshotAttributes, elementAttributes ) );
- i++;
- j++;
- } else {
- // `action` is 'equal'. Child not changed.
- i++;
- j++;
- }
- }
- }
- // Then, sort the changes by the position (change at position before other changes is first).
- diffSet.sort( ( a, b ) => {
- // If the change is in different root, we don't care much, but we'd like to have all changes in given
- // root "together" in the array. So let's just sort them by the root name. It does not matter which root
- // will be processed first.
- if ( a.position.root != b.position.root ) {
- return a.position.root.rootName < b.position.root.rootName ? -1 : 1;
- }
- // If change happens at the same position...
- if ( a.position.isEqual( b.position ) ) {
- // Keep chronological order of operations.
- return a.changeCount - b.changeCount;
- }
- // If positions differ, position "on the left" should be earlier in the result.
- return a.position.isBefore( b.position ) ? -1 : 1;
- } );
- // Glue together multiple changes (mostly on text nodes).
- for ( let i = 1, prevIndex = 0; i < diffSet.length; i++ ) {
- const prevDiff = diffSet[ prevIndex ];
- const thisDiff = diffSet[ i ];
- // Glue remove changes if they happen on text on same position.
- const isConsecutiveTextRemove =
- prevDiff.type == 'remove' && thisDiff.type == 'remove' &&
- prevDiff.name == '$text' && thisDiff.name == '$text' &&
- prevDiff.position.isEqual( thisDiff.position );
- // Glue insert changes if they happen on text on consecutive fragments.
- const isConsecutiveTextAdd =
- prevDiff.type == 'insert' && thisDiff.type == 'insert' &&
- prevDiff.name == '$text' && thisDiff.name == '$text' &&
- prevDiff.position.parent == thisDiff.position.parent &&
- prevDiff.position.offset + prevDiff.length == thisDiff.position.offset;
- // Glue attribute changes if they happen on consecutive fragments and have same key, old value and new value.
- const isConsecutiveAttributeChange =
- prevDiff.type == 'attribute' && thisDiff.type == 'attribute' &&
- prevDiff.position.parent == thisDiff.position.parent &&
- prevDiff.range.isFlat && thisDiff.range.isFlat &&
- prevDiff.position.offset + prevDiff.length == thisDiff.position.offset &&
- prevDiff.attributeKey == thisDiff.attributeKey &&
- prevDiff.attributeOldValue == thisDiff.attributeOldValue &&
- prevDiff.attributeNewValue == thisDiff.attributeNewValue;
- if ( isConsecutiveTextRemove || isConsecutiveTextAdd || isConsecutiveAttributeChange ) {
- prevDiff.length++;
- if ( isConsecutiveAttributeChange ) {
- prevDiff.range.end = prevDiff.range.end.getShiftedBy( 1 );
- }
- diffSet[ i ] = null;
- } else {
- prevIndex = i;
- }
- }
- diffSet = diffSet.filter( v => v );
- // Remove `changeCount` property from diff items. It is used only for sorting and is internal thing.
- for ( const item of diffSet ) {
- delete item.changeCount;
- if ( item.type == 'attribute' ) {
- delete item.position;
- delete item.length;
- }
- }
- this._changeCount = 0;
- // Cache changes.
- this._cachedChangesWithGraveyard = diffSet.slice();
- this._cachedChanges = diffSet.filter( _changesInGraveyardFilter );
- if ( options.includeChangesInGraveyard ) {
- return this._cachedChangesWithGraveyard;
- } else {
- return this._cachedChanges;
- }
- }
- /**
- * Resets `Differ`. Removes all buffered changes.
- */
- reset() {
- this._changesInElement.clear();
- this._elementSnapshots.clear();
- this._changedMarkers.clear();
- this._cachedChanges = null;
- }
- /**
- * Saves and handles an insert change.
- *
- * @private
- * @param {module:engine/model/element~Element} parent
- * @param {Number} offset
- * @param {Number} howMany
- */
- _markInsert( parent, offset, howMany ) {
- const changeItem = { type: 'insert', offset, howMany, count: this._changeCount++ };
- this._markChange( parent, changeItem );
- }
- /**
- * Saves and handles a remove change.
- *
- * @private
- * @param {module:engine/model/element~Element} parent
- * @param {Number} offset
- * @param {Number} howMany
- */
- _markRemove( parent, offset, howMany ) {
- const changeItem = { type: 'remove', offset, howMany, count: this._changeCount++ };
- this._markChange( parent, changeItem );
- this._removeAllNestedChanges( parent, offset, howMany );
- }
- /**
- * Saves and handles an attribute change.
- *
- * @private
- * @param {module:engine/model/item~Item} item
- */
- _markAttribute( item ) {
- const changeItem = { type: 'attribute', offset: item.startOffset, howMany: item.offsetSize, count: this._changeCount++ };
- this._markChange( item.parent, changeItem );
- }
- /**
- * Saves and handles a model change.
- *
- * @private
- * @param {module:engine/model/element~Element} parent
- * @param {Object} changeItem
- */
- _markChange( parent, changeItem ) {
- // First, make a snapshot of this parent's children (it will be made only if it was not made before).
- this._makeSnapshot( parent );
- // Then, get all changes that already were done on the element (empty array if this is the first change).
- const changes = this._getChangesForElement( parent );
- // Then, look through all the changes, and transform them or the new change.
- this._handleChange( changeItem, changes );
- // Add the new change.
- changes.push( changeItem );
- // Remove incorrect changes. During transformation some change might be, for example, included in another.
- // In that case, the change will have `howMany` property set to `0` or less. We need to remove those changes.
- for ( let i = 0; i < changes.length; i++ ) {
- if ( changes[ i ].howMany < 1 ) {
- changes.splice( i, 1 );
- i--;
- }
- }
- }
- /**
- * Gets an array of changes that have already been saved for a given element.
- *
- * @private
- * @param {module:engine/model/element~Element} element
- * @returns {Array.<Object>}
- */
- _getChangesForElement( element ) {
- let changes;
- if ( this._changesInElement.has( element ) ) {
- changes = this._changesInElement.get( element );
- } else {
- changes = [];
- this._changesInElement.set( element, changes );
- }
- return changes;
- }
- /**
- * Saves a children snapshot for a given element.
- *
- * @private
- * @param {module:engine/model/element~Element} element
- */
- _makeSnapshot( element ) {
- if ( !this._elementSnapshots.has( element ) ) {
- this._elementSnapshots.set( element, _getChildrenSnapshot( element.getChildren() ) );
- }
- }
- /**
- * For a given newly saved change, compares it with a change already done on the element and modifies the incoming
- * change and/or the old change.
- *
- * @private
- * @param {Object} inc Incoming (new) change.
- * @param {Array.<Object>} changes An array containing all the changes done on that element.
- */
- _handleChange( inc, changes ) {
- // We need a helper variable that will store how many nodes are to be still handled for this change item.
- // `nodesToHandle` (how many nodes still need to be handled) and `howMany` (how many nodes were affected)
- // needs to be differentiated.
- //
- // This comes up when there are multiple changes that are affected by `inc` change item.
- //
- // For example: assume two insert changes: `{ offset: 2, howMany: 1 }` and `{ offset: 5, howMany: 1 }`.
- // Assume that `inc` change is remove `{ offset: 2, howMany: 2, nodesToHandle: 2 }`.
- //
- // Then, we:
- // - "forget" about first insert change (it is "eaten" by remove),
- // - because of that, at the end we will want to remove only one node (`nodesToHandle = 1`),
- // - but still we have to change offset of the second insert change from `5` to `3`!
- //
- // So, `howMany` does not change throughout items transformation and keeps information about how many nodes were affected,
- // while `nodesToHandle` means how many nodes need to be handled after the change item is transformed by other changes.
- inc.nodesToHandle = inc.howMany;
- for ( const old of changes ) {
- const incEnd = inc.offset + inc.howMany;
- const oldEnd = old.offset + old.howMany;
- if ( inc.type == 'insert' ) {
- if ( old.type == 'insert' ) {
- if ( inc.offset <= old.offset ) {
- old.offset += inc.howMany;
- } else if ( inc.offset < oldEnd ) {
- old.howMany += inc.nodesToHandle;
- inc.nodesToHandle = 0;
- }
- }
- if ( old.type == 'remove' ) {
- if ( inc.offset < old.offset ) {
- old.offset += inc.howMany;
- }
- }
- if ( old.type == 'attribute' ) {
- if ( inc.offset <= old.offset ) {
- old.offset += inc.howMany;
- } else if ( inc.offset < oldEnd ) {
- // This case is more complicated, because attribute change has to be split into two.
- // Example (assume that uppercase and lowercase letters mean different attributes):
- //
- // initial state: abcxyz
- // attribute change: aBCXYz
- // incoming insert: aBCfooXYz
- //
- // Change ranges cannot intersect because each item has to be described exactly (it was either
- // not changed, inserted, removed, or its attribute was changed). That's why old attribute
- // change has to be split and both parts has to be handled separately from now on.
- const howMany = old.howMany;
- old.howMany = inc.offset - old.offset;
- // Add the second part of attribute change to the beginning of processed array so it won't
- // be processed again in this loop.
- changes.unshift( {
- type: 'attribute',
- offset: incEnd,
- howMany: howMany - old.howMany,
- count: this._changeCount++
- } );
- }
- }
- }
- if ( inc.type == 'remove' ) {
- if ( old.type == 'insert' ) {
- if ( incEnd <= old.offset ) {
- old.offset -= inc.howMany;
- } else if ( incEnd <= oldEnd ) {
- if ( inc.offset < old.offset ) {
- const intersectionLength = incEnd - old.offset;
- old.offset = inc.offset;
- old.howMany -= intersectionLength;
- inc.nodesToHandle -= intersectionLength;
- } else {
- old.howMany -= inc.nodesToHandle;
- inc.nodesToHandle = 0;
- }
- } else {
- if ( inc.offset <= old.offset ) {
- inc.nodesToHandle -= old.howMany;
- old.howMany = 0;
- } else if ( inc.offset < oldEnd ) {
- const intersectionLength = oldEnd - inc.offset;
- old.howMany -= intersectionLength;
- inc.nodesToHandle -= intersectionLength;
- }
- }
- }
- if ( old.type == 'remove' ) {
- if ( incEnd <= old.offset ) {
- old.offset -= inc.howMany;
- } else if ( inc.offset < old.offset ) {
- inc.nodesToHandle += old.howMany;
- old.howMany = 0;
- }
- }
- if ( old.type == 'attribute' ) {
- if ( incEnd <= old.offset ) {
- old.offset -= inc.howMany;
- } else if ( inc.offset < old.offset ) {
- const intersectionLength = incEnd - old.offset;
- old.offset = inc.offset;
- old.howMany -= intersectionLength;
- } else if ( inc.offset < oldEnd ) {
- if ( incEnd <= oldEnd ) {
- // On first sight in this case we don't need to split attribute operation into two.
- // However the changes set is later converted to actions (see `_generateActionsFromChanges`).
- // For that reason, no two changes may intersect.
- // So we cannot have an attribute change that "contains" remove change.
- // Attribute change needs to be split.
- const howMany = old.howMany;
- old.howMany = inc.offset - old.offset;
- const howManyAfter = howMany - old.howMany - inc.nodesToHandle;
- // Add the second part of attribute change to the beginning of processed array so it won't
- // be processed again in this loop.
- changes.unshift( {
- type: 'attribute',
- offset: inc.offset,
- howMany: howManyAfter,
- count: this._changeCount++
- } );
- } else {
- old.howMany -= oldEnd - inc.offset;
- }
- }
- }
- }
- if ( inc.type == 'attribute' ) {
- // In case of attribute change, `howMany` should be kept same as `nodesToHandle`. It's not an error.
- if ( old.type == 'insert' ) {
- if ( inc.offset < old.offset && incEnd > old.offset ) {
- if ( incEnd > oldEnd ) {
- // This case is similar to a case described when incoming change was insert and old change was attribute.
- // See comment above.
- //
- // This time incoming change is attribute. We need to split incoming change in this case too.
- // However this time, the second part of the attribute change needs to be processed further
- // because there might be other changes that it collides with.
- const attributePart = {
- type: 'attribute',
- offset: oldEnd,
- howMany: incEnd - oldEnd,
- count: this._changeCount++
- };
- this._handleChange( attributePart, changes );
- changes.push( attributePart );
- }
- inc.nodesToHandle = old.offset - inc.offset;
- inc.howMany = inc.nodesToHandle;
- } else if ( inc.offset >= old.offset && inc.offset < oldEnd ) {
- if ( incEnd > oldEnd ) {
- inc.nodesToHandle = incEnd - oldEnd;
- inc.offset = oldEnd;
- } else {
- inc.nodesToHandle = 0;
- }
- }
- }
- if ( old.type == 'remove' ) {
- // This is a case when attribute change "contains" remove change.
- // The attribute change needs to be split into two because changes cannot intersect.
- if ( inc.offset < old.offset && incEnd > old.offset ) {
- const attributePart = {
- type: 'attribute',
- offset: old.offset,
- howMany: incEnd - old.offset,
- count: this._changeCount++
- };
- this._handleChange( attributePart, changes );
- changes.push( attributePart );
- inc.nodesToHandle = old.offset - inc.offset;
- inc.howMany = inc.nodesToHandle;
- }
- }
- if ( old.type == 'attribute' ) {
- // There are only two conflicting scenarios possible here:
- if ( inc.offset >= old.offset && incEnd <= oldEnd ) {
- // `old` change includes `inc` change, or they are the same.
- inc.nodesToHandle = 0;
- inc.howMany = 0;
- inc.offset = 0;
- } else if ( inc.offset <= old.offset && incEnd >= oldEnd ) {
- // `inc` change includes `old` change.
- old.howMany = 0;
- }
- }
- }
- }
- inc.howMany = inc.nodesToHandle;
- delete inc.nodesToHandle;
- }
- /**
- * Returns an object with a single insert change description.
- *
- * @private
- * @param {module:engine/model/element~Element} parent The element in which the change happened.
- * @param {Number} offset The offset at which change happened.
- * @param {String} name The name of the removed element or `'$text'` for a character.
- * @returns {Object} The diff item.
- */
- _getInsertDiff( parent, offset, name ) {
- return {
- type: 'insert',
- position: _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset ),
- name,
- length: 1,
- changeCount: this._changeCount++
- };
- }
- /**
- * Returns an object with a single remove change description.
- *
- * @private
- * @param {module:engine/model/element~Element} parent The element in which change happened.
- * @param {Number} offset The offset at which change happened.
- * @param {String} name The name of the removed element or `'$text'` for a character.
- * @returns {Object} The diff item.
- */
- _getRemoveDiff( parent, offset, name ) {
- return {
- type: 'remove',
- position: _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset ),
- name,
- length: 1,
- changeCount: this._changeCount++
- };
- }
- /**
- * Returns an array of objects where each one is a single attribute change description.
- *
- * @private
- * @param {module:engine/model/range~Range} range The range where the change happened.
- * @param {Map} oldAttributes A map, map iterator or compatible object that contains attributes before the change.
- * @param {Map} newAttributes A map, map iterator or compatible object that contains attributes after the change.
- * @returns {Array.<Object>} An array containing one or more diff items.
- */
- _getAttributesDiff( range, oldAttributes, newAttributes ) {
- // Results holder.
- const diffs = [];
- // Clone new attributes as we will be performing changes on this object.
- newAttributes = new Map( newAttributes );
- // Look through old attributes.
- for ( const [ key, oldValue ] of oldAttributes ) {
- // Check what is the new value of the attribute (or if it was removed).
- const newValue = newAttributes.has( key ) ? newAttributes.get( key ) : null;
- // If values are different (or attribute was removed)...
- if ( newValue !== oldValue ) {
- // Add diff item.
- diffs.push( {
- type: 'attribute',
- position: range.start,
- range: range.clone(),
- length: 1,
- attributeKey: key,
- attributeOldValue: oldValue,
- attributeNewValue: newValue,
- changeCount: this._changeCount++
- } );
- }
- // Prevent returning two diff items for the same change.
- newAttributes.delete( key );
- }
- // Look through new attributes that weren't handled above.
- for ( const [ key, newValue ] of newAttributes ) {
- // Each of them is a new attribute. Add diff item.
- diffs.push( {
- type: 'attribute',
- position: range.start,
- range: range.clone(),
- length: 1,
- attributeKey: key,
- attributeOldValue: null,
- attributeNewValue: newValue,
- changeCount: this._changeCount++
- } );
- }
- return diffs;
- }
- /**
- * Checks whether given element or any of its parents is an element that is buffered as an inserted element.
- *
- * @private
- * @param {module:engine/model/element~Element} element Element to check.
- * @returns {Boolean}
- */
- _isInInsertedElement( element ) {
- const parent = element.parent;
- if ( !parent ) {
- return false;
- }
- const changes = this._changesInElement.get( parent );
- const offset = element.startOffset;
- if ( changes ) {
- for ( const change of changes ) {
- if ( change.type == 'insert' && offset >= change.offset && offset < change.offset + change.howMany ) {
- return true;
- }
- }
- }
- return this._isInInsertedElement( parent );
- }
- /**
- * Removes deeply all buffered changes that are registered in elements from range specified by `parent`, `offset`
- * and `howMany`.
- *
- * @private
- * @param {module:engine/model/element~Element} parent
- * @param {Number} offset
- * @param {Number} howMany
- */
- _removeAllNestedChanges( parent, offset, howMany ) {
- const range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset + howMany ) );
- for ( const item of range.getItems( { shallow: true } ) ) {
- if ( item.is( 'element' ) ) {
- this._elementSnapshots.delete( item );
- this._changesInElement.delete( item );
- this._removeAllNestedChanges( item, 0, item.maxOffset );
- }
- }
- }
- }
- // Returns an array that is a copy of passed child list with the exception that text nodes are split to one or more
- // objects, each representing one character and attributes set on that character.
- function _getChildrenSnapshot( children ) {
- const snapshot = [];
- for ( const child of children ) {
- if ( child.is( '$text' ) ) {
- for ( let i = 0; i < child.data.length; i++ ) {
- snapshot.push( {
- name: '$text',
- attributes: new Map( child.getAttributes() )
- } );
- }
- } else {
- snapshot.push( {
- name: child.name,
- attributes: new Map( child.getAttributes() )
- } );
- }
- }
- return snapshot;
- }
- // Generates array of actions for given changes set.
- // It simulates what `diff` function does.
- // Generated actions are:
- // - 'e' for 'equal' - when item at that position did not change,
- // - 'i' for 'insert' - when item at that position was inserted,
- // - 'r' for 'remove' - when item at that position was removed,
- // - 'a' for 'attribute' - when item at that position has it attributes changed.
- //
- // Example (assume that uppercase letters have bold attribute, compare with function code):
- //
- // children before: fooBAR
- // children after: foxybAR
- //
- // changes: type: remove, offset: 1, howMany: 1
- // type: insert, offset: 2, howMany: 2
- // type: attribute, offset: 4, howMany: 1
- //
- // expected actions: equal (f), remove (o), equal (o), insert (x), insert (y), attribute (b), equal (A), equal (R)
- //
- // steps taken by th script:
- //
- // 1. change = "type: remove, offset: 1, howMany: 1"; offset = 0; oldChildrenHandled = 0
- // 1.1 between this change and the beginning is one not-changed node, fill with one equal action, one old child has been handled
- // 1.2 this change removes one node, add one remove action
- // 1.3 change last visited `offset` to 1
- // 1.4 since an old child has been removed, one more old child has been handled
- // 1.5 actions at this point are: equal, remove
- //
- // 2. change = "type: insert, offset: 2, howMany: 2"; offset = 1; oldChildrenHandled = 2
- // 2.1 between this change and previous change is one not-changed node, add equal action, another one old children has been handled
- // 2.2 this change inserts two nodes, add two insert actions
- // 2.3 change last visited offset to the end of the inserted range, that is 4
- // 2.4 actions at this point are: equal, remove, equal, insert, insert
- //
- // 3. change = "type: attribute, offset: 4, howMany: 1"; offset = 4, oldChildrenHandled = 3
- // 3.1 between this change and previous change are no not-changed nodes
- // 3.2 this change changes one node, add one attribute action
- // 3.3 change last visited `offset` to the end of change range, that is 5
- // 3.4 since an old child has been changed, one more old child has been handled
- // 3.5 actions at this point are: equal, remove, equal, insert, insert, attribute
- //
- // 4. after loop oldChildrenHandled = 4, oldChildrenLength = 6 (fooBAR is 6 characters)
- // 4.1 fill up with two equal actions
- //
- // The result actions are: equal, remove, equal, insert, insert, attribute, equal, equal.
- function _generateActionsFromChanges( oldChildrenLength, changes ) {
- const actions = [];
- let offset = 0;
- let oldChildrenHandled = 0;
- // Go through all buffered changes.
- for ( const change of changes ) {
- // First, fill "holes" between changes with "equal" actions.
- if ( change.offset > offset ) {
- for ( let i = 0; i < change.offset - offset; i++ ) {
- actions.push( 'e' );
- }
- oldChildrenHandled += change.offset - offset;
- }
- // Then, fill up actions accordingly to change type.
- if ( change.type == 'insert' ) {
- for ( let i = 0; i < change.howMany; i++ ) {
- actions.push( 'i' );
- }
- // The last handled offset is after inserted range.
- offset = change.offset + change.howMany;
- } else if ( change.type == 'remove' ) {
- for ( let i = 0; i < change.howMany; i++ ) {
- actions.push( 'r' );
- }
- // The last handled offset is at the position where the nodes were removed.
- offset = change.offset;
- // We removed `howMany` old nodes, update `oldChildrenHandled`.
- oldChildrenHandled += change.howMany;
- } else {
- actions.push( ...'a'.repeat( change.howMany ).split( '' ) );
- // The last handled offset is at the position after the changed range.
- offset = change.offset + change.howMany;
- // We changed `howMany` old nodes, update `oldChildrenHandled`.
- oldChildrenHandled += change.howMany;
- }
- }
- // Fill "equal" actions at the end of actions set. Use `oldChildrenHandled` to see how many children
- // has not been changed / removed at the end of their parent.
- if ( oldChildrenHandled < oldChildrenLength ) {
- for ( let i = 0; i < oldChildrenLength - oldChildrenHandled - offset; i++ ) {
- actions.push( 'e' );
- }
- }
- return actions;
- }
- // Filter callback for Array.filter that filters out change entries that are in graveyard.
- function _changesInGraveyardFilter( entry ) {
- const posInGy = entry.position && entry.position.root.rootName == '$graveyard';
- const rangeInGy = entry.range && entry.range.root.rootName == '$graveyard';
- return !posInGy && !rangeInGy;
- }
- /**
- * The single diff item.
- *
- * Could be one of:
- *
- * * {@link module:engine/model/differ~DiffItemInsert `DiffItemInsert`},
- * * {@link module:engine/model/differ~DiffItemRemove `DiffItemRemove`},
- * * {@link module:engine/model/differ~DiffItemAttribute `DiffItemAttribute`}.
- *
- * @interface DiffItem
- */
- /**
- * The single diff item for inserted nodes.
- *
- * @class DiffItemInsert
- * @implements module:engine/model/differ~DiffItem
- */
- /**
- * The type of diff item.
- *
- * @member {'insert'} module:engine/model/differ~DiffItemInsert#type
- */
- /**
- * The name of the inserted elements or `'$text'` for a text node.
- *
- * @member {String} module:engine/model/differ~DiffItemInsert#name
- */
- /**
- * The position where the node was inserted.
- *
- * @member {module:engine/model/position~Position} module:engine/model/differ~DiffItemInsert#position
- */
- /**
- * The length of an inserted text node. For elements it is always 1 as each inserted element is counted as a one.
- *
- * @member {Number} module:engine/model/differ~DiffItemInsert#length
- */
- /**
- * The single diff item for removed nodes.
- *
- * @class DiffItemRemove
- * @implements module:engine/model/differ~DiffItem
- */
- /**
- * The type of diff item.
- *
- * @member {'remove'} module:engine/model/differ~DiffItemRemove#type
- */
- /**
- * The name of the removed element or `'$text'` for a text node.
- *
- * @member {String} module:engine/model/differ~DiffItemRemove#name
- */
- /**
- * The position where the node was removed.
- *
- * @member {module:engine/model/position~Position} module:engine/model/differ~DiffItemRemove#position
- */
- /**
- * The length of a removed text node. For elements it is always 1 as each removed element is counted as a one.
- *
- * @member {Number} module:engine/model/differ~DiffItemRemove#length
- */
- /**
- * The single diff item for attribute change.
- *
- * @class DiffItemAttribute
- * @implements module:engine/model/differ~DiffItem
- */
- /**
- * The type of diff item.
- *
- * @member {'attribute'} module:engine/model/differ~DiffItemAttribute#type
- */
- /**
- * The name of the changed attribute.
- *
- * @member {String} module:engine/model/differ~DiffItemAttribute#attributeKey
- */
- /**
- * An attribute previous value (before change).
- *
- * @member {String} module:engine/model/differ~DiffItemAttribute#attributeOldValue
- */
- /**
- * An attribute new value (after change).
- *
- * @member {String} module:engine/model/differ~DiffItemAttribute#attributeNewValue
- */
- /**
- * The range where the change happened.
- *
- * @member {module:engine/model/range~Range} module:engine/model/differ~DiffItemAttribute#range
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Document; });
- /* harmony import */ var _differ__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./differ */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js");
- /* harmony import */ var _rootelement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rootelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js");
- /* harmony import */ var _history__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./history */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js");
- /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/unicode */ "./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/document
- */
- // @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );
- const graveyardName = '$graveyard';
- /**
- * Data model's document. It contains the model's structure, its selection and the history of changes.
- *
- * Read more about working with the model in
- * {@glink framework/guides/architecture/editing-engine#model introduction to the the editing engine's architecture}.
- *
- * Usually, the document contains just one {@link module:engine/model/document~Document#roots root element}, so
- * you can retrieve it by just calling {@link module:engine/model/document~Document#getRoot} without specifying its name:
- *
- * model.document.getRoot(); // -> returns the main root
- *
- * However, the document may contain multiple roots – e.g. when the editor has multiple editable areas
- * (e.g. a title and a body of a message).
- *
- * @mixes module:utils/emittermixin~EmitterMixin
- */
- class Document {
- /**
- * Creates an empty document instance with no {@link #roots} (other than
- * the {@link #graveyard graveyard root}).
- */
- constructor( model ) {
- /**
- * The {@link module:engine/model/model~Model model} that the document is a part of.
- *
- * @readonly
- * @type {module:engine/model/model~Model}
- */
- this.model = model;
- /**
- * The document version. It starts from `0` and every operation increases the version number. It is used to ensure that
- * operations are applied on a proper document version.
- *
- * If the {@link module:engine/model/operation/operation~Operation#baseVersion base version} does not match the document version,
- * a {@link module:utils/ckeditorerror~CKEditorError model-document-applyoperation-wrong-version} error is thrown.
- *
- * @type {Number}
- */
- this.version = 0;
- /**
- * The document's history.
- *
- * @readonly
- * @type {module:engine/model/history~History}
- */
- this.history = new _history__WEBPACK_IMPORTED_MODULE_2__["default"]( this );
- /**
- * The selection in this document.
- *
- * @readonly
- * @type {module:engine/model/documentselection~DocumentSelection}
- */
- this.selection = new _documentselection__WEBPACK_IMPORTED_MODULE_3__["default"]( this );
- /**
- * A list of roots that are owned and managed by this document. Use {@link #createRoot} and
- * {@link #getRoot} to manipulate it.
- *
- * @readonly
- * @type {module:utils/collection~Collection}
- */
- this.roots = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__["default"]( { idProperty: 'rootName' } );
- /**
- * The model differ object. Its role is to buffer changes done on the model document and then calculate a diff of those changes.
- *
- * @readonly
- * @type {module:engine/model/differ~Differ}
- */
- this.differ = new _differ__WEBPACK_IMPORTED_MODULE_0__["default"]( model.markers );
- /**
- * Post-fixer callbacks registered to the model document.
- *
- * @private
- * @type {Set.<Function>}
- */
- this._postFixers = new Set();
- /**
- * A boolean indicates whether the selection has changed until
- *
- * @private
- * @type {Boolean}
- */
- this._hasSelectionChangedFromTheLastChangeBlock = false;
- // Graveyard tree root. Document always have a graveyard root, which stores removed nodes.
- this.createRoot( '$root', graveyardName );
- // First, if the operation is a document operation check if it's base version is correct.
- this.listenTo( model, 'applyOperation', ( evt, args ) => {
- const operation = args[ 0 ];
- if ( operation.isDocumentOperation && operation.baseVersion !== this.version ) {
- /**
- * Only operations with matching versions can be applied.
- *
- * @error model-document-applyoperation-wrong-version
- * @param {module:engine/model/operation/operation~Operation} operation
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'model-document-applyoperation-wrong-version', this, { operation } );
- }
- }, { priority: 'highest' } );
- // Then, still before an operation is applied on model, buffer the change in differ.
- this.listenTo( model, 'applyOperation', ( evt, args ) => {
- const operation = args[ 0 ];
- if ( operation.isDocumentOperation ) {
- this.differ.bufferOperation( operation );
- }
- }, { priority: 'high' } );
- // After the operation is applied, bump document's version and add the operation to the history.
- this.listenTo( model, 'applyOperation', ( evt, args ) => {
- const operation = args[ 0 ];
- if ( operation.isDocumentOperation ) {
- this.version++;
- this.history.addOperation( operation );
- }
- }, { priority: 'low' } );
- // Listen to selection changes. If selection changed, mark it.
- this.listenTo( this.selection, 'change', () => {
- this._hasSelectionChangedFromTheLastChangeBlock = true;
- } );
- // Buffer marker changes.
- // This is not covered in buffering operations because markers may change outside of them (when they
- // are modified using `model.markers` collection, not through `MarkerOperation`).
- this.listenTo( model.markers, 'update', ( evt, marker, oldRange, newRange ) => {
- // Whenever marker is updated, buffer that change.
- this.differ.bufferMarkerChange( marker.name, oldRange, newRange, marker.affectsData );
- if ( oldRange === null ) {
- // If this is a new marker, add a listener that will buffer change whenever marker changes.
- marker.on( 'change', ( evt, oldRange ) => {
- this.differ.bufferMarkerChange( marker.name, oldRange, marker.getRange(), marker.affectsData );
- } );
- }
- } );
- }
- /**
- * The graveyard tree root. A document always has a graveyard root that stores removed nodes.
- *
- * @readonly
- * @member {module:engine/model/rootelement~RootElement}
- */
- get graveyard() {
- return this.getRoot( graveyardName );
- }
- /**
- * Creates a new root.
- *
- * @param {String} [elementName='$root'] The element name. Defaults to `'$root'` which also has some basic schema defined
- * (`$block`s are allowed inside the `$root`). Make sure to define a proper schema if you use a different name.
- * @param {String} [rootName='main'] A unique root name.
- * @returns {module:engine/model/rootelement~RootElement} The created root.
- */
- createRoot( elementName = '$root', rootName = 'main' ) {
- if ( this.roots.get( rootName ) ) {
- /**
- * A root with the specified name already exists.
- *
- * @error model-document-createroot-name-exists
- * @param {module:engine/model/document~Document} doc
- * @param {String} name
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'model-document-createroot-name-exists', this, { name: rootName } );
- }
- const root = new _rootelement__WEBPACK_IMPORTED_MODULE_1__["default"]( this, elementName, rootName );
- this.roots.add( root );
- return root;
- }
- /**
- * Removes all event listeners set by the document instance.
- */
- destroy() {
- this.selection.destroy();
- this.stopListening();
- }
- /**
- * Returns a root by its name.
- *
- * @param {String} [name='main'] A unique root name.
- * @returns {module:engine/model/rootelement~RootElement|null} The root registered under a given name or `null` when
- * there is no root with the given name.
- */
- getRoot( name = 'main' ) {
- return this.roots.get( name );
- }
- /**
- * Returns an array with names of all roots (without the {@link #graveyard}) added to the document.
- *
- * @returns {Array.<String>} Roots names.
- */
- getRootNames() {
- return Array.from( this.roots, root => root.rootName ).filter( name => name != graveyardName );
- }
- /**
- * Used to register a post-fixer callback. A post-fixer mechanism guarantees that the features
- * will operate on a correct model state.
- *
- * An execution of a feature may lead to an incorrect document tree state. The callbacks are used to fix the document tree after
- * it has changed. Post-fixers are fired just after all changes from the outermost change block were applied but
- * before the {@link module:engine/model/document~Document#event:change change event} is fired. If a post-fixer callback made
- * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should
- * not be fixed in the new document tree state.
- *
- * As a parameter, a post-fixer callback receives a {@link module:engine/model/writer~Writer writer} instance connected with the
- * executed changes block. Thanks to that, all changes done by the callback will be added to the same
- * {@link module:engine/model/batch~Batch batch} (and undo step) as the original changes. This makes post-fixer changes transparent
- * for the user.
- *
- * An example of a post-fixer is a callback that checks if all the data were removed from the editor. If so, the
- * callback should add an empty paragraph so that the editor is never empty:
- *
- * document.registerPostFixer( writer => {
- * const changes = document.differ.getChanges();
- *
- * // Check if the changes lead to an empty root in the editor.
- * for ( const entry of changes ) {
- * if ( entry.type == 'remove' && entry.position.root.isEmpty ) {
- * writer.insertElement( 'paragraph', entry.position.root, 0 );
- *
- * // It is fine to return early, even if multiple roots would need to be fixed.
- * // All post-fixers will be fired again, so if there are more empty roots, those will be fixed, too.
- * return true;
- * }
- * }
- * } );
- *
- * @param {Function} postFixer
- */
- registerPostFixer( postFixer ) {
- this._postFixers.add( postFixer );
- }
- /**
- * A custom `toJSON()` method to solve child-parent circular dependencies.
- *
- * @returns {Object} A clone of this object with the document property changed to a string.
- */
- toJSON() {
- const json = Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__["clone"])( this );
- // Due to circular references we need to remove parent reference.
- json.selection = '[engine.model.DocumentSelection]';
- json.model = '[engine.model.Model]';
- return json;
- }
- /**
- * Check if there were any changes done on document, and if so, call post-fixers,
- * fire `change` event for features and conversion and then reset the differ.
- * Fire `change:data` event when at least one operation or buffered marker changes the data.
- *
- * @protected
- * @fires change
- * @fires change:data
- * @param {module:engine/model/writer~Writer} writer The writer on which post-fixers will be called.
- */
- _handleChangeBlock( writer ) {
- if ( this._hasDocumentChangedFromTheLastChangeBlock() ) {
- this._callPostFixers( writer );
- // Refresh selection attributes according to the final position in the model after the change.
- this.selection.refresh();
- if ( this.differ.hasDataChanges() ) {
- this.fire( 'change:data', writer.batch );
- } else {
- this.fire( 'change', writer.batch );
- }
- // Theoretically, it is not necessary to refresh selection after change event because
- // post-fixers are the last who should change the model, but just in case...
- this.selection.refresh();
- this.differ.reset();
- }
- this._hasSelectionChangedFromTheLastChangeBlock = false;
- }
- /**
- * Returns whether there is a buffered change or if the selection has changed from the last
- * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()` block}
- * or {@link module:engine/model/model~Model#change `change()` block}.
- *
- * @protected
- * @returns {Boolean} Returns `true` if document has changed from the last `change()` or `enqueueChange()` block.
- */
- _hasDocumentChangedFromTheLastChangeBlock() {
- return !this.differ.isEmpty || this._hasSelectionChangedFromTheLastChangeBlock;
- }
- /**
- * Returns the default root for this document which is either the first root that was added to the document using
- * {@link #createRoot} or the {@link #graveyard graveyard root} if no other roots were created.
- *
- * @protected
- * @returns {module:engine/model/rootelement~RootElement} The default root for this document.
- */
- _getDefaultRoot() {
- for ( const root of this.roots ) {
- if ( root !== this.graveyard ) {
- return root;
- }
- }
- return this.graveyard;
- }
- /**
- * Returns the default range for this selection. The default range is a collapsed range that starts and ends
- * at the beginning of this selection's document {@link #_getDefaultRoot default root}.
- *
- * @protected
- * @returns {module:engine/model/range~Range}
- */
- _getDefaultRange() {
- const defaultRoot = this._getDefaultRoot();
- const model = this.model;
- const schema = model.schema;
- // Find the first position where the selection can be put.
- const position = model.createPositionFromPath( defaultRoot, [ 0 ] );
- const nearestRange = schema.getNearestSelectionRange( position );
- // If valid selection range is not found - return range collapsed at the beginning of the root.
- return nearestRange || model.createRange( position );
- }
- /**
- * Checks whether a given {@link module:engine/model/range~Range range} is a valid range for
- * the {@link #selection document's selection}.
- *
- * @private
- * @param {module:engine/model/range~Range} range A range to check.
- * @returns {Boolean} `true` if `range` is valid, `false` otherwise.
- */
- _validateSelectionRange( range ) {
- return validateTextNodePosition( range.start ) && validateTextNodePosition( range.end );
- }
- /**
- * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.
- *
- * @private
- * @param {module:engine/model/writer~Writer} writer The writer on which post-fixer callbacks will be called.
- */
- _callPostFixers( writer ) {
- let wasFixed = false;
- do {
- for ( const callback of this._postFixers ) {
- // Ensure selection attributes are up to date before each post-fixer.
- // https://github.com/ckeditor/ckeditor5-engine/issues/1673.
- //
- // It might be good to refresh the selection after each operation but at the moment it leads
- // to losing attributes for composition or and spell checking
- // https://github.com/ckeditor/ckeditor5-typing/issues/188
- this.selection.refresh();
- wasFixed = callback( writer );
- if ( wasFixed ) {
- break;
- }
- }
- } while ( wasFixed );
- }
- /**
- * Fired after each {@link module:engine/model/model~Model#enqueueChange `enqueueChange()` block} or the outermost
- * {@link module:engine/model/model~Model#change `change()` block} was executed and the document was changed
- * during that block's execution.
- *
- * The changes which this event will cover include:
- *
- * * document structure changes,
- * * selection changes,
- * * marker changes.
- *
- * If you want to be notified about all these changes, then simply listen to this event like this:
- *
- * model.document.on( 'change', () => {
- * console.log( 'The document has changed!' );
- * } );
- *
- * If, however, you only want to be notified about the data changes, then use the
- * {@link module:engine/model/document~Document#event:change:data change:data} event,
- * which is fired for document structure changes and marker changes (which affects the data).
- *
- * model.document.on( 'change:data', () => {
- * console.log( 'The data has changed!' );
- * } );
- *
- * @event change
- * @param {module:engine/model/batch~Batch} batch The batch that was used in the executed changes block.
- */
- /**
- * It is a narrower version of the {@link #event:change} event. It is fired for changes which
- * affect the editor data. This is:
- *
- * * document structure changes,
- * * marker changes (which affects the data).
- *
- * If you want to be notified about the data changes, then listen to this event:
- *
- * model.document.on( 'change:data', () => {
- * console.log( 'The data has changed!' );
- * } );
- *
- * If you would like to listen to all document changes, then check out the
- * {@link module:engine/model/document~Document#event:change change} event.
- *
- * @event change:data
- * @param {module:engine/model/batch~Batch} batch The batch that was used in the executed changes block.
- */
- // @if CK_DEBUG_ENGINE // log( version = null ) {
- // @if CK_DEBUG_ENGINE // version = version === null ? this.version : version;
- // @if CK_DEBUG_ENGINE // logDocument( this, version );
- // @if CK_DEBUG_ENGINE // }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__["default"])( Document, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
- // Checks whether given range boundary position is valid for document selection, meaning that is not between
- // unicode surrogate pairs or base character and combining marks.
- function validateTextNodePosition( rangeBoundary ) {
- const textNode = rangeBoundary.textNode;
- if ( textNode ) {
- const data = textNode.data;
- const offset = rangeBoundary.offset - textNode.startOffset;
- return !Object(_ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_8__["isInsideSurrogatePair"])( data, offset ) && !Object(_ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_8__["isInsideCombinedSymbol"])( data, offset );
- }
- return true;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentFragment; });
- /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
- /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module module:engine/model/documentfragment
- */
- // @if CK_DEBUG_ENGINE // const { stringifyMap } = require( '../dev-utils/utils' );
- /**
- * DocumentFragment represents a part of model which does not have a common root but its top-level nodes
- * can be seen as siblings. In other words, it is a detached part of model tree, without a root.
- *
- * DocumentFragment has own {@link module:engine/model/markercollection~MarkerCollection}. Markers from this collection
- * will be set to the {@link module:engine/model/model~Model#markers model markers} by a
- * {@link module:engine/model/writer~Writer#insert} function.
- */
- class DocumentFragment {
- /**
- * Creates an empty `DocumentFragment`.
- *
- * **Note:** Constructor of this class shouldn't be used directly in the code.
- * Use the {@link module:engine/model/writer~Writer#createDocumentFragment} method instead.
- *
- * @protected
- * @param {module:engine/model/node~Node|Iterable.<module:engine/model/node~Node>} [children]
- * Nodes to be contained inside the `DocumentFragment`.
- */
- constructor( children ) {
- /**
- * DocumentFragment static markers map. This is a list of names and {@link module:engine/model/range~Range ranges}
- * which will be set as Markers to {@link module:engine/model/model~Model#markers model markers collection}
- * when DocumentFragment will be inserted to the document.
- *
- * @readonly
- * @member {Map<String,module:engine/model/range~Range>} module:engine/model/documentfragment~DocumentFragment#markers
- */
- this.markers = new Map();
- /**
- * List of nodes contained inside the document fragment.
- *
- * @private
- * @member {module:engine/model/nodelist~NodeList} module:engine/model/documentfragment~DocumentFragment#_children
- */
- this._children = new _nodelist__WEBPACK_IMPORTED_MODULE_0__["default"]();
- if ( children ) {
- this._insertChild( 0, children );
- }
- }
- /**
- * Returns an iterator that iterates over all nodes contained inside this document fragment.
- *
- * @returns {Iterable.<module:engine/model/node~Node>}
- */
- [ Symbol.iterator ]() {
- return this.getChildren();
- }
- /**
- * Number of this document fragment's children.
- *
- * @readonly
- * @type {Number}
- */
- get childCount() {
- return this._children.length;
- }
- /**
- * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this document fragment's children.
- *
- * @readonly
- * @type {Number}
- */
- get maxOffset() {
- return this._children.maxOffset;
- }
- /**
- * Is `true` if there are no nodes inside this document fragment, `false` otherwise.
- *
- * @readonly
- * @type {Boolean}
- */
- get isEmpty() {
- return this.childCount === 0;
- }
- /**
- * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.
- *
- * @readonly
- * @type {module:engine/model/documentfragment~DocumentFragment}
- */
- get root() {
- return this;
- }
- /**
- * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
- *
- * @readonly
- * @type {null}
- */
- get parent() {
- return null;
- }
- /**
- * Checks whether this object is of the given type.
- *
- * docFrag.is( 'documentFragment' ); // -> true
- * docFrag.is( 'model:documentFragment' ); // -> true
- *
- * docFrag.is( 'view:documentFragment' ); // -> false
- * docFrag.is( 'element' ); // -> false
- * docFrag.is( 'node' ); // -> false
- *
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'documentFragment' || type === 'model:documentFragment';
- }
- /**
- * Gets the child at the given index. Returns `null` if incorrect index was passed.
- *
- * @param {Number} index Index of child.
- * @returns {module:engine/model/node~Node|null} Child node.
- */
- getChild( index ) {
- return this._children.getNode( index );
- }
- /**
- * Returns an iterator that iterates over all of this document fragment's children.
- *
- * @returns {Iterable.<module:engine/model/node~Node>}
- */
- getChildren() {
- return this._children[ Symbol.iterator ]();
- }
- /**
- * Returns an index of the given child node. Returns `null` if given node is not a child of this document fragment.
- *
- * @param {module:engine/model/node~Node} node Child node to look for.
- * @returns {Number|null} Child node's index.
- */
- getChildIndex( node ) {
- return this._children.getNodeIndex( node );
- }
- /**
- * Returns the starting offset of given child. Starting offset is equal to the sum of
- * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if
- * given node is not a child of this document fragment.
- *
- * @param {module:engine/model/node~Node} node Child node to look for.
- * @returns {Number|null} Child node's starting offset.
- */
- getChildStartOffset( node ) {
- return this._children.getNodeStartOffset( node );
- }
- /**
- * Returns path to a `DocumentFragment`, which is an empty array. Added for compatibility reasons.
- *
- * @returns {Array}
- */
- getPath() {
- return [];
- }
- /**
- * Returns a descendant node by its path relative to this element.
- *
- * // <this>a<b>c</b></this>
- * this.getNodeByPath( [ 0 ] ); // -> "a"
- * this.getNodeByPath( [ 1 ] ); // -> <b>
- * this.getNodeByPath( [ 1, 0 ] ); // -> "c"
- *
- * @param {Array.<Number>} relativePath Path of the node to find, relative to this element.
- * @returns {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}
- */
- getNodeByPath( relativePath ) {
- let node = this; // eslint-disable-line consistent-this
- for ( const index of relativePath ) {
- node = node.getChild( node.offsetToIndex( index ) );
- }
- return node;
- }
- /**
- * Converts offset "position" to index "position".
- *
- * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is
- * too high, returns index after last child}.
- *
- * const textNode = new Text( 'foo' );
- * const pElement = new Element( 'p' );
- * const docFrag = new DocumentFragment( [ textNode, pElement ] );
- * docFrag.offsetToIndex( -1 ); // Returns 0, because offset is too low.
- * docFrag.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.
- * docFrag.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.
- * docFrag.offsetToIndex( 2 ); // Returns 0.
- * docFrag.offsetToIndex( 3 ); // Returns 1.
- * docFrag.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.
- *
- * @param {Number} offset Offset to look for.
- * @returns {Number} Index of a node that occupies given offset.
- */
- offsetToIndex( offset ) {
- return this._children.offsetToIndex( offset );
- }
- /**
- * Converts `DocumentFragment` instance to plain object and returns it.
- * Takes care of converting all of this document fragment's children.
- *
- * @returns {Object} `DocumentFragment` instance converted to plain object.
- */
- toJSON() {
- const json = [];
- for ( const node of this._children ) {
- json.push( node.toJSON() );
- }
- return json;
- }
- /**
- * Creates a `DocumentFragment` instance from given plain object (i.e. parsed JSON string).
- * Converts `DocumentFragment` children to proper nodes.
- *
- * @param {Object} json Plain object to be converted to `DocumentFragment`.
- * @returns {module:engine/model/documentfragment~DocumentFragment} `DocumentFragment` instance created using given plain object.
- */
- static fromJSON( json ) {
- const children = [];
- for ( const child of json ) {
- if ( child.name ) {
- // If child has name property, it is an Element.
- children.push( _element__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( child ) );
- } else {
- // Otherwise, it is a Text node.
- children.push( _text__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( child ) );
- }
- }
- return new DocumentFragment( children );
- }
- /**
- * {@link #_insertChild Inserts} one or more nodes at the end of this document fragment.
- *
- * @protected
- * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} items Items to be inserted.
- */
- _appendChild( items ) {
- this._insertChild( this.childCount, items );
- }
- /**
- * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes
- * to this document fragment.
- *
- * @protected
- * @param {Number} index Index at which nodes should be inserted.
- * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} items Items to be inserted.
- */
- _insertChild( index, items ) {
- const nodes = normalize( items );
- for ( const node of nodes ) {
- // If node that is being added to this element is already inside another element, first remove it from the old parent.
- if ( node.parent !== null ) {
- node._remove();
- }
- node.parent = this;
- }
- this._children._insertNodes( index, nodes );
- }
- /**
- * Removes one or more nodes starting at the given index
- * and sets {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.
- *
- * @protected
- * @param {Number} index Index of the first node to remove.
- * @param {Number} [howMany=1] Number of nodes to remove.
- * @returns {Array.<module:engine/model/node~Node>} Array containing removed nodes.
- */
- _removeChildren( index, howMany = 1 ) {
- const nodes = this._children._removeNodes( index, howMany );
- for ( const node of nodes ) {
- node.parent = null;
- }
- return nodes;
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return 'documentFragment';
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // log() {
- // @if CK_DEBUG_ENGINE // console.log( 'ModelDocumentFragment: ' + this );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // printTree() {
- // @if CK_DEBUG_ENGINE // let string = 'ModelDocumentFragment: [';
- // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
- // @if CK_DEBUG_ENGINE // string += '\n';
- // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
- // @if CK_DEBUG_ENGINE // const textAttrs = stringifyMap( child._attrs );
- // @if CK_DEBUG_ENGINE // string += '\t'.repeat( 1 );
- // @if CK_DEBUG_ENGINE // if ( textAttrs !== '' ) {
- // @if CK_DEBUG_ENGINE // string += `<$text${ textAttrs }>` + child.data + '</$text>';
- // @if CK_DEBUG_ENGINE // } else {
- // @if CK_DEBUG_ENGINE // string += child.data;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // } else {
- // @if CK_DEBUG_ENGINE // string += child.printTree( 1 );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // string += '\n]';
- // @if CK_DEBUG_ENGINE // return string;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // logTree() {
- // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
- // @if CK_DEBUG_ENGINE // }
- }
- // Converts strings to Text and non-iterables to arrays.
- //
- // @param {String|module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>}
- // @returns {Iterable.<module:engine/model/node~Node>}
- function normalize( nodes ) {
- // Separate condition because string is iterable.
- if ( typeof nodes == 'string' ) {
- return [ new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( nodes ) ];
- }
- if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__["default"])( nodes ) ) {
- nodes = [ nodes ];
- }
- // Array.from to enable .map() on non-arrays.
- return Array.from( nodes )
- .map( node => {
- if ( typeof node == 'string' ) {
- return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node );
- }
- if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_3__["default"] ) {
- return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node.data, node.getAttributes() );
- }
- return node;
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentSelection; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
- /* harmony import */ var _liverange__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
- /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/documentselection
- */
- const storePrefix = 'selection:';
- /**
- * `DocumentSelection` is a special selection which is used as the
- * {@link module:engine/model/document~Document#selection document's selection}.
- * There can be only one instance of `DocumentSelection` per document.
- *
- * Document selection can only be changed by using the {@link module:engine/model/writer~Writer} instance
- * inside the {@link module:engine/model/model~Model#change `change()`} block, as it provides a secure way to modify model.
- *
- * `DocumentSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}
- * to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.
- *
- * Differences between {@link module:engine/model/selection~Selection} and `DocumentSelection` are:
- * * there is always a range in `DocumentSelection` - even if no ranges were added there is a "default range"
- * present in the selection,
- * * ranges added to this selection updates automatically when the document changes,
- * * attributes of `DocumentSelection` are updated automatically according to selection ranges.
- *
- * Since `DocumentSelection` uses {@link module:engine/model/liverange~LiveRange live ranges}
- * and is updated when {@link module:engine/model/document~Document document}
- * changes, it cannot be set on {@link module:engine/model/node~Node nodes}
- * that are inside {@link module:engine/model/documentfragment~DocumentFragment document fragment}.
- * If you need to represent a selection in document fragment,
- * use {@link module:engine/model/selection~Selection Selection class} instead.
- *
- * @mixes module:utils/emittermixin~EmitterMixin
- */
- class DocumentSelection {
- /**
- * Creates an empty live selection for given {@link module:engine/model/document~Document}.
- *
- * @param {module:engine/model/document~Document} doc Document which owns this selection.
- */
- constructor( doc ) {
- /**
- * Selection used internally by that class (`DocumentSelection` is a proxy to that selection).
- *
- * @protected
- */
- this._selection = new LiveSelection( doc );
- this._selection.delegate( 'change:range' ).to( this );
- this._selection.delegate( 'change:attribute' ).to( this );
- this._selection.delegate( 'change:marker' ).to( this );
- }
- /**
- * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
- * collapsed.
- *
- * @readonly
- * @type {Boolean}
- */
- get isCollapsed() {
- return this._selection.isCollapsed;
- }
- /**
- * Selection anchor. Anchor may be described as a position where the most recent part of the selection starts.
- * Together with {@link #focus} they define the direction of selection, which is important
- * when expanding/shrinking selection. Anchor is always {@link module:engine/model/range~Range#start start} or
- * {@link module:engine/model/range~Range#end end} position of the most recently added range.
- *
- * Is set to `null` if there are no ranges in selection.
- *
- * @see #focus
- * @readonly
- * @type {module:engine/model/position~Position|null}
- */
- get anchor() {
- return this._selection.anchor;
- }
- /**
- * Selection focus. Focus is a position where the selection ends.
- *
- * Is set to `null` if there are no ranges in selection.
- *
- * @see #anchor
- * @readonly
- * @type {module:engine/model/position~Position|null}
- */
- get focus() {
- return this._selection.focus;
- }
- /**
- * Returns number of ranges in selection.
- *
- * @readonly
- * @type {Number}
- */
- get rangeCount() {
- return this._selection.rangeCount;
- }
- /**
- * Describes whether `Documentselection` has own range(s) set, or if it is defaulted to
- * {@link module:engine/model/document~Document#_getDefaultRange document's default range}.
- *
- * @readonly
- * @type {Boolean}
- */
- get hasOwnRange() {
- return this._selection.hasOwnRange;
- }
- /**
- * Specifies whether the {@link #focus}
- * precedes {@link #anchor}.
- *
- * @readonly
- * @type {Boolean}
- */
- get isBackward() {
- return this._selection.isBackward;
- }
- /**
- * Describes whether the gravity is overridden (using {@link module:engine/model/writer~Writer#overrideSelectionGravity}) or not.
- *
- * Note that the gravity remains overridden as long as will not be restored the same number of times as it was overridden.
- *
- * @readonly
- * @returns {Boolean}
- */
- get isGravityOverridden() {
- return this._selection.isGravityOverridden;
- }
- /**
- * A collection of selection {@link module:engine/model/markercollection~Marker markers}.
- * Marker is a selection marker when selection range is inside the marker range.
- *
- * **Note**: Only markers from {@link ~DocumentSelection#observeMarkers observed markers groups} are collected.
- *
- * @readonly
- * @type {module:utils/collection~Collection}
- */
- get markers() {
- return this._selection.markers;
- }
- /**
- * Used for the compatibility with the {@link module:engine/model/selection~Selection#isEqual} method.
- *
- * @protected
- */
- get _ranges() {
- return this._selection._ranges;
- }
- /**
- * Returns an iterable that iterates over copies of selection ranges.
- *
- * @returns {Iterable.<module:engine/model/range~Range>}
- */
- getRanges() {
- return this._selection.getRanges();
- }
- /**
- * Returns the first position in the selection.
- * First position is the position that {@link module:engine/model/position~Position#isBefore is before}
- * any other position in the selection.
- *
- * Returns `null` if there are no ranges in selection.
- *
- * @returns {module:engine/model/position~Position|null}
- */
- getFirstPosition() {
- return this._selection.getFirstPosition();
- }
- /**
- * Returns the last position in the selection.
- * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}
- * any other position in the selection.
- *
- * Returns `null` if there are no ranges in selection.
- *
- * @returns {module:engine/model/position~Position|null}
- */
- getLastPosition() {
- return this._selection.getLastPosition();
- }
- /**
- * Returns a copy of the first range in the selection.
- * First range is the one which {@link module:engine/model/range~Range#start start} position
- * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges
- * (not to confuse with the first range added to the selection).
- *
- * Returns `null` if there are no ranges in selection.
- *
- * @returns {module:engine/model/range~Range|null}
- */
- getFirstRange() {
- return this._selection.getFirstRange();
- }
- /**
- * Returns a copy of the last range in the selection.
- * Last range is the one which {@link module:engine/model/range~Range#end end} position
- * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most
- * recently added to the selection).
- *
- * Returns `null` if there are no ranges in selection.
- *
- * @returns {module:engine/model/range~Range|null}
- */
- getLastRange() {
- return this._selection.getLastRange();
- }
- /**
- * Gets elements of type {@link module:engine/model/schema~Schema#isBlock "block"} touched by the selection.
- *
- * This method's result can be used for example to apply block styling to all blocks covered by this selection.
- *
- * **Note:** `getSelectedBlocks()` returns blocks that are nested in other non-block elements
- * but will not return blocks nested in other blocks.
- *
- * In this case the function will return exactly all 3 paragraphs (note: `<blockQuote>` is not a block itself):
- *
- * <paragraph>[a</paragraph>
- * <blockQuote>
- * <paragraph>b</paragraph>
- * </blockQuote>
- * <paragraph>c]d</paragraph>
- *
- * In this case the paragraph will also be returned, despite the collapsed selection:
- *
- * <paragraph>[]a</paragraph>
- *
- * In such a scenario, however, only blocks A, B & E will be returned as blocks C & D are nested in block B:
- *
- * [<blockA></blockA>
- * <blockB>
- * <blockC></blockC>
- * <blockD></blockD>
- * </blockB>
- * <blockE></blockE>]
- *
- * If the selection is inside a block all the inner blocks (A & B) are returned:
- *
- * <block>
- * <blockA>[a</blockA>
- * <blockB>b]</blockB>
- * </block>
- *
- * **Special case**: If a selection ends at the beginning of a block, that block is not returned as from user perspective
- * this block wasn't selected. See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.
- *
- * <paragraph>[a</paragraph>
- * <paragraph>b</paragraph>
- * <paragraph>]c</paragraph> // this block will not be returned
- *
- * @returns {Iterable.<module:engine/model/element~Element>}
- */
- getSelectedBlocks() {
- return this._selection.getSelectedBlocks();
- }
- /**
- * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only
- * one range in the selection, and that range contains exactly one element.
- * Returns `null` if there is no selected element.
- *
- * @returns {module:engine/model/element~Element|null}
- */
- getSelectedElement() {
- return this._selection.getSelectedElement();
- }
- /**
- * Checks whether the selection contains the entire content of the given element. This means that selection must start
- * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position
- * touching the element's end.
- *
- * By default, this method will check whether the entire content of the selection's current root is selected.
- * Useful to check if e.g. the user has just pressed <kbd>Ctrl</kbd> + <kbd>A</kbd>.
- *
- * @param {module:engine/model/element~Element} [element=this.anchor.root]
- * @returns {Boolean}
- */
- containsEntireContent( element ) {
- return this._selection.containsEntireContent( element );
- }
- /**
- * Unbinds all events previously bound by document selection.
- */
- destroy() {
- this._selection.destroy();
- }
- /**
- * Returns iterable that iterates over this selection's attribute keys.
- *
- * @returns {Iterable.<String>}
- */
- getAttributeKeys() {
- return this._selection.getAttributeKeys();
- }
- /**
- * Returns iterable that iterates over this selection's attributes.
- *
- * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
- * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
- *
- * @returns {Iterable.<*>}
- */
- getAttributes() {
- return this._selection.getAttributes();
- }
- /**
- * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.
- *
- * @param {String} key Key of attribute to look for.
- * @returns {*} Attribute value or `undefined`.
- */
- getAttribute( key ) {
- return this._selection.getAttribute( key );
- }
- /**
- * Checks if the selection has an attribute for given key.
- *
- * @param {String} key Key of attribute to check.
- * @returns {Boolean} `true` if attribute with given key is set on selection, `false` otherwise.
- */
- hasAttribute( key ) {
- return this._selection.hasAttribute( key );
- }
- /**
- * Refreshes selection attributes and markers according to the current position in the model.
- */
- refresh() {
- this._selection._updateMarkers();
- this._selection._updateAttributes( false );
- }
- /**
- * Registers a marker group prefix or a marker name to be collected in the
- * {@link ~DocumentSelection#markers selection markers collection}.
- *
- * See also {@link module:engine/model/markercollection~MarkerCollection#getMarkersGroup `MarkerCollection#getMarkersGroup()`}.
- *
- * @param {String} prefixOrName The marker group prefix or marker name.
- */
- observeMarkers( prefixOrName ) {
- this._selection.observeMarkers( prefixOrName );
- }
- /**
- * Checks whether this object is of the given type.
- *
- * selection.is( 'selection' ); // -> true
- * selection.is( 'documentSelection' ); // -> true
- * selection.is( 'model:selection' ); // -> true
- * selection.is( 'model:documentSelection' ); // -> true
- *
- * selection.is( 'view:selection' ); // -> false
- * selection.is( 'element' ); // -> false
- * selection.is( 'node' ); // -> false
- *
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'selection' ||
- type == 'model:selection' ||
- type == 'documentSelection' ||
- type == 'model:documentSelection';
- }
- /**
- * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.
- * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionFocus} method.
- *
- * The location can be specified in the same form as
- * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.
- *
- * @see module:engine/model/writer~Writer#setSelectionFocus
- * @protected
- * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * first parameter is a {@link module:engine/model/item~Item model item}.
- */
- _setFocus( itemOrPosition, offset ) {
- this._selection.setFocus( itemOrPosition, offset );
- }
- /**
- * Sets this selection's ranges and direction to the specified location based on the given
- * {@link module:engine/model/selection~Selectable selectable}.
- * Should be used only within the {@link module:engine/model/writer~Writer#setSelection} method.
- *
- * @see module:engine/model/writer~Writer#setSelection
- * @protected
- * @param {module:engine/model/selection~Selectable} selectable
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- */
- _setTo( selectable, placeOrOffset, options ) {
- this._selection.setTo( selectable, placeOrOffset, options );
- }
- /**
- * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.
- * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionAttribute} method.
- *
- * @see module:engine/model/writer~Writer#setSelectionAttribute
- * @protected
- * @param {String} key Key of the attribute to set.
- * @param {*} value Attribute value.
- */
- _setAttribute( key, value ) {
- this._selection.setAttribute( key, value );
- }
- /**
- * Removes an attribute with given key from the selection.
- * If the given attribute was set on the selection, fires the {@link module:engine/model/selection~Selection#event:change:range}
- * event with removed attribute key.
- * Should be used only within the {@link module:engine/model/writer~Writer#removeSelectionAttribute} method.
- *
- * @see module:engine/model/writer~Writer#removeSelectionAttribute
- * @protected
- * @param {String} key Key of the attribute to remove.
- */
- _removeAttribute( key ) {
- this._selection.removeAttribute( key );
- }
- /**
- * Returns an iterable that iterates through all selection attributes stored in current selection's parent.
- *
- * @protected
- * @returns {Iterable.<*>}
- */
- _getStoredAttributes() {
- return this._selection._getStoredAttributes();
- }
- /**
- * Temporarily changes the gravity of the selection from the left to the right.
- *
- * The gravity defines from which direction the selection inherits its attributes. If it's the default left
- * gravity, the selection (after being moved by the the user) inherits attributes from its left hand side.
- * This method allows to temporarily override this behavior by forcing the gravity to the right.
- *
- * It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry
- * of the process.
- *
- * @see module:engine/model/writer~Writer#overrideSelectionGravity
- * @protected
- * @returns {String} The unique id which allows restoring the gravity.
- */
- _overrideGravity() {
- return this._selection.overrideGravity();
- }
- /**
- * Restores the {@link ~DocumentSelection#_overrideGravity overridden gravity}.
- *
- * Restoring the gravity is only possible using the unique identifier returned by
- * {@link ~DocumentSelection#_overrideGravity}. Note that the gravity remains overridden as long as won't be restored
- * the same number of times it was overridden.
- *
- * @see module:engine/model/writer~Writer#restoreSelectionGravity
- * @protected
- * @param {String} uid The unique id returned by {@link #_overrideGravity}.
- */
- _restoreGravity( uid ) {
- this._selection.restoreGravity( uid );
- }
- /**
- * Generates and returns an attribute key for selection attributes store, basing on original attribute key.
- *
- * @protected
- * @param {String} key Attribute key to convert.
- * @returns {String} Converted attribute key, applicable for selection store.
- */
- static _getStoreAttributeKey( key ) {
- return storePrefix + key;
- }
- /**
- * Checks whether the given attribute key is an attribute stored on an element.
- *
- * @protected
- * @param {String} key
- * @returns {Boolean}
- */
- static _isStoreAttributeKey( key ) {
- return key.startsWith( storePrefix );
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( DocumentSelection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /**
- * Fired when selection range(s) changed.
- *
- * @event change:range
- * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
- * to `true` which indicates that the selection change was caused by a direct use of selection's API.
- * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its position
- * was directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
- * changed because the structure of the model has been changed (which means an indirect change).
- * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
- * which mean that they are not updated once the document changes.
- */
- /**
- * Fired when selection attribute changed.
- *
- * @event change:attribute
- * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
- * to `true` which indicates that the selection change was caused by a direct use of selection's API.
- * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its attributes
- * were directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
- * changed in the model and its attributes were refreshed (which means an indirect change).
- * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
- * which mean that they are not updated once the document changes.
- * @param {Array.<String>} attributeKeys Array containing keys of attributes that changed.
- */
- /**
- * Fired when selection marker(s) changed.
- *
- * @event change:marker
- * @param {Boolean} directChange This is always set to `false` in case of `change:marker` event as there is no possibility
- * to change markers directly through {@link module:engine/model/documentselection~DocumentSelection} API.
- * See also {@link module:engine/model/documentselection~DocumentSelection#event:change:range} and
- * {@link module:engine/model/documentselection~DocumentSelection#event:change:attribute}.
- * @param {Array.<module:engine/model/markercollection~Marker>} oldMarkers Markers in which the selection was before the change.
- */
- // `LiveSelection` is used internally by {@link module:engine/model/documentselection~DocumentSelection} and shouldn't be used directly.
- //
- // LiveSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}
- // to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.
- //
- // Differences between {@link module:engine/model/selection~Selection} and `LiveSelection` are:
- // * there is always a range in `LiveSelection` - even if no ranges were added there is a "default range"
- // present in the selection,
- // * ranges added to this selection updates automatically when the document changes,
- // * attributes of `LiveSelection` are updated automatically according to selection ranges.
- //
- // @extends module:engine/model/selection~Selection
- //
- class LiveSelection extends _selection__WEBPACK_IMPORTED_MODULE_2__["default"] {
- // Creates an empty live selection for given {@link module:engine/model/document~Document}.
- // @param {module:engine/model/document~Document} doc Document which owns this selection.
- constructor( doc ) {
- super();
- // List of selection markers.
- // Marker is a selection marker when selection range is inside the marker range.
- //
- // @type {module:utils/collection~Collection}
- this.markers = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_7__["default"]( { idProperty: 'name' } );
- // Document which owns this selection.
- //
- // @protected
- // @member {module:engine/model/model~Model}
- this._model = doc.model;
- // Document which owns this selection.
- //
- // @protected
- // @member {module:engine/model/document~Document}
- this._document = doc;
- // Keeps mapping of attribute name to priority with which the attribute got modified (added/changed/removed)
- // last time. Possible values of priority are: `'low'` and `'normal'`.
- //
- // Priorities are used by internal `LiveSelection` mechanisms. All attributes set using `LiveSelection`
- // attributes API are set with `'normal'` priority.
- //
- // @private
- // @member {Map} module:engine/model/liveselection~LiveSelection#_attributePriority
- this._attributePriority = new Map();
- // Position to which the selection should be set if the last selection range was moved to the graveyard.
- // @private
- // @member {module:engine/model/position~Position} module:engine/model/liveselection~LiveSelection#_selectionRestorePosition
- this._selectionRestorePosition = null;
- // Flag that informs whether the selection ranges have changed. It is changed on true when `LiveRange#change:range` event is fired.
- // @private
- // @member {Array} module:engine/model/liveselection~LiveSelection#_hasChangedRange
- this._hasChangedRange = false;
- // Each overriding gravity adds an UID to the set and each removal removes it.
- // Gravity is overridden when there's at least one UID in the set.
- // Gravity is restored when the set is empty.
- // This is to prevent conflicts when gravity is overridden by more than one feature at the same time.
- // @private
- // @type {Set}
- this._overriddenGravityRegister = new Set();
- // Prefixes of marker names that should affect `LiveSelection#markers` collection.
- // @private
- // @type {Set}
- this._observedMarkers = new Set();
- // Ensure selection is correct after each operation.
- this.listenTo( this._model, 'applyOperation', ( evt, args ) => {
- const operation = args[ 0 ];
- if ( !operation.isDocumentOperation || operation.type == 'marker' || operation.type == 'rename' || operation.type == 'noop' ) {
- return;
- }
- // Fix selection if the last range was removed from it and we have a position to which we can restore the selection.
- if ( this._ranges.length == 0 && this._selectionRestorePosition ) {
- this._fixGraveyardSelection( this._selectionRestorePosition );
- }
- // "Forget" the restore position even if it was not "used".
- this._selectionRestorePosition = null;
- if ( this._hasChangedRange ) {
- this._hasChangedRange = false;
- this.fire( 'change:range', { directChange: false } );
- }
- }, { priority: 'lowest' } );
- // Ensure selection is correct and up to date after each range change.
- this.on( 'change:range', () => {
- for ( const range of this.getRanges() ) {
- if ( !this._document._validateSelectionRange( range ) ) {
- /**
- * Range from {@link module:engine/model/documentselection~DocumentSelection document selection}
- * starts or ends at incorrect position.
- *
- * @error document-selection-wrong-position
- * @param {module:engine/model/range~Range} range
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
- 'document-selection-wrong-position',
- this,
- { range }
- );
- }
- }
- } );
- // Update markers data stored by the selection after each marker change.
- // This handles only marker changes done through marker operations (not model tree changes).
- this.listenTo( this._model.markers, 'update', ( evt, marker, oldRange, newRange ) => {
- this._updateMarker( marker, newRange );
- } );
- // Ensure selection is up to date after each change block.
- this.listenTo( this._document, 'change', ( evt, batch ) => {
- clearAttributesStoredInElement( this._model, batch );
- } );
- }
- get isCollapsed() {
- const length = this._ranges.length;
- return length === 0 ? this._document._getDefaultRange().isCollapsed : super.isCollapsed;
- }
- get anchor() {
- return super.anchor || this._document._getDefaultRange().start;
- }
- get focus() {
- return super.focus || this._document._getDefaultRange().end;
- }
- get rangeCount() {
- return this._ranges.length ? this._ranges.length : 1;
- }
- // Describes whether `LiveSelection` has own range(s) set, or if it is defaulted to
- // {@link module:engine/model/document~Document#_getDefaultRange document's default range}.
- //
- // @readonly
- // @type {Boolean}
- get hasOwnRange() {
- return this._ranges.length > 0;
- }
- // When set to `true` then selection attributes on node before the caret won't be taken
- // into consideration while updating selection attributes.
- //
- // @protected
- // @type {Boolean}
- get isGravityOverridden() {
- return !!this._overriddenGravityRegister.size;
- }
- // Unbinds all events previously bound by live selection.
- destroy() {
- for ( let i = 0; i < this._ranges.length; i++ ) {
- this._ranges[ i ].detach();
- }
- this.stopListening();
- }
- * getRanges() {
- if ( this._ranges.length ) {
- yield* super.getRanges();
- } else {
- yield this._document._getDefaultRange();
- }
- }
- getFirstRange() {
- return super.getFirstRange() || this._document._getDefaultRange();
- }
- getLastRange() {
- return super.getLastRange() || this._document._getDefaultRange();
- }
- setTo( selectable, optionsOrPlaceOrOffset, options ) {
- super.setTo( selectable, optionsOrPlaceOrOffset, options );
- this._updateAttributes( true );
- this._updateMarkers();
- }
- setFocus( itemOrPosition, offset ) {
- super.setFocus( itemOrPosition, offset );
- this._updateAttributes( true );
- this._updateMarkers();
- }
- setAttribute( key, value ) {
- if ( this._setAttribute( key, value ) ) {
- // Fire event with exact data.
- const attributeKeys = [ key ];
- this.fire( 'change:attribute', { attributeKeys, directChange: true } );
- }
- }
- removeAttribute( key ) {
- if ( this._removeAttribute( key ) ) {
- // Fire event with exact data.
- const attributeKeys = [ key ];
- this.fire( 'change:attribute', { attributeKeys, directChange: true } );
- }
- }
- overrideGravity() {
- const overrideUid = Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_9__["default"])();
- // Remember that another overriding has been requested. It will need to be removed
- // before the gravity is to be restored.
- this._overriddenGravityRegister.add( overrideUid );
- if ( this._overriddenGravityRegister.size === 1 ) {
- this._updateAttributes( true );
- }
- return overrideUid;
- }
- restoreGravity( uid ) {
- if ( !this._overriddenGravityRegister.has( uid ) ) {
- /**
- * Restoring gravity for an unknown UID is not possible. Make sure you are using a correct
- * UID obtained from the {@link module:engine/model/writer~Writer#overrideSelectionGravity} to restore.
- *
- * @error document-selection-gravity-wrong-restore
- * @param {String} uid The unique identifier returned by
- * {@link module:engine/model/documentselection~DocumentSelection#_overrideGravity}.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
- 'document-selection-gravity-wrong-restore',
- this,
- { uid }
- );
- }
- this._overriddenGravityRegister.delete( uid );
- // Restore gravity only when all overriding have been restored.
- if ( !this.isGravityOverridden ) {
- this._updateAttributes( true );
- }
- }
- observeMarkers( prefixOrName ) {
- this._observedMarkers.add( prefixOrName );
- this._updateMarkers();
- }
- _popRange() {
- this._ranges.pop().detach();
- }
- _pushRange( range ) {
- const liveRange = this._prepareRange( range );
- // `undefined` is returned when given `range` is in graveyard root.
- if ( liveRange ) {
- this._ranges.push( liveRange );
- }
- }
- // Prepares given range to be added to selection. Checks if it is correct,
- // converts it to {@link module:engine/model/liverange~LiveRange LiveRange}
- // and sets listeners listening to the range's change event.
- //
- // @private
- // @param {module:engine/model/range~Range} range
- _prepareRange( range ) {
- this._checkRange( range );
- if ( range.root == this._document.graveyard ) {
- // @if CK_DEBUG // console.warn( 'Trying to add a Range that is in the graveyard root. Range rejected.' );
- return;
- }
- const liveRange = _liverange__WEBPACK_IMPORTED_MODULE_3__["default"].fromRange( range );
- // If selection range is moved to the graveyard remove it from the selection object.
- // Also, save some data that can be used to restore selection later, on `Model#applyOperation` event.
- liveRange.on( 'change:range', ( evt, oldRange, data ) => {
- this._hasChangedRange = true;
- if ( liveRange.root == this._document.graveyard ) {
- this._selectionRestorePosition = data.deletionPosition;
- const index = this._ranges.indexOf( liveRange );
- this._ranges.splice( index, 1 );
- liveRange.detach();
- }
- } );
- return liveRange;
- }
- _updateMarkers() {
- if ( !this._observedMarkers.size ) {
- return;
- }
- const markers = [];
- let changed = false;
- for ( const marker of this._model.markers ) {
- const markerGroup = marker.name.split( ':', 1 )[ 0 ];
- if ( !this._observedMarkers.has( markerGroup ) ) {
- continue;
- }
- const markerRange = marker.getRange();
- for ( const selectionRange of this.getRanges() ) {
- if ( markerRange.containsRange( selectionRange, !selectionRange.isCollapsed ) ) {
- markers.push( marker );
- }
- }
- }
- const oldMarkers = Array.from( this.markers );
- for ( const marker of markers ) {
- if ( !this.markers.has( marker ) ) {
- this.markers.add( marker );
- changed = true;
- }
- }
- for ( const marker of Array.from( this.markers ) ) {
- if ( !markers.includes( marker ) ) {
- this.markers.remove( marker );
- changed = true;
- }
- }
- if ( changed ) {
- this.fire( 'change:marker', { oldMarkers, directChange: false } );
- }
- }
- _updateMarker( marker, markerRange ) {
- const markerGroup = marker.name.split( ':', 1 )[ 0 ];
- if ( !this._observedMarkers.has( markerGroup ) ) {
- return;
- }
- let changed = false;
- const oldMarkers = Array.from( this.markers );
- const hasMarker = this.markers.has( marker );
- if ( !markerRange ) {
- if ( hasMarker ) {
- this.markers.remove( marker );
- changed = true;
- }
- } else {
- let contained = false;
- for ( const selectionRange of this.getRanges() ) {
- if ( markerRange.containsRange( selectionRange, !selectionRange.isCollapsed ) ) {
- contained = true;
- break;
- }
- }
- if ( contained && !hasMarker ) {
- this.markers.add( marker );
- changed = true;
- } else if ( !contained && hasMarker ) {
- this.markers.remove( marker );
- changed = true;
- }
- }
- if ( changed ) {
- this.fire( 'change:marker', { oldMarkers, directChange: false } );
- }
- }
- // Updates this selection attributes according to its ranges and the {@link module:engine/model/document~Document model document}.
- //
- // @protected
- // @param {Boolean} clearAll
- // @fires change:attribute
- _updateAttributes( clearAll ) {
- const newAttributes = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_6__["default"])( this._getSurroundingAttributes() );
- const oldAttributes = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_6__["default"])( this.getAttributes() );
- if ( clearAll ) {
- // If `clearAll` remove all attributes and reset priorities.
- this._attributePriority = new Map();
- this._attrs = new Map();
- } else {
- // If not, remove only attributes added with `low` priority.
- for ( const [ key, priority ] of this._attributePriority ) {
- if ( priority == 'low' ) {
- this._attrs.delete( key );
- this._attributePriority.delete( key );
- }
- }
- }
- this._setAttributesTo( newAttributes );
- // Let's evaluate which attributes really changed.
- const changed = [];
- // First, loop through all attributes that are set on selection right now.
- // Check which of them are different than old attributes.
- for ( const [ newKey, newValue ] of this.getAttributes() ) {
- if ( !oldAttributes.has( newKey ) || oldAttributes.get( newKey ) !== newValue ) {
- changed.push( newKey );
- }
- }
- // Then, check which of old attributes got removed.
- for ( const [ oldKey ] of oldAttributes ) {
- if ( !this.hasAttribute( oldKey ) ) {
- changed.push( oldKey );
- }
- }
- // Fire event with exact data (fire only if anything changed).
- if ( changed.length > 0 ) {
- this.fire( 'change:attribute', { attributeKeys: changed, directChange: false } );
- }
- }
- // Internal method for setting `LiveSelection` attribute. Supports attribute priorities (through `directChange`
- // parameter).
- //
- // @private
- // @param {String} key Attribute key.
- // @param {*} value Attribute value.
- // @param {Boolean} [directChange=true] `true` if the change is caused by `Selection` API, `false` if change
- // is caused by `Batch` API.
- // @returns {Boolean} Whether value has changed.
- _setAttribute( key, value, directChange = true ) {
- const priority = directChange ? 'normal' : 'low';
- if ( priority == 'low' && this._attributePriority.get( key ) == 'normal' ) {
- // Priority too low.
- return false;
- }
- const oldValue = super.getAttribute( key );
- // Don't do anything if value has not changed.
- if ( oldValue === value ) {
- return false;
- }
- this._attrs.set( key, value );
- // Update priorities map.
- this._attributePriority.set( key, priority );
- return true;
- }
- // Internal method for removing `LiveSelection` attribute. Supports attribute priorities (through `directChange`
- // parameter).
- //
- // NOTE: Even if attribute is not present in the selection but is provided to this method, it's priority will
- // be changed according to `directChange` parameter.
- //
- // @private
- // @param {String} key Attribute key.
- // @param {Boolean} [directChange=true] `true` if the change is caused by `Selection` API, `false` if change
- // is caused by `Batch` API.
- // @returns {Boolean} Whether attribute was removed. May not be true if such attributes didn't exist or the
- // existing attribute had higher priority.
- _removeAttribute( key, directChange = true ) {
- const priority = directChange ? 'normal' : 'low';
- if ( priority == 'low' && this._attributePriority.get( key ) == 'normal' ) {
- // Priority too low.
- return false;
- }
- // Update priorities map.
- this._attributePriority.set( key, priority );
- // Don't do anything if value has not changed.
- if ( !super.hasAttribute( key ) ) {
- return false;
- }
- this._attrs.delete( key );
- return true;
- }
- // Internal method for setting multiple `LiveSelection` attributes. Supports attribute priorities (through
- // `directChange` parameter).
- //
- // @private
- // @param {Map.<String,*>} attrs Iterable object containing attributes to be set.
- // @returns {Set.<String>} Changed attribute keys.
- _setAttributesTo( attrs ) {
- const changed = new Set();
- for ( const [ oldKey, oldValue ] of this.getAttributes() ) {
- // Do not remove attribute if attribute with same key and value is about to be set.
- if ( attrs.get( oldKey ) === oldValue ) {
- continue;
- }
- // All rest attributes will be removed so changed attributes won't change .
- this._removeAttribute( oldKey, false );
- }
- for ( const [ key, value ] of attrs ) {
- // Attribute may not be set because of attributes or because same key/value is already added.
- const gotAdded = this._setAttribute( key, value, false );
- if ( gotAdded ) {
- changed.add( key );
- }
- }
- return changed;
- }
- // Returns an iterable that iterates through all selection attributes stored in current selection's parent.
- //
- // @protected
- // @returns {Iterable.<*>}
- * _getStoredAttributes() {
- const selectionParent = this.getFirstPosition().parent;
- if ( this.isCollapsed && selectionParent.isEmpty ) {
- for ( const key of selectionParent.getAttributeKeys() ) {
- if ( key.startsWith( storePrefix ) ) {
- const realKey = key.substr( storePrefix.length );
- yield [ realKey, selectionParent.getAttribute( key ) ];
- }
- }
- }
- }
- // Checks model text nodes that are closest to the selection's first position and returns attributes of first
- // found element. If there are no text nodes in selection's first position parent, it returns selection
- // attributes stored in that parent.
- //
- // @private
- // @returns {Iterable.<*>} Collection of attributes.
- _getSurroundingAttributes() {
- const position = this.getFirstPosition();
- const schema = this._model.schema;
- let attrs = null;
- if ( !this.isCollapsed ) {
- // 1. If selection is a range...
- const range = this.getFirstRange();
- // ...look for a first character node in that range and take attributes from it.
- for ( const value of range ) {
- // If the item is an object, we don't want to get attributes from its children.
- if ( value.item.is( 'element' ) && schema.isObject( value.item ) ) {
- break;
- }
- if ( value.type == 'text' ) {
- attrs = value.item.getAttributes();
- break;
- }
- }
- } else {
- // 2. If the selection is a caret or the range does not contain a character node...
- const nodeBefore = position.textNode ? position.textNode : position.nodeBefore;
- const nodeAfter = position.textNode ? position.textNode : position.nodeAfter;
- // When gravity is overridden then don't take node before into consideration.
- if ( !this.isGravityOverridden ) {
- // ...look at the node before caret and take attributes from it if it is a character node.
- attrs = getAttrsIfCharacter( nodeBefore );
- }
- // 3. If not, look at the node after caret...
- if ( !attrs ) {
- attrs = getAttrsIfCharacter( nodeAfter );
- }
- // 4. If not, try to find the first character on the left, that is in the same node.
- // When gravity is overridden then don't take node before into consideration.
- if ( !this.isGravityOverridden && !attrs ) {
- let node = nodeBefore;
- while ( node && !schema.isInline( node ) && !attrs ) {
- node = node.previousSibling;
- attrs = getAttrsIfCharacter( node );
- }
- }
- // 5. If not found, try to find the first character on the right, that is in the same node.
- if ( !attrs ) {
- let node = nodeAfter;
- while ( node && !schema.isInline( node ) && !attrs ) {
- node = node.nextSibling;
- attrs = getAttrsIfCharacter( node );
- }
- }
- // 6. If not found, selection should retrieve attributes from parent.
- if ( !attrs ) {
- attrs = this._getStoredAttributes();
- }
- }
- return attrs;
- }
- // Fixes the selection after all its ranges got removed.
- //
- // @private
- // @param {module:engine/model/position~Position} deletionPosition Position where the deletion happened.
- _fixGraveyardSelection( deletionPosition ) {
- // Find a range that is a correct selection range and is closest to the position where the deletion happened.
- const selectionRange = this._model.schema.getNearestSelectionRange( deletionPosition );
- // If nearest valid selection range has been found - add it in the place of old range.
- if ( selectionRange ) {
- // Check the range, convert it to live range, bind events, etc.
- this._pushRange( selectionRange );
- }
- // If nearest valid selection range cannot be found don't add any range. Selection will be set to the default range.
- }
- }
- // Helper function for {@link module:engine/model/liveselection~LiveSelection#_updateAttributes}.
- //
- // It takes model item, checks whether it is a text node (or text proxy) and, if so, returns it's attributes. If not, returns `null`.
- //
- // @param {module:engine/model/item~Item|null} node
- // @returns {Boolean}
- function getAttrsIfCharacter( node ) {
- if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_5__["default"] || node instanceof _text__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
- return node.getAttributes();
- }
- return null;
- }
- // Removes selection attributes from element which is not empty anymore.
- //
- // @param {module:engine/model/model~Model} model
- // @param {module:engine/model/batch~Batch} batch
- function clearAttributesStoredInElement( model, batch ) {
- const differ = model.document.differ;
- for ( const entry of differ.getChanges() ) {
- if ( entry.type != 'insert' ) {
- continue;
- }
- const changeParent = entry.position.parent;
- const isNoLongerEmpty = entry.length === changeParent.maxOffset;
- if ( isNoLongerEmpty ) {
- model.enqueueChange( batch, writer => {
- const storedAttributes = Array.from( changeParent.getAttributeKeys() )
- .filter( key => key.startsWith( storePrefix ) );
- for ( const key of storedAttributes ) {
- writer.removeAttribute( key, changeParent );
- }
- } );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Element; });
- /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
- /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
- /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/element
- */
- // @if CK_DEBUG_ENGINE // const { stringifyMap, convertMapToStringifiedObject, convertMapToTags } = require( '../dev-utils/utils' );
- /**
- * Model element. Type of {@link module:engine/model/node~Node node} that has a {@link module:engine/model/element~Element#name name} and
- * {@link module:engine/model/element~Element#getChildren child nodes}.
- *
- * **Important**: see {@link module:engine/model/node~Node} to read about restrictions using `Element` and `Node` API.
- *
- * @extends module:engine/model/node~Node
- */
- class Element extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates a model element.
- *
- * **Note:** Constructor of this class shouldn't be used directly in the code.
- * Use the {@link module:engine/model/writer~Writer#createElement} method instead.
- *
- * @protected
- * @param {String} name Element's name.
- * @param {Object} [attrs] Element's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
- * @param {module:engine/model/node~Node|Iterable.<module:engine/model/node~Node>} [children]
- * One or more nodes to be inserted as children of created element.
- */
- constructor( name, attrs, children ) {
- super( attrs );
- /**
- * Element name.
- *
- * @readonly
- * @member {String} module:engine/model/element~Element#name
- */
- this.name = name;
- /**
- * List of children nodes.
- *
- * @private
- * @member {module:engine/model/nodelist~NodeList} module:engine/model/element~Element#_children
- */
- this._children = new _nodelist__WEBPACK_IMPORTED_MODULE_1__["default"]();
- if ( children ) {
- this._insertChild( 0, children );
- }
- }
- /**
- * Number of this element's children.
- *
- * @readonly
- * @type {Number}
- */
- get childCount() {
- return this._children.length;
- }
- /**
- * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this element's children.
- *
- * @readonly
- * @type {Number}
- */
- get maxOffset() {
- return this._children.maxOffset;
- }
- /**
- * Is `true` if there are no nodes inside this element, `false` otherwise.
- *
- * @readonly
- * @type {Boolean}
- */
- get isEmpty() {
- return this.childCount === 0;
- }
- /**
- * Checks whether this object is of the given.
- *
- * element.is( 'element' ); // -> true
- * element.is( 'node' ); // -> true
- * element.is( 'model:element' ); // -> true
- * element.is( 'model:node' ); // -> true
- *
- * element.is( 'view:element' ); // -> false
- * element.is( 'documentSelection' ); // -> false
- *
- * Assuming that the object being checked is an element, you can also check its
- * {@link module:engine/model/element~Element#name name}:
- *
- * element.is( 'element', 'image' ); // -> true if this is an <image> element
- * element.is( 'element', 'image' ); // -> same as above
- * text.is( 'element', 'image' ); -> false
- *
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
- *
- * @param {String} type Type to check.
- * @param {String} [name] Element name.
- * @returns {Boolean}
- */
- is( type, name = null ) {
- if ( !name ) {
- return type === 'element' || type === 'model:element' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'node' || type === 'model:node';
- }
- return name === this.name && ( type === 'element' || type === 'model:element' );
- }
- /**
- * Gets the child at the given index.
- *
- * @param {Number} index Index of child.
- * @returns {module:engine/model/node~Node} Child node.
- */
- getChild( index ) {
- return this._children.getNode( index );
- }
- /**
- * Returns an iterator that iterates over all of this element's children.
- *
- * @returns {Iterable.<module:engine/model/node~Node>}
- */
- getChildren() {
- return this._children[ Symbol.iterator ]();
- }
- /**
- * Returns an index of the given child node. Returns `null` if given node is not a child of this element.
- *
- * @param {module:engine/model/node~Node} node Child node to look for.
- * @returns {Number} Child node's index in this element.
- */
- getChildIndex( node ) {
- return this._children.getNodeIndex( node );
- }
- /**
- * Returns the starting offset of given child. Starting offset is equal to the sum of
- * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if
- * given node is not a child of this element.
- *
- * @param {module:engine/model/node~Node} node Child node to look for.
- * @returns {Number} Child node's starting offset.
- */
- getChildStartOffset( node ) {
- return this._children.getNodeStartOffset( node );
- }
- /**
- * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is
- * too high, returns {@link module:engine/model/element~Element#getChildIndex index after last child}.
- *
- * const textNode = new Text( 'foo' );
- * const pElement = new Element( 'p' );
- * const divElement = new Element( [ textNode, pElement ] );
- * divElement.offsetToIndex( -1 ); // Returns 0, because offset is too low.
- * divElement.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.
- * divElement.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.
- * divElement.offsetToIndex( 2 ); // Returns 0.
- * divElement.offsetToIndex( 3 ); // Returns 1.
- * divElement.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.
- *
- * @param {Number} offset Offset to look for.
- * @returns {Number}
- */
- offsetToIndex( offset ) {
- return this._children.offsetToIndex( offset );
- }
- /**
- * Returns a descendant node by its path relative to this element.
- *
- * // <this>a<b>c</b></this>
- * this.getNodeByPath( [ 0 ] ); // -> "a"
- * this.getNodeByPath( [ 1 ] ); // -> <b>
- * this.getNodeByPath( [ 1, 0 ] ); // -> "c"
- *
- * @param {Array.<Number>} relativePath Path of the node to find, relative to this element.
- * @returns {module:engine/model/node~Node}
- */
- getNodeByPath( relativePath ) {
- let node = this; // eslint-disable-line consistent-this
- for ( const index of relativePath ) {
- node = node.getChild( node.offsetToIndex( index ) );
- }
- return node;
- }
- /**
- * Returns the parent element of the given name. Returns null if the element is not inside the desired parent.
- *
- * @param {String} parentName The name of the parent element to find.
- * @param {Object} [options] Options object.
- * @param {Boolean} [options.includeSelf=false] When set to `true` this node will be also included while searching.
- * @returns {module:engine/model/element~Element|null}
- */
- findAncestor( parentName, options = { includeSelf: false } ) {
- let parent = options.includeSelf ? this : this.parent;
- while ( parent ) {
- if ( parent.name === parentName ) {
- return parent;
- }
- parent = parent.parent;
- }
- return null;
- }
- /**
- * Converts `Element` instance to plain object and returns it. Takes care of converting all of this element's children.
- *
- * @returns {Object} `Element` instance converted to plain object.
- */
- toJSON() {
- const json = super.toJSON();
- json.name = this.name;
- if ( this._children.length > 0 ) {
- json.children = [];
- for ( const node of this._children ) {
- json.children.push( node.toJSON() );
- }
- }
- return json;
- }
- /**
- * Creates a copy of this element and returns it. Created element has the same name and attributes as the original element.
- * If clone is deep, the original element's children are also cloned. If not, then empty element is returned.
- *
- * @protected
- * @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
- * element will be cloned without any child.
- */
- _clone( deep = false ) {
- const children = deep ? Array.from( this._children ).map( node => node._clone( true ) ) : null;
- return new Element( this.name, this.getAttributes(), children );
- }
- /**
- * {@link module:engine/model/element~Element#_insertChild Inserts} one or more nodes at the end of this element.
- *
- * @see module:engine/model/writer~Writer#append
- * @protected
- * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} nodes Nodes to be inserted.
- */
- _appendChild( nodes ) {
- this._insertChild( this.childCount, nodes );
- }
- /**
- * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes
- * to this element.
- *
- * @see module:engine/model/writer~Writer#insert
- * @protected
- * @param {Number} index Index at which nodes should be inserted.
- * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} items Items to be inserted.
- */
- _insertChild( index, items ) {
- const nodes = normalize( items );
- for ( const node of nodes ) {
- // If node that is being added to this element is already inside another element, first remove it from the old parent.
- if ( node.parent !== null ) {
- node._remove();
- }
- node.parent = this;
- }
- this._children._insertNodes( index, nodes );
- }
- /**
- * Removes one or more nodes starting at the given index and sets
- * {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.
- *
- * @see module:engine/model/writer~Writer#remove
- * @protected
- * @param {Number} index Index of the first node to remove.
- * @param {Number} [howMany=1] Number of nodes to remove.
- * @returns {Array.<module:engine/model/node~Node>} Array containing removed nodes.
- */
- _removeChildren( index, howMany = 1 ) {
- const nodes = this._children._removeNodes( index, howMany );
- for ( const node of nodes ) {
- node.parent = null;
- }
- return nodes;
- }
- /**
- * Creates an `Element` instance from given plain object (i.e. parsed JSON string).
- * Converts `Element` children to proper nodes.
- *
- * @param {Object} json Plain object to be converted to `Element`.
- * @returns {module:engine/model/element~Element} `Element` instance created using given plain object.
- */
- static fromJSON( json ) {
- let children = null;
- if ( json.children ) {
- children = [];
- for ( const child of json.children ) {
- if ( child.name ) {
- // If child has name property, it is an Element.
- children.push( Element.fromJSON( child ) );
- } else {
- // Otherwise, it is a Text node.
- children.push( _text__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( child ) );
- }
- }
- }
- return new Element( json.name, json.attributes, children );
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `<${ this.rootName || this.name }>`;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // log() {
- // @if CK_DEBUG_ENGINE // console.log( 'ModelElement: ' + this );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // logExtended() {
- // @if CK_DEBUG_ENGINE // console.log( `ModelElement: ${ this }, ${ this.childCount } children,
- // @if CK_DEBUG_ENGINE // attrs: ${ convertMapToStringifiedObject( this.getAttributes() ) }` );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // logAll() {
- // @if CK_DEBUG_ENGINE // console.log( '--------------------' );
- // @if CK_DEBUG_ENGINE //
- // @if CK_DEBUG_ENGINE // this.logExtended();
- // @if CK_DEBUG_ENGINE // console.log( 'List of children:' );
- // @if CK_DEBUG_ENGINE //
- // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
- // @if CK_DEBUG_ENGINE // child.log();
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // printTree( level = 0) {
- // @if CK_DEBUG_ENGINE // let string = '';
- // @if CK_DEBUG_ENGINE // string += '\t'.repeat( level );
- // @if CK_DEBUG_ENGINE // string += `<${ this.rootName || this.name }${ convertMapToTags( this.getAttributes() ) }>`;
- // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
- // @if CK_DEBUG_ENGINE // string += '\n';
- // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
- // @if CK_DEBUG_ENGINE // const textAttrs = convertMapToTags( child._attrs );
- // @if CK_DEBUG_ENGINE // string += '\t'.repeat( level + 1 );
- // @if CK_DEBUG_ENGINE // if ( textAttrs !== '' ) {
- // @if CK_DEBUG_ENGINE // string += `<$text${ textAttrs }>` + child.data + '</$text>';
- // @if CK_DEBUG_ENGINE // } else {
- // @if CK_DEBUG_ENGINE // string += child.data;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // } else {
- // @if CK_DEBUG_ENGINE // string += child.printTree( level + 1 );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // if ( this.childCount ) {
- // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( level );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // string += `</${ this.rootName || this.name }>`;
- // @if CK_DEBUG_ENGINE // return string;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // logTree() {
- // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
- // @if CK_DEBUG_ENGINE // }
- }
- // Converts strings to Text and non-iterables to arrays.
- //
- // @param {String|module:engine/model/item~Item|Iterable.<String|module:engine/model/item~Item>}
- // @returns {Iterable.<module:engine/model/node~Node>}
- function normalize( nodes ) {
- // Separate condition because string is iterable.
- if ( typeof nodes == 'string' ) {
- return [ new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( nodes ) ];
- }
- if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__["default"])( nodes ) ) {
- nodes = [ nodes ];
- }
- // Array.from to enable .map() on non-arrays.
- return Array.from( nodes )
- .map( node => {
- if ( typeof node == 'string' ) {
- return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node );
- }
- if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_3__["default"] ) {
- return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node.data, node.getAttributes() );
- }
- return node;
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return History; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/history
- */
- /**
- * `History` keeps the track of all the operations applied to the {@link module:engine/model/document~Document document}.
- */
- class History {
- /**
- * Creates an empty History instance.
- */
- constructor() {
- /**
- * Operations added to the history.
- *
- * @protected
- * @member {Array.<module:engine/model/operation/operation~Operation>} module:engine/model/history~History#_operations
- */
- this._operations = [];
- /**
- * Holds an information which {@link module:engine/model/operation/operation~Operation operation} undoes which
- * {@link module:engine/model/operation/operation~Operation operation}.
- *
- * Keys of the map are "undoing operations", that is operations that undone some other operations. For each key, the
- * value is an operation that has been undone by the "undoing operation".
- *
- * @private
- * @member {Map} module:engine/model/history~History#_undoPairs
- */
- this._undoPairs = new Map();
- /**
- * Holds all undone operations.
- *
- * @private
- * @member {Set.<module:engine/model/operation/operation~Operation>} module:engine/model/history~History#_undoneOperations
- */
- this._undoneOperations = new Set();
- }
- /**
- * Adds an operation to the history.
- *
- * @param {module:engine/model/operation/operation~Operation} operation Operation to add.
- */
- addOperation( operation ) {
- if ( this._operations.includes( operation ) ) {
- return;
- }
- this._operations.push( operation );
- }
- /**
- * Returns operations added to the history.
- *
- * @param {Number} [from=Number.NEGATIVE_INFINITY] Base version from which operations should be returned (inclusive).
- * Defaults to `Number.NEGATIVE_INFINITY`, which means that operations from the first one will be returned.
- * @param {Number} [to=Number.POSITIVE_INFINITY] Base version up to which operations should be returned (exclusive).
- * Defaults to `Number.POSITIVE_INFINITY` which means that operations up to the last one will be returned.
- * @returns {Array.<module:engine/model/operation/operation~Operation>} Operations added to the history.
- */
- getOperations( from = Number.NEGATIVE_INFINITY, to = Number.POSITIVE_INFINITY ) {
- const operations = [];
- for ( const operation of this._operations ) {
- if ( operation.baseVersion >= from && operation.baseVersion < to ) {
- operations.push( operation );
- }
- }
- return operations;
- }
- /**
- * Returns operation from the history that bases on given `baseVersion`.
- *
- * @param {Number} baseVersion Base version of the operation to get.
- * @returns {module:engine/model/operation/operation~Operation|undefined} Operation with given base version or `undefined` if
- * there is no such operation in history.
- */
- getOperation( baseVersion ) {
- for ( const operation of this._operations ) {
- if ( operation.baseVersion == baseVersion ) {
- return operation;
- }
- }
- }
- /**
- * Marks in history that one operation is an operation that is undoing the other operation. By marking operation this way,
- * history is keeping more context information about operations, which helps in operational transformation.
- *
- * @param {module:engine/model/operation/operation~Operation} undoneOperation Operation which is undone by `undoingOperation`.
- * @param {module:engine/model/operation/operation~Operation} undoingOperation Operation which undoes `undoneOperation`.
- */
- setOperationAsUndone( undoneOperation, undoingOperation ) {
- this._undoPairs.set( undoingOperation, undoneOperation );
- this._undoneOperations.add( undoneOperation );
- }
- /**
- * Checks whether given `operation` is undoing any other operation.
- *
- * @param {module:engine/model/operation/operation~Operation} operation Operation to check.
- * @returns {Boolean} `true` if given `operation` is undoing any other operation, `false` otherwise.
- */
- isUndoingOperation( operation ) {
- return this._undoPairs.has( operation );
- }
- /**
- * Checks whether given `operation` has been undone by any other operation.
- *
- * @param {module:engine/model/operation/operation~Operation} operation Operation to check.
- * @returns {Boolean} `true` if given `operation` has been undone any other operation, `false` otherwise.
- */
- isUndoneOperation( operation ) {
- return this._undoneOperations.has( operation );
- }
- /**
- * For given `undoingOperation`, returns the operation which has been undone by it.
- *
- * @param {module:engine/model/operation/operation~Operation} undoingOperation
- * @returns {module:engine/model/operation/operation~Operation|undefined} Operation that has been undone by given
- * `undoingOperation` or `undefined` if given `undoingOperation` is not undoing any other operation.
- */
- getUndoneOperation( undoingOperation ) {
- return this._undoPairs.get( undoingOperation );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LivePosition; });
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/liveposition
- */
- /**
- * `LivePosition` is a type of {@link module:engine/model/position~Position Position}
- * that updates itself as {@link module:engine/model/document~Document document}
- * is changed through operations. It may be used as a bookmark.
- *
- * **Note:** Contrary to {@link module:engine/model/position~Position}, `LivePosition` works only in roots that are
- * {@link module:engine/model/rootelement~RootElement}.
- * If {@link module:engine/model/documentfragment~DocumentFragment} is passed, error will be thrown.
- *
- * **Note:** Be very careful when dealing with `LivePosition`. Each `LivePosition` instance bind events that might
- * have to be unbound.
- * Use {@link module:engine/model/liveposition~LivePosition#detach} whenever you don't need `LivePosition` anymore.
- *
- * @extends module:engine/model/position~Position
- */
- class LivePosition extends _position__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates a live position.
- *
- * @see module:engine/model/position~Position
- * @param {module:engine/model/rootelement~RootElement} root
- * @param {Array.<Number>} path
- * @param {module:engine/model/position~PositionStickiness} [stickiness]
- */
- constructor( root, path, stickiness = 'toNone' ) {
- super( root, path, stickiness );
- if ( !this.root.is( 'rootElement' ) ) {
- /**
- * LivePosition's root has to be an instance of RootElement.
- *
- * @error model-liveposition-root-not-rootelement
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"]( 'model-liveposition-root-not-rootelement', root );
- }
- bindWithDocument.call( this );
- }
- /**
- * Unbinds all events previously bound by `LivePosition`. Use it whenever you don't need `LivePosition` instance
- * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was
- * referring to it).
- */
- detach() {
- this.stopListening();
- }
- /**
- * Checks whether this object is of the given.
- *
- * livePosition.is( 'position' ); // -> true
- * livePosition.is( 'model:position' ); // -> true
- * livePosition.is( 'liveposition' ); // -> true
- * livePosition.is( 'model:livePosition' ); // -> true
- *
- * livePosition.is( 'view:position' ); // -> false
- * livePosition.is( 'documentSelection' ); // -> false
- *
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'livePosition' || type === 'model:livePosition' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type == 'position' || type === 'model:position';
- }
- /**
- * Creates a {@link module:engine/model/position~Position position instance}, which is equal to this live position.
- *
- * @returns {module:engine/model/position~Position}
- */
- toPosition() {
- return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( this.root, this.path.slice(), this.stickiness );
- }
- /**
- * Creates a `LivePosition` instance that is equal to position.
- *
- * @param {module:engine/model/position~Position} position
- * @param {module:engine/model/position~PositionStickiness} [stickiness]
- * @returns {module:engine/model/liveposition~LivePosition}
- */
- static fromPosition( position, stickiness ) {
- return new this( position.root, position.path.slice(), stickiness ? stickiness : position.stickiness );
- }
- /**
- * @static
- * @protected
- * @method module:engine/model/liveposition~LivePosition._createAfter
- * @see module:engine/model/position~Position._createAfter
- * @param {module:engine/model/node~Node} node
- * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone']
- * @returns {module:engine/model/liveposition~LivePosition}
- */
- /**
- * @static
- * @protected
- * @method module:engine/model/liveposition~LivePosition._createBefore
- * @see module:engine/model/position~Position._createBefore
- * @param {module:engine/model/node~Node} node
- * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone']
- * @returns {module:engine/model/liveposition~LivePosition}
- */
- /**
- * @static
- * @protected
- * @method module:engine/model/liveposition~LivePosition._createAt
- * @see module:engine/model/position~Position._createAt
- * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset]
- * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone']
- * @returns {module:engine/model/liveposition~LivePosition}
- */
- /**
- * Fired when `LivePosition` instance is changed due to changes on {@link module:engine/model/document~Document}.
- *
- * @event module:engine/model/liveposition~LivePosition#change
- * @param {module:engine/model/position~Position} oldPosition Position equal to this live position before it got changed.
- */
- }
- // Binds this `LivePosition` to the {@link module:engine/model/document~Document document} that owns
- // this position's {@link module:engine/model/position~Position#root root}.
- //
- // @private
- function bindWithDocument() {
- this.listenTo(
- this.root.document.model,
- 'applyOperation',
- ( event, args ) => {
- const operation = args[ 0 ];
- if ( !operation.isDocumentOperation ) {
- return;
- }
- transform.call( this, operation );
- },
- { priority: 'low' }
- );
- }
- // Updates this position accordingly to the updates applied to the model. Bases on change events.
- //
- // @private
- // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
- function transform( operation ) {
- const result = this.getTransformedByOperation( operation );
- if ( !this.isEqual( result ) ) {
- const oldPosition = this.toPosition();
- this.path = result.path;
- this.root = result.root;
- this.fire( 'change', oldPosition );
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( LivePosition, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LiveRange; });
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/liverange
- */
- /**
- * `LiveRange` is a type of {@link module:engine/model/range~Range Range}
- * that updates itself as {@link module:engine/model/document~Document document}
- * is changed through operations. It may be used as a bookmark.
- *
- * **Note:** Be very careful when dealing with `LiveRange`. Each `LiveRange` instance bind events that might
- * have to be unbound. Use {@link module:engine/model/liverange~LiveRange#detach detach} whenever you don't need `LiveRange` anymore.
- */
- class LiveRange extends _range__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates a live range.
- *
- * @see module:engine/model/range~Range
- */
- constructor( start, end ) {
- super( start, end );
- bindWithDocument.call( this );
- }
- /**
- * Unbinds all events previously bound by `LiveRange`. Use it whenever you don't need `LiveRange` instance
- * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was
- * referring to it).
- */
- detach() {
- this.stopListening();
- }
- /**
- * Checks whether this object is of the given.
- *
- * liveRange.is( 'range' ); // -> true
- * liveRange.is( 'model:range' ); // -> true
- * liveRange.is( 'liveRange' ); // -> true
- * liveRange.is( 'model:liveRange' ); // -> true
- *
- * liveRange.is( 'view:range' ); // -> false
- * liveRange.is( 'documentSelection' ); // -> false
- *
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'liveRange' || type === 'model:liveRange' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type == 'range' || type === 'model:range';
- }
- /**
- * Creates a {@link module:engine/model/range~Range range instance} that is equal to this live range.
- *
- * @returns {module:engine/model/range~Range}
- */
- toRange() {
- return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( this.start, this.end );
- }
- /**
- * Creates a `LiveRange` instance that is equal to the given range.
- *
- * @param {module:engine/model/range~Range} range
- * @returns {module:engine/model/liverange~LiveRange}
- */
- static fromRange( range ) {
- return new LiveRange( range.start, range.end );
- }
- /**
- * @see module:engine/model/range~Range._createIn
- * @static
- * @protected
- * @method module:engine/model/liverange~LiveRange._createIn
- * @param {module:engine/model/element~Element} element
- * @returns {module:engine/model/liverange~LiveRange}
- */
- /**
- * @see module:engine/model/range~Range._createOn
- * @static
- * @protected
- * @method module:engine/model/liverange~LiveRange._createOn
- * @param {module:engine/model/element~Element} element
- * @returns {module:engine/model/liverange~LiveRange}
- */
- /**
- * @see module:engine/model/range~Range._createFromPositionAndShift
- * @static
- * @protected
- * @method module:engine/model/liverange~LiveRange._createFromPositionAndShift
- * @param {module:engine/model/position~Position} position
- * @param {Number} shift
- * @returns {module:engine/model/liverange~LiveRange}
- */
- /**
- * Fired when `LiveRange` instance boundaries have changed due to changes in the
- * {@link module:engine/model/document~Document document}.
- *
- * @event change:range
- * @param {module:engine/model/range~Range} oldRange Range with start and end position equal to start and end position of this live
- * range before it got changed.
- * @param {Object} data Object with additional information about the change.
- * @param {module:engine/model/position~Position|null} data.deletionPosition Source position for remove and merge changes.
- * Available if the range was moved to the graveyard root, `null` otherwise.
- */
- /**
- * Fired when `LiveRange` instance boundaries have not changed after a change in {@link module:engine/model/document~Document document}
- * but the change took place inside the range, effectively changing its content.
- *
- * @event change:content
- * @param {module:engine/model/range~Range} range Range with start and end position equal to start and end position of
- * change range.
- * @param {Object} data Object with additional information about the change.
- * @param {null} data.deletionPosition Due to the nature of this event, this property is always set to `null`. It is passed
- * for compatibility with the {@link module:engine/model/liverange~LiveRange#event:change:range} event.
- */
- }
- // Binds this `LiveRange` to the {@link module:engine/model/document~Document document}
- // that owns this range's {@link module:engine/model/range~Range#root root}.
- //
- // @private
- function bindWithDocument() {
- this.listenTo(
- this.root.document.model,
- 'applyOperation',
- ( event, args ) => {
- const operation = args[ 0 ];
- if ( !operation.isDocumentOperation ) {
- return;
- }
- transform.call( this, operation );
- },
- { priority: 'low' }
- );
- }
- // Updates this range accordingly to the updates applied to the model. Bases on change events.
- //
- // @private
- // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
- function transform( operation ) {
- // Transform the range by the operation. Join the result ranges if needed.
- const ranges = this.getTransformedByOperation( operation );
- const result = _range__WEBPACK_IMPORTED_MODULE_0__["default"]._createFromRanges( ranges );
- const boundariesChanged = !result.isEqual( this );
- const contentChanged = doesOperationChangeRangeContent( this, operation );
- let deletionPosition = null;
- if ( boundariesChanged ) {
- // If range boundaries have changed, fire `change:range` event.
- //
- if ( result.root.rootName == '$graveyard' ) {
- // If the range was moved to the graveyard root, set `deletionPosition`.
- if ( operation.type == 'remove' ) {
- deletionPosition = operation.sourcePosition;
- } else {
- // Merge operation.
- deletionPosition = operation.deletionPosition;
- }
- }
- const oldRange = this.toRange();
- this.start = result.start;
- this.end = result.end;
- this.fire( 'change:range', oldRange, { deletionPosition } );
- } else if ( contentChanged ) {
- // If range boundaries have not changed, but there was change inside the range, fire `change:content` event.
- this.fire( 'change:content', this.toRange(), { deletionPosition } );
- }
- }
- // Checks whether given operation changes something inside the range (even if it does not change boundaries).
- //
- // @private
- // @param {module:engine/model/range~Range} range Range to check.
- // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
- // @returns {Boolean}
- function doesOperationChangeRangeContent( range, operation ) {
- switch ( operation.type ) {
- case 'insert':
- return range.containsPosition( operation.position );
- case 'move':
- case 'remove':
- case 'reinsert':
- case 'merge':
- return range.containsPosition( operation.sourcePosition ) ||
- range.start.isEqual( operation.sourcePosition ) ||
- range.containsPosition( operation.targetPosition );
- case 'split':
- return range.containsPosition( operation.splitPosition ) || range.containsPosition( operation.insertionPosition );
- }
- return false;
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( LiveRange, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MarkerCollection; });
- /* harmony import */ var _liverange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/markercollection
- */
- /**
- * The collection of all {@link module:engine/model/markercollection~Marker markers} attached to the document.
- * It lets you {@link module:engine/model/markercollection~MarkerCollection#get get} markers or track them using
- * {@link module:engine/model/markercollection~MarkerCollection#event:update} event.
- *
- * To create, change or remove makers use {@link module:engine/model/writer~Writer model writers'} methods:
- * {@link module:engine/model/writer~Writer#addMarker} or {@link module:engine/model/writer~Writer#removeMarker}. Since
- * the writer is the only proper way to change the data model it is not possible to change markers directly using this
- * collection. All markers created by the writer will be automatically added to this collection.
- *
- * By default there is one marker collection available as {@link module:engine/model/model~Model#markers model property}.
- *
- * @see module:engine/model/markercollection~Marker
- */
- class MarkerCollection {
- /**
- * Creates a markers collection.
- */
- constructor() {
- /**
- * Stores {@link ~Marker markers} added to the collection.
- *
- * @private
- * @member {Map} #_markers
- */
- this._markers = new Map();
- }
- /**
- * Iterable interface.
- *
- * Iterates over all {@link ~Marker markers} added to the collection.
- *
- * @returns {Iterable}
- */
- [ Symbol.iterator ]() {
- return this._markers.values();
- }
- /**
- * Checks if marker with given `markerName` is in the collection.
- *
- * @param {String} markerName Marker name.
- * @returns {Boolean} `true` if marker with given `markerName` is in the collection, `false` otherwise.
- */
- has( markerName ) {
- return this._markers.has( markerName );
- }
- /**
- * Returns {@link ~Marker marker} with given `markerName`.
- *
- * @param {String} markerName Name of marker to get.
- * @returns {module:engine/model/markercollection~Marker|null} Marker with given name or `null` if such marker was
- * not added to the collection.
- */
- get( markerName ) {
- return this._markers.get( markerName ) || null;
- }
- /**
- * Creates and adds a {@link ~Marker marker} to the `MarkerCollection` with given name on given
- * {@link module:engine/model/range~Range range}.
- *
- * If `MarkerCollection` already had a marker with given name (or {@link ~Marker marker} was passed), the marker in
- * collection is updated and {@link module:engine/model/markercollection~MarkerCollection#event:update} event is fired
- * but only if there was a change (marker range or {@link module:engine/model/markercollection~Marker#managedUsingOperations}
- * flag has changed.
- *
- * @protected
- * @fires module:engine/model/markercollection~MarkerCollection#event:update
- * @param {String|module:engine/model/markercollection~Marker} markerOrName Name of marker to set or marker instance to update.
- * @param {module:engine/model/range~Range} range Marker range.
- * @param {Boolean} [managedUsingOperations=false] Specifies whether the marker is managed using operations.
- * @param {Boolean} [affectsData=false] Specifies whether the marker affects the data produced by the data pipeline
- * (is persisted in the editor's data).
- * @returns {module:engine/model/markercollection~Marker} `Marker` instance which was added or updated.
- */
- _set( markerOrName, range, managedUsingOperations = false, affectsData = false ) {
- const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
- if ( markerName.includes( ',' ) ) {
- /**
- * Marker name cannot contain the "," character.
- *
- * @error markercollection-incorrect-marker-name
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'markercollection-incorrect-marker-name', this );
- }
- const oldMarker = this._markers.get( markerName );
- if ( oldMarker ) {
- const oldRange = oldMarker.getRange();
- let hasChanged = false;
- if ( !oldRange.isEqual( range ) ) {
- oldMarker._attachLiveRange( _liverange__WEBPACK_IMPORTED_MODULE_0__["default"].fromRange( range ) );
- hasChanged = true;
- }
- if ( managedUsingOperations != oldMarker.managedUsingOperations ) {
- oldMarker._managedUsingOperations = managedUsingOperations;
- hasChanged = true;
- }
- if ( typeof affectsData === 'boolean' && affectsData != oldMarker.affectsData ) {
- oldMarker._affectsData = affectsData;
- hasChanged = true;
- }
- if ( hasChanged ) {
- this.fire( 'update:' + markerName, oldMarker, oldRange, range );
- }
- return oldMarker;
- }
- const liveRange = _liverange__WEBPACK_IMPORTED_MODULE_0__["default"].fromRange( range );
- const marker = new Marker( markerName, liveRange, managedUsingOperations, affectsData );
- this._markers.set( markerName, marker );
- this.fire( 'update:' + markerName, marker, null, range );
- return marker;
- }
- /**
- * Removes given {@link ~Marker marker} or a marker with given name from the `MarkerCollection`.
- *
- * @protected
- * @fires module:engine/model/markercollection~MarkerCollection#event:update
- * @param {String} markerOrName Marker or name of a marker to remove.
- * @returns {Boolean} `true` if marker was found and removed, `false` otherwise.
- */
- _remove( markerOrName ) {
- const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
- const oldMarker = this._markers.get( markerName );
- if ( oldMarker ) {
- this._markers.delete( markerName );
- this.fire( 'update:' + markerName, oldMarker, oldMarker.getRange(), null );
- this._destroyMarker( oldMarker );
- return true;
- }
- return false;
- }
- /**
- * Fires an {@link module:engine/model/markercollection~MarkerCollection#event:update} event for the given {@link ~Marker marker}
- * but does not change the marker. Useful to force {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast
- * conversion} for the marker.
- *
- * @protected
- * @fires module:engine/model/markercollection~MarkerCollection#event:update
- * @param {String} markerOrName Marker or name of a marker to refresh.
- */
- _refresh( markerOrName ) {
- const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
- const marker = this._markers.get( markerName );
- if ( !marker ) {
- /**
- * Marker with provided name does not exists.
- *
- * @error markercollection-refresh-marker-not-exists
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'markercollection-refresh-marker-not-exists', this );
- }
- const range = marker.getRange();
- this.fire( 'update:' + markerName, marker, range, range, marker.managedUsingOperations, marker.affectsData );
- }
- /**
- * Returns iterator that iterates over all markers, which ranges contain given {@link module:engine/model/position~Position position}.
- *
- * @param {module:engine/model/position~Position} position
- * @returns {Iterable.<module:engine/model/markercollection~Marker>}
- */
- * getMarkersAtPosition( position ) {
- for ( const marker of this ) {
- if ( marker.getRange().containsPosition( position ) ) {
- yield marker;
- }
- }
- }
- /**
- * Returns iterator that iterates over all markers, which intersects with given {@link module:engine/model/range~Range range}.
- *
- * @param {module:engine/model/range~Range} range
- * @returns {Iterable.<module:engine/model/markercollection~Marker>}
- */
- * getMarkersIntersectingRange( range ) {
- for ( const marker of this ) {
- if ( marker.getRange().getIntersection( range ) !== null ) {
- yield marker;
- }
- }
- }
- /**
- * Destroys marker collection and all markers inside it.
- */
- destroy() {
- for ( const marker of this._markers.values() ) {
- this._destroyMarker( marker );
- }
- this._markers = null;
- this.stopListening();
- }
- /**
- * Iterates over all markers that starts with given `prefix`.
- *
- * const markerFooA = markersCollection.set( 'foo:a', rangeFooA );
- * const markerFooB = markersCollection.set( 'foo:b', rangeFooB );
- * const markerBarA = markersCollection.set( 'bar:a', rangeBarA );
- * const markerFooBarA = markersCollection.set( 'foobar:a', rangeFooBarA );
- * Array.from( markersCollection.getMarkersGroup( 'foo' ) ); // [ markerFooA, markerFooB ]
- * Array.from( markersCollection.getMarkersGroup( 'a' ) ); // []
- *
- * @param prefix
- * @returns {Iterable.<module:engine/model/markercollection~Marker>}
- */
- * getMarkersGroup( prefix ) {
- for ( const marker of this._markers.values() ) {
- if ( marker.name.startsWith( prefix + ':' ) ) {
- yield marker;
- }
- }
- }
- /**
- * Destroys the marker.
- *
- * @private
- * @param {module:engine/model/markercollection~Marker} marker Marker to destroy.
- */
- _destroyMarker( marker ) {
- marker.stopListening();
- marker._detachLiveRange();
- }
- /**
- * Fired whenever marker is added, updated or removed from `MarkerCollection`.
- *
- * @event update
- * @param {module:engine/model/markercollection~Marker} marker Updated Marker.
- * @param {module:engine/model/range~Range|null} oldRange Marker range before the update. When is not defined it
- * means that marker is just added.
- * @param {module:engine/model/range~Range|null} newRange Marker range after update. When is not defined it
- * means that marker is just removed.
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( MarkerCollection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /**
- * `Marker` is a continuous parts of model (like a range), is named and represent some kind of information about marked
- * part of model document. In contrary to {@link module:engine/model/node~Node nodes}, which are building blocks of
- * model document tree, markers are not stored directly in document tree but in
- * {@link module:engine/model/model~Model#markers model markers' collection}. Still, they are document data, by giving
- * additional meaning to the part of a model document between marker start and marker end.
- *
- * In this sense, markers are similar to adding and converting attributes on nodes. The difference is that attribute is
- * connected with a given node (e.g. a character is bold no matter if it gets moved or content around it changes).
- * Markers on the other hand are continuous ranges and are characterized by their start and end position. This means that
- * any character in the marker is marked by the marker. For example, if a character is moved outside of marker it stops being
- * "special" and the marker is shrunk. Similarly, when a character is moved into the marker from other place in document
- * model, it starts being "special" and the marker is enlarged.
- *
- * Another upside of markers is that finding marked part of document is fast and easy. Using attributes to mark some nodes
- * and then trying to find that part of document would require traversing whole document tree. Marker gives instant access
- * to the range which it is marking at the moment.
- *
- * Markers are built from a name and a range.
- *
- * Range of the marker is updated automatically when document changes, using
- * {@link module:engine/model/liverange~LiveRange live range} mechanism.
- *
- * Name is used to group and identify markers. Names have to be unique, but markers can be grouped by
- * using common prefixes, separated with `:`, for example: `user:john` or `search:3`. That's useful in term of creating
- * namespaces for custom elements (e.g. comments, highlights). You can use this prefixes in
- * {@link module:engine/model/markercollection~MarkerCollection#event:update} listeners to listen on changes in a group of markers.
- * For instance: `model.markers.on( 'update:user', callback );` will be called whenever any `user:*` markers changes.
- *
- * There are two types of markers.
- *
- * 1. Markers managed directly, without using operations. They are added directly by {@link module:engine/model/writer~Writer}
- * to the {@link module:engine/model/markercollection~MarkerCollection} without any additional mechanism. They can be used
- * as bookmarks or visual markers. They are great for showing results of the find, or select link when the focus is in the input.
- *
- * 1. Markers managed using operations. These markers are also stored in {@link module:engine/model/markercollection~MarkerCollection}
- * but changes in these markers is managed the same way all other changes in the model structure - using operations.
- * Therefore, they are handled in the undo stack and synchronized between clients if the collaboration plugin is enabled.
- * This type of markers is useful for solutions like spell checking or comments.
- *
- * Both type of them should be added / updated by {@link module:engine/model/writer~Writer#addMarker}
- * and removed by {@link module:engine/model/writer~Writer#removeMarker} methods.
- *
- * model.change( ( writer ) => {
- * const marker = writer.addMarker( name, { range, usingOperation: true } );
- *
- * // ...
- *
- * writer.removeMarker( marker );
- * } );
- *
- * See {@link module:engine/model/writer~Writer} to find more examples.
- *
- * Since markers need to track change in the document, for efficiency reasons, it is best to create and keep as little
- * markers as possible and remove them as soon as they are not needed anymore.
- *
- * Markers can be downcasted and upcasted.
- *
- * Markers downcast happens on {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} and
- * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} events.
- * Use {@link module:engine/conversion/downcasthelpers downcast converters} or attach a custom converter to mentioned events.
- * For {@link module:engine/controller/datacontroller~DataController data pipeline}, marker should be downcasted to an element.
- * Then, it can be upcasted back to a marker. Again, use {@link module:engine/conversion/upcasthelpers upcast converters} or
- * attach a custom converter to {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element}.
- *
- * `Marker` instances are created and destroyed only by {@link ~MarkerCollection MarkerCollection}.
- */
- class Marker {
- /**
- * Creates a marker instance.
- *
- * @param {String} name Marker name.
- * @param {module:engine/model/liverange~LiveRange} liveRange Range marked by the marker.
- * @param {Boolean} managedUsingOperations Specifies whether the marker is managed using operations.
- * @param {Boolean} affectsData Specifies whether the marker affects the data produced by the data pipeline
- * (is persisted in the editor's data).
- */
- constructor( name, liveRange, managedUsingOperations, affectsData ) {
- /**
- * Marker's name.
- *
- * @readonly
- * @type {String}
- */
- this.name = name;
- /**
- * Range marked by the marker.
- *
- * @protected
- * @member {module:engine/model/liverange~LiveRange}
- */
- this._liveRange = this._attachLiveRange( liveRange );
- /**
- * Flag indicates if the marker is managed using operations or not.
- *
- * @private
- * @member {Boolean}
- */
- this._managedUsingOperations = managedUsingOperations;
- /**
- * Specifies whether the marker affects the data produced by the data pipeline
- * (is persisted in the editor's data).
- *
- * @private
- * @member {Boolean}
- */
- this._affectsData = affectsData;
- }
- /**
- * A value indicating if the marker is managed using operations.
- * See {@link ~Marker marker class description} to learn more about marker types.
- * See {@link module:engine/model/writer~Writer#addMarker}.
- *
- * @returns {Boolean}
- */
- get managedUsingOperations() {
- if ( !this._liveRange ) {
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
- }
- return this._managedUsingOperations;
- }
- /**
- * A value indicating if the marker changes the data.
- *
- * @returns {Boolean}
- */
- get affectsData() {
- if ( !this._liveRange ) {
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
- }
- return this._affectsData;
- }
- /**
- * Returns current marker start position.
- *
- * @returns {module:engine/model/position~Position}
- */
- getStart() {
- if ( !this._liveRange ) {
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
- }
- return this._liveRange.start.clone();
- }
- /**
- * Returns current marker end position.
- *
- * @returns {module:engine/model/position~Position}
- */
- getEnd() {
- if ( !this._liveRange ) {
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
- }
- return this._liveRange.end.clone();
- }
- /**
- * Returns a range that represents the current state of the marker.
- *
- * Keep in mind that returned value is a {@link module:engine/model/range~Range Range}, not a
- * {@link module:engine/model/liverange~LiveRange LiveRange}. This means that it is up-to-date and relevant only
- * until next model document change. Do not store values returned by this method. Instead, store {@link ~Marker#name}
- * and get `Marker` instance from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection} every
- * time there is a need to read marker properties. This will guarantee that the marker has not been removed and
- * that it's data is up-to-date.
- *
- * @returns {module:engine/model/range~Range}
- */
- getRange() {
- if ( !this._liveRange ) {
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
- }
- return this._liveRange.toRange();
- }
- /**
- * Checks whether this object is of the given.
- *
- * marker.is( 'marker' ); // -> true
- * marker.is( 'model:marker' ); // -> true
- *
- * marker.is( 'view:element' ); // -> false
- * marker.is( 'documentSelection' ); // -> false
- *
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'marker' || type === 'model:marker';
- }
- /**
- * Binds new live range to the marker and detach the old one if is attached.
- *
- * @protected
- * @param {module:engine/model/liverange~LiveRange} liveRange Live range to attach
- * @returns {module:engine/model/liverange~LiveRange} Attached live range.
- */
- _attachLiveRange( liveRange ) {
- if ( this._liveRange ) {
- this._detachLiveRange();
- }
- // Delegating does not work with namespaces. Alternatively, we could delegate all events (using `*`).
- liveRange.delegate( 'change:range' ).to( this );
- liveRange.delegate( 'change:content' ).to( this );
- this._liveRange = liveRange;
- return liveRange;
- }
- /**
- * Unbinds and destroys currently attached live range.
- *
- * @protected
- */
- _detachLiveRange() {
- this._liveRange.stopDelegating( 'change:range', this );
- this._liveRange.stopDelegating( 'change:content', this );
- this._liveRange.detach();
- this._liveRange = null;
- }
- /**
- * Fired whenever {@link ~Marker#_liveRange marker range} is changed due to changes on {@link module:engine/model/document~Document}.
- * This is a delegated {@link module:engine/model/liverange~LiveRange#event:change:range LiveRange change:range event}.
- *
- * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},
- * all event listeners listening to it should be removed. It is best to do it on
- * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.
- *
- * @see module:engine/model/liverange~LiveRange#event:change:range
- * @event change:range
- * @param {module:engine/model/range~Range} oldRange
- * @param {Object} data
- */
- /**
- * Fired whenever change on {@link module:engine/model/document~Document} is done inside {@link ~Marker#_liveRange marker range}.
- * This is a delegated {@link module:engine/model/liverange~LiveRange#event:change:content LiveRange change:content event}.
- *
- * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},
- * all event listeners listening to it should be removed. It is best to do it on
- * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.
- *
- * @see module:engine/model/liverange~LiveRange#event:change:content
- * @event change:content
- * @param {module:engine/model/range~Range} oldRange
- * @param {Object} data
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( Marker, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /**
- * Cannot use a {@link module:engine/model/markercollection~MarkerCollection#destroy destroyed marker} instance.
- *
- * @error marker-destroyed
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Model; });
- /* harmony import */ var _batch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./batch */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js");
- /* harmony import */ var _writer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./writer */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js");
- /* harmony import */ var _schema__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./schema */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js");
- /* harmony import */ var _document__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./document */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js");
- /* harmony import */ var _markercollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./markercollection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
- /* harmony import */ var _operation_operationfactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./operation/operationfactory */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js");
- /* harmony import */ var _utils_insertcontent__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/insertcontent */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js");
- /* harmony import */ var _utils_deletecontent__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/deletecontent */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js");
- /* harmony import */ var _utils_modifyselection__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils/modifyselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js");
- /* harmony import */ var _utils_getselectedcontent__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./utils/getselectedcontent */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js");
- /* harmony import */ var _utils_selection_post_fixer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./utils/selection-post-fixer */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js");
- /* harmony import */ var _utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/model
- */
- // @if CK_DEBUG_ENGINE // const { dumpTrees } = require( '../dev-utils/utils' );
- // @if CK_DEBUG_ENGINE // const { OperationReplayer } = require( '../dev-utils/operationreplayer' ).default;
- /**
- * Editor's data model. Read about the model in the
- * {@glink framework/guides/architecture/editing-engine engine architecture guide}.
- *
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class Model {
- constructor() {
- /**
- * Model's marker collection.
- *
- * @readonly
- * @member {module:engine/model/markercollection~MarkerCollection}
- */
- this.markers = new _markercollection__WEBPACK_IMPORTED_MODULE_4__["default"]();
- /**
- * Model's document.
- *
- * @readonly
- * @member {module:engine/model/document~Document}
- */
- this.document = new _document__WEBPACK_IMPORTED_MODULE_3__["default"]( this );
- /**
- * Model's schema.
- *
- * @readonly
- * @member {module:engine/model/schema~Schema}
- */
- this.schema = new _schema__WEBPACK_IMPORTED_MODULE_2__["default"]();
- /**
- * All callbacks added by {@link module:engine/model/model~Model#change} or
- * {@link module:engine/model/model~Model#enqueueChange} methods waiting to be executed.
- *
- * @private
- * @type {Array.<Function>}
- */
- this._pendingChanges = [];
- /**
- * The last created and currently used writer instance.
- *
- * @private
- * @member {module:engine/model/writer~Writer}
- */
- this._currentWriter = null;
- [ 'insertContent', 'deleteContent', 'modifySelection', 'getSelectedContent', 'applyOperation' ]
- .forEach( methodName => this.decorate( methodName ) );
- // Adding operation validation with `highest` priority, so it is called before any other feature would like
- // to do anything with the operation. If the operation has incorrect parameters it should throw on the earliest occasion.
- this.on( 'applyOperation', ( evt, args ) => {
- const operation = args[ 0 ];
- operation._validate();
- }, { priority: 'highest' } );
- // Register some default abstract entities.
- this.schema.register( '$root', {
- isLimit: true
- } );
- this.schema.register( '$block', {
- allowIn: '$root',
- isBlock: true
- } );
- this.schema.register( '$text', {
- allowIn: '$block',
- isInline: true,
- isContent: true
- } );
- this.schema.register( '$clipboardHolder', {
- allowContentOf: '$root',
- allowChildren: '$text',
- isLimit: true
- } );
- this.schema.register( '$documentFragment', {
- allowContentOf: '$root',
- allowChildren: '$text',
- isLimit: true
- } );
- // An element needed by the `upcastElementToMarker` converter.
- // This element temporarily represents a marker boundary during the conversion process and is removed
- // at the end of the conversion. `UpcastDispatcher` or at least `Conversion` class looks like a
- // better place for this registration but both know nothing about `Schema`.
- this.schema.register( '$marker' );
- this.schema.addChildCheck( ( context, childDefinition ) => {
- if ( childDefinition.name === '$marker' ) {
- return true;
- }
- } );
- Object(_utils_selection_post_fixer__WEBPACK_IMPORTED_MODULE_16__["injectSelectionPostFixer"])( this );
- // Post-fixer which takes care of adding empty paragraph elements to the empty roots.
- this.document.registerPostFixer( _utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_17__["autoParagraphEmptyRoots"] );
- // @if CK_DEBUG_ENGINE // this.on( 'applyOperation', () => {
- // @if CK_DEBUG_ENGINE // dumpTrees( this.document, this.document.version );
- // @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );
- }
- /**
- * The `change()` method is the primary way of changing the model. You should use it to modify all document nodes
- * (including detached nodes – i.e. nodes not added to the {@link module:engine/model/model~Model#document model document}),
- * the {@link module:engine/model/document~Document#selection document's selection}, and
- * {@link module:engine/model/model~Model#markers model markers}.
- *
- * model.change( writer => {
- * writer.insertText( 'foo', paragraph, 'end' );
- * } );
- *
- * All changes inside the change block use the same {@link module:engine/model/batch~Batch} so they are combined
- * into a single undo step.
- *
- * model.change( writer => {
- * writer.insertText( 'foo', paragraph, 'end' ); // foo.
- *
- * model.change( writer => {
- * writer.insertText( 'bar', paragraph, 'end' ); // foobar.
- * } );
- *
- * writer.insertText( 'bom', paragraph, 'end' ); // foobarbom.
- * } );
- *
- * The callback of the `change()` block is executed synchronously.
- *
- * You can also return a value from the change block.
- *
- * const img = model.change( writer => {
- * return writer.createElement( 'img' );
- * } );
- *
- * @see #enqueueChange
- * @param {Function} callback Callback function which may modify the model.
- * @returns {*} Value returned by the callback.
- */
- change( callback ) {
- try {
- if ( this._pendingChanges.length === 0 ) {
- // If this is the outermost block, create a new batch and start `_runPendingChanges` execution flow.
- this._pendingChanges.push( { batch: new _batch__WEBPACK_IMPORTED_MODULE_0__["default"](), callback } );
- return this._runPendingChanges()[ 0 ];
- } else {
- // If this is not the outermost block, just execute the callback.
- return callback( this._currentWriter );
- }
- } catch ( err ) {
- // @if CK_DEBUG // throw err;
- /* istanbul ignore next */
- _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_18__["default"].rethrowUnexpectedError( err, this );
- }
- }
- /**
- * The `enqueueChange()` method performs similar task as the {@link #change `change()` method}, with two major differences.
- *
- * First, the callback of `enqueueChange()` is executed when all other enqueued changes are done. It might be executed
- * immediately if it is not nested in any other change block, but if it is nested in another (enqueue)change block,
- * it will be delayed and executed after the outermost block.
- *
- * model.change( writer => {
- * console.log( 1 );
- *
- * model.enqueueChange( writer => {
- * console.log( 2 );
- * } );
- *
- * console.log( 3 );
- * } ); // Will log: 1, 3, 2.
- *
- * In addition to that, the changes enqueued with `enqueueChange()` will be converted separately from the changes
- * done in the outer `change()` block.
- *
- * Second, it lets you define the {@link module:engine/model/batch~Batch} into which you want to add your changes.
- * By default, a new batch is created. In the sample above, `change` and `enqueueChange` blocks use a different
- * batch (and different {@link module:engine/model/writer~Writer} since each of them operates on the separate batch).
- *
- * When using the `enqueueChange()` block you can also add some changes to the batch you used before.
- *
- * model.enqueueChange( batch, writer => {
- * writer.insertText( 'foo', paragraph, 'end' );
- * } );
- *
- * In order to make a nested `enqueueChange()` create a single undo step together with the changes done in the outer `change()`
- * block, you can obtain the batch instance from the {@link module:engine/model/writer~Writer#batch writer} of the outer block.
- *
- * @param {module:engine/model/batch~Batch|'transparent'|'default'} batchOrType Batch or batch type should be used in the callback.
- * If not defined, a new batch will be created.
- * @param {Function} callback Callback function which may modify the model.
- */
- enqueueChange( batchOrType, callback ) {
- try {
- if ( typeof batchOrType === 'string' ) {
- batchOrType = new _batch__WEBPACK_IMPORTED_MODULE_0__["default"]( batchOrType );
- } else if ( typeof batchOrType == 'function' ) {
- callback = batchOrType;
- batchOrType = new _batch__WEBPACK_IMPORTED_MODULE_0__["default"]();
- }
- this._pendingChanges.push( { batch: batchOrType, callback } );
- if ( this._pendingChanges.length == 1 ) {
- this._runPendingChanges();
- }
- } catch ( err ) {
- // @if CK_DEBUG // throw err;
- /* istanbul ignore next */
- _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_18__["default"].rethrowUnexpectedError( err, this );
- }
- }
- /**
- * {@link module:utils/observablemixin~ObservableMixin#decorate Decorated} function for applying
- * {@link module:engine/model/operation/operation~Operation operations} to the model.
- *
- * This is a low-level way of changing the model. It is exposed for very specific use cases (like the undo feature).
- * Normally, to modify the model, you will want to use {@link module:engine/model/writer~Writer `Writer`}.
- * See also {@glink framework/guides/architecture/editing-engine#changing-the-model Changing the model} section
- * of the {@glink framework/guides/architecture/editing-engine Editing architecture} guide.
- *
- * @param {module:engine/model/operation/operation~Operation} operation The operation to apply.
- */
- applyOperation( operation ) {
- // @if CK_DEBUG_ENGINE // console.log( 'Applying ' + operation );
- // @if CK_DEBUG_ENGINE // if ( !this._operationLogs ) {
- // @if CK_DEBUG_ENGINE // this._operationLogs = [];
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // this._operationLogs.push( JSON.stringify( operation ) );
- // @if CK_DEBUG_ENGINE //if ( !this._appliedOperations ) {
- // @if CK_DEBUG_ENGINE // this._appliedOperations = [];
- // @if CK_DEBUG_ENGINE //}
- // @if CK_DEBUG_ENGINE //this._appliedOperations.push( operation );
- operation._execute();
- }
- // @if CK_DEBUG_ENGINE // getAppliedOperation() {
- // @if CK_DEBUG_ENGINE // if ( !this._appliedOperations ) {
- // @if CK_DEBUG_ENGINE // return '';
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // return this._appliedOperations.map( JSON.stringify ).join( '-------' );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // createReplayer( stringifiedOperations ) {
- // @if CK_DEBUG_ENGINE // return new OperationReplayer( this, '-------', stringifiedOperations );
- // @if CK_DEBUG_ENGINE // }
- /**
- * Inserts content at the position in the editor specified by the selection, as one would expect the paste
- * functionality to work.
- *
- * This is a high-level method. It takes the {@link #schema schema} into consideration when inserting
- * the content, clears the given selection's content before inserting nodes and moves the selection
- * to its target position at the end of the process.
- * It can split elements, merge them, wrap bare text nodes with paragraphs, etc. — just like the
- * pasting feature should do.
- *
- * For lower-level methods see {@link module:engine/model/writer~Writer `Writer`}.
- *
- * This method, unlike {@link module:engine/model/writer~Writer `Writer`}'s methods, does not have to be used
- * inside a {@link #change `change()` block}.
- *
- * # Conversion and schema
- *
- * Inserting elements and text nodes into the model is not enough to make CKEditor 5 render that content
- * to the user. CKEditor 5 implements a model-view-controller architecture and what `model.insertContent()` does
- * is only adding nodes to the model. Additionally, you need to define
- * {@glink framework/guides/architecture/editing-engine#conversion converters} between the model and view
- * and define those nodes in the {@glink framework/guides/architecture/editing-engine#schema schema}.
- *
- * So, while this method may seem similar to CKEditor 4 `editor.insertHtml()` (in fact, both methods
- * are used for paste-like content insertion), the CKEditor 5 method cannot be use to insert arbitrary HTML
- * unless converters are defined for all elements and attributes in that HTML.
- *
- * # Examples
- *
- * Using `insertContent()` with a manually created model structure:
- *
- * // Let's create a document fragment containing such content as:
- * //
- * // <paragraph>foo</paragraph>
- * // <blockQuote>
- * // <paragraph>bar</paragraph>
- * // </blockQuote>
- * const docFrag = editor.model.change( writer => {
- * const p1 = writer.createElement( 'paragraph' );
- * const p2 = writer.createElement( 'paragraph' );
- * const blockQuote = writer.createElement( 'blockQuote' );
- * const docFrag = writer.createDocumentFragment();
- *
- * writer.append( p1, docFrag );
- * writer.append( blockQuote, docFrag );
- * writer.append( p2, blockQuote );
- * writer.insertText( 'foo', p1 );
- * writer.insertText( 'bar', p2 );
- *
- * return docFrag;
- * } );
- *
- * // insertContent() does not have to be used in a change() block. It can, though,
- * // so this code could be moved to the callback defined above.
- * editor.model.insertContent( docFrag );
- *
- * Using `insertContent()` with an HTML string converted to a model document fragment (similar to the pasting mechanism):
- *
- * // You can create your own HtmlDataProcessor instance or use editor.data.processor
- * // if you have not overridden the default one (which is the HtmlDataProcessor instance).
- * const htmlDP = new HtmlDataProcessor( viewDocument );
- *
- * // Convert an HTML string to a view document fragment:
- * const viewFragment = htmlDP.toView( htmlString );
- *
- * // Convert the view document fragment to a model document fragment
- * // in the context of $root. This conversion takes the schema into
- * // account so if, for example, the view document fragment contained a bare text node,
- * // this text node cannot be a child of $root, so it will be automatically
- * // wrapped with a <paragraph>. You can define the context yourself (in the second parameter),
- * // and e.g. convert the content like it would happen in a <paragraph>.
- * // Note: The clipboard feature uses a custom context called $clipboardHolder
- * // which has a loosened schema.
- * const modelFragment = editor.data.toModel( viewFragment );
- *
- * editor.model.insertContent( modelFragment );
- *
- * By default this method will use the document selection but it can also be used with a position, range or selection instance.
- *
- * // Insert text at the current document selection position.
- * editor.model.change( writer => {
- * editor.model.insertContent( writer.createText( 'x' ) );
- * } );
- *
- * // Insert text at a given position - the document selection will not be modified.
- * editor.model.change( writer => {
- * editor.model.insertContent( writer.createText( 'x' ), doc.getRoot(), 2 );
- *
- * // Which is a shorthand for:
- * editor.model.insertContent( writer.createText( 'x' ), writer.createPositionAt( doc.getRoot(), 2 ) );
- * } );
- *
- * If you want the document selection to be moved to the inserted content, use the
- * {@link module:engine/model/writer~Writer#setSelection `setSelection()`} method of the writer after inserting
- * the content:
- *
- * editor.model.change( writer => {
- * const paragraph = writer.createElement( 'paragraph' );
- *
- * // Insert an empty paragraph at the beginning of the root.
- * editor.model.insertContent( paragraph, writer.createPositionAt( editor.model.document.getRoot(), 0 ) );
- *
- * // Move the document selection to the inserted paragraph.
- * writer.setSelection( paragraph, 'in' );
- * } );
- *
- * If an instance of the {@link module:engine/model/selection~Selection model selection} is passed as `selectable`,
- * the new content will be inserted at the passed selection (instead of document selection):
- *
- * editor.model.change( writer => {
- * // Create a selection in a paragraph that will be used as a place of insertion.
- * const selection = writer.createSelection( paragraph, 'in' );
- *
- * // Insert the new text at the created selection.
- * editor.model.insertContent( writer.createText( 'x' ), selection );
- *
- * // insertContent() modifies the passed selection instance so it can be used to set the document selection.
- * // Note: This is not necessary when you passed the document selection to insertContent().
- * writer.setSelection( selection );
- * } );
- *
- * @fires insertContent
- * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
- * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
- * The selection into which the content should be inserted. If not provided the current model document selection will be used.
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] To be used when a model item was passed as `selectable`.
- * This param defines a position in relation to that item.
- * @returns {module:engine/model/range~Range} Range which contains all the performed changes. This is a range that, if removed,
- * would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed
- * at the insertion position.
- */
- insertContent( content, selectable, placeOrOffset ) {
- return Object(_utils_insertcontent__WEBPACK_IMPORTED_MODULE_12__["default"])( this, content, selectable, placeOrOffset );
- }
- /**
- * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
- *
- * **Note:** For the sake of predictability, the resulting selection should always be collapsed.
- * In cases where a feature wants to modify deleting behavior so selection isn't collapsed
- * (e.g. a table feature may want to keep row selection after pressing <kbd>Backspace</kbd>),
- * then that behavior should be implemented in the view's listener. At the same time, the table feature
- * will need to modify this method's behavior too, e.g. to "delete contents and then collapse
- * the selection inside the last selected cell" or "delete the row and collapse selection somewhere near".
- * That needs to be done in order to ensure that other features which use `deleteContent()` will work well with tables.
- *
- * @fires deleteContent
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- * Selection of which the content should be deleted.
- * @param {Object} [options]
- * @param {Boolean} [options.leaveUnmerged=false] Whether to merge elements after removing the content of the selection.
- *
- * For example `<heading1>x[x</heading1><paragraph>y]y</paragraph>` will become:
- *
- * * `<heading1>x^y</heading1>` with the option disabled (`leaveUnmerged == false`)
- * * `<heading1>x^</heading1><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).
- *
- * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}
- * elements will not be merged.
- *
- * @param {Boolean} [options.doNotResetEntireContent=false] Whether to skip replacing the entire content with a
- * paragraph when the entire content was selected.
- *
- * For example `<heading1>[x</heading1><paragraph>y]</paragraph>` will become:
- *
- * * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)
- * * `<heading1>^</heading1>` with enabled (`doNotResetEntireContent == true`)
- *
- * @param {Boolean} [options.doNotAutoparagraph=false] Whether to create a paragraph if after content deletion selection is moved
- * to a place where text cannot be inserted.
- *
- * For example `<paragraph>x</paragraph>[<image src="foo.jpg"></image>]` will become:
- *
- * * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)
- * * `<paragraph>x[]</paragraph>` with the option enabled (`doNotAutoparagraph == true`).
- *
- * **Note:** if there is no valid position for the selection, the paragraph will always be created:
- *
- * `[<image src="foo.jpg"></image>]` -> `<paragraph>[]</paragraph>`.
- *
- * @param {'forward'|'backward'} [options.direction='backward'] The direction in which the content is being consumed.
- * Deleting backward corresponds to using the <kbd>Backspace</kbd> key, while deleting content forward corresponds to
- * the <kbd>Shift</kbd>+<kbd>Backspace</kbd> keystroke.
- */
- deleteContent( selection, options ) {
- Object(_utils_deletecontent__WEBPACK_IMPORTED_MODULE_13__["default"])( this, selection, options );
- }
- /**
- * Modifies the selection. Currently, the supported modifications are:
- *
- * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.
- * Possible values for `unit` are:
- * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one
- * character in `String` sense. However, unicode also defines "combing marks". These are special symbols, that combines
- * with a symbol before it ("base character") to create one user-perceived character. For example, `q̣̇` is a normal
- * letter `q` with two "combining marks": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending
- * selection by one position, it is correct to include both "base character" and all of it's "combining marks". That is
- * why `'character'` value is most natural and common method of modifying selection.
- * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert
- * selection between "base character" and "combining mark", because "combining marks" have their own unicode code points.
- * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by
- * two characters, called "surrogate pairs". Halves of "surrogate pairs" have a meaning only when placed next to each other.
- * For example `𨭎` is represented in `String` by `\uD862\uDF4E`. Both `\uD862` and `\uDF4E` do not have any meaning
- * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection
- * extension will include whole "surrogate pair".
- * * `'word'` - moves selection by a whole word.
- *
- * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.
- *
- * @fires modifySelection
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- * The selection to modify.
- * @param {Object} [options]
- * @param {'forward'|'backward'} [options.direction='forward'] The direction in which the selection should be modified.
- * @param {'character'|'codePoint'|'word'} [options.unit='character'] The unit by which selection should be modified.
- */
- modifySelection( selection, options ) {
- Object(_utils_modifyselection__WEBPACK_IMPORTED_MODULE_14__["default"])( this, selection, options );
- }
- /**
- * Gets a clone of the selected content.
- *
- * For example, for the following selection:
- *
- * ```html
- * <paragraph>x</paragraph>
- * <blockQuote>
- * <paragraph>y</paragraph>
- * <heading1>fir[st</heading1>
- * </blockQuote>
- * <paragraph>se]cond</paragraph>
- * <paragraph>z</paragraph>
- * ```
- *
- * It will return a document fragment with such a content:
- *
- * ```html
- * <blockQuote>
- * <heading1>st</heading1>
- * </blockQuote>
- * <paragraph>se</paragraph>
- * ```
- *
- * @fires getSelectedContent
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- * The selection of which content will be returned.
- * @returns {module:engine/model/documentfragment~DocumentFragment}
- */
- getSelectedContent( selection ) {
- return Object(_utils_getselectedcontent__WEBPACK_IMPORTED_MODULE_15__["default"])( this, selection );
- }
- /**
- * Checks whether the given {@link module:engine/model/range~Range range} or
- * {@link module:engine/model/element~Element element} has any meaningful content.
- *
- * Meaningful content is:
- *
- * * any text node (`options.ignoreWhitespaces` allows controlling whether this text node must also contain
- * any non-whitespace characters),
- * * or any {@link module:engine/model/schema~Schema#isContent content element},
- * * or any {@link module:engine/model/markercollection~Marker marker} which
- * {@link module:engine/model/markercollection~Marker#_affectsData affects data}.
- *
- * This means that a range containing an empty `<paragraph></paragraph>` is not considered to have a meaningful content.
- * However, a range containing an `<image></image>` (which would normally be marked in the schema as an object element)
- * is considered non-empty.
- *
- * @param {module:engine/model/range~Range|module:engine/model/element~Element} rangeOrElement Range or element to check.
- * @param {Object} [options]
- * @param {Boolean} [options.ignoreWhitespaces] Whether text node with whitespaces only should be considered empty.
- * @param {Boolean} [options.ignoreMarkers] Whether markers should be ignored.
- * @returns {Boolean}
- */
- hasContent( rangeOrElement, options = {} ) {
- const range = rangeOrElement instanceof _element__WEBPACK_IMPORTED_MODULE_7__["default"] ? _range__WEBPACK_IMPORTED_MODULE_8__["default"]._createIn( rangeOrElement ) : rangeOrElement;
- if ( range.isCollapsed ) {
- return false;
- }
- const { ignoreWhitespaces = false, ignoreMarkers = false } = options;
- // Check if there are any markers which affects data in this given range.
- if ( !ignoreMarkers ) {
- for ( const intersectingMarker of this.markers.getMarkersIntersectingRange( range ) ) {
- if ( intersectingMarker.affectsData ) {
- return true;
- }
- }
- }
- for ( const item of range.getItems() ) {
- if ( this.schema.isContent( item ) ) {
- if ( item.is( '$textProxy' ) ) {
- if ( !ignoreWhitespaces ) {
- return true;
- } else if ( item.data.search( /\S/ ) !== -1 ) {
- return true;
- }
- } else {
- return true;
- }
- }
- }
- return false;
- }
- /**
- * Creates a position from the given root and path in that root.
- *
- * Note: This method is also available as
- * {@link module:engine/model/writer~Writer#createPositionFromPath `Writer#createPositionFromPath()`}.
- *
- * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.
- * @param {Array.<Number>} path Position path. See {@link module:engine/model/position~Position#path}.
- * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
- * See {@link module:engine/model/position~PositionStickiness}.
- * @returns {module:engine/model/position~Position}
- */
- createPositionFromPath( root, path, stickiness ) {
- return new _position__WEBPACK_IMPORTED_MODULE_9__["default"]( root, path, stickiness );
- }
- /**
- * Creates position at the given location. The location can be specified as:
- *
- * * a {@link module:engine/model/position~Position position},
- * * a parent element and offset in that element,
- * * a parent element and `'end'` (the position will be set at the end of that element),
- * * a {@link module:engine/model/item~Item model item} and `'before'` or `'after'`
- * (the position will be set before or after the given model item).
- *
- * This method is a shortcut to other factory methods such as:
- *
- * * {@link module:engine/model/model~Model#createPositionBefore `createPositionBefore()`},
- * * {@link module:engine/model/model~Model#createPositionAfter `createPositionAfter()`}.
- *
- * Note: This method is also available as
- * {@link module:engine/model/writer~Writer#createPositionAt `Writer#createPositionAt()`},
- *
- * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * first parameter is a {@link module:engine/model/item~Item model item}.
- */
- createPositionAt( itemOrPosition, offset ) {
- return _position__WEBPACK_IMPORTED_MODULE_9__["default"]._createAt( itemOrPosition, offset );
- }
- /**
- * Creates a new position after the given {@link module:engine/model/item~Item model item}.
- *
- * Note: This method is also available as
- * {@link module:engine/model/writer~Writer#createPositionAfter `Writer#createPositionAfter()`}.
- *
- * @param {module:engine/model/item~Item} item Item after which the position should be placed.
- * @returns {module:engine/model/position~Position}
- */
- createPositionAfter( item ) {
- return _position__WEBPACK_IMPORTED_MODULE_9__["default"]._createAfter( item );
- }
- /**
- * Creates a new position before the given {@link module:engine/model/item~Item model item}.
- *
- * Note: This method is also available as
- * {@link module:engine/model/writer~Writer#createPositionBefore `Writer#createPositionBefore()`}.
- *
- * @param {module:engine/model/item~Item} item Item before which the position should be placed.
- * @returns {module:engine/model/position~Position}
- */
- createPositionBefore( item ) {
- return _position__WEBPACK_IMPORTED_MODULE_9__["default"]._createBefore( item );
- }
- /**
- * Creates a range spanning from the `start` position to the `end` position.
- *
- * Note: This method is also available as
- * {@link module:engine/model/writer~Writer#createRange `Writer#createRange()`}:
- *
- * model.change( writer => {
- * const range = writer.createRange( start, end );
- * } );
- *
- * @param {module:engine/model/position~Position} start Start position.
- * @param {module:engine/model/position~Position} [end] End position. If not set, the range will be collapsed
- * to the `start` position.
- * @returns {module:engine/model/range~Range}
- */
- createRange( start, end ) {
- return new _range__WEBPACK_IMPORTED_MODULE_8__["default"]( start, end );
- }
- /**
- * Creates a range inside the given element which starts before the first child of
- * that element and ends after the last child of that element.
- *
- * Note: This method is also available as
- * {@link module:engine/model/writer~Writer#createRangeIn `Writer#createRangeIn()`}:
- *
- * model.change( writer => {
- * const range = writer.createRangeIn( paragraph );
- * } );
- *
- * @param {module:engine/model/element~Element} element Element which is a parent for the range.
- * @returns {module:engine/model/range~Range}
- */
- createRangeIn( element ) {
- return _range__WEBPACK_IMPORTED_MODULE_8__["default"]._createIn( element );
- }
- /**
- * Creates a range that starts before the given {@link module:engine/model/item~Item model item} and ends after it.
- *
- * Note: This method is also available on `writer` instance as
- * {@link module:engine/model/writer~Writer#createRangeOn `Writer.createRangeOn()`}:
- *
- * model.change( writer => {
- * const range = writer.createRangeOn( paragraph );
- * } );
- *
- * @param {module:engine/model/item~Item} item
- * @returns {module:engine/model/range~Range}
- */
- createRangeOn( item ) {
- return _range__WEBPACK_IMPORTED_MODULE_8__["default"]._createOn( item );
- }
- /**
- * Creates a new selection instance based on the given {@link module:engine/model/selection~Selectable selectable}
- * or creates an empty selection if no arguments were passed.
- *
- * Note: This method is also available as
- * {@link module:engine/model/writer~Writer#createSelection `Writer#createSelection()`}.
- *
- * // Creates empty selection without ranges.
- * const selection = writer.createSelection();
- *
- * // Creates selection at the given range.
- * const range = writer.createRange( start, end );
- * const selection = writer.createSelection( range );
- *
- * // Creates selection at the given ranges
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
- * const selection = writer.createSelection( ranges );
- *
- * // Creates selection from the other selection.
- * // Note: It doesn't copies selection attributes.
- * const otherSelection = writer.createSelection();
- * const selection = writer.createSelection( otherSelection );
- *
- * // Creates selection from the given document selection.
- * // Note: It doesn't copies selection attributes.
- * const documentSelection = model.document.selection;
- * const selection = writer.createSelection( documentSelection );
- *
- * // Creates selection at the given position.
- * const position = writer.createPositionFromPath( root, path );
- * const selection = writer.createSelection( position );
- *
- * // Creates selection at the given offset in the given element.
- * const paragraph = writer.createElement( 'paragraph' );
- * const selection = writer.createSelection( paragraph, offset );
- *
- * // Creates a range inside an {@link module:engine/model/element~Element element} which starts before the
- * // first child of that element and ends after the last child of that element.
- * const selection = writer.createSelection( paragraph, 'in' );
- *
- * // Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends
- * // just after the item.
- * const selection = writer.createSelection( paragraph, 'on' );
- *
- * // Additional options (`'backward'`) can be specified as the last argument.
- *
- * // Creates backward selection.
- * const selection = writer.createSelection( range, { backward: true } );
- *
- * @param {module:engine/model/selection~Selectable} selectable
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- * @returns {module:engine/model/selection~Selection}
- */
- createSelection( selectable, placeOrOffset, options ) {
- return new _selection__WEBPACK_IMPORTED_MODULE_10__["default"]( selectable, placeOrOffset, options );
- }
- /**
- * Creates a {@link module:engine/model/batch~Batch} instance.
- *
- * **Note:** In most cases creating a batch instance is not necessary as they are created when using:
- *
- * * {@link #change `change()`},
- * * {@link #enqueueChange `enqueueChange()`}.
- *
- * @param {'transparent'|'default'} [type='default'] The type of the batch.
- * @returns {module:engine/model/batch~Batch}
- */
- createBatch( type ) {
- return new _batch__WEBPACK_IMPORTED_MODULE_0__["default"]( type );
- }
- /**
- * Creates an operation instance from a JSON object (parsed JSON string).
- *
- * This is an alias for {@link module:engine/model/operation/operationfactory~OperationFactory.fromJSON `OperationFactory.fromJSON()`}.
- *
- * @param {Object} json Deserialized JSON object.
- * @returns {module:engine/model/operation/operation~Operation}
- */
- createOperationFromJSON( json ) {
- return _operation_operationfactory__WEBPACK_IMPORTED_MODULE_11__["default"].fromJSON( json, this.document );
- }
- /**
- * Removes all events listeners set by model instance and destroys {@link module:engine/model/document~Document}.
- */
- destroy() {
- this.document.destroy();
- this.stopListening();
- }
- /**
- * Common part of {@link module:engine/model/model~Model#change} and {@link module:engine/model/model~Model#enqueueChange}
- * which calls callbacks and returns array of values returned by these callbacks.
- *
- * @private
- * @returns {Array.<*>} Array of values returned by callbacks.
- */
- _runPendingChanges() {
- const ret = [];
- this.fire( '_beforeChanges' );
- while ( this._pendingChanges.length ) {
- // Create a new writer using batch instance created for this chain of changes.
- const currentBatch = this._pendingChanges[ 0 ].batch;
- this._currentWriter = new _writer__WEBPACK_IMPORTED_MODULE_1__["default"]( this, currentBatch );
- // Execute changes callback and gather the returned value.
- const callbackReturnValue = this._pendingChanges[ 0 ].callback( this._currentWriter );
- ret.push( callbackReturnValue );
- this.document._handleChangeBlock( this._currentWriter );
- this._pendingChanges.shift();
- this._currentWriter = null;
- }
- this.fire( '_afterChanges' );
- return ret;
- }
- /**
- * Fired when entering the outermost {@link module:engine/model/model~Model#enqueueChange} or
- * {@link module:engine/model/model~Model#change} block.
- *
- * @protected
- * @event _beforeChanges
- */
- /**
- * Fired when leaving the outermost {@link module:engine/model/model~Model#enqueueChange} or
- * {@link module:engine/model/model~Model#change} block.
- *
- * @protected
- * @event _afterChanges
- */
- /**
- * Fired every time any {@link module:engine/model/operation/operation~Operation operation} is applied on the model
- * using {@link #applyOperation}.
- *
- * Note that this event is suitable only for very specific use-cases. Use it if you need to listen to every single operation
- * applied on the document. However, in most cases {@link module:engine/model/document~Document#event:change} should
- * be used.
- *
- * A few callbacks are already added to this event by engine internal classes:
- *
- * * with `highest` priority operation is validated,
- * * with `normal` priority operation is executed,
- * * with `low` priority the {@link module:engine/model/document~Document} updates its version,
- * * with `low` priority {@link module:engine/model/liveposition~LivePosition} and {@link module:engine/model/liverange~LiveRange}
- * update themselves.
- *
- * @event applyOperation
- * @param {Array} args Arguments of the `applyOperation` which is an array with a single element - applied
- * {@link module:engine/model/operation/operation~Operation operation}.
- */
- /**
- * Event fired when {@link #insertContent} method is called.
- *
- * The {@link #insertContent default action of that method} is implemented as a
- * listener to this event so it can be fully customized by the features.
- *
- * **Note** The `selectable` parameter for the {@link #insertContent} is optional. When `undefined` value is passed the method uses
- * `model.document.selection`.
- *
- * @event insertContent
- * @param {Array} args The arguments passed to the original method.
- */
- /**
- * Event fired when {@link #deleteContent} method is called.
- *
- * The {@link #deleteContent default action of that method} is implemented as a
- * listener to this event so it can be fully customized by the features.
- *
- * @event deleteContent
- * @param {Array} args The arguments passed to the original method.
- */
- /**
- * Event fired when {@link #modifySelection} method is called.
- *
- * The {@link #modifySelection default action of that method} is implemented as a
- * listener to this event so it can be fully customized by the features.
- *
- * @event modifySelection
- * @param {Array} args The arguments passed to the original method.
- */
- /**
- * Event fired when {@link #getSelectedContent} method is called.
- *
- * The {@link #getSelectedContent default action of that method} is implemented as a
- * listener to this event so it can be fully customized by the features.
- *
- * @event getSelectedContent
- * @param {Array} args The arguments passed to the original method.
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( Model, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Node; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_version__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/node
- */
- // To check if component is loaded more than once.
- /**
- * Model node. Most basic structure of model tree.
- *
- * This is an abstract class that is a base for other classes representing different nodes in model.
- *
- * **Note:** If a node is detached from the model tree, you can manipulate it using it's API.
- * However, it is **very important** that nodes already attached to model tree should be only changed through
- * {@link module:engine/model/writer~Writer Writer API}.
- *
- * Changes done by `Node` methods, like {@link module:engine/model/element~Element#_insertChild _insertChild} or
- * {@link module:engine/model/node~Node#_setAttribute _setAttribute}
- * do not generate {@link module:engine/model/operation/operation~Operation operations}
- * which are essential for correct editor work if you modify nodes in {@link module:engine/model/document~Document document} root.
- *
- * The flow of working on `Node` (and classes that inherits from it) is as such:
- * 1. You can create a `Node` instance, modify it using it's API.
- * 2. Add `Node` to the model using `Batch` API.
- * 3. Change `Node` that was already added to the model using `Batch` API.
- *
- * Similarly, you cannot use `Batch` API on a node that has not been added to the model tree, with the exception
- * of {@link module:engine/model/writer~Writer#insert inserting} that node to the model tree.
- *
- * Be aware that using {@link module:engine/model/writer~Writer#remove remove from Batch API} does not allow to use `Node` API because
- * the information about `Node` is still kept in model document.
- *
- * In case of {@link module:engine/model/element~Element element node}, adding and removing children also counts as changing a node and
- * follows same rules.
- */
- class Node {
- /**
- * Creates a model node.
- *
- * This is an abstract class, so this constructor should not be used directly.
- *
- * @abstract
- * @param {Object} [attrs] Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
- */
- constructor( attrs ) {
- /**
- * Parent of this node. It could be {@link module:engine/model/element~Element}
- * or {@link module:engine/model/documentfragment~DocumentFragment}.
- * Equals to `null` if the node has no parent.
- *
- * @readonly
- * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
- */
- this.parent = null;
- /**
- * Attributes set on this node.
- *
- * @private
- * @member {Map} module:engine/model/node~Node#_attrs
- */
- this._attrs = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__["default"])( attrs );
- }
- /**
- * Index of this node in it's parent or `null` if the node has no parent.
- *
- * Accessing this property throws an error if this node's parent element does not contain it.
- * This means that model tree got broken.
- *
- * @readonly
- * @type {Number|null}
- */
- get index() {
- let pos;
- if ( !this.parent ) {
- return null;
- }
- if ( ( pos = this.parent.getChildIndex( this ) ) === null ) {
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-node-not-found-in-parent', this );
- }
- return pos;
- }
- /**
- * Offset at which this node starts in it's parent. It is equal to the sum of {@link #offsetSize offsetSize}
- * of all it's previous siblings. Equals to `null` if node has no parent.
- *
- * Accessing this property throws an error if this node's parent element does not contain it.
- * This means that model tree got broken.
- *
- * @readonly
- * @type {Number|null}
- */
- get startOffset() {
- let pos;
- if ( !this.parent ) {
- return null;
- }
- if ( ( pos = this.parent.getChildStartOffset( this ) ) === null ) {
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-node-not-found-in-parent', this );
- }
- return pos;
- }
- /**
- * Offset size of this node. Represents how much "offset space" is occupied by the node in it's parent.
- * It is important for {@link module:engine/model/position~Position position}. When node has `offsetSize` greater than `1`, position
- * can be placed between that node start and end. `offsetSize` greater than `1` is for nodes that represents more
- * than one entity, i.e. {@link module:engine/model/text~Text text node}.
- *
- * @readonly
- * @type {Number}
- */
- get offsetSize() {
- return 1;
- }
- /**
- * Offset at which this node ends in it's parent. It is equal to the sum of this node's
- * {@link module:engine/model/node~Node#startOffset start offset} and {@link #offsetSize offset size}.
- * Equals to `null` if the node has no parent.
- *
- * @readonly
- * @type {Number|null}
- */
- get endOffset() {
- if ( !this.parent ) {
- return null;
- }
- return this.startOffset + this.offsetSize;
- }
- /**
- * Node's next sibling or `null` if the node is a last child of it's parent or if the node has no parent.
- *
- * @readonly
- * @type {module:engine/model/node~Node|null}
- */
- get nextSibling() {
- const index = this.index;
- return ( index !== null && this.parent.getChild( index + 1 ) ) || null;
- }
- /**
- * Node's previous sibling or `null` if the node is a first child of it's parent or if the node has no parent.
- *
- * @readonly
- * @type {module:engine/model/node~Node|null}
- */
- get previousSibling() {
- const index = this.index;
- return ( index !== null && this.parent.getChild( index - 1 ) ) || null;
- }
- /**
- * The top-most ancestor of the node. If node has no parent it is the root itself. If the node is a part
- * of {@link module:engine/model/documentfragment~DocumentFragment}, it's `root` is equal to that `DocumentFragment`.
- *
- * @readonly
- * @type {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}
- */
- get root() {
- let root = this; // eslint-disable-line consistent-this
- while ( root.parent ) {
- root = root.parent;
- }
- return root;
- }
- /**
- * Returns true if the node is in a tree rooted in the document (is a descendant of one of its roots).
- *
- * @returns {Boolean}
- */
- isAttached() {
- return this.root.is( 'rootElement' );
- }
- /**
- * Gets path to the node. The path is an array containing starting offsets of consecutive ancestors of this node,
- * beginning from {@link module:engine/model/node~Node#root root}, down to this node's starting offset. The path can be used to
- * create {@link module:engine/model/position~Position Position} instance.
- *
- * const abc = new Text( 'abc' );
- * const foo = new Text( 'foo' );
- * const h1 = new Element( 'h1', null, new Text( 'header' ) );
- * const p = new Element( 'p', null, [ abc, foo ] );
- * const div = new Element( 'div', null, [ h1, p ] );
- * foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.
- * h1.getPath(); // Returns [ 0 ].
- * div.getPath(); // Returns [].
- *
- * @returns {Array.<Number>} The path.
- */
- getPath() {
- const path = [];
- let node = this; // eslint-disable-line consistent-this
- while ( node.parent ) {
- path.unshift( node.startOffset );
- node = node.parent;
- }
- return path;
- }
- /**
- * Returns ancestors array of this node.
- *
- * @param {Object} options Options object.
- * @param {Boolean} [options.includeSelf=false] When set to `true` this node will be also included in parent's array.
- * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from node's parent to root element,
- * otherwise root element will be the first item in the array.
- * @returns {Array} Array with ancestors.
- */
- getAncestors( options = { includeSelf: false, parentFirst: false } ) {
- const ancestors = [];
- let parent = options.includeSelf ? this : this.parent;
- while ( parent ) {
- ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
- parent = parent.parent;
- }
- return ancestors;
- }
- /**
- * Returns a {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
- * which is a common ancestor of both nodes.
- *
- * @param {module:engine/model/node~Node} node The second node.
- * @param {Object} options Options object.
- * @param {Boolean} [options.includeSelf=false] When set to `true` both nodes will be considered "ancestors" too.
- * Which means that if e.g. node A is inside B, then their common ancestor will be B.
- * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
- */
- getCommonAncestor( node, options = {} ) {
- const ancestorsA = this.getAncestors( options );
- const ancestorsB = node.getAncestors( options );
- let i = 0;
- while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
- i++;
- }
- return i === 0 ? null : ancestorsA[ i - 1 ];
- }
- /**
- * Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,
- * in different {@link module:engine/model/documentfragment~DocumentFragment}s).
- *
- * @param {module:engine/model/node~Node} node Node to compare with.
- * @returns {Boolean}
- */
- isBefore( node ) {
- // Given node is not before this node if they are same.
- if ( this == node ) {
- return false;
- }
- // Return `false` if it is impossible to compare nodes.
- if ( this.root !== node.root ) {
- return false;
- }
- const thisPath = this.getPath();
- const nodePath = node.getPath();
- const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_2__["default"])( thisPath, nodePath );
- switch ( result ) {
- case 'prefix':
- return true;
- case 'extension':
- return false;
- default:
- return thisPath[ result ] < nodePath[ result ];
- }
- }
- /**
- * Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,
- * in different {@link module:engine/model/documentfragment~DocumentFragment}s).
- *
- * @param {module:engine/model/node~Node} node Node to compare with.
- * @returns {Boolean}
- */
- isAfter( node ) {
- // Given node is not before this node if they are same.
- if ( this == node ) {
- return false;
- }
- // Return `false` if it is impossible to compare nodes.
- if ( this.root !== node.root ) {
- return false;
- }
- // In other cases, just check if the `node` is before, and return the opposite.
- return !this.isBefore( node );
- }
- /**
- * Checks if the node has an attribute with given key.
- *
- * @param {String} key Key of attribute to check.
- * @returns {Boolean} `true` if attribute with given key is set on node, `false` otherwise.
- */
- hasAttribute( key ) {
- return this._attrs.has( key );
- }
- /**
- * Gets an attribute value for given key or `undefined` if that attribute is not set on node.
- *
- * @param {String} key Key of attribute to look for.
- * @returns {*} Attribute value or `undefined`.
- */
- getAttribute( key ) {
- return this._attrs.get( key );
- }
- /**
- * Returns iterator that iterates over this node's attributes.
- *
- * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
- * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
- *
- * @returns {Iterable.<*>}
- */
- getAttributes() {
- return this._attrs.entries();
- }
- /**
- * Returns iterator that iterates over this node's attribute keys.
- *
- * @returns {Iterable.<String>}
- */
- getAttributeKeys() {
- return this._attrs.keys();
- }
- /**
- * Converts `Node` to plain object and returns it.
- *
- * @returns {Object} `Node` converted to plain object.
- */
- toJSON() {
- const json = {};
- // Serializes attributes to the object.
- // attributes = { a: 'foo', b: 1, c: true }.
- if ( this._attrs.size ) {
- json.attributes = Array.from( this._attrs ).reduce( ( result, attr ) => {
- result[ attr[ 0 ] ] = attr[ 1 ];
- return result;
- }, {} );
- }
- return json;
- }
- /**
- * Checks whether this object is of the given type.
- *
- * This method is useful when processing model objects that are of unknown type. For example, a function
- * may return a {@link module:engine/model/documentfragment~DocumentFragment} or a {@link module:engine/model/node~Node}
- * that can be either a text node or an element. This method can be used to check what kind of object is returned.
- *
- * someObject.is( 'element' ); // -> true if this is an element
- * someObject.is( 'node' ); // -> true if this is a node (a text node or an element)
- * someObject.is( 'documentFragment' ); // -> true if this is a document fragment
- *
- * Since this method is also available on a range of view objects, you can prefix the type of the object with
- * `model:` or `view:` to check, for example, if this is the model's or view's element:
- *
- * modelElement.is( 'model:element' ); // -> true
- * modelElement.is( 'view:element' ); // -> false
- *
- * By using this method it is also possible to check a name of an element:
- *
- * imageElement.is( 'element', 'image' ); // -> true
- * imageElement.is( 'element', 'image' ); // -> same as above
- * imageElement.is( 'model:element', 'image' ); // -> same as above, but more precise
- *
- * The list of model objects which implement the `is()` method:
- *
- * * {@link module:engine/model/node~Node#is `Node#is()`}
- * * {@link module:engine/model/text~Text#is `Text#is()`}
- * * {@link module:engine/model/element~Element#is `Element#is()`}
- * * {@link module:engine/model/rootelement~RootElement#is `RootElement#is()`}
- * * {@link module:engine/model/position~Position#is `Position#is()`}
- * * {@link module:engine/model/liveposition~LivePosition#is `LivePosition#is()`}
- * * {@link module:engine/model/range~Range#is `Range#is()`}
- * * {@link module:engine/model/liverange~LiveRange#is `LiveRange#is()`}
- * * {@link module:engine/model/documentfragment~DocumentFragment#is `DocumentFragment#is()`}
- * * {@link module:engine/model/selection~Selection#is `Selection#is()`}
- * * {@link module:engine/model/documentselection~DocumentSelection#is `DocumentSelection#is()`}
- * * {@link module:engine/model/markercollection~Marker#is `Marker#is()`}
- * * {@link module:engine/model/textproxy~TextProxy#is `TextProxy#is()`}
- *
- * @method #is
- * @param {String} type Type to check.
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'node' || type === 'model:node';
- }
- /**
- * Creates a copy of this node, that is a node with exactly same attributes, and returns it.
- *
- * @protected
- * @returns {module:engine/model/node~Node} Node with same attributes as this node.
- */
- _clone() {
- return new Node( this._attrs );
- }
- /**
- * Removes this node from it's parent.
- *
- * @see module:engine/model/writer~Writer#remove
- * @protected
- */
- _remove() {
- this.parent._removeChildren( this.index );
- }
- /**
- * Sets attribute on the node. If attribute with the same key already is set, it's value is overwritten.
- *
- * @see module:engine/model/writer~Writer#setAttribute
- * @protected
- * @param {String} key Key of attribute to set.
- * @param {*} value Attribute value.
- */
- _setAttribute( key, value ) {
- this._attrs.set( key, value );
- }
- /**
- * Removes all attributes from the node and sets given attributes.
- *
- * @see module:engine/model/writer~Writer#setAttributes
- * @protected
- * @param {Object} [attrs] Attributes to set. See {@link module:utils/tomap~toMap} for a list of accepted values.
- */
- _setAttributesTo( attrs ) {
- this._attrs = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__["default"])( attrs );
- }
- /**
- * Removes an attribute with given key from the node.
- *
- * @see module:engine/model/writer~Writer#removeAttribute
- * @protected
- * @param {String} key Key of attribute to remove.
- * @returns {Boolean} `true` if the attribute was set on the element, `false` otherwise.
- */
- _removeAttribute( key ) {
- return this._attrs.delete( key );
- }
- /**
- * Removes all attributes from the node.
- *
- * @see module:engine/model/writer~Writer#clearAttributes
- * @protected
- */
- _clearAttributes() {
- this._attrs.clear();
- }
- }
- /**
- * The node's parent does not contain this node.
- *
- * @error model-node-not-found-in-parent
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NodeList; });
- /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/nodelist
- */
- /**
- * Provides an interface to operate on a list of {@link module:engine/model/node~Node nodes}. `NodeList` is used internally
- * in classes like {@link module:engine/model/element~Element Element}
- * or {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment}.
- */
- class NodeList {
- /**
- * Creates an empty node list.
- *
- * @protected
- * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes contained in this node list.
- */
- constructor( nodes ) {
- /**
- * Nodes contained in this node list.
- *
- * @private
- * @member {Array.<module:engine/model/node~Node>}
- */
- this._nodes = [];
- if ( nodes ) {
- this._insertNodes( 0, nodes );
- }
- }
- /**
- * Iterable interface.
- *
- * Iterates over all nodes contained inside this node list.
- *
- * @returns {Iterable.<module:engine/model/node~Node>}
- */
- [ Symbol.iterator ]() {
- return this._nodes[ Symbol.iterator ]();
- }
- /**
- * Number of nodes contained inside this node list.
- *
- * @readonly
- * @type {Number}
- */
- get length() {
- return this._nodes.length;
- }
- /**
- * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes contained inside this node list.
- *
- * @readonly
- * @type {Number}
- */
- get maxOffset() {
- return this._nodes.reduce( ( sum, node ) => sum + node.offsetSize, 0 );
- }
- /**
- * Gets the node at the given index. Returns `null` if incorrect index was passed.
- *
- * @param {Number} index Index of node.
- * @returns {module:engine/model/node~Node|null} Node at given index.
- */
- getNode( index ) {
- return this._nodes[ index ] || null;
- }
- /**
- * Returns an index of the given node. Returns `null` if given node is not inside this node list.
- *
- * @param {module:engine/model/node~Node} node Child node to look for.
- * @returns {Number|null} Child node's index.
- */
- getNodeIndex( node ) {
- const index = this._nodes.indexOf( node );
- return index == -1 ? null : index;
- }
- /**
- * Returns the starting offset of given node. Starting offset is equal to the sum of
- * {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes that are before this node in this node list.
- *
- * @param {module:engine/model/node~Node} node Node to look for.
- * @returns {Number|null} Node's starting offset.
- */
- getNodeStartOffset( node ) {
- const index = this.getNodeIndex( node );
- return index === null ? null : this._nodes.slice( 0, index ).reduce( ( sum, node ) => sum + node.offsetSize, 0 );
- }
- /**
- * Converts index to offset in node list.
- *
- * Returns starting offset of a node that is at given index. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
- * `model-nodelist-index-out-of-bounds` if given index is less than `0` or more than {@link #length}.
- *
- * @param {Number} index Node's index.
- * @returns {Number} Node's starting offset.
- */
- indexToOffset( index ) {
- if ( index == this._nodes.length ) {
- return this.maxOffset;
- }
- const node = this._nodes[ index ];
- if ( !node ) {
- /**
- * Given index cannot be found in the node list.
- *
- * @error model-nodelist-index-out-of-bounds
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-nodelist-index-out-of-bounds', this );
- }
- return this.getNodeStartOffset( node );
- }
- /**
- * Converts offset in node list to index.
- *
- * Returns index of a node that occupies given offset. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
- * `model-nodelist-offset-out-of-bounds` if given offset is less than `0` or more than {@link #maxOffset}.
- *
- * @param {Number} offset Offset to look for.
- * @returns {Number} Index of a node that occupies given offset.
- */
- offsetToIndex( offset ) {
- let totalOffset = 0;
- for ( const node of this._nodes ) {
- if ( offset >= totalOffset && offset < totalOffset + node.offsetSize ) {
- return this.getNodeIndex( node );
- }
- totalOffset += node.offsetSize;
- }
- if ( totalOffset != offset ) {
- /**
- * Given offset cannot be found in the node list.
- *
- * @error model-nodelist-offset-out-of-bounds
- * @param {Number} offset
- * @param {module:engine/model/nodelist~NodeList} nodeList Stringified node list.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-nodelist-offset-out-of-bounds',
- this,
- {
- offset,
- nodeList: this
- }
- );
- }
- return this.length;
- }
- /**
- * Inserts given nodes at given index.
- *
- * @protected
- * @param {Number} index Index at which nodes should be inserted.
- * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes to be inserted.
- */
- _insertNodes( index, nodes ) {
- // Validation.
- for ( const node of nodes ) {
- if ( !( node instanceof _node__WEBPACK_IMPORTED_MODULE_0__["default"] ) ) {
- /**
- * Trying to insert an object which is not a Node instance.
- *
- * @error model-nodelist-insertnodes-not-node
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-nodelist-insertnodes-not-node', this );
- }
- }
- this._nodes.splice( index, 0, ...nodes );
- }
- /**
- * Removes one or more nodes starting at the given index.
- *
- * @protected
- * @param {Number} indexStart Index of the first node to remove.
- * @param {Number} [howMany=1] Number of nodes to remove.
- * @returns {Array.<module:engine/model/node~Node>} Array containing removed nodes.
- */
- _removeNodes( indexStart, howMany = 1 ) {
- return this._nodes.splice( indexStart, howMany );
- }
- /**
- * Converts `NodeList` instance to an array containing nodes that were inserted in the node list. Nodes
- * are also converted to their plain object representation.
- *
- * @returns {Array.<module:engine/model/node~Node>} `NodeList` instance converted to `Array`.
- */
- toJSON() {
- return this._nodes.map( node => node.toJSON() );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js":
- /*!*******************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js ***!
- \*******************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AttributeOperation; });
- /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/attributeoperation
- */
- /**
- * Operation to change nodes' attribute.
- *
- * Using this class you can add, remove or change value of the attribute.
- *
- * @extends module:engine/model/operation/operation~Operation
- */
- class AttributeOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an operation that changes, removes or adds attributes.
- *
- * If only `newValue` is set, attribute will be added on a node. Note that all nodes in operation's range must not
- * have an attribute with the same key as the added attribute.
- *
- * If only `oldValue` is set, then attribute with given key will be removed. Note that all nodes in operation's range
- * must have an attribute with that key added.
- *
- * If both `newValue` and `oldValue` are set, then the operation will change the attribute value. Note that all nodes in
- * operation's ranges must already have an attribute with given key and `oldValue` as value
- *
- * @param {module:engine/model/range~Range} range Range on which the operation should be applied. Must be a flat range.
- * @param {String} key Key of an attribute to change or remove.
- * @param {*} oldValue Old value of the attribute with given key or `null`, if attribute was not set before.
- * @param {*} newValue New value of the attribute with given key or `null`, if operation should remove attribute.
- * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
- * can be applied or `null` if the operation operates on detached (non-document) tree.
- */
- constructor( range, key, oldValue, newValue, baseVersion ) {
- super( baseVersion );
- /**
- * Range on which operation should be applied.
- *
- * @readonly
- * @member {module:engine/model/range~Range}
- */
- this.range = range.clone();
- /**
- * Key of an attribute to change or remove.
- *
- * @readonly
- * @member {String}
- */
- this.key = key;
- /**
- * Old value of the attribute with given key or `null`, if attribute was not set before.
- *
- * @readonly
- * @member {*}
- */
- this.oldValue = oldValue === undefined ? null : oldValue;
- /**
- * New value of the attribute with given key or `null`, if operation should remove attribute.
- *
- * @readonly
- * @member {*}
- */
- this.newValue = newValue === undefined ? null : newValue;
- }
- /**
- * @inheritDoc
- */
- get type() {
- if ( this.oldValue === null ) {
- return 'addAttribute';
- } else if ( this.newValue === null ) {
- return 'removeAttribute';
- } else {
- return 'changeAttribute';
- }
- }
- /**
- * Creates and returns an operation that has the same parameters as this operation.
- *
- * @returns {module:engine/model/operation/attributeoperation~AttributeOperation} Clone of this operation.
- */
- clone() {
- return new AttributeOperation( this.range, this.key, this.oldValue, this.newValue, this.baseVersion );
- }
- /**
- * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
- *
- * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}
- */
- getReversed() {
- return new AttributeOperation( this.range, this.key, this.newValue, this.oldValue, this.baseVersion + 1 );
- }
- /**
- * @inheritDoc
- */
- toJSON() {
- const json = super.toJSON();
- json.range = this.range.toJSON();
- return json;
- }
- /**
- * @inheritDoc
- */
- _validate() {
- if ( !this.range.isFlat ) {
- /**
- * The range to change is not flat.
- *
- * @error attribute-operation-range-not-flat
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'attribute-operation-range-not-flat', this );
- }
- for ( const item of this.range.getItems( { shallow: true } ) ) {
- if ( this.oldValue !== null && !Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isEqual"])( item.getAttribute( this.key ), this.oldValue ) ) {
- /**
- * Changed node has different attribute value than operation's old attribute value.
- *
- * @error attribute-operation-wrong-old-value
- * @param {module:engine/model/item~Item} item
- * @param {String} key
- * @param {*} value
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
- 'attribute-operation-wrong-old-value',
- this,
- { item, key: this.key, value: this.oldValue }
- );
- }
- if ( this.oldValue === null && this.newValue !== null && item.hasAttribute( this.key ) ) {
- /**
- * The attribute with given key already exists for the given node.
- *
- * @error attribute-operation-attribute-exists
- * @param {module:engine/model/node~Node} node
- * @param {String} key
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
- 'attribute-operation-attribute-exists',
- this,
- { node: item, key: this.key }
- );
- }
- }
- }
- /**
- * @inheritDoc
- */
- _execute() {
- // If value to set is same as old value, don't do anything.
- if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isEqual"])( this.oldValue, this.newValue ) ) {
- // Execution.
- Object(_utils__WEBPACK_IMPORTED_MODULE_3__["_setAttribute"])( this.range, this.key, this.newValue );
- }
- }
- /**
- * @inheritDoc
- */
- static get className() {
- return 'AttributeOperation';
- }
- /**
- * Creates `AttributeOperation` object from deserilized object, i.e. from parsed JSON string.
- *
- * @param {Object} json Deserialized JSON object.
- * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
- * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}
- */
- static fromJSON( json, document ) {
- return new AttributeOperation( _range__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.range, document ), json.key, json.oldValue, json.newValue, json.baseVersion );
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `AttributeOperation( ${ this.baseVersion } ): ` +
- // @if CK_DEBUG_ENGINE // `"${ this.key }": ${ JSON.stringify( this.oldValue ) }` +
- // @if CK_DEBUG_ENGINE // ` -> ${ JSON.stringify( this.newValue ) }, ${ this.range }`;
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js ***!
- \****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DetachOperation; });
- /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/detachoperation
- */
- // @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
- /**
- * Operation to permanently remove node from detached root.
- * Note this operation is only a local operation and won't be send to the other clients.
- *
- * @extends module:engine/model/operation/operation~Operation
- */
- class DetachOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an insert operation.
- *
- * @param {module:engine/model/position~Position} sourcePosition
- * Position before the first {@link module:engine/model/item~Item model item} to move.
- * @param {Number} howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at
- * `sourcePosition` with offset shifted by `howMany`.
- */
- constructor( sourcePosition, howMany ) {
- super( null );
- /**
- * Position before the first {@link module:engine/model/item~Item model item} to detach.
- *
- * @member {module:engine/model/position~Position} #sourcePosition
- */
- this.sourcePosition = sourcePosition.clone();
- /**
- * Offset size of moved range.
- *
- * @member {Number} #howMany
- */
- this.howMany = howMany;
- }
- /**
- * @inheritDoc
- */
- get type() {
- return 'detach';
- }
- /**
- * @inheritDoc
- */
- toJSON() {
- const json = super.toJSON();
- json.sourcePosition = this.sourcePosition.toJSON();
- return json;
- }
- /**
- * @inheritDoc
- */
- _validate() {
- if ( this.sourcePosition.root.document ) {
- /**
- * Cannot detach document node.
- *
- * @error detach-operation-on-document-node
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"]( 'detach-operation-on-document-node', this );
- }
- }
- /**
- * @inheritDoc
- */
- _execute() {
- Object(_utils__WEBPACK_IMPORTED_MODULE_2__["_remove"])( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( this.sourcePosition, this.howMany ) );
- }
- /**
- * @inheritDoc
- */
- static get className() {
- return 'DetachOperation';
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // const range = ModelRange._createFromPositionAndShift( this.sourcePosition, this.howMany );
- // @if CK_DEBUG_ENGINE // const nodes = Array.from( range.getItems() );
- // @if CK_DEBUG_ENGINE // const nodeString = nodes.length > 1 ? `[ ${ nodes.length } ]` : nodes[ 0 ];
- // @if CK_DEBUG_ENGINE // return `DetachOperation( ${ this.baseVersion } ): ${ nodeString } -> ${ range }`;
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js ***!
- \****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertOperation; });
- /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
- /* harmony import */ var _moveoperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/insertoperation
- */
- /**
- * Operation to insert one or more nodes at given position in the model.
- *
- * @extends module:engine/model/operation/operation~Operation
- */
- class InsertOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an insert operation.
- *
- * @param {module:engine/model/position~Position} position Position of insertion.
- * @param {module:engine/model/node~NodeSet} nodes The list of nodes to be inserted.
- * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
- * can be applied or `null` if the operation operates on detached (non-document) tree.
- */
- constructor( position, nodes, baseVersion ) {
- super( baseVersion );
- /**
- * Position of insertion.
- *
- * @readonly
- * @member {module:engine/model/position~Position} module:engine/model/operation/insertoperation~InsertOperation#position
- */
- this.position = position.clone();
- this.position.stickiness = 'toNone';
- /**
- * List of nodes to insert.
- *
- * @readonly
- * @member {module:engine/model/nodelist~NodeList} module:engine/model/operation/insertoperation~InsertOperation#nodeList
- */
- this.nodes = new _nodelist__WEBPACK_IMPORTED_MODULE_2__["default"]( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_normalizeNodes"])( nodes ) );
- /**
- * Flag deciding how the operation should be transformed. If set to `true`, nodes might get additional attributes
- * during operational transformation. This happens when the operation insertion position is inside of a range
- * where attributes have changed.
- *
- * @member {Boolean} module:engine/model/operation/insertoperation~InsertOperation#shouldReceiveAttributes
- */
- this.shouldReceiveAttributes = false;
- }
- /**
- * @inheritDoc
- */
- get type() {
- return 'insert';
- }
- /**
- * Total offset size of inserted nodes.
- *
- * @returns {Number}
- */
- get howMany() {
- return this.nodes.maxOffset;
- }
- /**
- * Creates and returns an operation that has the same parameters as this operation.
- *
- * @returns {module:engine/model/operation/insertoperation~InsertOperation} Clone of this operation.
- */
- clone() {
- const nodes = new _nodelist__WEBPACK_IMPORTED_MODULE_2__["default"]( [ ...this.nodes ].map( node => node._clone( true ) ) );
- const insert = new InsertOperation( this.position, nodes, this.baseVersion );
- insert.shouldReceiveAttributes = this.shouldReceiveAttributes;
- return insert;
- }
- /**
- * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
- *
- * @returns {module:engine/model/operation/moveoperation~MoveOperation}
- */
- getReversed() {
- const graveyard = this.position.root.document.graveyard;
- const gyPosition = new _position__WEBPACK_IMPORTED_MODULE_1__["default"]( graveyard, [ 0 ] );
- return new _moveoperation__WEBPACK_IMPORTED_MODULE_3__["default"]( this.position, this.nodes.maxOffset, gyPosition, this.baseVersion + 1 );
- }
- /**
- * @inheritDoc
- */
- _validate() {
- const targetElement = this.position.parent;
- if ( !targetElement || targetElement.maxOffset < this.position.offset ) {
- /**
- * Insertion position is invalid.
- *
- * @error insert-operation-position-invalid
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__["default"](
- 'insert-operation-position-invalid',
- this
- );
- }
- }
- /**
- * @inheritDoc
- */
- _execute() {
- // What happens here is that we want original nodes be passed to writer because we want original nodes
- // to be inserted to the model. But in InsertOperation, we want to keep those nodes as they were added
- // to the operation, not modified. For example, text nodes can get merged or cropped while Elements can
- // get children. It is important that InsertOperation has the copy of original nodes in intact state.
- const originalNodes = this.nodes;
- this.nodes = new _nodelist__WEBPACK_IMPORTED_MODULE_2__["default"]( [ ...originalNodes ].map( node => node._clone( true ) ) );
- Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_insert"])( this.position, originalNodes );
- }
- /**
- * @inheritDoc
- */
- toJSON() {
- const json = super.toJSON();
- json.position = this.position.toJSON();
- json.nodes = this.nodes.toJSON();
- return json;
- }
- /**
- * @inheritDoc
- */
- static get className() {
- return 'InsertOperation';
- }
- /**
- * Creates `InsertOperation` object from deserilized object, i.e. from parsed JSON string.
- *
- * @param {Object} json Deserialized JSON object.
- * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
- * @returns {module:engine/model/operation/insertoperation~InsertOperation}
- */
- static fromJSON( json, document ) {
- const children = [];
- for ( const child of json.nodes ) {
- if ( child.name ) {
- // If child has name property, it is an Element.
- children.push( _element__WEBPACK_IMPORTED_MODULE_6__["default"].fromJSON( child ) );
- } else {
- // Otherwise, it is a Text node.
- children.push( _text__WEBPACK_IMPORTED_MODULE_5__["default"].fromJSON( child ) );
- }
- }
- const insert = new InsertOperation( _position__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.position, document ), children, json.baseVersion );
- insert.shouldReceiveAttributes = json.shouldReceiveAttributes;
- return insert;
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // const nodeString = this.nodes.length > 1 ? `[ ${ this.nodes.length } ]` : this.nodes.getNode( 0 );
- // @if CK_DEBUG_ENGINE // return `InsertOperation( ${ this.baseVersion } ): ${ nodeString } -> ${ this.position }`;
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js ***!
- \****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MarkerOperation; });
- /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/markeroperation
- */
- /**
- * @extends module:engine/model/operation/operation~Operation
- */
- class MarkerOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @param {String} name Marker name.
- * @param {module:engine/model/range~Range} oldRange Marker range before the change.
- * @param {module:engine/model/range~Range} newRange Marker range after the change.
- * @param {module:engine/model/markercollection~MarkerCollection} markers Marker collection on which change should be executed.
- * @param {Boolean} affectsData Specifies whether the marker operation affects the data produced by the data pipeline
- * (is persisted in the editor's data).
- * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
- * can be applied or `null` if the operation operates on detached (non-document) tree.
- */
- constructor( name, oldRange, newRange, markers, affectsData, baseVersion ) {
- super( baseVersion );
- /**
- * Marker name.
- *
- * @readonly
- * @member {String}
- */
- this.name = name;
- /**
- * Marker range before the change.
- *
- * @readonly
- * @member {module:engine/model/range~Range}
- */
- this.oldRange = oldRange ? oldRange.clone() : null;
- /**
- * Marker range after the change.
- *
- * @readonly
- * @member {module:engine/model/range~Range}
- */
- this.newRange = newRange ? newRange.clone() : null;
- /**
- * Specifies whether the marker operation affects the data produced by the data pipeline
- * (is persisted in the editor's data).
- *
- * @readonly
- * @member {Boolean}
- */
- this.affectsData = affectsData;
- /**
- * Marker collection on which change should be executed.
- *
- * @private
- * @member {module:engine/model/markercollection~MarkerCollection}
- */
- this._markers = markers;
- }
- /**
- * @inheritDoc
- */
- get type() {
- return 'marker';
- }
- /**
- * Creates and returns an operation that has the same parameters as this operation.
- *
- * @returns {module:engine/model/operation/markeroperation~MarkerOperation} Clone of this operation.
- */
- clone() {
- return new MarkerOperation( this.name, this.oldRange, this.newRange, this._markers, this.affectsData, this.baseVersion );
- }
- /**
- * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
- *
- * @returns {module:engine/model/operation/markeroperation~MarkerOperation}
- */
- getReversed() {
- return new MarkerOperation( this.name, this.newRange, this.oldRange, this._markers, this.affectsData, this.baseVersion + 1 );
- }
- /**
- * @inheritDoc
- */
- _execute() {
- const type = this.newRange ? '_set' : '_remove';
- this._markers[ type ]( this.name, this.newRange, true, this.affectsData );
- }
- /**
- * @inheritDoc
- */
- toJSON() {
- const json = super.toJSON();
- if ( this.oldRange ) {
- json.oldRange = this.oldRange.toJSON();
- }
- if ( this.newRange ) {
- json.newRange = this.newRange.toJSON();
- }
- delete json._markers;
- return json;
- }
- /**
- * @inheritDoc
- */
- static get className() {
- return 'MarkerOperation';
- }
- /**
- * Creates `MarkerOperation` object from deserialized object, i.e. from parsed JSON string.
- *
- * @param {Object} json Deserialized JSON object.
- * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
- * @returns {module:engine/model/operation/markeroperation~MarkerOperation}
- */
- static fromJSON( json, document ) {
- return new MarkerOperation(
- json.name,
- json.oldRange ? _range__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.oldRange, document ) : null,
- json.newRange ? _range__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.newRange, document ) : null,
- document.model.markers,
- json.affectsData,
- json.baseVersion
- );
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `MarkerOperation( ${ this.baseVersion } ): ` +
- // @if CK_DEBUG_ENGINE // `"${ this.name }": ${ this.oldRange } -> ${ this.newRange }`;
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js ***!
- \***************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MergeOperation; });
- /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
- /* harmony import */ var _splitoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/mergeoperation
- */
- /**
- * Operation to merge two {@link module:engine/model/element~Element elements}.
- *
- * The merged element is the parent of {@link ~MergeOperation#sourcePosition} and it is merged into the parent of
- * {@link ~MergeOperation#targetPosition}. All nodes from the merged element are moved to {@link ~MergeOperation#targetPosition}.
- *
- * The merged element is moved to the graveyard at {@link ~MergeOperation#graveyardPosition}.
- *
- * @extends module:engine/model/operation/operation~Operation
- */
- class MergeOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates a merge operation.
- *
- * @param {module:engine/model/position~Position} sourcePosition Position inside the merged element. All nodes from that
- * element after that position will be moved to {@link ~#targetPosition}.
- * @param {Number} howMany Summary offset size of nodes which will be moved from the merged element to the new parent.
- * @param {module:engine/model/position~Position} targetPosition Position which the nodes from the merged elements will be moved to.
- * @param {module:engine/model/position~Position} graveyardPosition Position in graveyard to which the merged element will be moved.
- * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
- * can be applied or `null` if the operation operates on detached (non-document) tree.
- */
- constructor( sourcePosition, howMany, targetPosition, graveyardPosition, baseVersion ) {
- super( baseVersion );
- /**
- * Position inside the merged element. All nodes from that element after that position will be moved to {@link ~#targetPosition}.
- *
- * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#sourcePosition
- */
- this.sourcePosition = sourcePosition.clone();
- // This is, and should always remain, the first position in its parent.
- this.sourcePosition.stickiness = 'toPrevious';
- /**
- * Summary offset size of nodes which will be moved from the merged element to the new parent.
- *
- * @member {Number} module:engine/model/operation/mergeoperation~MergeOperation#howMany
- */
- this.howMany = howMany;
- /**
- * Position which the nodes from the merged elements will be moved to.
- *
- * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#targetPosition
- */
- this.targetPosition = targetPosition.clone();
- // Except of a rare scenario in `MergeOperation` x `MergeOperation` transformation,
- // this is, and should always remain, the last position in its parent.
- this.targetPosition.stickiness = 'toNext';
- /**
- * Position in graveyard to which the merged element will be moved.
- *
- * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#graveyardPosition
- */
- this.graveyardPosition = graveyardPosition.clone();
- }
- /**
- * @inheritDoc
- */
- get type() {
- return 'merge';
- }
- /**
- * Position before the merged element (which will be deleted).
- *
- * @readonly
- * @type {module:engine/model/position~Position}
- */
- get deletionPosition() {
- return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( this.sourcePosition.root, this.sourcePosition.path.slice( 0, -1 ) );
- }
- /**
- * Artificial range that contains all the nodes from the merged element that will be moved to {@link ~MergeOperation#sourcePosition}.
- * The range starts at {@link ~MergeOperation#sourcePosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.
- *
- * @readonly
- * @type {module:engine/model/range~Range}
- */
- get movedRange() {
- const end = this.sourcePosition.getShiftedBy( Number.POSITIVE_INFINITY );
- return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( this.sourcePosition, end );
- }
- /**
- * Creates and returns an operation that has the same parameters as this operation.
- *
- * @returns {module:engine/model/operation/mergeoperation~MergeOperation} Clone of this operation.
- */
- clone() {
- return new this.constructor( this.sourcePosition, this.howMany, this.targetPosition, this.graveyardPosition, this.baseVersion );
- }
- /**
- * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
- *
- * @returns {module:engine/model/operation/splitoperation~SplitOperation}
- */
- getReversed() {
- // Positions in this method are transformed by this merge operation because the split operation bases on
- // the context after this merge operation happened (because split operation reverses it).
- // So we need to acknowledge that the merge operation happened and those positions changed a little.
- const targetPosition = this.targetPosition._getTransformedByMergeOperation( this );
- const path = this.sourcePosition.path.slice( 0, -1 );
- const insertionPosition = new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( this.sourcePosition.root, path )._getTransformedByMergeOperation( this );
- return new _splitoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( targetPosition, this.howMany, insertionPosition, this.graveyardPosition, this.baseVersion + 1 );
- }
- /**
- * @inheritDoc
- */
- _validate() {
- const sourceElement = this.sourcePosition.parent;
- const targetElement = this.targetPosition.parent;
- // Validate whether merge operation has correct parameters.
- if ( !sourceElement.parent ) {
- /**
- * Merge source position is invalid. The element to be merged must have a parent node.
- *
- * @error merge-operation-source-position-invalid
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'merge-operation-source-position-invalid', this );
- } else if ( !targetElement.parent ) {
- /**
- * Merge target position is invalid. The element to be merged must have a parent node.
- *
- * @error merge-operation-target-position-invalid
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'merge-operation-target-position-invalid', this );
- } else if ( this.howMany != sourceElement.maxOffset ) {
- /**
- * Merge operation specifies wrong number of nodes to move.
- *
- * @error merge-operation-how-many-invalid
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'merge-operation-how-many-invalid', this );
- }
- }
- /**
- * @inheritDoc
- */
- _execute() {
- const mergedElement = this.sourcePosition.parent;
- const sourceRange = _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( mergedElement );
- Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( sourceRange, this.targetPosition );
- Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createOn( mergedElement ), this.graveyardPosition );
- }
- /**
- * @inheritDoc
- */
- toJSON() {
- const json = super.toJSON();
- json.sourcePosition = json.sourcePosition.toJSON();
- json.targetPosition = json.targetPosition.toJSON();
- json.graveyardPosition = json.graveyardPosition.toJSON();
- return json;
- }
- /**
- * @inheritDoc
- */
- static get className() {
- return 'MergeOperation';
- }
- /**
- * Creates `MergeOperation` object from deserilized object, i.e. from parsed JSON string.
- *
- * @param {Object} json Deserialized JSON object.
- * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
- * @returns {module:engine/model/operation/mergeoperation~MergeOperation}
- */
- static fromJSON( json, document ) {
- const sourcePosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.sourcePosition, document );
- const targetPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.targetPosition, document );
- const graveyardPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.graveyardPosition, document );
- return new this( sourcePosition, json.howMany, targetPosition, graveyardPosition, json.baseVersion );
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `MergeOperation( ${ this.baseVersion } ): ` +
- // @if CK_DEBUG_ENGINE // `${ this.sourcePosition } -> ${ this.targetPosition }` +
- // @if CK_DEBUG_ENGINE // ` ( ${ this.howMany } ), ${ this.graveyardPosition }`;
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js ***!
- \**************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MoveOperation; });
- /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/moveoperation
- */
- // @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
- /**
- * Operation to move a range of {@link module:engine/model/item~Item model items}
- * to given {@link module:engine/model/position~Position target position}.
- *
- * @extends module:engine/model/operation/operation~Operation
- */
- class MoveOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates a move operation.
- *
- * @param {module:engine/model/position~Position} sourcePosition
- * Position before the first {@link module:engine/model/item~Item model item} to move.
- * @param {Number} howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at
- * `sourcePosition` with offset shifted by `howMany`.
- * @param {module:engine/model/position~Position} targetPosition Position at which moved nodes will be inserted.
- * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
- * can be applied or `null` if the operation operates on detached (non-document) tree.
- */
- constructor( sourcePosition, howMany, targetPosition, baseVersion ) {
- super( baseVersion );
- /**
- * Position before the first {@link module:engine/model/item~Item model item} to move.
- *
- * @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#sourcePosition
- */
- this.sourcePosition = sourcePosition.clone();
- // `'toNext'` because `sourcePosition` is a bit like a start of the moved range.
- this.sourcePosition.stickiness = 'toNext';
- /**
- * Offset size of moved range.
- *
- * @member {Number} module:engine/model/operation/moveoperation~MoveOperation#howMany
- */
- this.howMany = howMany;
- /**
- * Position at which moved nodes will be inserted.
- *
- * @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#targetPosition
- */
- this.targetPosition = targetPosition.clone();
- this.targetPosition.stickiness = 'toNone';
- }
- /**
- * @inheritDoc
- */
- get type() {
- if ( this.targetPosition.root.rootName == '$graveyard' ) {
- return 'remove';
- } else if ( this.sourcePosition.root.rootName == '$graveyard' ) {
- return 'reinsert';
- }
- return 'move';
- }
- /**
- * Creates and returns an operation that has the same parameters as this operation.
- *
- * @returns {module:engine/model/operation/moveoperation~MoveOperation} Clone of this operation.
- */
- clone() {
- return new this.constructor( this.sourcePosition, this.howMany, this.targetPosition, this.baseVersion );
- }
- /**
- * Returns the start position of the moved range after it got moved. This may be different than
- * {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition} in some cases, i.e. when a range is moved
- * inside the same parent but {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition targetPosition}
- * is after {@link module:engine/model/operation/moveoperation~MoveOperation#sourcePosition sourcePosition}.
- *
- * vv vv
- * abcdefg ===> adefbcg
- * ^ ^
- * targetPos movedRangeStart
- * offset 6 offset 4
- *
- * @returns {module:engine/model/position~Position}
- */
- getMovedRangeStart() {
- return this.targetPosition._getTransformedByDeletion( this.sourcePosition, this.howMany );
- }
- /**
- * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
- *
- * @returns {module:engine/model/operation/moveoperation~MoveOperation}
- */
- getReversed() {
- const newTargetPosition = this.sourcePosition._getTransformedByInsertion( this.targetPosition, this.howMany );
- return new this.constructor( this.getMovedRangeStart(), this.howMany, newTargetPosition, this.baseVersion + 1 );
- }
- /**
- * @inheritDoc
- */
- _validate() {
- const sourceElement = this.sourcePosition.parent;
- const targetElement = this.targetPosition.parent;
- const sourceOffset = this.sourcePosition.offset;
- const targetOffset = this.targetPosition.offset;
- // Validate whether move operation has correct parameters.
- // Validation is pretty complex but move operation is one of the core ways to manipulate the document state.
- // We expect that many errors might be connected with one of scenarios described below.
- if ( sourceOffset + this.howMany > sourceElement.maxOffset ) {
- /**
- * The nodes which should be moved do not exist.
- *
- * @error move-operation-nodes-do-not-exist
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
- 'move-operation-nodes-do-not-exist', this
- );
- } else if ( sourceElement === targetElement && sourceOffset < targetOffset && targetOffset < sourceOffset + this.howMany ) {
- /**
- * Trying to move a range of nodes into the middle of that range.
- *
- * @error move-operation-range-into-itself
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
- 'move-operation-range-into-itself', this
- );
- } else if ( this.sourcePosition.root == this.targetPosition.root ) {
- if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_4__["default"])( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'prefix' ) {
- const i = this.sourcePosition.path.length - 1;
- if ( this.targetPosition.path[ i ] >= sourceOffset && this.targetPosition.path[ i ] < sourceOffset + this.howMany ) {
- /**
- * Trying to move a range of nodes into one of nodes from that range.
- *
- * @error move-operation-node-into-itself
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
- 'move-operation-node-into-itself', this
- );
- }
- }
- }
- }
- /**
- * @inheritDoc
- */
- _execute() {
- Object(_utils__WEBPACK_IMPORTED_MODULE_5__["_move"])( _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createFromPositionAndShift( this.sourcePosition, this.howMany ), this.targetPosition );
- }
- /**
- * @inheritDoc
- */
- toJSON() {
- const json = super.toJSON();
- json.sourcePosition = this.sourcePosition.toJSON();
- json.targetPosition = this.targetPosition.toJSON();
- return json;
- }
- /**
- * @inheritDoc
- */
- static get className() {
- return 'MoveOperation';
- }
- /**
- * Creates `MoveOperation` object from deserilized object, i.e. from parsed JSON string.
- *
- * @param {Object} json Deserialized JSON object.
- * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
- * @returns {module:engine/model/operation/moveoperation~MoveOperation}
- */
- static fromJSON( json, document ) {
- const sourcePosition = _position__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.sourcePosition, document );
- const targetPosition = _position__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.targetPosition, document );
- return new this( sourcePosition, json.howMany, targetPosition, json.baseVersion );
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // const range = ModelRange._createFromPositionAndShift( this.sourcePosition, this.howMany );
- // @if CK_DEBUG_ENGINE // return `MoveOperation( ${ this.baseVersion } ): ${ range } -> ${ this.targetPosition }`;
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NoOperation; });
- /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/nooperation
- */
- /**
- * Operation which is doing nothing ("empty operation", "do-nothing operation", "noop"). This is an operation,
- * which when executed does not change the tree model. It still has some parameters defined for transformation purposes.
- *
- * In most cases this operation is a result of transforming operations. When transformation returns
- * {@link module:engine/model/operation/nooperation~NoOperation} it means that changes done by the transformed operation
- * have already been applied.
- *
- * @extends module:engine/model/operation/operation~Operation
- */
- class NoOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
- get type() {
- return 'noop';
- }
- /**
- * Creates and returns an operation that has the same parameters as this operation.
- *
- * @returns {module:engine/model/operation/nooperation~NoOperation} Clone of this operation.
- */
- clone() {
- return new NoOperation( this.baseVersion );
- }
- /**
- * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
- *
- * @returns {module:engine/model/operation/nooperation~NoOperation}
- */
- getReversed() {
- return new NoOperation( this.baseVersion + 1 );
- }
- _execute() {
- }
- /**
- * @inheritDoc
- */
- static get className() {
- return 'NoOperation';
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `NoOperation( ${ this.baseVersion } )`;
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Operation; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/operation
- */
- /**
- * Abstract base operation class.
- *
- * @abstract
- */
- class Operation {
- /**
- * Base operation constructor.
- *
- * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
- * can be applied or `null` if the operation operates on detached (non-document) tree.
- */
- constructor( baseVersion ) {
- /**
- * {@link module:engine/model/document~Document#version} on which operation can be applied. If you try to
- * {@link module:engine/model/model~Model#applyOperation apply} operation with different base version than the
- * {@link module:engine/model/document~Document#version document version} the
- * {@link module:utils/ckeditorerror~CKEditorError model-document-applyOperation-wrong-version} error is thrown.
- *
- * @member {Number}
- */
- this.baseVersion = baseVersion;
- /**
- * Defines whether operation is executed on attached or detached {@link module:engine/model/item~Item items}.
- *
- * @readonly
- * @member {Boolean} #isDocumentOperation
- */
- this.isDocumentOperation = this.baseVersion !== null;
- /**
- * {@link module:engine/model/batch~Batch Batch} to which the operation is added or `null` if the operation is not
- * added to any batch yet.
- *
- * @member {module:engine/model/batch~Batch|null} #batch
- */
- this.batch = null;
- /**
- * Operation type.
- *
- * @readonly
- * @member {String} #type
- */
- /**
- * Creates and returns an operation that has the same parameters as this operation.
- *
- * @method #clone
- * @returns {module:engine/model/operation/operation~Operation} Clone of this operation.
- */
- /**
- * Creates and returns a reverse operation. Reverse operation when executed right after
- * the original operation will bring back tree model state to the point before the original
- * operation execution. In other words, it reverses changes done by the original operation.
- *
- * Keep in mind that tree model state may change since executing the original operation,
- * so reverse operation will be "outdated". In that case you will need to transform it by
- * all operations that were executed after the original operation.
- *
- * @method #getReversed
- * @returns {module:engine/model/operation/operation~Operation} Reversed operation.
- */
- /**
- * Executes the operation - modifications described by the operation properties will be applied to the model tree.
- *
- * @protected
- * @method #_execute
- */
- }
- /**
- * Checks whether the operation's parameters are correct and the operation can be correctly executed. Throws
- * an error if operation is not valid.
- *
- * @protected
- * @method #_validate
- */
- _validate() {
- }
- /**
- * Custom toJSON method to solve child-parent circular dependencies.
- *
- * @method #toJSON
- * @returns {Object} Clone of this object with the operation property replaced with string.
- */
- toJSON() {
- // This method creates only a shallow copy, all nested objects should be defined separately.
- // See https://github.com/ckeditor/ckeditor5-engine/issues/1477.
- const json = Object.assign( {}, this );
- json.__className = this.constructor.className;
- // Remove reference to the parent `Batch` to avoid circular dependencies.
- delete json.batch;
- // Only document operations are shared with other clients so it is not necessary to keep this information.
- delete json.isDocumentOperation;
- return json;
- }
- /**
- * Name of the operation class used for serialization.
- *
- * @type {String}
- */
- static get className() {
- return 'Operation';
- }
- /**
- * Creates Operation object from deserilized object, i.e. from parsed JSON string.
- *
- * @param {Object} json Deserialized JSON object.
- * @param {module:engine/model/document~Document} doc Document on which this operation will be applied.
- * @returns {module:engine/model/operation/operation~Operation}
- */
- static fromJSON( json ) {
- return new this( json.baseVersion );
- }
- // @if CK_DEBUG_ENGINE // log() {
- // @if CK_DEBUG_ENGINE // console.log( this.toString() );
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js":
- /*!*****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js ***!
- \*****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return OperationFactory; });
- /* harmony import */ var _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../operation/attributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js");
- /* harmony import */ var _operation_insertoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../operation/insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
- /* harmony import */ var _operation_markeroperation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operation/markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
- /* harmony import */ var _operation_moveoperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../operation/moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
- /* harmony import */ var _operation_nooperation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../operation/nooperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js");
- /* harmony import */ var _operation_operation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../operation/operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
- /* harmony import */ var _operation_renameoperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../operation/renameoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js");
- /* harmony import */ var _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../operation/rootattributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js");
- /* harmony import */ var _operation_splitoperation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../operation/splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
- /* harmony import */ var _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../operation/mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/operationfactory
- */
- const operations = {};
- operations[ _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"].className ] = _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"];
- operations[ _operation_insertoperation__WEBPACK_IMPORTED_MODULE_1__["default"].className ] = _operation_insertoperation__WEBPACK_IMPORTED_MODULE_1__["default"];
- operations[ _operation_markeroperation__WEBPACK_IMPORTED_MODULE_2__["default"].className ] = _operation_markeroperation__WEBPACK_IMPORTED_MODULE_2__["default"];
- operations[ _operation_moveoperation__WEBPACK_IMPORTED_MODULE_3__["default"].className ] = _operation_moveoperation__WEBPACK_IMPORTED_MODULE_3__["default"];
- operations[ _operation_nooperation__WEBPACK_IMPORTED_MODULE_4__["default"].className ] = _operation_nooperation__WEBPACK_IMPORTED_MODULE_4__["default"];
- operations[ _operation_operation__WEBPACK_IMPORTED_MODULE_5__["default"].className ] = _operation_operation__WEBPACK_IMPORTED_MODULE_5__["default"];
- operations[ _operation_renameoperation__WEBPACK_IMPORTED_MODULE_6__["default"].className ] = _operation_renameoperation__WEBPACK_IMPORTED_MODULE_6__["default"];
- operations[ _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_7__["default"].className ] = _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_7__["default"];
- operations[ _operation_splitoperation__WEBPACK_IMPORTED_MODULE_8__["default"].className ] = _operation_splitoperation__WEBPACK_IMPORTED_MODULE_8__["default"];
- operations[ _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_9__["default"].className ] = _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_9__["default"];
- /**
- * A factory class for creating operations.
- *
- * @abstract
- */
- class OperationFactory {
- /**
- * Creates an operation instance from a JSON object (parsed JSON string).
- *
- * @param {Object} json Deserialized JSON object.
- * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
- * @returns {module:engine/model/operation/operation~Operation}
- */
- static fromJSON( json, document ) {
- return operations[ json.__className ].fromJSON( json, document );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js ***!
- \****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RenameOperation; });
- /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/renameoperation
- */
- /**
- * Operation to change element's name.
- *
- * Using this class you can change element's name.
- *
- * @extends module:engine/model/operation/operation~Operation
- */
- class RenameOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an operation that changes element's name.
- *
- * @param {module:engine/model/position~Position} position Position before an element to change.
- * @param {String} oldName Current name of the element.
- * @param {String} newName New name for the element.
- * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
- * can be applied or `null` if the operation operates on detached (non-document) tree.
- */
- constructor( position, oldName, newName, baseVersion ) {
- super( baseVersion );
- /**
- * Position before an element to change.
- *
- * @member {module:engine/model/position~Position} module:engine/model/operation/renameoperation~RenameOperation#position
- */
- this.position = position;
- // This position sticks to the next node because it is a position before the node that we want to change.
- this.position.stickiness = 'toNext';
- /**
- * Current name of the element.
- *
- * @member {String} module:engine/model/operation/renameoperation~RenameOperation#oldName
- */
- this.oldName = oldName;
- /**
- * New name for the element.
- *
- * @member {String} module:engine/model/operation/renameoperation~RenameOperation#newName
- */
- this.newName = newName;
- }
- /**
- * @inheritDoc
- */
- get type() {
- return 'rename';
- }
- /**
- * Creates and returns an operation that has the same parameters as this operation.
- *
- * @returns {module:engine/model/operation/renameoperation~RenameOperation} Clone of this operation.
- */
- clone() {
- return new RenameOperation( this.position.clone(), this.oldName, this.newName, this.baseVersion );
- }
- /**
- * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
- *
- * @returns {module:engine/model/operation/renameoperation~RenameOperation}
- */
- getReversed() {
- return new RenameOperation( this.position.clone(), this.newName, this.oldName, this.baseVersion + 1 );
- }
- /**
- * @inheritDoc
- */
- _validate() {
- const element = this.position.nodeAfter;
- if ( !( element instanceof _element__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
- /**
- * Given position is invalid or node after it is not instance of Element.
- *
- * @error rename-operation-wrong-position
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
- 'rename-operation-wrong-position',
- this
- );
- } else if ( element.name !== this.oldName ) {
- /**
- * Element to change has different name than operation's old name.
- *
- * @error rename-operation-wrong-name
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
- 'rename-operation-wrong-name',
- this
- );
- }
- }
- /**
- * @inheritDoc
- */
- _execute() {
- const element = this.position.nodeAfter;
- element.name = this.newName;
- }
- /**
- * @inheritDoc
- */
- toJSON() {
- const json = super.toJSON();
- json.position = this.position.toJSON();
- return json;
- }
- /**
- * @inheritDoc
- */
- static get className() {
- return 'RenameOperation';
- }
- /**
- * Creates `RenameOperation` object from deserialized object, i.e. from parsed JSON string.
- *
- * @param {Object} json Deserialized JSON object.
- * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
- * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}
- */
- static fromJSON( json, document ) {
- return new RenameOperation( _position__WEBPACK_IMPORTED_MODULE_3__["default"].fromJSON( json.position, document ), json.oldName, json.newName, json.baseVersion );
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `RenameOperation( ${ this.baseVersion } ): ` +
- // @if CK_DEBUG_ENGINE // `${ this.position }: "${ this.oldName }" -> "${ this.newName }"`;
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js":
- /*!***********************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js ***!
- \***********************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RootAttributeOperation; });
- /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/rootattributeoperation
- */
- /**
- * Operation to change root element's attribute. Using this class you can add, remove or change value of the attribute.
- *
- * This operation is needed, because root elements can't be changed through
- * @link module:engine/model/operation/attributeoperation~AttributeOperation}.
- * It is because {@link module:engine/model/operation/attributeoperation~AttributeOperation}
- * requires a range to change and root element can't
- * be a part of range because every {@link module:engine/model/position~Position} has to be inside a root.
- * {@link module:engine/model/position~Position} can't be created before a root element.
- *
- * @extends module:engine/model/operation/operation~Operation
- */
- class RootAttributeOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an operation that changes, removes or adds attributes on root element.
- *
- * @see module:engine/model/operation/attributeoperation~AttributeOperation
- * @param {module:engine/model/rootelement~RootElement} root Root element to change.
- * @param {String} key Key of an attribute to change or remove.
- * @param {*} oldValue Old value of the attribute with given key or `null` if adding a new attribute.
- * @param {*} newValue New value to set for the attribute. If `null`, then the operation just removes the attribute.
- * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
- * can be applied or `null` if the operation operates on detached (non-document) tree.
- */
- constructor( root, key, oldValue, newValue, baseVersion ) {
- super( baseVersion );
- /**
- * Root element to change.
- *
- * @readonly
- * @member {module:engine/model/rootelement~RootElement}
- */
- this.root = root;
- /**
- * Key of an attribute to change or remove.
- *
- * @readonly
- * @member {String}
- */
- this.key = key;
- /**
- * Old value of the attribute with given key or `null` if adding a new attribute.
- *
- * @readonly
- * @member {*}
- */
- this.oldValue = oldValue;
- /**
- * New value to set for the attribute. If `null`, then the operation just removes the attribute.
- *
- * @readonly
- * @member {*}
- */
- this.newValue = newValue;
- }
- /**
- * @inheritDoc
- */
- get type() {
- if ( this.oldValue === null ) {
- return 'addRootAttribute';
- } else if ( this.newValue === null ) {
- return 'removeRootAttribute';
- } else {
- return 'changeRootAttribute';
- }
- }
- /**
- * Creates and returns an operation that has the same parameters as this operation.
- *
- * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation} Clone of this operation.
- */
- clone() {
- return new RootAttributeOperation( this.root, this.key, this.oldValue, this.newValue, this.baseVersion );
- }
- /**
- * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
- *
- * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}
- */
- getReversed() {
- return new RootAttributeOperation( this.root, this.key, this.newValue, this.oldValue, this.baseVersion + 1 );
- }
- /**
- * @inheritDoc
- */
- _validate() {
- if ( this.root != this.root.root || this.root.is( 'documentFragment' ) ) {
- /**
- * The element to change is not a root element.
- *
- * @error rootattribute-operation-not-a-root
- * @param {module:engine/model/rootelement~RootElement} root
- * @param {String} key
- * @param {*} value
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
- 'rootattribute-operation-not-a-root',
- this,
- { root: this.root, key: this.key }
- );
- }
- if ( this.oldValue !== null && this.root.getAttribute( this.key ) !== this.oldValue ) {
- /**
- * The attribute which should be removed does not exists for the given node.
- *
- * @error rootattribute-operation-wrong-old-value
- * @param {module:engine/model/rootelement~RootElement} root
- * @param {String} key
- * @param {*} value
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
- 'rootattribute-operation-wrong-old-value',
- this,
- { root: this.root, key: this.key }
- );
- }
- if ( this.oldValue === null && this.newValue !== null && this.root.hasAttribute( this.key ) ) {
- /**
- * The attribute with given key already exists for the given node.
- *
- * @error rootattribute-operation-attribute-exists
- * @param {module:engine/model/rootelement~RootElement} root
- * @param {String} key
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
- 'rootattribute-operation-attribute-exists',
- this,
- { root: this.root, key: this.key }
- );
- }
- }
- /**
- * @inheritDoc
- */
- _execute() {
- if ( this.newValue !== null ) {
- this.root._setAttribute( this.key, this.newValue );
- } else {
- this.root._removeAttribute( this.key );
- }
- }
- /**
- * @inheritDoc
- */
- toJSON() {
- const json = super.toJSON();
- json.root = this.root.toJSON();
- return json;
- }
- /**
- * @inheritDoc
- */
- static get className() {
- return 'RootAttributeOperation';
- }
- /**
- * Creates RootAttributeOperation object from deserilized object, i.e. from parsed JSON string.
- *
- * @param {Object} json Deserialized JSON object.
- * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
- * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}
- */
- static fromJSON( json, document ) {
- if ( !document.getRoot( json.root ) ) {
- /**
- * Cannot create RootAttributeOperation for document. Root with specified name does not exist.
- *
- * @error rootattribute-operation-fromjson-no-root
- * @param {String} rootName
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'rootattribute-operation-fromjson-no-root', this, { rootName: json.root } );
- }
- return new RootAttributeOperation( document.getRoot( json.root ), json.key, json.oldValue, json.newValue, json.baseVersion );
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `RootAttributeOperation( ${ this.baseVersion } ): ` +
- // @if CK_DEBUG_ENGINE // `"${ this.key }": ${ JSON.stringify( this.oldValue ) }` +
- // @if CK_DEBUG_ENGINE // ` -> ${ JSON.stringify( this.newValue ) }, ${ this.root.rootName }`;
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js ***!
- \***************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SplitOperation; });
- /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
- /* harmony import */ var _mergeoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/splitoperation
- */
- /**
- * Operation to split {@link module:engine/model/element~Element an element} at given
- * {@link module:engine/model/operation/splitoperation~SplitOperation#splitPosition split position} into two elements,
- * both containing a part of the element's original content.
- *
- * @extends module:engine/model/operation/operation~Operation
- */
- class SplitOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates a split operation.
- *
- * @param {module:engine/model/position~Position} splitPosition Position at which an element should be split.
- * @param {Number} howMany Total offset size of elements that are in the split element after `position`.
- * @param {module:engine/model/position~Position} insertionPosition Position at which the clone of split element
- * (or element from graveyard) will be inserted.
- * @param {module:engine/model/position~Position|null} graveyardPosition Position in the graveyard root before the element which
- * should be used as a parent of the nodes after `position`. If it is not set, a copy of the the `position` parent will be used.
- * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
- * can be applied or `null` if the operation operates on detached (non-document) tree.
- */
- constructor( splitPosition, howMany, insertionPosition, graveyardPosition, baseVersion ) {
- super( baseVersion );
- /**
- * Position at which an element should be split.
- *
- * @member {module:engine/model/position~Position} module:engine/model/operation/splitoperation~SplitOperation#splitPosition
- */
- this.splitPosition = splitPosition.clone();
- // Keep position sticking to the next node. This way any new content added at the place where the element is split
- // will be left in the original element.
- this.splitPosition.stickiness = 'toNext';
- /**
- * Total offset size of elements that are in the split element after `position`.
- *
- * @member {Number} module:engine/model/operation/splitoperation~SplitOperation#howMany
- */
- this.howMany = howMany;
- /**
- * Position at which the clone of split element (or element from graveyard) will be inserted.
- *
- * @member {module:engine/model/position~Position} module:engine/model/operation/splitoperation~SplitOperation#insertionPosition
- */
- this.insertionPosition = insertionPosition;
- /**
- * Position in the graveyard root before the element which should be used as a parent of the nodes after `position`.
- * If it is not set, a copy of the the `position` parent will be used.
- *
- * The default behavior is to clone the split element. Element from graveyard is used during undo.
- *
- * @member {module:engine/model/position~Position|null} #graveyardPosition
- */
- this.graveyardPosition = graveyardPosition ? graveyardPosition.clone() : null;
- if ( this.graveyardPosition ) {
- this.graveyardPosition.stickiness = 'toNext';
- }
- }
- /**
- * @inheritDoc
- */
- get type() {
- return 'split';
- }
- /**
- * Position inside the new clone of a split element.
- *
- * This is a position where nodes that are after the split position will be moved to.
- *
- * @readonly
- * @type {module:engine/model/position~Position}
- */
- get moveTargetPosition() {
- const path = this.insertionPosition.path.slice();
- path.push( 0 );
- return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( this.insertionPosition.root, path );
- }
- /**
- * Artificial range that contains all the nodes from the split element that will be moved to the new element.
- * The range starts at {@link ~#splitPosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.
- *
- * @readonly
- * @type {module:engine/model/range~Range}
- */
- get movedRange() {
- const end = this.splitPosition.getShiftedBy( Number.POSITIVE_INFINITY );
- return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( this.splitPosition, end );
- }
- /**
- * Creates and returns an operation that has the same parameters as this operation.
- *
- * @returns {module:engine/model/operation/splitoperation~SplitOperation} Clone of this operation.
- */
- clone() {
- return new this.constructor( this.splitPosition, this.howMany, this.insertionPosition, this.graveyardPosition, this.baseVersion );
- }
- /**
- * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
- *
- * @returns {module:engine/model/operation/mergeoperation~MergeOperation}
- */
- getReversed() {
- const graveyard = this.splitPosition.root.document.graveyard;
- const graveyardPosition = new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( graveyard, [ 0 ] );
- return new _mergeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( this.moveTargetPosition, this.howMany, this.splitPosition, graveyardPosition, this.baseVersion + 1 );
- }
- /**
- * @inheritDoc
- */
- _validate() {
- const element = this.splitPosition.parent;
- const offset = this.splitPosition.offset;
- // Validate whether split operation has correct parameters.
- if ( !element || element.maxOffset < offset ) {
- /**
- * Split position is invalid.
- *
- * @error split-operation-position-invalid
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-position-invalid', this );
- } else if ( !element.parent ) {
- /**
- * Cannot split root element.
- *
- * @error split-operation-split-in-root
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-split-in-root', this );
- } else if ( this.howMany != element.maxOffset - this.splitPosition.offset ) {
- /**
- * Split operation specifies wrong number of nodes to move.
- *
- * @error split-operation-how-many-invalid
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-how-many-invalid', this );
- } else if ( this.graveyardPosition && !this.graveyardPosition.nodeAfter ) {
- /**
- * Graveyard position invalid.
- *
- * @error split-operation-graveyard-position-invalid
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-graveyard-position-invalid', this );
- }
- }
- /**
- * @inheritDoc
- */
- _execute() {
- const splitElement = this.splitPosition.parent;
- if ( this.graveyardPosition ) {
- Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createFromPositionAndShift( this.graveyardPosition, 1 ), this.insertionPosition );
- } else {
- const newElement = splitElement._clone();
- Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_insert"])( this.insertionPosition, newElement );
- }
- const sourceRange = new _range__WEBPACK_IMPORTED_MODULE_3__["default"](
- _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( splitElement, this.splitPosition.offset ),
- _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( splitElement, splitElement.maxOffset )
- );
- Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( sourceRange, this.moveTargetPosition );
- }
- /**
- * @inheritDoc
- */
- toJSON() {
- const json = super.toJSON();
- json.splitPosition = this.splitPosition.toJSON();
- json.insertionPosition = this.insertionPosition.toJSON();
- if ( this.graveyardPosition ) {
- json.graveyardPosition = this.graveyardPosition.toJSON();
- }
- return json;
- }
- /**
- * @inheritDoc
- */
- static get className() {
- return 'SplitOperation';
- }
- /**
- * Helper function that returns a default insertion position basing on given `splitPosition`. The default insertion
- * position is after the split element.
- *
- * @param {module:engine/model/position~Position} splitPosition
- * @returns {module:engine/model/position~Position}
- */
- static getInsertionPosition( splitPosition ) {
- const path = splitPosition.path.slice( 0, -1 );
- path[ path.length - 1 ]++;
- return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( splitPosition.root, path, 'toPrevious' );
- }
- /**
- * Creates `SplitOperation` object from deserilized object, i.e. from parsed JSON string.
- *
- * @param {Object} json Deserialized JSON object.
- * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
- * @returns {module:engine/model/operation/splitoperation~SplitOperation}
- */
- static fromJSON( json, document ) {
- const splitPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.splitPosition, document );
- const insertionPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.insertionPosition, document );
- const graveyardPosition = json.graveyardPosition ? _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.graveyardPosition, document ) : null;
- return new this( splitPosition, json.howMany, insertionPosition, graveyardPosition, json.baseVersion );
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `SplitOperation( ${ this.baseVersion } ): ${ this.splitPosition } ` +
- // @if CK_DEBUG_ENGINE // `( ${ this.howMany } ) -> ${ this.insertionPosition }` +
- // @if CK_DEBUG_ENGINE // `${ this.graveyardPosition ? ' with ' + this.graveyardPosition : '' }`;
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js ***!
- \**********************************************************************************/
- /*! exports provided: transform, transformSets */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return transform; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformSets", function() { return transformSets; });
- /* harmony import */ var _insertoperation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
- /* harmony import */ var _attributeoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./attributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js");
- /* harmony import */ var _renameoperation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./renameoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js");
- /* harmony import */ var _markeroperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
- /* harmony import */ var _moveoperation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
- /* harmony import */ var _rootattributeoperation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rootattributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js");
- /* harmony import */ var _mergeoperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
- /* harmony import */ var _splitoperation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
- /* harmony import */ var _nooperation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./nooperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- const transformations = new Map();
- /**
- * @module engine/model/operation/transform
- */
- /**
- * Sets a transformation function to be be used to transform instances of class `OperationA` by instances of class `OperationB`.
- *
- * The `transformationFunction` is passed three parameters:
- *
- * * `a` - operation to be transformed, an instance of `OperationA`,
- * * `b` - operation to be transformed by, an instance of `OperationB`,
- * * {@link module:engine/model/operation/transform~TransformationContext `context`} - object with additional information about
- * transformation context.
- *
- * The `transformationFunction` should return transformation result, which is an array with one or multiple
- * {@link module:engine/model/operation/operation~Operation operation} instances.
- *
- * @protected
- * @param {Function} OperationA
- * @param {Function} OperationB
- * @param {Function} transformationFunction Function to use for transforming.
- */
- function setTransformation( OperationA, OperationB, transformationFunction ) {
- let aGroup = transformations.get( OperationA );
- if ( !aGroup ) {
- aGroup = new Map();
- transformations.set( OperationA, aGroup );
- }
- aGroup.set( OperationB, transformationFunction );
- }
- /**
- * Returns a previously set transformation function for transforming an instance of `OperationA` by an instance of `OperationB`.
- *
- * If no transformation was set for given pair of operations, {@link module:engine/model/operation/transform~noUpdateTransformation}
- * is returned. This means that if no transformation was set, the `OperationA` instance will not change when transformed
- * by the `OperationB` instance.
- *
- * @private
- * @param {Function} OperationA
- * @param {Function} OperationB
- * @returns {Function} Function set to transform an instance of `OperationA` by an instance of `OperationB`.
- */
- function getTransformation( OperationA, OperationB ) {
- const aGroup = transformations.get( OperationA );
- if ( aGroup && aGroup.has( OperationB ) ) {
- return aGroup.get( OperationB );
- }
- return noUpdateTransformation;
- }
- /**
- * A transformation function that only clones operation to transform, without changing it.
- *
- * @private
- * @param {module:engine/model/operation/operation~Operation} a Operation to transform.
- * @returns {Array.<module:engine/model/operation/operation~Operation>}
- */
- function noUpdateTransformation( a ) {
- return [ a ];
- }
- /**
- * Transforms operation `a` by operation `b`.
- *
- * @param {module:engine/model/operation/operation~Operation} a Operation to be transformed.
- * @param {module:engine/model/operation/operation~Operation} b Operation to transform by.
- * @param {module:engine/model/operation/transform~TransformationContext} context Transformation context for this transformation.
- * @returns {Array.<module:engine/model/operation/operation~Operation>} Transformation result.
- */
- function transform( a, b, context = {} ) {
- const transformationFunction = getTransformation( a.constructor, b.constructor );
- /* eslint-disable no-useless-catch */
- try {
- a = a.clone();
- return transformationFunction( a, b, context );
- } catch ( e ) {
- // @if CK_DEBUG // console.warn( 'Error during operation transformation!', e.message );
- // @if CK_DEBUG // console.warn( 'Transformed operation', a );
- // @if CK_DEBUG // console.warn( 'Operation transformed by', b );
- // @if CK_DEBUG // console.warn( 'context.aIsStrong', context.aIsStrong );
- // @if CK_DEBUG // console.warn( 'context.aWasUndone', context.aWasUndone );
- // @if CK_DEBUG // console.warn( 'context.bWasUndone', context.bWasUndone );
- // @if CK_DEBUG // console.warn( 'context.abRelation', context.abRelation );
- // @if CK_DEBUG // console.warn( 'context.baRelation', context.baRelation );
- throw e;
- }
- /* eslint-enable no-useless-catch */
- }
- /**
- * Performs a transformation of two sets of operations - `operationsA` and `operationsB`. The transformation is two-way -
- * both transformed `operationsA` and transformed `operationsB` are returned.
- *
- * Note, that the first operation in each set should base on the same document state (
- * {@link module:engine/model/document~Document#version document version}).
- *
- * It is assumed that `operationsA` are "more important" during conflict resolution between two operations.
- *
- * New copies of both passed arrays and operations inside them are returned. Passed arguments are not altered.
- *
- * Base versions of the transformed operations sets are updated accordingly. For example, assume that base versions are `4`
- * and there are `3` operations in `operationsA` and `5` operations in `operationsB`. Then:
- *
- * * transformed `operationsA` will start from base version `9` (`4` base version + `5` operations B),
- * * transformed `operationsB` will start from base version `7` (`4` base version + `3` operations A).
- *
- * If no operation was broken into two during transformation, then both sets will end up with an operation that bases on version `11`:
- *
- * * transformed `operationsA` start from `9` and there are `3` of them, so the last will have `baseVersion` equal to `11`,
- * * transformed `operationsB` start from `7` and there are `5` of them, so the last will have `baseVersion` equal to `11`.
- *
- * @param {Array.<module:engine/model/operation/operation~Operation>} operationsA
- * @param {Array.<module:engine/model/operation/operation~Operation>} operationsB
- * @param {Object} options Additional transformation options.
- * @param {module:engine/model/document~Document|null} options.document Document which the operations change.
- * @param {Boolean} [options.useRelations=false] Whether during transformation relations should be used (used during undo for
- * better conflict resolution).
- * @param {Boolean} [options.padWithNoOps=false] Whether additional {@link module:engine/model/operation/nooperation~NoOperation}s
- * should be added to the transformation results to force the same last base version for both transformed sets (in case
- * if some operations got broken into multiple operations during transformation).
- * @returns {Object} Transformation result.
- * @returns {Array.<module:engine/model/operation/operation~Operation>} return.operationsA Transformed `operationsA`.
- * @returns {Array.<module:engine/model/operation/operation~Operation>} return.operationsB Transformed `operationsB`.
- * @returns {Map} return.originalOperations A map that links transformed operations to original operations. The keys are the transformed
- * operations and the values are the original operations from the input (`operationsA` and `operationsB`).
- */
- function transformSets( operationsA, operationsB, options ) {
- // Create new arrays so the originally passed arguments are not changed.
- // No need to clone operations, they are cloned as they are transformed.
- operationsA = operationsA.slice();
- operationsB = operationsB.slice();
- const contextFactory = new ContextFactory( options.document, options.useRelations, options.forceWeakRemove );
- contextFactory.setOriginalOperations( operationsA );
- contextFactory.setOriginalOperations( operationsB );
- const originalOperations = contextFactory.originalOperations;
- // If one of sets is empty there is simply nothing to transform, so return sets as they are.
- if ( operationsA.length == 0 || operationsB.length == 0 ) {
- return { operationsA, operationsB, originalOperations };
- }
- //
- // Following is a description of transformation process:
- //
- // There are `operationsA` and `operationsB` to be transformed, both by both.
- //
- // So, suppose we have sets of two operations each: `operationsA` = `[ a1, a2 ]`, `operationsB` = `[ b1, b2 ]`.
- //
- // Remember, that we can only transform operations that base on the same context. We assert that `a1` and `b1` base on
- // the same context and we transform them. Then, we get `a1'` and `b1'`. `a2` bases on a context with `a1` -- `a2`
- // is an operation that followed `a1`. Similarly, `b2` bases on a context with `b1`.
- //
- // However, since `a1'` is a result of transformation by `b1`, `a1'` now also has a context with `b1`. This means that
- // we can safely transform `a1'` by `b2`. As we finish transforming `a1`, we also transformed all `operationsB`.
- // All `operationsB` also have context including `a1`. Now, we can properly transform `a2` by those operations.
- //
- // The transformation process can be visualized on a transformation diagram ("diamond diagram"):
- //
- // [the initial state]
- // [common for a1 and b1]
- //
- // *
- // / \
- // / \
- // b1 a1
- // / \
- // / \
- // * *
- // / \ / \
- // / \ / \
- // b2 a1' b1' a2
- // / \ / \
- // / \ / \
- // * * *
- // \ / \ /
- // \ / \ /
- // a1'' b2' a2' b1''
- // \ / \ /
- // \ / \ /
- // * *
- // \ /
- // \ /
- // a2'' b2''
- // \ /
- // \ /
- // *
- //
- // [the final state]
- //
- // The final state can be reached from the initial state by applying `a1`, `a2`, `b1''` and `b2''`, as well as by
- // applying `b1`, `b2`, `a1''`, `a2''`. Note how the operations get to a proper common state before each pair is
- // transformed.
- //
- // Another thing to consider is that an operation during transformation can be broken into multiple operations.
- // Suppose that `a1` * `b1` = `[ a11', a12' ]` (instead of `a1'` that we considered previously).
- //
- // In that case, we leave `a12'` for later and we continue transforming `a11'` until it is transformed by all `operationsB`
- // (in our case it is just `b2`). At this point, `b1` is transformed by "whole" `a1`, while `b2` is only transformed
- // by `a11'`. Similarly, `a12'` is only transformed by `b1`. This leads to a conclusion that we need to start transforming `a12'`
- // from the moment just after it was broken. So, `a12'` is transformed by `b2`. Now, "the whole" `a1` is transformed
- // by `operationsB`, while all `operationsB` are transformed by "the whole" `a1`. This means that we can continue with
- // following `operationsA` (in our case it is just `a2`).
- //
- // Of course, also `operationsB` can be broken. However, since we focus on transforming operation `a` to the end,
- // the only thing to do is to store both pieces of operation `b`, so that the next transformed operation `a` will
- // be transformed by both of them.
- //
- // *
- // / \
- // / \
- // / \
- // b1 a1
- // / \
- // / \
- // / \
- // * *
- // / \ / \
- // / a11' / \
- // / \ / \
- // b2 * b1' a2
- // / / \ / \
- // / / a12' / \
- // / / \ / \
- // * b2' * *
- // \ / / \ /
- // a11'' / b21'' \ /
- // \ / / \ /
- // * * a2' b1''
- // \ / \ \ /
- // a12'' b22''\ \ /
- // \ / \ \ /
- // * a2'' *
- // \ \ /
- // \ \ b21'''
- // \ \ /
- // a2''' *
- // \ /
- // \ b22'''
- // \ /
- // *
- //
- // Note, how `a1` is broken and transformed into `a11'` and `a12'`, while `b2'` got broken and transformed into `b21''` and `b22''`.
- //
- // Having all that on mind, here is an outline for the transformation process algorithm:
- //
- // 1. We have `operationsA` and `operationsB` array, which we dynamically update as the transformation process goes.
- //
- // 2. We take next (or first) operation from `operationsA` and check from which operation `b` we need to start transforming it.
- // All original `operationsA` are set to be transformed starting from the first operation `b`.
- //
- // 3. We take operations from `operationsB`, one by one, starting from the correct one, and transform operation `a`
- // by operation `b` (and vice versa). We update `operationsA` and `operationsB` by replacing the original operations
- // with the transformation results.
- //
- // 4. If operation is broken into multiple operations, we save all the new operations in the place of the
- // original operation.
- //
- // 5. Additionally, if operation `a` was broken, for the "new" operation, we remember from which operation `b` it should
- // be transformed by.
- //
- // 6. We continue transforming "current" operation `a` until it is transformed by all `operationsB`. Then, go to 2.
- // unless the last operation `a` was transformed.
- //
- // The actual implementation of the above algorithm is slightly different, as only one loop (while) is used.
- // The difference is that we have "current" `a` operation to transform and we store the index of the next `b` operation
- // to transform by. Each loop operates on two indexes then: index pointing to currently processed `a` operation and
- // index pointing to next `b` operation. Each loop is just one `a * b` + `b * a` transformation. After each loop
- // operation `b` index is updated. If all `b` operations were visited for the current `a` operation, we change
- // current `a` operation index to the next one.
- //
- // For each operation `a`, keeps information what is the index in `operationsB` from which the transformation should start.
- const nextTransformIndex = new WeakMap();
- // For all the original `operationsA`, set that they should be transformed starting from the first of `operationsB`.
- for ( const op of operationsA ) {
- nextTransformIndex.set( op, 0 );
- }
- // Additional data that is used for some postprocessing after the main transformation process is done.
- const data = {
- nextBaseVersionA: operationsA[ operationsA.length - 1 ].baseVersion + 1,
- nextBaseVersionB: operationsB[ operationsB.length - 1 ].baseVersion + 1,
- originalOperationsACount: operationsA.length,
- originalOperationsBCount: operationsB.length
- };
- // Index of currently transformed operation `a`.
- let i = 0;
- // While not all `operationsA` are transformed...
- while ( i < operationsA.length ) {
- // Get "current" operation `a`.
- const opA = operationsA[ i ];
- // For the "current" operation `a`, get the index of the next operation `b` to transform by.
- const indexB = nextTransformIndex.get( opA );
- // If operation `a` was already transformed by every operation `b`, change "current" operation `a` to the next one.
- if ( indexB == operationsB.length ) {
- i++;
- continue;
- }
- const opB = operationsB[ indexB ];
- // Transform `a` by `b` and `b` by `a`.
- const newOpsA = transform( opA, opB, contextFactory.getContext( opA, opB, true ) );
- const newOpsB = transform( opB, opA, contextFactory.getContext( opB, opA, false ) );
- // As a result we get one or more `newOpsA` and one or more `newOpsB` operations.
- // Update contextual information about operations.
- contextFactory.updateRelation( opA, opB );
- contextFactory.setOriginalOperations( newOpsA, opA );
- contextFactory.setOriginalOperations( newOpsB, opB );
- // For new `a` operations, update their index of the next operation `b` to transform them by.
- //
- // This is needed even if there was only one result (`a` was not broken) because that information is used
- // at the beginning of this loop every time.
- for ( const newOpA of newOpsA ) {
- // Acknowledge, that operation `b` also might be broken into multiple operations.
- //
- // This is why we raise `indexB` not just by 1. If `newOpsB` are multiple operations, they will be
- // spliced in the place of `opB`. So we need to change `transformBy` accordingly, so that an operation won't
- // be transformed by the same operation (part of it) again.
- nextTransformIndex.set( newOpA, indexB + newOpsB.length );
- }
- // Update `operationsA` and `operationsB` with the transformed versions.
- operationsA.splice( i, 1, ...newOpsA );
- operationsB.splice( indexB, 1, ...newOpsB );
- }
- if ( options.padWithNoOps ) {
- // If no-operations padding is enabled, count how many extra `a` and `b` operations were generated.
- const brokenOperationsACount = operationsA.length - data.originalOperationsACount;
- const brokenOperationsBCount = operationsB.length - data.originalOperationsBCount;
- // Then, if that number is not the same, pad `operationsA` or `operationsB` with correct number of no-ops so
- // that the base versions are equalled.
- //
- // Note that only one array will be updated, as only one of those subtractions can be greater than zero.
- padWithNoOps( operationsA, brokenOperationsBCount - brokenOperationsACount );
- padWithNoOps( operationsB, brokenOperationsACount - brokenOperationsBCount );
- }
- // Finally, update base versions of transformed operations.
- updateBaseVersions( operationsA, data.nextBaseVersionB );
- updateBaseVersions( operationsB, data.nextBaseVersionA );
- return { operationsA, operationsB, originalOperations };
- }
- // Gathers additional data about operations processed during transformation. Can be used to obtain contextual information
- // about two operations that are about to be transformed. This contextual information can be used for better conflict resolution.
- class ContextFactory {
- // Creates `ContextFactory` instance.
- //
- // @param {module:engine/model/document~Document} document Document which the operations change.
- // @param {Boolean} useRelations Whether during transformation relations should be used (used during undo for
- // better conflict resolution).
- // @param {Boolean} [forceWeakRemove=false] If set to `false`, remove operation will be always stronger than move operation,
- // so the removed nodes won't end up back in the document root. When set to `true`, context data will be used.
- constructor( document, useRelations, forceWeakRemove = false ) {
- // For each operation that is created during transformation process, we keep a reference to the original operation
- // which it comes from. The original operation works as a kind of "identifier". Every contextual information
- // gathered during transformation that we want to save for given operation, is actually saved for the original operation.
- // This way no matter if operation `a` is cloned, then transformed, even breaks, we still have access to the previously
- // gathered data through original operation reference.
- this.originalOperations = new Map();
- // `model.History` instance which information about undone operations will be taken from.
- this._history = document.history;
- // Whether additional context should be used.
- this._useRelations = useRelations;
- this._forceWeakRemove = !!forceWeakRemove;
- // Relations is a double-map structure (maps in map) where for two operations we store how those operations were related
- // to each other. Those relations are evaluated during transformation process. For every transformated pair of operations
- // we keep relations between them.
- this._relations = new Map();
- }
- // Sets "original operation" for given operations.
- //
- // During transformation process, operations are cloned, then changed, then processed again, sometimes broken into two
- // or multiple operations. When gathering additional data it is important that all operations can be somehow linked
- // so a cloned and transformed "version" still kept track of the data assigned earlier to it.
- //
- // The original operation object will be used as such an universal linking id. Throughout the transformation process
- // all cloned operations will refer to "the original operation" when storing and reading additional data.
- //
- // If `takeFrom` is not set, each operation from `operations` array will be assigned itself as "the original operation".
- // This should be used as an initialization step.
- //
- // If `takeFrom` is set, each operation from `operations` will be assigned the same original operation as assigned
- // for `takeFrom` operation. This should be used to update original operations. It should be used in a way that
- // `operations` are the result of `takeFrom` transformation to ensure proper "original operation propagation".
- //
- // @param {Array.<module:engine/model/operation/operation~Operation>} operations
- // @param {module:engine/model/operation/operation~Operation|null} [takeFrom=null]
- setOriginalOperations( operations, takeFrom = null ) {
- const originalOperation = takeFrom ? this.originalOperations.get( takeFrom ) : null;
- for ( const operation of operations ) {
- this.originalOperations.set( operation, originalOperation || operation );
- }
- }
- // Saves a relation between operations `opA` and `opB`.
- //
- // Relations are then later used to help solve conflicts when operations are transformed.
- //
- // @param {module:engine/model/operation/operation~Operation} opA
- // @param {module:engine/model/operation/operation~Operation} opB
- updateRelation( opA, opB ) {
- // The use of relations is described in a bigger detail in transformation functions.
- //
- // In brief, this function, for specified pairs of operation types, checks how positions defined in those operations relate.
- // Then those relations are saved. For example, for two move operations, it is saved if one of those operations target
- // position is before the other operation source position. This kind of information gives contextual information when
- // transformation is used during undo. Similar checks are done for other pairs of operations.
- //
- switch ( opA.constructor ) {
- case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
- switch ( opB.constructor ) {
- case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
- if ( opA.targetPosition.isEqual( opB.sourcePosition ) || opB.movedRange.containsPosition( opA.targetPosition ) ) {
- this._setRelation( opA, opB, 'insertAtSource' );
- } else if ( opA.targetPosition.isEqual( opB.deletionPosition ) ) {
- this._setRelation( opA, opB, 'insertBetween' );
- } else if ( opA.targetPosition.isAfter( opB.sourcePosition ) ) {
- this._setRelation( opA, opB, 'moveTargetAfter' );
- }
- break;
- }
- case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
- if ( opA.targetPosition.isEqual( opB.sourcePosition ) || opA.targetPosition.isBefore( opB.sourcePosition ) ) {
- this._setRelation( opA, opB, 'insertBefore' );
- } else {
- this._setRelation( opA, opB, 'insertAfter' );
- }
- break;
- }
- }
- break;
- }
- case _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]: {
- switch ( opB.constructor ) {
- case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
- if ( opA.splitPosition.isBefore( opB.sourcePosition ) ) {
- this._setRelation( opA, opB, 'splitBefore' );
- }
- break;
- }
- case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
- if ( opA.splitPosition.isEqual( opB.sourcePosition ) || opA.splitPosition.isBefore( opB.sourcePosition ) ) {
- this._setRelation( opA, opB, 'splitBefore' );
- } else {
- const range = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( opB.sourcePosition, opB.howMany );
- if ( opA.splitPosition.hasSameParentAs( opB.sourcePosition ) && range.containsPosition( opA.splitPosition ) ) {
- const howMany = range.end.offset - opA.splitPosition.offset;
- const offset = opA.splitPosition.offset - range.start.offset;
- this._setRelation( opA, opB, { howMany, offset } );
- }
- }
- }
- }
- break;
- }
- case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
- switch ( opB.constructor ) {
- case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
- if ( !opA.targetPosition.isEqual( opB.sourcePosition ) ) {
- this._setRelation( opA, opB, 'mergeTargetNotMoved' );
- }
- if ( opA.sourcePosition.isEqual( opB.targetPosition ) ) {
- this._setRelation( opA, opB, 'mergeSourceNotMoved' );
- }
- if ( opA.sourcePosition.isEqual( opB.sourcePosition ) ) {
- this._setRelation( opA, opB, 'mergeSameElement' );
- }
- break;
- }
- case _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]: {
- if ( opA.sourcePosition.isEqual( opB.splitPosition ) ) {
- this._setRelation( opA, opB, 'splitAtSource' );
- }
- }
- }
- break;
- }
- case _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"]: {
- const markerRange = opA.newRange;
- if ( !markerRange ) {
- return;
- }
- switch ( opB.constructor ) {
- case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
- const movedRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( opB.sourcePosition, opB.howMany );
- const affectedLeft = movedRange.containsPosition( markerRange.start ) ||
- movedRange.start.isEqual( markerRange.start );
- const affectedRight = movedRange.containsPosition( markerRange.end ) ||
- movedRange.end.isEqual( markerRange.end );
- if ( ( affectedLeft || affectedRight ) && !movedRange.containsRange( markerRange ) ) {
- this._setRelation( opA, opB, {
- side: affectedLeft ? 'left' : 'right',
- path: affectedLeft ? markerRange.start.path.slice() : markerRange.end.path.slice()
- } );
- }
- break;
- }
- case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
- const wasInLeftElement = markerRange.start.isEqual( opB.targetPosition );
- const wasStartBeforeMergedElement = markerRange.start.isEqual( opB.deletionPosition );
- const wasEndBeforeMergedElement = markerRange.end.isEqual( opB.deletionPosition );
- const wasInRightElement = markerRange.end.isEqual( opB.sourcePosition );
- if ( wasInLeftElement || wasStartBeforeMergedElement || wasEndBeforeMergedElement || wasInRightElement ) {
- this._setRelation( opA, opB, {
- wasInLeftElement,
- wasStartBeforeMergedElement,
- wasEndBeforeMergedElement,
- wasInRightElement
- } );
- }
- break;
- }
- }
- break;
- }
- }
- }
- // Evaluates and returns contextual information about two given operations `opA` and `opB` which are about to be transformed.
- //
- // @param {module:engine/model/operation/operation~Operation} opA
- // @param {module:engine/model/operation/operation~Operation} opB
- // @returns {module:engine/model/operation/transform~TransformationContext}
- getContext( opA, opB, aIsStrong ) {
- return {
- aIsStrong,
- aWasUndone: this._wasUndone( opA ),
- bWasUndone: this._wasUndone( opB ),
- abRelation: this._useRelations ? this._getRelation( opA, opB ) : null,
- baRelation: this._useRelations ? this._getRelation( opB, opA ) : null,
- forceWeakRemove: this._forceWeakRemove
- };
- }
- // Returns whether given operation `op` has already been undone.
- //
- // Information whether an operation was undone gives more context when making a decision when two operations are in conflict.
- //
- // @param {module:engine/model/operation/operation~Operation} op
- // @returns {Boolean}
- _wasUndone( op ) {
- // For `op`, get its original operation. After all, if `op` is a clone (or even transformed clone) of another
- // operation, literally `op` couldn't be undone. It was just generated. If anything, it was the operation it origins
- // from which was undone. So get that original operation.
- const originalOp = this.originalOperations.get( op );
- // And check with the document if the original operation was undone.
- return originalOp.wasUndone || this._history.isUndoneOperation( originalOp );
- }
- // Returns a relation between `opA` and an operation which is undone by `opB`. This can be `String` value if a relation
- // was set earlier or `null` if there was no relation between those operations.
- //
- // This is a little tricky to understand, so let's compare it to `ContextFactory#_wasUndone`.
- //
- // When `wasUndone( opB )` is used, we check if the `opB` has already been undone. It is obvious, that the
- // undoing operation must happen after the undone operation. So, essentially, we have `opB`, we take document history,
- // we look forward in the future and ask if in that future `opB` was undone.
- //
- // Relations is a backward process to `wasUndone()`.
- //
- // Long story short - using relations is asking what happened in the past. Looking back. This time we have an undoing
- // operation `opB` which has undone some other operation. When there is a transformation `opA` x `opB` and there is
- // a conflict to solve and `opB` is an undoing operation, we can look back in the history and see what was a relation
- // between `opA` and the operation which `opB` undone. Basing on that relation from the past, we can now make
- // a better decision when resolving a conflict between two operations, because we know more about the context of
- // those two operations.
- //
- // This is why this function does not return a relation directly between `opA` and `opB` because we need to look
- // back to search for a meaningful contextual information.
- //
- // @param {module:engine/model/operation/operation~Operation} opA
- // @param {module:engine/model/operation/operation~Operation} opB
- // @returns {String|null}
- _getRelation( opA, opB ) {
- // Get the original operation. Similarly as in `wasUndone()` it is used as an universal identifier for stored data.
- const origB = this.originalOperations.get( opB );
- const undoneB = this._history.getUndoneOperation( origB );
- // If `opB` is not undoing any operation, there is no relation.
- if ( !undoneB ) {
- return null;
- }
- const origA = this.originalOperations.get( opA );
- const relationsA = this._relations.get( origA );
- // Get all relations for `opA`, and check if there is a relation with `opB`-undone-counterpart. If so, return it.
- if ( relationsA ) {
- return relationsA.get( undoneB ) || null;
- }
- return null;
- }
- // Helper function for `ContextFactory#updateRelations`.
- //
- // @private
- // @param {module:engine/model/operation/operation~Operation} opA
- // @param {module:engine/model/operation/operation~Operation} opB
- // @param {String} relation
- _setRelation( opA, opB, relation ) {
- // As always, setting is for original operations, not the clones/transformed operations.
- const origA = this.originalOperations.get( opA );
- const origB = this.originalOperations.get( opB );
- let relationsA = this._relations.get( origA );
- if ( !relationsA ) {
- relationsA = new Map();
- this._relations.set( origA, relationsA );
- }
- relationsA.set( origB, relation );
- }
- }
- /**
- * Holds additional contextual information about a transformed pair of operations (`a` and `b`). Those information
- * can be used for better conflict resolving.
- *
- * @typedef {Object} module:engine/model/operation/transform~TransformationContext
- *
- * @property {Boolean} aIsStrong Whether `a` is strong operation in this transformation, or weak.
- * @property {Boolean} aWasUndone Whether `a` operation was undone.
- * @property {Boolean} bWasUndone Whether `b` operation was undone.
- * @property {String|null} abRelation The relation between `a` operation and an operation undone by `b` operation.
- * @property {String|null} baRelation The relation between `b` operation and an operation undone by `a` operation.
- */
- /**
- * An utility function that updates {@link module:engine/model/operation/operation~Operation#baseVersion base versions}
- * of passed operations.
- *
- * The function simply sets `baseVersion` as a base version of the first passed operation and then increments it for
- * each following operation in `operations`.
- *
- * @private
- * @param {Array.<module:engine/model/operation/operation~Operation>} operations Operations to update.
- * @param {Number} baseVersion Base version to set for the first operation in `operations`.
- */
- function updateBaseVersions( operations, baseVersion ) {
- for ( const operation of operations ) {
- operation.baseVersion = baseVersion++;
- }
- }
- /**
- * Adds `howMany` instances of {@link module:engine/model/operation/nooperation~NoOperation} to `operations` set.
- *
- * @private
- * @param {Array.<module:engine/model/operation/operation~Operation>} operations
- * @param {Number} howMany
- */
- function padWithNoOps( operations, howMany ) {
- for ( let i = 0; i < howMany; i++ ) {
- operations.push( new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) );
- }
- }
- // -----------------------
- setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], ( a, b, context ) => {
- // If operations in conflict, check if their ranges intersect and manage them properly.
- //
- // Operations can be in conflict only if:
- //
- // * their key is the same (they change the same attribute), and
- // * they are in the same parent (operations for ranges [ 1 ] - [ 3 ] and [ 2, 0 ] - [ 2, 5 ] change different
- // elements and can't be in conflict).
- if ( a.key === b.key && a.range.start.hasSameParentAs( b.range.start ) ) {
- // First, we want to apply change to the part of a range that has not been changed by the other operation.
- const operations = a.range.getDifference( b.range ).map( range => {
- return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, a.key, a.oldValue, a.newValue, 0 );
- } );
- // Then we take care of the common part of ranges.
- const common = a.range.getIntersection( b.range );
- if ( common ) {
- // If this operation is more important, we also want to apply change to the part of the
- // original range that has already been changed by the other operation. Since that range
- // got changed we also have to update `oldValue`.
- if ( context.aIsStrong ) {
- operations.push( new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( common, b.key, b.newValue, a.newValue, 0 ) );
- }
- }
- if ( operations.length == 0 ) {
- return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
- }
- return operations;
- } else {
- // If operations don't conflict, simply return an array containing just a clone of this operation.
- return [ a ];
- }
- } );
- setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
- // Case 1:
- //
- // The attribute operation range includes the position where nodes were inserted.
- // There are two possible scenarios: the inserted nodes were text and they should receive attributes or
- // the inserted nodes were elements and they should not receive attributes.
- //
- if ( a.range.start.hasSameParentAs( b.position ) && a.range.containsPosition( b.position ) ) {
- // If new nodes should not receive attributes, two separated ranges will be returned.
- // Otherwise, one expanded range will be returned.
- const range = a.range._getTransformedByInsertion( b.position, b.howMany, !b.shouldReceiveAttributes );
- const result = range.map( r => {
- return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( r, a.key, a.oldValue, a.newValue, a.baseVersion );
- } );
- if ( b.shouldReceiveAttributes ) {
- // `AttributeOperation#range` includes some newly inserted text.
- // The operation should also change the attribute of that text. An example:
- //
- // Bold should be applied on the following range:
- // <p>Fo[zb]ar</p>
- //
- // In meantime, new text is typed:
- // <p>Fozxxbar</p>
- //
- // Bold should be applied also on the new text:
- // <p>Fo[zxxb]ar</p>
- // <p>Fo<$text bold="true">zxxb</$text>ar</p>
- //
- // There is a special case to consider here to consider.
- //
- // Consider setting an attribute with multiple possible values, for example `highlight`. The inserted text might
- // have already an attribute value applied and the `oldValue` property of the attribute operation might be wrong:
- //
- // Attribute `highlight="yellow"` should be applied on the following range:
- // <p>Fo[zb]ar<p>
- //
- // In meantime, character `x` with `highlight="red"` is typed:
- // <p>Fo[z<$text highlight="red">x</$text>b]ar</p>
- //
- // In this case we cannot simply apply operation changing the attribute value from `null` to `"yellow"` for the whole range
- // because that would lead to an exception (`oldValue` is incorrect for `x`).
- //
- // We also cannot break the original range as this would mess up a scenario when there are multiple following
- // insert operations, because then only the first inserted character is included in those ranges:
- // <p>Fo[z][x][b]ar</p> --> <p>Fo[z][x]x[b]ar</p> --> <p>Fo[z][x]xx[b]ar</p>
- //
- // So, the attribute range needs be expanded, no matter what attributes are set on the inserted nodes:
- //
- // <p>Fo[z<$text highlight="red">x</$text>b]ar</p> <--- Change from `null` to `yellow`, throwing an exception.
- //
- // But before that operation would be applied, we will add an additional attribute operation that will change
- // attributes on the inserted nodes in a way which would make the original operation correct:
- //
- // <p>Fo[z{<$text highlight="red">}x</$text>b]ar</p> <--- Change range `{}` from `red` to `null`.
- // <p>Fo[zxb]ar</p> <--- Now change from `null` to `yellow` is completely fine.
- //
- // Generate complementary attribute operation. Be sure to add it before the original operation.
- const op = _getComplementaryAttributeOperations( b, a.key, a.oldValue );
- if ( op ) {
- result.unshift( op );
- }
- }
- // If nodes should not receive new attribute, we are done here.
- return result;
- }
- // If insert operation is not expanding the attribute operation range, simply transform the range.
- a.range = a.range._getTransformedByInsertion( b.position, b.howMany, false )[ 0 ];
- return [ a ];
- } );
- /**
- * Helper function for `AttributeOperation` x `InsertOperation` (and reverse) transformation.
- *
- * For given `insertOperation` it checks the inserted node if it has an attribute `key` set to a value different
- * than `newValue`. If so, it generates an `AttributeOperation` which changes the value of `key` attribute to `newValue`.
- *
- * @private
- * @param {module:engine/model/operation/insertoperation~InsertOperation} insertOperation
- * @param {String} key
- * @param {*} newValue
- * @returns {module:engine/model/operation/attributeoperation~AttributeOperation|null}
- */
- function _getComplementaryAttributeOperations( insertOperation, key, newValue ) {
- const nodes = insertOperation.nodes;
- // At the beginning we store the attribute value from the first node.
- const insertValue = nodes.getNode( 0 ).getAttribute( key );
- if ( insertValue == newValue ) {
- return null;
- }
- const range = new _range__WEBPACK_IMPORTED_MODULE_9__["default"]( insertOperation.position, insertOperation.position.getShiftedBy( insertOperation.howMany ) );
- return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, key, insertValue, newValue, 0 );
- }
- setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
- const ranges = [];
- // Case 1:
- //
- // Attribute change on the merged element. In this case, the merged element was moved to the graveyard.
- // An additional attribute operation that will change the (re)moved element needs to be generated.
- //
- if ( a.range.start.hasSameParentAs( b.deletionPosition ) ) {
- if ( a.range.containsPosition( b.deletionPosition ) || a.range.start.isEqual( b.deletionPosition ) ) {
- ranges.push( _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.graveyardPosition, 1 ) );
- }
- }
- const range = a.range._getTransformedByMergeOperation( b );
- // Do not add empty (collapsed) ranges to the result. `range` may be collapsed if it contained only the merged element.
- if ( !range.isCollapsed ) {
- ranges.push( range );
- }
- // Create `AttributeOperation`s out of the ranges.
- return ranges.map( range => {
- return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, a.key, a.oldValue, a.newValue, a.baseVersion );
- } );
- } );
- setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b ) => {
- const ranges = _breakRangeByMoveOperation( a.range, b );
- // Create `AttributeOperation`s out of the ranges.
- return ranges.map( range => new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, a.key, a.oldValue, a.newValue, a.baseVersion ) );
- } );
- // Helper function for `AttributeOperation` x `MoveOperation` transformation.
- //
- // Takes the passed `range` and transforms it by move operation `moveOp` in a specific way. Only top-level nodes of `range`
- // are considered to be in the range. If move operation moves nodes deep from inside of the range, those nodes won't
- // be included in the result. In other words, top-level nodes of the ranges from the result are exactly the same as
- // top-level nodes of the original `range`.
- //
- // This is important for `AttributeOperation` because, for its range, it changes only the top-level nodes. So we need to
- // track only how those nodes have been affected by `MoveOperation`.
- //
- // @private
- // @param {module:engine/model/range~Range} range
- // @param {module:engine/model/operation/moveoperation~MoveOperation} moveOp
- // @returns {Array.<module:engine/model/range~Range>}
- function _breakRangeByMoveOperation( range, moveOp ) {
- const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( moveOp.sourcePosition, moveOp.howMany );
- // We are transforming `range` (original range) by `moveRange` (range moved by move operation). As usual when it comes to
- // transforming a ranges, we may have a common part of the ranges and we may have a difference part (zero to two ranges).
- let common = null;
- let difference = [];
- // Let's compare the ranges.
- if ( moveRange.containsRange( range, true ) ) {
- // If the whole original range is moved, treat it whole as a common part. There's also no difference part.
- common = range;
- } else if ( range.start.hasSameParentAs( moveRange.start ) ) {
- // If the ranges are "on the same level" (in the same parent) then move operation may move exactly those nodes
- // that are changed by the attribute operation. In this case we get common part and difference part in the usual way.
- difference = range.getDifference( moveRange );
- common = range.getIntersection( moveRange );
- } else {
- // In any other situation we assume that original range is different than move range, that is that move operation
- // moves other nodes that attribute operation change. Even if the moved range is deep inside in the original range.
- //
- // Note that this is different than in `.getIntersection` (we would get a common part in that case) and different
- // than `.getDifference` (we would get two ranges).
- difference = [ range ];
- }
- const result = [];
- // The default behaviour of `_getTransformedByMove` might get wrong results for difference part, though, so
- // we do it by hand.
- for ( let diff of difference ) {
- // First, transform the range by removing moved nodes. Since this is a difference, this is safe, `null` won't be returned
- // as the range is different than the moved range.
- diff = diff._getTransformedByDeletion( moveOp.sourcePosition, moveOp.howMany );
- // Transform also `targetPosition`.
- const targetPosition = moveOp.getMovedRangeStart();
- // Spread the range only if moved nodes are inserted only between the top-level nodes of the `diff` range.
- const spread = diff.start.hasSameParentAs( targetPosition );
- // Transform by insertion of moved nodes.
- diff = diff._getTransformedByInsertion( targetPosition, moveOp.howMany, spread );
- result.push( ...diff );
- }
- // Common part can be simply transformed by the move operation. This is because move operation will not target to
- // that common part (the operation would have to target inside its own moved range).
- if ( common ) {
- result.push(
- common._getTransformedByMove( moveOp.sourcePosition, moveOp.targetPosition, moveOp.howMany, false )[ 0 ]
- );
- }
- return result;
- }
- setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b ) => {
- // Case 1:
- //
- // Split node is the last node in `AttributeOperation#range`.
- // `AttributeOperation#range` needs to be expanded to include the new (split) node.
- //
- // Attribute `type` to be changed to `numbered` but the `listItem` is split.
- // <listItem type="bulleted">foobar</listItem>
- //
- // After split:
- // <listItem type="bulleted">foo</listItem><listItem type="bulleted">bar</listItem>
- //
- // After attribute change:
- // <listItem type="numbered">foo</listItem><listItem type="numbered">foo</listItem>
- //
- if ( a.range.end.isEqual( b.insertionPosition ) ) {
- if ( !b.graveyardPosition ) {
- a.range.end.offset++;
- }
- return [ a ];
- }
- // Case 2:
- //
- // Split position is inside `AttributeOperation#range`, at the same level, so the nodes to change are
- // not going to make a flat range.
- //
- // Content with range-to-change and split position:
- // <p>Fo[zb^a]r</p>
- //
- // After split:
- // <p>Fozb</p><p>ar</p>
- //
- // Make two separate ranges containing all nodes to change:
- // <p>Fo[zb]</p><p>[a]r</p>
- //
- if ( a.range.start.hasSameParentAs( b.splitPosition ) && a.range.containsPosition( b.splitPosition ) ) {
- const secondPart = a.clone();
- secondPart.range = new _range__WEBPACK_IMPORTED_MODULE_9__["default"](
- b.moveTargetPosition.clone(),
- a.range.end._getCombined( b.splitPosition, b.moveTargetPosition )
- );
- a.range.end = b.splitPosition.clone();
- a.range.end.stickiness = 'toPrevious';
- return [ a, secondPart ];
- }
- // The default case.
- //
- a.range = a.range._getTransformedBySplitOperation( b );
- return [ a ];
- } );
- setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], ( a, b ) => {
- const result = [ a ];
- // Case 1:
- //
- // The attribute operation range includes the position where nodes were inserted.
- // There are two possible scenarios: the inserted nodes were text and they should receive attributes or
- // the inserted nodes were elements and they should not receive attributes.
- //
- // This is a mirror scenario to the one described in `AttributeOperation` x `InsertOperation` transformation,
- // although this case is a little less complicated. In this case we simply need to change attributes of the
- // inserted nodes and that's it.
- //
- if ( a.shouldReceiveAttributes && a.position.hasSameParentAs( b.range.start ) && b.range.containsPosition( a.position ) ) {
- const op = _getComplementaryAttributeOperations( a, b.key, b.newValue );
- if ( op ) {
- result.push( op );
- }
- }
- // The default case is: do nothing.
- // `AttributeOperation` does not change the model tree structure so `InsertOperation` does not need to be changed.
- //
- return result;
- } );
- setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b, context ) => {
- // Case 1:
- //
- // Two insert operations insert nodes at the same position. Since they are the same, it needs to be decided
- // what will be the order of inserted nodes. However, there is no additional information to help in that
- // decision. Also, when `b` will be transformed by `a`, the same order must be maintained.
- //
- // To achieve that, we will check if the operation is strong.
- // If it is, it won't get transformed. If it is not, it will be moved.
- //
- if ( a.position.isEqual( b.position ) && context.aIsStrong ) {
- return [ a ];
- }
- // The default case.
- //
- a.position = a.position._getTransformedByInsertOperation( b );
- return [ a ];
- } );
- setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b ) => {
- // The default case.
- //
- a.position = a.position._getTransformedByMoveOperation( b );
- return [ a ];
- } );
- setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b ) => {
- // The default case.
- //
- a.position = a.position._getTransformedBySplitOperation( b );
- return [ a ];
- } );
- setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
- a.position = a.position._getTransformedByMergeOperation( b );
- return [ a ];
- } );
- // -----------------------
- setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
- if ( a.oldRange ) {
- a.oldRange = a.oldRange._getTransformedByInsertOperation( b )[ 0 ];
- }
- if ( a.newRange ) {
- a.newRange = a.newRange._getTransformedByInsertOperation( b )[ 0 ];
- }
- return [ a ];
- } );
- setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], ( a, b, context ) => {
- if ( a.name == b.name ) {
- if ( context.aIsStrong ) {
- a.oldRange = b.newRange ? b.newRange.clone() : null;
- } else {
- return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
- }
- }
- return [ a ];
- } );
- setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
- if ( a.oldRange ) {
- a.oldRange = a.oldRange._getTransformedByMergeOperation( b );
- }
- if ( a.newRange ) {
- a.newRange = a.newRange._getTransformedByMergeOperation( b );
- }
- return [ a ];
- } );
- setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
- if ( a.oldRange ) {
- a.oldRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromRanges( a.oldRange._getTransformedByMoveOperation( b ) );
- }
- if ( a.newRange ) {
- if ( context.abRelation ) {
- const aNewRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromRanges( a.newRange._getTransformedByMoveOperation( b ) );
- if ( context.abRelation.side == 'left' && b.targetPosition.isEqual( a.newRange.start ) ) {
- a.newRange.start.path = context.abRelation.path;
- a.newRange.end = aNewRange.end;
- return [ a ];
- } else if ( context.abRelation.side == 'right' && b.targetPosition.isEqual( a.newRange.end ) ) {
- a.newRange.start = aNewRange.start;
- a.newRange.end.path = context.abRelation.path;
- return [ a ];
- }
- }
- a.newRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromRanges( a.newRange._getTransformedByMoveOperation( b ) );
- }
- return [ a ];
- } );
- setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
- if ( a.oldRange ) {
- a.oldRange = a.oldRange._getTransformedBySplitOperation( b );
- }
- if ( a.newRange ) {
- if ( context.abRelation ) {
- const aNewRange = a.newRange._getTransformedBySplitOperation( b );
- if ( a.newRange.start.isEqual( b.splitPosition ) && context.abRelation.wasStartBeforeMergedElement ) {
- a.newRange.start = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.insertionPosition );
- } else if ( a.newRange.start.isEqual( b.splitPosition ) && !context.abRelation.wasInLeftElement ) {
- a.newRange.start = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.moveTargetPosition );
- }
- if ( a.newRange.end.isEqual( b.splitPosition ) && context.abRelation.wasInRightElement ) {
- a.newRange.end = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.moveTargetPosition );
- } else if ( a.newRange.end.isEqual( b.splitPosition ) && context.abRelation.wasEndBeforeMergedElement ) {
- a.newRange.end = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.insertionPosition );
- } else {
- a.newRange.end = aNewRange.end;
- }
- return [ a ];
- }
- a.newRange = a.newRange._getTransformedBySplitOperation( b );
- }
- return [ a ];
- } );
- // -----------------------
- setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
- if ( a.sourcePosition.hasSameParentAs( b.position ) ) {
- a.howMany += b.howMany;
- }
- a.sourcePosition = a.sourcePosition._getTransformedByInsertOperation( b );
- a.targetPosition = a.targetPosition._getTransformedByInsertOperation( b );
- return [ a ];
- } );
- setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b, context ) => {
- // Case 1:
- //
- // Same merge operations.
- //
- // Both operations have same source and target positions. So the element already got merged and there is
- // theoretically nothing to do.
- //
- if ( a.sourcePosition.isEqual( b.sourcePosition ) && a.targetPosition.isEqual( b.targetPosition ) ) {
- // There are two ways that we can provide a do-nothing operation.
- //
- // First is simply a NoOperation instance. We will use it if `b` operation was not undone.
- //
- // Second is a merge operation that has the source operation in the merged element - in the graveyard -
- // same target position and `howMany` equal to `0`. So it is basically merging an empty element from graveyard
- // which is almost the same as NoOperation.
- //
- // This way the merge operation can be later transformed by split operation
- // to provide correct undo. This will be used if `b` operation was undone (only then it is correct).
- //
- if ( !context.bWasUndone ) {
- return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
- } else {
- const path = b.graveyardPosition.path.slice();
- path.push( 0 );
- a.sourcePosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.graveyardPosition.root, path );
- a.howMany = 0;
- return [ a ];
- }
- }
- // Case 2:
- //
- // Same merge source position but different target position.
- //
- // This can happen during collaboration. For example, if one client merged a paragraph to the previous paragraph
- // and the other person removed that paragraph and merged the same paragraph to something before:
- //
- // Client A:
- // <p>Foo</p><p>Bar</p><p>[]Xyz</p>
- // <p>Foo</p><p>BarXyz</p>
- //
- // Client B:
- // <p>Foo</p>[<p>Bar</p>]<p>Xyz</p>
- // <p>Foo</p><p>[]Xyz</p>
- // <p>FooXyz</p>
- //
- // In this case we need to decide where finally "Xyz" will land:
- //
- // <p>FooXyz</p> graveyard: <p>Bar</p>
- // <p>Foo</p> graveyard: <p>BarXyz</p>
- //
- // Let's move it in a way so that a merge operation that does not target to graveyard is more important so that
- // nodes does not end up in the graveyard. It makes sense. Both for Client A and for Client B "Xyz" finally did not
- // end up in the graveyard (see above).
- //
- // If neither or both operations point to graveyard, then let `aIsStrong` decide.
- //
- if (
- a.sourcePosition.isEqual( b.sourcePosition ) && !a.targetPosition.isEqual( b.targetPosition ) &&
- !context.bWasUndone && context.abRelation != 'splitAtSource'
- ) {
- const aToGraveyard = a.targetPosition.root.rootName == '$graveyard';
- const bToGraveyard = b.targetPosition.root.rootName == '$graveyard';
- // If `aIsWeak` it means that `a` points to graveyard while `b` doesn't. Don't move nodes then.
- const aIsWeak = aToGraveyard && !bToGraveyard;
- // If `bIsWeak` it means that `b` points to graveyard while `a` doesn't. Force moving nodes then.
- const bIsWeak = bToGraveyard && !aToGraveyard;
- // Force move if `b` is weak or neither operation is weak but `a` is stronger through `context.aIsStrong`.
- const forceMove = bIsWeak || ( !aIsWeak && context.aIsStrong );
- if ( forceMove ) {
- const sourcePosition = b.targetPosition._getTransformedByMergeOperation( b );
- const targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
- return [ new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( sourcePosition, a.howMany, targetPosition, 0 ) ];
- } else {
- return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
- }
- }
- // The default case.
- //
- if ( a.sourcePosition.hasSameParentAs( b.targetPosition ) ) {
- a.howMany += b.howMany;
- }
- a.sourcePosition = a.sourcePosition._getTransformedByMergeOperation( b );
- a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
- // Handle positions in graveyard.
- // If graveyard positions are same and `a` operation is strong - do not transform.
- if ( !a.graveyardPosition.isEqual( b.graveyardPosition ) || !context.aIsStrong ) {
- a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation( b );
- }
- return [ a ];
- } );
- setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
- // Case 1:
- //
- // The element to merge got removed.
- //
- // Merge operation does support merging elements which are not siblings. So it would not be a problem
- // from technical point of view. However, if the element was removed, the intention of the user deleting it
- // was to have it all deleted, together with its children. From user experience point of view, moving back the
- // removed nodes might be unexpected. This means that in this scenario we will block the merging.
- //
- // The exception of this rule would be if the remove operation was later undone.
- //
- const removedRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.sourcePosition, b.howMany );
- if ( b.type == 'remove' && !context.bWasUndone && !context.forceWeakRemove ) {
- if ( a.deletionPosition.hasSameParentAs( b.sourcePosition ) && removedRange.containsPosition( a.sourcePosition ) ) {
- return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
- }
- }
- // The default case.
- //
- if ( a.sourcePosition.hasSameParentAs( b.targetPosition ) ) {
- a.howMany += b.howMany;
- }
- if ( a.sourcePosition.hasSameParentAs( b.sourcePosition ) ) {
- a.howMany -= b.howMany;
- }
- a.sourcePosition = a.sourcePosition._getTransformedByMoveOperation( b );
- a.targetPosition = a.targetPosition._getTransformedByMoveOperation( b );
- // `MergeOperation` graveyard position is like `MoveOperation` target position. It is a position where element(s) will
- // be moved. Like in other similar cases, we need to consider the scenario when those positions are same.
- // Here, we will treat `MergeOperation` like it is always strong (see `InsertOperation` x `InsertOperation` for comparison).
- // This means that we won't transform graveyard position if it is equal to move operation target position.
- if ( !a.graveyardPosition.isEqual( b.targetPosition ) ) {
- a.graveyardPosition = a.graveyardPosition._getTransformedByMoveOperation( b );
- }
- return [ a ];
- } );
- setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
- if ( b.graveyardPosition ) {
- // If `b` operation defines graveyard position, a node from graveyard will be moved. This means that we need to
- // transform `a.graveyardPosition` accordingly.
- a.graveyardPosition = a.graveyardPosition._getTransformedByDeletion( b.graveyardPosition, 1 );
- // This is a scenario foreseen in `MergeOperation` x `MergeOperation`, with two identical merge operations.
- //
- // So, there was `MergeOperation` x `MergeOperation` transformation earlier. Now, `a` is a merge operation which
- // source position is in graveyard. Interestingly, split operation wants to use the node to be merged by `a`. This
- // means that `b` is undoing that merge operation from earlier, which caused `a` to be in graveyard.
- //
- // If that's the case, at this point, we will only "fix" `a.howMany`. It was earlier set to `0` in
- // `MergeOperation` x `MergeOperation` transformation. Later transformations in this function will change other
- // properties.
- //
- if ( a.deletionPosition.isEqual( b.graveyardPosition ) ) {
- a.howMany = b.howMany;
- }
- }
- // Case 1:
- //
- // Merge operation moves nodes to the place where split happens.
- // This is a classic situation when there are two paragraphs, and there is a split (enter) after the first
- // paragraph and there is a merge (delete) at the beginning of the second paragraph:
- //
- // <p>Foo{}</p><p>[]Bar</p>.
- //
- // Split is after `Foo`, while merge is from `Bar` to the end of `Foo`.
- //
- // State after split:
- // <p>Foo</p><p></p><p>Bar</p>
- //
- // Now, `Bar` should be merged to the new paragraph:
- // <p>Foo</p><p>Bar</p>
- //
- // Instead of merging it to the original paragraph:
- // <p>FooBar</p><p></p>
- //
- // This means that `targetPosition` needs to be transformed. This is the default case though.
- // For example, if the split would be after `F`, `targetPosition` should also be transformed.
- //
- // There are three exceptions, though, when we want to keep `targetPosition` as it was.
- //
- // First exception is when the merge target position is inside an element (not at the end, as usual). This
- // happens when the merge operation earlier was transformed by "the same" merge operation. If merge operation
- // targets inside the element we want to keep the original target position (and not transform it) because
- // we have additional context telling us that we want to merge to the original element. We can check if the
- // merge operation points inside element by checking what is `SplitOperation#howMany`. Since merge target position
- // is same as split position, if `howMany` is non-zero, it means that the merge target position is inside an element.
- //
- // Second exception is when the element to merge is in the graveyard and split operation uses it. In that case
- // if target position would be transformed, the merge operation would target at the source position:
- //
- // root: <p>Foo</p> graveyard: <p></p>
- //
- // SplitOperation: root [ 0, 3 ] using graveyard [ 0 ] (howMany = 0)
- // MergeOperation: graveyard [ 0, 0 ] -> root [ 0, 3 ] (howMany = 0)
- //
- // Since split operation moves the graveyard node back to the root, the merge operation source position changes.
- // We would like to merge from the empty <p> to the "Foo" <p>:
- //
- // root: <p>Foo</p><p></p> graveyard:
- //
- // MergeOperation#sourcePosition = root [ 1, 0 ]
- //
- // If `targetPosition` is transformed, it would become root [ 1, 0 ] as well. It has to be kept as it was.
- //
- // Third exception is connected with relations. If this happens during undo and we have explicit information
- // that target position has not been affected by the operation which is undone by this split then this split should
- // not move the target position either.
- //
- if ( a.targetPosition.isEqual( b.splitPosition ) ) {
- const mergeInside = b.howMany != 0;
- const mergeSplittingElement = b.graveyardPosition && a.deletionPosition.isEqual( b.graveyardPosition );
- if ( mergeInside || mergeSplittingElement || context.abRelation == 'mergeTargetNotMoved' ) {
- a.sourcePosition = a.sourcePosition._getTransformedBySplitOperation( b );
- return [ a ];
- }
- }
- // Case 2:
- //
- // Merge source is at the same position as split position. This sometimes happen, mostly during undo.
- // The decision here is mostly to choose whether merge source position should stay where it is (so it will be at the end of the
- // split element) or should be move to the beginning of the new element.
- //
- if ( a.sourcePosition.isEqual( b.splitPosition ) ) {
- // Use context to check if `SplitOperation` is not undoing a merge operation, that didn't change the `a` operation.
- // This scenario happens the undone merge operation moved nodes at the source position of `a` operation.
- // In that case `a` operation source position should stay where it is.
- if ( context.abRelation == 'mergeSourceNotMoved' ) {
- a.howMany = 0;
- a.targetPosition = a.targetPosition._getTransformedBySplitOperation( b );
- return [ a ];
- }
- // This merge operation might have been earlier transformed by a merge operation which both merged the same element.
- // See that case in `MergeOperation` x `MergeOperation` transformation. In that scenario, if the merge operation has been undone,
- // the special case is not applied.
- //
- // Now, the merge operation is transformed by the split which has undone that previous merge operation.
- // So now we are fixing situation which was skipped in `MergeOperation` x `MergeOperation` case.
- //
- if ( context.abRelation == 'mergeSameElement' || a.sourcePosition.offset > 0 ) {
- a.sourcePosition = b.moveTargetPosition.clone();
- a.targetPosition = a.targetPosition._getTransformedBySplitOperation( b );
- return [ a ];
- }
- }
- // The default case.
- //
- if ( a.sourcePosition.hasSameParentAs( b.splitPosition ) ) {
- a.howMany = b.splitPosition.offset;
- }
- a.sourcePosition = a.sourcePosition._getTransformedBySplitOperation( b );
- a.targetPosition = a.targetPosition._getTransformedBySplitOperation( b );
- return [ a ];
- } );
- // -----------------------
- setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
- const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
- const transformed = moveRange._getTransformedByInsertOperation( b, false )[ 0 ];
- a.sourcePosition = transformed.start;
- a.howMany = transformed.end.offset - transformed.start.offset;
- // See `InsertOperation` x `MoveOperation` transformation for details on this case.
- //
- // In summary, both operations point to the same place, so the order of nodes needs to be decided.
- // `MoveOperation` is considered weaker, so it is always transformed, unless there was a certain relation
- // between operations.
- //
- if ( !a.targetPosition.isEqual( b.position ) ) {
- a.targetPosition = a.targetPosition._getTransformedByInsertOperation( b );
- }
- return [ a ];
- } );
- setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
- //
- // Setting and evaluating some variables that will be used in special cases and default algorithm.
- //
- // Create ranges from `MoveOperations` properties.
- const rangeA = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
- const rangeB = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.sourcePosition, b.howMany );
- // Assign `context.aIsStrong` to a different variable, because the value may change during execution of
- // this algorithm and we do not want to override original `context.aIsStrong` that will be used in later transformations.
- let aIsStrong = context.aIsStrong;
- // This will be used to decide the order of nodes if both operations target at the same position.
- // By default, use strong/weak operation mechanism.
- let insertBefore = !context.aIsStrong;
- // If the relation is set, then use it to decide nodes order.
- if ( context.abRelation == 'insertBefore' || context.baRelation == 'insertAfter' ) {
- insertBefore = true;
- } else if ( context.abRelation == 'insertAfter' || context.baRelation == 'insertBefore' ) {
- insertBefore = false;
- }
- // `a.targetPosition` could be affected by the `b` operation. We will transform it.
- let newTargetPosition;
- if ( a.targetPosition.isEqual( b.targetPosition ) && insertBefore ) {
- newTargetPosition = a.targetPosition._getTransformedByDeletion(
- b.sourcePosition,
- b.howMany
- );
- } else {
- newTargetPosition = a.targetPosition._getTransformedByMove(
- b.sourcePosition,
- b.targetPosition,
- b.howMany
- );
- }
- //
- // Special case #1 + mirror.
- //
- // Special case when both move operations' target positions are inside nodes that are
- // being moved by the other move operation. So in other words, we move ranges into inside of each other.
- // This case can't be solved reasonably (on the other hand, it should not happen often).
- if ( _moveTargetIntoMovedRange( a, b ) && _moveTargetIntoMovedRange( b, a ) ) {
- // Instead of transforming operation, we return a reverse of the operation that we transform by.
- // So when the results of this "transformation" will be applied, `b` MoveOperation will get reversed.
- return [ b.getReversed() ];
- }
- //
- // End of special case #1.
- //
- //
- // Special case #2.
- //
- // Check if `b` operation targets inside `rangeA`.
- const bTargetsToA = rangeA.containsPosition( b.targetPosition );
- // If `b` targets to `rangeA` and `rangeA` contains `rangeB`, `b` operation has no influence on `a` operation.
- // You might say that operation `b` is captured inside operation `a`.
- if ( bTargetsToA && rangeA.containsRange( rangeB, true ) ) {
- // There is a mini-special case here, where `rangeB` is on other level than `rangeA`. That's why
- // we need to transform `a` operation anyway.
- rangeA.start = rangeA.start._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
- rangeA.end = rangeA.end._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
- return _makeMoveOperationsFromRanges( [ rangeA ], newTargetPosition );
- }
- //
- // Special case #2 mirror.
- //
- const aTargetsToB = rangeB.containsPosition( a.targetPosition );
- if ( aTargetsToB && rangeB.containsRange( rangeA, true ) ) {
- // `a` operation is "moved together" with `b` operation.
- // Here, just move `rangeA` "inside" `rangeB`.
- rangeA.start = rangeA.start._getCombined( b.sourcePosition, b.getMovedRangeStart() );
- rangeA.end = rangeA.end._getCombined( b.sourcePosition, b.getMovedRangeStart() );
- return _makeMoveOperationsFromRanges( [ rangeA ], newTargetPosition );
- }
- //
- // End of special case #2.
- //
- //
- // Special case #3 + mirror.
- //
- // `rangeA` has a node which is an ancestor of `rangeB`. In other words, `rangeB` is inside `rangeA`
- // but not on the same tree level. In such case ranges have common part but we have to treat it
- // differently, because in such case those ranges are not really conflicting and should be treated like
- // two separate ranges. Also we have to discard two difference parts.
- const aCompB = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__["default"])( a.sourcePosition.getParentPath(), b.sourcePosition.getParentPath() );
- if ( aCompB == 'prefix' || aCompB == 'extension' ) {
- // Transform `rangeA` by `b` operation and make operation out of it, and that's all.
- // Note that this is a simplified version of default case, but here we treat the common part (whole `rangeA`)
- // like a one difference part.
- rangeA.start = rangeA.start._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
- rangeA.end = rangeA.end._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
- return _makeMoveOperationsFromRanges( [ rangeA ], newTargetPosition );
- }
- //
- // End of special case #3.
- //
- //
- // Default case - ranges are on the same level or are not connected with each other.
- //
- // Modifier for default case.
- // Modifies `aIsStrong` flag in certain conditions.
- //
- // If only one of operations is a remove operation, we force remove operation to be the "stronger" one
- // to provide more expected results.
- if ( a.type == 'remove' && b.type != 'remove' && !context.aWasUndone && !context.forceWeakRemove ) {
- aIsStrong = true;
- } else if ( a.type != 'remove' && b.type == 'remove' && !context.bWasUndone && !context.forceWeakRemove ) {
- aIsStrong = false;
- }
- // Handle operation's source ranges - check how `rangeA` is affected by `b` operation.
- // This will aggregate transformed ranges.
- const ranges = [];
- // Get the "difference part" of `a` operation source range.
- // This is an array with one or two ranges. Two ranges if `rangeB` is inside `rangeA`.
- const difference = rangeA.getDifference( rangeB );
- for ( const range of difference ) {
- // Transform those ranges by `b` operation. For example if `b` moved range from before those ranges, fix those ranges.
- range.start = range.start._getTransformedByDeletion( b.sourcePosition, b.howMany );
- range.end = range.end._getTransformedByDeletion( b.sourcePosition, b.howMany );
- // If `b` operation targets into `rangeA` on the same level, spread `rangeA` into two ranges.
- const shouldSpread = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__["default"])( range.start.getParentPath(), b.getMovedRangeStart().getParentPath() ) == 'same';
- const newRanges = range._getTransformedByInsertion( b.getMovedRangeStart(), b.howMany, shouldSpread );
- ranges.push( ...newRanges );
- }
- // Then, we have to manage the "common part" of both move ranges.
- const common = rangeA.getIntersection( rangeB );
- if ( common !== null && aIsStrong ) {
- // Calculate the new position of that part of original range.
- common.start = common.start._getCombined( b.sourcePosition, b.getMovedRangeStart() );
- common.end = common.end._getCombined( b.sourcePosition, b.getMovedRangeStart() );
- // Take care of proper range order.
- //
- // Put `common` at appropriate place. Keep in mind that we are interested in original order.
- // Basically there are only three cases: there is zero, one or two difference ranges.
- //
- // If there is zero difference ranges, just push `common` in the array.
- if ( ranges.length === 0 ) {
- ranges.push( common );
- }
- // If there is one difference range, we need to check whether common part was before it or after it.
- else if ( ranges.length == 1 ) {
- if ( rangeB.start.isBefore( rangeA.start ) || rangeB.start.isEqual( rangeA.start ) ) {
- ranges.unshift( common );
- } else {
- ranges.push( common );
- }
- }
- // If there are more ranges (which means two), put common part between them. This is the only scenario
- // where there could be two difference ranges so we don't have to make any comparisons.
- else {
- ranges.splice( 1, 0, common );
- }
- }
- if ( ranges.length === 0 ) {
- // If there are no "source ranges", nothing should be changed.
- // Note that this can happen only if `aIsStrong == false` and `rangeA.isEqual( rangeB )`.
- return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( a.baseVersion ) ];
- }
- return _makeMoveOperationsFromRanges( ranges, newTargetPosition );
- } );
- setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
- let newTargetPosition = a.targetPosition.clone();
- // Do not transform if target position is same as split insertion position and this split comes from undo.
- // This should be done on relations but it is too much work for now as it would require relations working in collaboration.
- // We need to make a decision how we will resolve such conflict and this is less harmful way.
- if ( !a.targetPosition.isEqual( b.insertionPosition ) || !b.graveyardPosition || context.abRelation == 'moveTargetAfter' ) {
- newTargetPosition = a.targetPosition._getTransformedBySplitOperation( b );
- }
- // Case 1:
- //
- // Last element in the moved range got split.
- //
- // In this case the default range transformation will not work correctly as the element created by
- // split operation would be outside the range. The range to move needs to be fixed manually.
- //
- const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
- if ( moveRange.end.isEqual( b.insertionPosition ) ) {
- // Do it only if this is a "natural" split, not a one that comes from undo.
- // If this is undo split, only `targetPosition` needs to be changed (if the move is a remove).
- if ( !b.graveyardPosition ) {
- a.howMany++;
- }
- a.targetPosition = newTargetPosition;
- return [ a ];
- }
- // Case 2:
- //
- // Split happened between the moved nodes. In this case two ranges to move need to be generated.
- //
- // Characters `ozba` are moved to the end of paragraph `Xyz` but split happened.
- // <p>F[oz|ba]r</p><p>Xyz</p>
- //
- // After split:
- // <p>F[oz</p><p>ba]r</p><p>Xyz</p>
- //
- // Correct ranges:
- // <p>F[oz]</p><p>[ba]r</p><p>Xyz</p>
- //
- // After move:
- // <p>F</p><p>r</p><p>Xyzozba</p>
- //
- if ( moveRange.start.hasSameParentAs( b.splitPosition ) && moveRange.containsPosition( b.splitPosition ) ) {
- let rightRange = new _range__WEBPACK_IMPORTED_MODULE_9__["default"]( b.splitPosition, moveRange.end );
- rightRange = rightRange._getTransformedBySplitOperation( b );
- const ranges = [
- new _range__WEBPACK_IMPORTED_MODULE_9__["default"]( moveRange.start, b.splitPosition ),
- rightRange
- ];
- return _makeMoveOperationsFromRanges( ranges, newTargetPosition );
- }
- // Case 3:
- //
- // Move operation targets at the split position. We need to decide if the nodes should be inserted
- // at the end of the split element or at the beginning of the new element.
- //
- if ( a.targetPosition.isEqual( b.splitPosition ) && context.abRelation == 'insertAtSource' ) {
- newTargetPosition = b.moveTargetPosition;
- }
- // Case 4:
- //
- // Move operation targets just after the split element. We need to decide if the nodes should be inserted
- // between two parts of split element, or after the new element.
- //
- // Split at `|`, while move operation moves `<p>Xyz</p>` and targets at `^`:
- // <p>Foo|bar</p>^<p>baz</p>
- // <p>Foo</p>^<p>bar</p><p>baz</p> or <p>Foo</p><p>bar</p>^<p>baz</p>?
- //
- // If there is no contextual information between operations (for example, they come from collaborative
- // editing), we don't want to put some unrelated content (move) between parts of related content (split parts).
- // However, if the split is from undo, in the past, the moved content might be targeting between the
- // split parts, meaning that was exactly user's intention:
- //
- // <p>Foo</p>^<p>bar</p> <--- original situation, in "past".
- // <p>Foobar</p>^ <--- after merge target position is transformed.
- // <p>Foo|bar</p>^ <--- then the merge is undone, and split happens, which leads us to current situation.
- //
- // In this case it is pretty clear that the intention was to put new paragraph between those nodes,
- // so we need to transform accordingly. We can detect this scenario thanks to relations.
- //
- if ( a.targetPosition.isEqual( b.insertionPosition ) && context.abRelation == 'insertBetween' ) {
- newTargetPosition = a.targetPosition;
- }
- // The default case.
- //
- const transformed = moveRange._getTransformedBySplitOperation( b );
- const ranges = [ transformed ];
- // Case 5:
- //
- // Moved range contains graveyard element used by split operation. Add extra move operation to the result.
- //
- if ( b.graveyardPosition ) {
- const movesGraveyardElement = moveRange.start.isEqual( b.graveyardPosition ) || moveRange.containsPosition( b.graveyardPosition );
- if ( a.howMany > 1 && movesGraveyardElement && !context.aWasUndone ) {
- ranges.push( _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.insertionPosition, 1 ) );
- }
- }
- return _makeMoveOperationsFromRanges( ranges, newTargetPosition );
- } );
- setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b, context ) => {
- const movedRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
- if ( b.deletionPosition.hasSameParentAs( a.sourcePosition ) && movedRange.containsPosition( b.sourcePosition ) ) {
- if ( a.type == 'remove' && !context.forceWeakRemove ) {
- // Case 1:
- //
- // The element to remove got merged.
- //
- // Merge operation does support merging elements which are not siblings. So it would not be a problem
- // from technical point of view. However, if the element was removed, the intention of the user
- // deleting it was to have it all deleted. From user experience point of view, moving back the
- // removed nodes might be unexpected. This means that in this scenario we will reverse merging and remove the element.
- //
- if ( !context.aWasUndone ) {
- const results = [];
- let gyMoveSource = b.graveyardPosition.clone();
- let splitNodesMoveSource = b.targetPosition._getTransformedByMergeOperation( b );
- if ( a.howMany > 1 ) {
- results.push( new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( a.sourcePosition, a.howMany - 1, a.targetPosition, 0 ) );
- gyMoveSource = gyMoveSource._getTransformedByMove( a.sourcePosition, a.targetPosition, a.howMany - 1 );
- splitNodesMoveSource = splitNodesMoveSource._getTransformedByMove( a.sourcePosition, a.targetPosition, a.howMany - 1 );
- }
- const gyMoveTarget = b.deletionPosition._getCombined( a.sourcePosition, a.targetPosition );
- const gyMove = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( gyMoveSource, 1, gyMoveTarget, 0 );
- const splitNodesMoveTargetPath = gyMove.getMovedRangeStart().path.slice();
- splitNodesMoveTargetPath.push( 0 );
- const splitNodesMoveTarget = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( gyMove.targetPosition.root, splitNodesMoveTargetPath );
- splitNodesMoveSource = splitNodesMoveSource._getTransformedByMove( gyMoveSource, gyMoveTarget, 1 );
- const splitNodesMove = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( splitNodesMoveSource, b.howMany, splitNodesMoveTarget, 0 );
- results.push( gyMove );
- results.push( splitNodesMove );
- return results;
- }
- } else {
- // Case 2:
- //
- // The element to move got merged and it was the only element to move.
- // In this case just don't do anything, leave the node in the graveyard. Without special case
- // it would be a move operation that moves 0 nodes, so maybe it is better just to return no-op.
- //
- if ( a.howMany == 1 ) {
- if ( !context.bWasUndone ) {
- return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
- } else {
- a.sourcePosition = b.graveyardPosition.clone();
- a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
- return [ a ];
- }
- }
- }
- }
- // The default case.
- //
- const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
- const transformed = moveRange._getTransformedByMergeOperation( b );
- a.sourcePosition = transformed.start;
- a.howMany = transformed.end.offset - transformed.start.offset;
- a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
- return [ a ];
- } );
- // -----------------------
- setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
- a.position = a.position._getTransformedByInsertOperation( b );
- return [ a ];
- } );
- setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
- // Case 1:
- //
- // Element to rename got merged, so it was moved to `b.graveyardPosition`.
- //
- if ( a.position.isEqual( b.deletionPosition ) ) {
- a.position = b.graveyardPosition.clone();
- a.position.stickiness = 'toNext';
- return [ a ];
- }
- a.position = a.position._getTransformedByMergeOperation( b );
- return [ a ];
- } );
- setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b ) => {
- a.position = a.position._getTransformedByMoveOperation( b );
- return [ a ];
- } );
- setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], ( a, b, context ) => {
- if ( a.position.isEqual( b.position ) ) {
- if ( context.aIsStrong ) {
- a.oldName = b.newName;
- } else {
- return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
- }
- }
- return [ a ];
- } );
- setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b ) => {
- // Case 1:
- //
- // The element to rename has been split. In this case, the new element should be also renamed.
- //
- // User decides to change the paragraph to a list item:
- // <paragraph>Foobar</paragraph>
- //
- // However, in meantime, split happens:
- // <paragraph>Foo</paragraph><paragraph>bar</paragraph>
- //
- // As a result, rename both elements:
- // <listItem>Foo</listItem><listItem>bar</listItem>
- //
- const renamePath = a.position.path;
- const splitPath = b.splitPosition.getParentPath();
- if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__["default"])( renamePath, splitPath ) == 'same' && !b.graveyardPosition ) {
- const extraRename = new _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"]( a.position.getShiftedBy( 1 ), a.oldName, a.newName, 0 );
- return [ a, extraRename ];
- }
- // The default case.
- //
- a.position = a.position._getTransformedBySplitOperation( b );
- return [ a ];
- } );
- // -----------------------
- setTransformation( _rootattributeoperation__WEBPACK_IMPORTED_MODULE_5__["default"], _rootattributeoperation__WEBPACK_IMPORTED_MODULE_5__["default"], ( a, b, context ) => {
- if ( a.root === b.root && a.key === b.key ) {
- if ( !context.aIsStrong || a.newValue === b.newValue ) {
- return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
- } else {
- a.oldValue = b.newValue;
- }
- }
- return [ a ];
- } );
- // -----------------------
- setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
- // The default case.
- //
- if ( a.splitPosition.hasSameParentAs( b.position ) && a.splitPosition.offset < b.position.offset ) {
- a.howMany += b.howMany;
- }
- a.splitPosition = a.splitPosition._getTransformedByInsertOperation( b );
- a.insertionPosition = a.insertionPosition._getTransformedByInsertOperation( b );
- return [ a ];
- } );
- setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b, context ) => {
- // Case 1:
- //
- // Split element got merged. If two different elements were merged, clients will have different content.
- //
- // Example. Merge at `{}`, split at `[]`:
- // <heading>Foo</heading>{}<paragraph>B[]ar</paragraph>
- //
- // On merge side it will look like this:
- // <heading>FooB[]ar</heading>
- // <heading>FooB</heading><heading>ar</heading>
- //
- // On split side it will look like this:
- // <heading>Foo</heading>{}<paragraph>B</paragraph><paragraph>ar</paragraph>
- // <heading>FooB</heading><paragraph>ar</paragraph>
- //
- // Clearly, the second element is different for both clients.
- //
- // We could use the removed merge element from graveyard as a split element but then clients would have a different
- // model state (in graveyard), because the split side client would still have an element in graveyard (removed by merge).
- //
- // To overcome this, in `SplitOperation` x `MergeOperation` transformation we will add additional `SplitOperation`
- // in the graveyard, which will actually clone the merged-and-deleted element. Then, that cloned element will be
- // used for splitting. Example below.
- //
- // Original state:
- // <heading>Foo</heading>{}<paragraph>B[]ar</paragraph>
- //
- // Merge side client:
- //
- // After merge:
- // <heading>FooB[]ar</heading> graveyard: <paragraph></paragraph>
- //
- // Extra split:
- // <heading>FooB[]ar</heading> graveyard: <paragraph></paragraph><paragraph></paragraph>
- //
- // Use the "cloned" element from graveyard:
- // <heading>FooB</heading><paragraph>ar</paragraph> graveyard: <paragraph></paragraph>
- //
- // Split side client:
- //
- // After split:
- // <heading>Foo</heading>{}<paragraph>B</paragraph><paragraph>ar</paragraph>
- //
- // After merge:
- // <heading>FooB</heading><paragraph>ar</paragraph> graveyard: <paragraph></paragraph>
- //
- // This special case scenario only applies if the original split operation clones the split element.
- // If the original split operation has `graveyardPosition` set, it all doesn't have sense because split operation
- // knows exactly which element it should use. So there would be no original problem with different contents.
- //
- // Additionally, the special case applies only if the merge wasn't already undone.
- //
- if ( !a.graveyardPosition && !context.bWasUndone && a.splitPosition.hasSameParentAs( b.sourcePosition ) ) {
- const splitPath = b.graveyardPosition.path.slice();
- splitPath.push( 0 );
- const splitPosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.graveyardPosition.root, splitPath );
- const insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.graveyardPosition.root, splitPath ) );
- const additionalSplit = new _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]( splitPosition, 0, insertionPosition, null, 0 );
- a.splitPosition = a.splitPosition._getTransformedByMergeOperation( b );
- a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
- a.graveyardPosition = additionalSplit.insertionPosition.clone();
- a.graveyardPosition.stickiness = 'toNext';
- return [ additionalSplit, a ];
- }
- // The default case.
- //
- if ( a.splitPosition.hasSameParentAs( b.deletionPosition ) && !a.splitPosition.isAfter( b.deletionPosition ) ) {
- a.howMany--;
- }
- if ( a.splitPosition.hasSameParentAs( b.targetPosition ) ) {
- a.howMany += b.howMany;
- }
- a.splitPosition = a.splitPosition._getTransformedByMergeOperation( b );
- a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
- if ( a.graveyardPosition ) {
- a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation( b );
- }
- return [ a ];
- } );
- setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
- const rangeToMove = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.sourcePosition, b.howMany );
- if ( a.graveyardPosition ) {
- // Case 1:
- //
- // Split operation graveyard node was moved. In this case move operation is stronger. Since graveyard element
- // is already moved to the correct position, we need to only move the nodes after the split position.
- // This will be done by `MoveOperation` instead of `SplitOperation`.
- //
- const gyElementMoved = rangeToMove.start.isEqual( a.graveyardPosition ) || rangeToMove.containsPosition( a.graveyardPosition );
- if ( !context.bWasUndone && gyElementMoved ) {
- const sourcePosition = a.splitPosition._getTransformedByMoveOperation( b );
- const newParentPosition = a.graveyardPosition._getTransformedByMoveOperation( b );
- const newTargetPath = newParentPosition.path.slice();
- newTargetPath.push( 0 );
- const newTargetPosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( newParentPosition.root, newTargetPath );
- const moveOp = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( sourcePosition, a.howMany, newTargetPosition, 0 );
- return [ moveOp ];
- }
- a.graveyardPosition = a.graveyardPosition._getTransformedByMoveOperation( b );
- }
- // Case 2:
- //
- // Split is at a position where nodes were moved.
- //
- // This is a scenario described in `MoveOperation` x `SplitOperation` transformation but from the
- // "split operation point of view".
- //
- const splitAtTarget = a.splitPosition.isEqual( b.targetPosition );
- if ( splitAtTarget && ( context.baRelation == 'insertAtSource' || context.abRelation == 'splitBefore' ) ) {
- a.howMany += b.howMany;
- a.splitPosition = a.splitPosition._getTransformedByDeletion( b.sourcePosition, b.howMany );
- a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
- return [ a ];
- }
- if ( splitAtTarget && context.abRelation && context.abRelation.howMany ) {
- const { howMany, offset } = context.abRelation;
- a.howMany += howMany;
- a.splitPosition = a.splitPosition.getShiftedBy( offset );
- return [ a ];
- }
- // Case 3:
- //
- // If the split position is inside the moved range, we need to shift the split position to a proper place.
- // The position cannot be moved together with moved range because that would result in splitting of an incorrect element.
- //
- // Characters `bc` should be moved to the second paragraph while split position is between them:
- // <paragraph>A[b|c]d</paragraph><paragraph>Xyz</paragraph>
- //
- // After move, new split position is incorrect:
- // <paragraph>Ad</paragraph><paragraph>Xb|cyz</paragraph>
- //
- // Correct split position:
- // <paragraph>A|d</paragraph><paragraph>Xbcyz</paragraph>
- //
- // After split:
- // <paragraph>A</paragraph><paragraph>d</paragraph><paragraph>Xbcyz</paragraph>
- //
- if ( a.splitPosition.hasSameParentAs( b.sourcePosition ) && rangeToMove.containsPosition( a.splitPosition ) ) {
- const howManyRemoved = b.howMany - ( a.splitPosition.offset - b.sourcePosition.offset );
- a.howMany -= howManyRemoved;
- if ( a.splitPosition.hasSameParentAs( b.targetPosition ) && a.splitPosition.offset < b.targetPosition.offset ) {
- a.howMany += b.howMany;
- }
- a.splitPosition = b.sourcePosition.clone();
- a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
- return [ a ];
- }
- // The default case.
- // Don't change `howMany` if move operation does not really move anything.
- //
- if ( !b.sourcePosition.isEqual( b.targetPosition ) ) {
- if ( a.splitPosition.hasSameParentAs( b.sourcePosition ) && a.splitPosition.offset <= b.sourcePosition.offset ) {
- a.howMany -= b.howMany;
- }
- if ( a.splitPosition.hasSameParentAs( b.targetPosition ) && a.splitPosition.offset < b.targetPosition.offset ) {
- a.howMany += b.howMany;
- }
- }
- // Change position stickiness to force a correct transformation.
- a.splitPosition.stickiness = 'toNone';
- a.splitPosition = a.splitPosition._getTransformedByMoveOperation( b );
- a.splitPosition.stickiness = 'toNext';
- if ( a.graveyardPosition ) {
- a.insertionPosition = a.insertionPosition._getTransformedByMoveOperation( b );
- } else {
- a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
- }
- return [ a ];
- } );
- setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
- // Case 1:
- //
- // Split at the same position.
- //
- // If there already was a split at the same position as in `a` operation, it means that the intention
- // conveyed by `a` operation has already been fulfilled and `a` should not do anything (to avoid double split).
- //
- // However, there is a difference if these are new splits or splits created by undo. These have different
- // intentions. Also splits moving back different elements from graveyard have different intentions. They
- // are just different operations.
- //
- // So we cancel split operation only if it was really identical.
- //
- // Also, there is additional case, where split operations aren't identical and should not be cancelled, however the
- // default transformation is incorrect too.
- //
- if ( a.splitPosition.isEqual( b.splitPosition ) ) {
- if ( !a.graveyardPosition && !b.graveyardPosition ) {
- return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
- }
- if ( a.graveyardPosition && b.graveyardPosition && a.graveyardPosition.isEqual( b.graveyardPosition ) ) {
- return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
- }
- // Use context to know that the `a.splitPosition` should stay where it is.
- // This happens during undo when first a merge operation moved nodes to `a.splitPosition` and now `b` operation undoes that merge.
- if ( context.abRelation == 'splitBefore' ) {
- // Since split is at the same position, there are no nodes left to split.
- a.howMany = 0;
- // Note: there was `if ( a.graveyardPosition )` here but it was uncovered in tests and I couldn't find any scenarios for now.
- // That would have to be a `SplitOperation` that didn't come from undo but is transformed by operations that were undone.
- // It could happen if `context` is enabled in collaboration.
- a.graveyardPosition = a.graveyardPosition._getTransformedBySplitOperation( b );
- return [ a ];
- }
- }
- // Case 2:
- //
- // Same node is using to split different elements. This happens in undo when previously same element was merged to
- // two different elements. This is described in `MergeOperation` x `MergeOperation` transformation.
- //
- // In this case we will follow the same logic. We will assume that `insertionPosition` is same for both
- // split operations. This might not always be true but in the real cases that were experienced it was. After all,
- // if these splits are reverses of merge operations that were merging the same element, then the `insertionPosition`
- // should be same for both of those splits.
- //
- // Again, we will decide which operation is stronger by checking if split happens in graveyard or in non-graveyard root.
- //
- if ( a.graveyardPosition && b.graveyardPosition && a.graveyardPosition.isEqual( b.graveyardPosition ) ) {
- const aInGraveyard = a.splitPosition.root.rootName == '$graveyard';
- const bInGraveyard = b.splitPosition.root.rootName == '$graveyard';
- // If `aIsWeak` it means that `a` points to graveyard while `b` doesn't. Don't move nodes then.
- const aIsWeak = aInGraveyard && !bInGraveyard;
- // If `bIsWeak` it means that `b` points to graveyard while `a` doesn't. Force moving nodes then.
- const bIsWeak = bInGraveyard && !aInGraveyard;
- // Force move if `b` is weak or neither operation is weak but `a` is stronger through `context.aIsStrong`.
- const forceMove = bIsWeak || ( !aIsWeak && context.aIsStrong );
- if ( forceMove ) {
- const result = [];
- // First we need to move any nodes split by `b` back to where they were.
- // Do it only if `b` actually moved something.
- if ( b.howMany ) {
- result.push( new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( b.moveTargetPosition, b.howMany, b.splitPosition, 0 ) );
- }
- // Then we need to move nodes from `a` split position to their new element.
- // Do it only if `a` actually should move something.
- if ( a.howMany ) {
- result.push( new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( a.splitPosition, a.howMany, a.moveTargetPosition, 0 ) );
- }
- return result;
- } else {
- return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
- }
- }
- if ( a.graveyardPosition ) {
- a.graveyardPosition = a.graveyardPosition._getTransformedBySplitOperation( b );
- }
- // Case 3:
- //
- // Position where operation `b` inserted a new node after split is the same as the operation `a` split position.
- // As in similar cases, there is ambiguity if the split should be before the new node (created by `b`) or after.
- //
- if ( a.splitPosition.isEqual( b.insertionPosition ) && context.abRelation == 'splitBefore' ) {
- a.howMany++;
- return [ a ];
- }
- // Case 4:
- //
- // This is a mirror to the case 2. above.
- //
- if ( b.splitPosition.isEqual( a.insertionPosition ) && context.baRelation == 'splitBefore' ) {
- const newPositionPath = b.insertionPosition.path.slice();
- newPositionPath.push( 0 );
- const newPosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.insertionPosition.root, newPositionPath );
- const moveOp = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( a.insertionPosition, 1, newPosition, 0 );
- return [ a, moveOp ];
- }
- // The default case.
- //
- if ( a.splitPosition.hasSameParentAs( b.splitPosition ) && a.splitPosition.offset < b.splitPosition.offset ) {
- a.howMany -= b.howMany;
- }
- a.splitPosition = a.splitPosition._getTransformedBySplitOperation( b );
- a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
- return [ a ];
- } );
- // Checks whether `MoveOperation` `targetPosition` is inside a node from the moved range of the other `MoveOperation`.
- //
- // @private
- // @param {module:engine/model/operation/moveoperation~MoveOperation} a
- // @param {module:engine/model/operation/moveoperation~MoveOperation} b
- // @returns {Boolean}
- function _moveTargetIntoMovedRange( a, b ) {
- return a.targetPosition._getTransformedByDeletion( b.sourcePosition, b.howMany ) === null;
- }
- // Helper function for `MoveOperation` x `MoveOperation` transformation. Converts given ranges and target position to
- // move operations and returns them.
- //
- // Ranges and target position will be transformed on-the-fly when generating operations.
- //
- // Given `ranges` should be in the order of how they were in the original transformed operation.
- //
- // Given `targetPosition` is the target position of the first range from `ranges`.
- //
- // @private
- // @param {Array.<module:engine/model/range~Range>} ranges
- // @param {module:engine/model/position~Position} targetPosition
- // @returns {Array.<module:engine/model/operation/moveoperation~MoveOperation>}
- function _makeMoveOperationsFromRanges( ranges, targetPosition ) {
- // At this moment we have some ranges and a target position, to which those ranges should be moved.
- // Order in `ranges` array is the go-to order of after transformation.
- //
- // We are almost done. We have `ranges` and `targetPosition` to make operations from.
- // Unfortunately, those operations may affect each other. Precisely, first operation after move
- // may affect source range and target position of second and third operation. Same with second
- // operation affecting third.
- //
- // We need to fix those source ranges and target positions once again, before converting `ranges` to operations.
- const operations = [];
- // Keep in mind that nothing will be transformed if there is just one range in `ranges`.
- for ( let i = 0; i < ranges.length; i++ ) {
- // Create new operation out of a range and target position.
- const range = ranges[ i ];
- const op = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"](
- range.start,
- range.end.offset - range.start.offset,
- targetPosition,
- 0
- );
- operations.push( op );
- // Transform other ranges by the generated operation.
- for ( let j = i + 1; j < ranges.length; j++ ) {
- // All ranges in `ranges` array should be:
- //
- // * non-intersecting (these are part of original operation source range), and
- // * `targetPosition` does not target into them (opposite would mean that transformed operation targets "inside itself").
- //
- // This means that the transformation will be "clean" and always return one result.
- ranges[ j ] = ranges[ j ]._getTransformedByMove( op.sourcePosition, op.targetPosition, op.howMany )[ 0 ];
- }
- targetPosition = targetPosition._getTransformedByMove( op.sourcePosition, op.targetPosition, op.howMany );
- }
- return operations;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js ***!
- \******************************************************************************/
- /*! exports provided: _insert, _remove, _move, _setAttribute, _normalizeNodes */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_insert", function() { return _insert; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_remove", function() { return _remove; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_move", function() { return _move; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_setAttribute", function() { return _setAttribute; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_normalizeNodes", function() { return _normalizeNodes; });
- /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
- /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js");
- /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/operation/utils
- */
- /**
- * Contains functions used for composing model tree by {@link module:engine/model/operation/operation~Operation operations}.
- * Those functions are built on top of {@link module:engine/model/node~Node node}, and it's child classes', APIs.
- *
- * @protected
- * @namespace utils
- */
- /**
- * Inserts given nodes at given position.
- *
- * @protected
- * @function module:engine/model/operation/utils~utils.insert
- * @param {module:engine/model/position~Position} position Position at which nodes should be inserted.
- * @param {module:engine/model/node~NodeSet} nodes Nodes to insert.
- * @returns {module:engine/model/range~Range} Range spanning over inserted elements.
- */
- function _insert( position, nodes ) {
- nodes = _normalizeNodes( nodes );
- // We have to count offset before inserting nodes because they can get merged and we would get wrong offsets.
- const offset = nodes.reduce( ( sum, node ) => sum + node.offsetSize, 0 );
- const parent = position.parent;
- // Insertion might be in a text node, we should split it if that's the case.
- _splitNodeAtPosition( position );
- const index = position.index;
- // Insert nodes at given index. After splitting we have a proper index and insertion is between nodes,
- // using basic `Element` API.
- parent._insertChild( index, nodes );
- // Merge text nodes, if possible. Merging is needed only at points where inserted nodes "touch" "old" nodes.
- _mergeNodesAtIndex( parent, index + nodes.length );
- _mergeNodesAtIndex( parent, index );
- return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( position, position.getShiftedBy( offset ) );
- }
- /**
- * Removed nodes in given range. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.
- *
- * @protected
- * @function module:engine/model/operation/utils~utils._remove
- * @param {module:engine/model/range~Range} range Range containing nodes to remove.
- * @returns {Array.<module:engine/model/node~Node>}
- */
- function _remove( range ) {
- if ( !range.isFlat ) {
- /**
- * Trying to remove a range which starts and ends in different element.
- *
- * @error operation-utils-remove-range-not-flat
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"](
- 'operation-utils-remove-range-not-flat',
- this
- );
- }
- const parent = range.start.parent;
- // Range may be inside text nodes, we have to split them if that's the case.
- _splitNodeAtPosition( range.start );
- _splitNodeAtPosition( range.end );
- // Remove the text nodes using basic `Element` API.
- const removed = parent._removeChildren( range.start.index, range.end.index - range.start.index );
- // Merge text nodes, if possible. After some nodes were removed, node before and after removed range will be
- // touching at the position equal to the removed range beginning. We check merging possibility there.
- _mergeNodesAtIndex( parent, range.start.index );
- return removed;
- }
- /**
- * Moves nodes in given range to given target position. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.
- *
- * @protected
- * @function module:engine/model/operation/utils~utils.move
- * @param {module:engine/model/range~Range} sourceRange Range containing nodes to move.
- * @param {module:engine/model/position~Position} targetPosition Position to which nodes should be moved.
- * @returns {module:engine/model/range~Range} Range containing moved nodes.
- */
- function _move( sourceRange, targetPosition ) {
- if ( !sourceRange.isFlat ) {
- /**
- * Trying to move a range which starts and ends in different element.
- *
- * @error operation-utils-move-range-not-flat
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"](
- 'operation-utils-move-range-not-flat',
- this
- );
- }
- const nodes = _remove( sourceRange );
- // We have to fix `targetPosition` because model changed after nodes from `sourceRange` got removed and
- // that change might have an impact on `targetPosition`.
- targetPosition = targetPosition._getTransformedByDeletion( sourceRange.start, sourceRange.end.offset - sourceRange.start.offset );
- return _insert( targetPosition, nodes );
- }
- /**
- * Sets given attribute on nodes in given range. The attributes are only set on top-level nodes of the range, not on its children.
- *
- * @protected
- * @function module:engine/model/operation/utils~utils._setAttribute
- * @param {module:engine/model/range~Range} range Range containing nodes that should have the attribute set. Must be a flat range.
- * @param {String} key Key of attribute to set.
- * @param {*} value Attribute value.
- */
- function _setAttribute( range, key, value ) {
- // Range might start or end in text nodes, so we have to split them.
- _splitNodeAtPosition( range.start );
- _splitNodeAtPosition( range.end );
- // Iterate over all items in the range.
- for ( const item of range.getItems( { shallow: true } ) ) {
- // Iterator will return `TextProxy` instances but we know that those text proxies will
- // always represent full text nodes (this is guaranteed thanks to splitting we did before).
- // So, we can operate on those text proxies' text nodes.
- const node = item.is( '$textProxy' ) ? item.textNode : item;
- if ( value !== null ) {
- node._setAttribute( key, value );
- } else {
- node._removeAttribute( key );
- }
- // After attributes changing it may happen that some text nodes can be merged. Try to merge with previous node.
- _mergeNodesAtIndex( node.parent, node.index );
- }
- // Try to merge last changed node with it's previous sibling (not covered by the loop above).
- _mergeNodesAtIndex( range.end.parent, range.end.index );
- }
- /**
- * Normalizes given object or an array of objects to an array of {@link module:engine/model/node~Node nodes}. See
- * {@link module:engine/model/node~NodeSet NodeSet} for details on how normalization is performed.
- *
- * @protected
- * @function module:engine/model/operation/utils~utils.normalizeNodes
- * @param {module:engine/model/node~NodeSet} nodes Objects to normalize.
- * @returns {Array.<module:engine/model/node~Node>} Normalized nodes.
- */
- function _normalizeNodes( nodes ) {
- const normalized = [];
- if ( !( nodes instanceof Array ) ) {
- nodes = [ nodes ];
- }
- // Convert instances of classes other than Node.
- for ( let i = 0; i < nodes.length; i++ ) {
- if ( typeof nodes[ i ] == 'string' ) {
- normalized.push( new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( nodes[ i ] ) );
- } else if ( nodes[ i ] instanceof _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
- normalized.push( new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( nodes[ i ].data, nodes[ i ].getAttributes() ) );
- } else if ( nodes[ i ] instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_4__["default"] || nodes[ i ] instanceof _nodelist__WEBPACK_IMPORTED_MODULE_5__["default"] ) {
- for ( const child of nodes[ i ] ) {
- normalized.push( child );
- }
- } else if ( nodes[ i ] instanceof _node__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- normalized.push( nodes[ i ] );
- }
- // Skip unrecognized type.
- }
- // Merge text nodes.
- for ( let i = 1; i < normalized.length; i++ ) {
- const node = normalized[ i ];
- const prev = normalized[ i - 1 ];
- if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] && prev instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] && _haveSameAttributes( node, prev ) ) {
- // Doing this instead changing `prev.data` because `data` is readonly.
- normalized.splice( i - 1, 2, new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( prev.data + node.data, prev.getAttributes() ) );
- i--;
- }
- }
- return normalized;
- }
- // Checks if nodes before and after given index in given element are {@link module:engine/model/text~Text text nodes} and
- // merges them into one node if they have same attributes.
- //
- // Merging is done by removing two text nodes and inserting a new text node containing data from both merged text nodes.
- //
- // @private
- // @param {module:engine/model/element~Element} element Parent element of nodes to merge.
- // @param {Number} index Index between nodes to merge.
- function _mergeNodesAtIndex( element, index ) {
- const nodeBefore = element.getChild( index - 1 );
- const nodeAfter = element.getChild( index );
- // Check if both of those nodes are text objects with same attributes.
- if ( nodeBefore && nodeAfter && nodeBefore.is( '$text' ) && nodeAfter.is( '$text' ) && _haveSameAttributes( nodeBefore, nodeAfter ) ) {
- // Append text of text node after index to the before one.
- const mergedNode = new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( nodeBefore.data + nodeAfter.data, nodeBefore.getAttributes() );
- // Remove separate text nodes.
- element._removeChildren( index - 1, 2 );
- // Insert merged text node.
- element._insertChild( index - 1, mergedNode );
- }
- }
- // Checks if given position is in a text node, and if so, splits the text node in two text nodes, each of them
- // containing a part of original text node.
- //
- // @private
- // @param {module:engine/model/position~Position} position Position at which node should be split.
- function _splitNodeAtPosition( position ) {
- const textNode = position.textNode;
- const element = position.parent;
- if ( textNode ) {
- const offsetDiff = position.offset - textNode.startOffset;
- const index = textNode.index;
- element._removeChildren( index, 1 );
- const firstPart = new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( textNode.data.substr( 0, offsetDiff ), textNode.getAttributes() );
- const secondPart = new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( textNode.data.substr( offsetDiff ), textNode.getAttributes() );
- element._insertChild( index, [ firstPart, secondPart ] );
- }
- }
- // Checks whether two given nodes have same attributes.
- //
- // @private
- // @param {module:engine/model/node~Node} nodeA Node to check.
- // @param {module:engine/model/node~Node} nodeB Node to check.
- // @returns {Boolean} `true` if nodes have same attributes, `false` otherwise.
- function _haveSameAttributes( nodeA, nodeB ) {
- const iteratorA = nodeA.getAttributes();
- const iteratorB = nodeB.getAttributes();
- for ( const attr of iteratorA ) {
- if ( attr[ 1 ] !== nodeB.getAttribute( attr[ 0 ] ) ) {
- return false;
- }
- iteratorB.next();
- }
- return iteratorB.next().done;
- }
- /**
- * Value that can be normalized to an array of {@link module:engine/model/node~Node nodes}.
- *
- * Non-arrays are normalized as follows:
- * * {@link module:engine/model/node~Node Node} is left as is,
- * * {@link module:engine/model/textproxy~TextProxy TextProxy} and `String` are normalized to {@link module:engine/model/text~Text Text},
- * * {@link module:engine/model/nodelist~NodeList NodeList} is normalized to an array containing all nodes that are in that node list,
- * * {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment} is normalized to an array containing all of it's
- * * children.
- *
- * Arrays are processed item by item like non-array values and flattened to one array. Normalization always results in
- * a flat array of {@link module:engine/model/node~Node nodes}. Consecutive text nodes (or items normalized to text nodes) will be
- * merged if they have same attributes.
- *
- * @typedef {module:engine/model/node~Node|module:engine/model/textproxy~TextProxy|String|
- * module:engine/model/nodelist~NodeList|module:engine/model/documentfragment~DocumentFragment|Iterable}
- * module:engine/model/node~NodeSet
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js ***!
- \***********************************************************************/
- /*! exports provided: default, getTextNodeAtPosition, getNodeAfterPosition, getNodeBeforePosition */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Position; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextNodeAtPosition", function() { return getTextNodeAtPosition; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeAfterPosition", function() { return getNodeAfterPosition; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeBeforePosition", function() { return getNodeBeforePosition; });
- /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_version__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/position
- */
- // To check if component is loaded more than once.
- /**
- * Represents a position in the model tree.
- *
- * A position is represented by its {@link module:engine/model/position~Position#root} and
- * a {@link module:engine/model/position~Position#path} in that root.
- *
- * You can create position instances via its constructor or the `createPosition*()` factory methods of
- * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.
- *
- * **Note:** Position is based on offsets, not indexes. This means that a position between two text nodes
- * `foo` and `bar` has offset `3`, not `1`. See {@link module:engine/model/position~Position#path} for more information.
- *
- * Since a position in the model is represented by a {@link module:engine/model/position~Position#root position root} and
- * {@link module:engine/model/position~Position#path position path} it is possible to create positions placed in non-existing places.
- * This requirement is important for operational transformation algorithms.
- *
- * Also, {@link module:engine/model/operation/operation~Operation operations}
- * kept in the {@link module:engine/model/document~Document#history document history}
- * are storing positions (and ranges) which were correct when those operations were applied, but may not be correct
- * after the document has changed.
- *
- * When changes are applied to the model, it may also happen that {@link module:engine/model/position~Position#parent position parent}
- * will change even if position path has not changed. Keep in mind, that if a position leads to non-existing element,
- * {@link module:engine/model/position~Position#parent} and some other properties and methods will throw errors.
- *
- * In most cases, position with wrong path is caused by an error in code, but it is sometimes needed, as described above.
- */
- class Position {
- /**
- * Creates a position.
- *
- * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.
- * @param {Array.<Number>} path Position path. See {@link module:engine/model/position~Position#path}.
- * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
- * See {@link module:engine/model/position~PositionStickiness}.
- */
- constructor( root, path, stickiness = 'toNone' ) {
- if ( !root.is( 'element' ) && !root.is( 'documentFragment' ) ) {
- /**
- * Position root is invalid.
- *
- * Positions can only be anchored in elements or document fragments.
- *
- * @error model-position-root-invalid
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
- 'model-position-root-invalid',
- root
- );
- }
- if ( !( path instanceof Array ) || path.length === 0 ) {
- /**
- * Position path must be an array with at least one item.
- *
- * @error model-position-path-incorrect-format
- * @param path
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
- 'model-position-path-incorrect-format',
- root,
- { path }
- );
- }
- // Normalize the root and path when element (not root) is passed.
- if ( root.is( 'rootElement' ) ) {
- path = path.slice();
- } else {
- path = [ ...root.getPath(), ...path ];
- root = root.root;
- }
- /**
- * Root of the position path.
- *
- * @readonly
- * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
- * module:engine/model/position~Position#root
- */
- this.root = root;
- /**
- * Position of the node in the tree. **Path contains offsets, not indexes.**
- *
- * Position can be placed before, after or in a {@link module:engine/model/node~Node node} if that node has
- * {@link module:engine/model/node~Node#offsetSize} greater than `1`. Items in position path are
- * {@link module:engine/model/node~Node#startOffset starting offsets} of position ancestors, starting from direct root children,
- * down to the position offset in it's parent.
- *
- * ROOT
- * |- P before: [ 0 ] after: [ 1 ]
- * |- UL before: [ 1 ] after: [ 2 ]
- * |- LI before: [ 1, 0 ] after: [ 1, 1 ]
- * | |- foo before: [ 1, 0, 0 ] after: [ 1, 0, 3 ]
- * |- LI before: [ 1, 1 ] after: [ 1, 2 ]
- * |- bar before: [ 1, 1, 0 ] after: [ 1, 1, 3 ]
- *
- * `foo` and `bar` are representing {@link module:engine/model/text~Text text nodes}. Since text nodes has offset size
- * greater than `1` you can place position offset between their start and end:
- *
- * ROOT
- * |- P
- * |- UL
- * |- LI
- * | |- f^o|o ^ has path: [ 1, 0, 1 ] | has path: [ 1, 0, 2 ]
- * |- LI
- * |- b^a|r ^ has path: [ 1, 1, 1 ] | has path: [ 1, 1, 2 ]
- *
- * @readonly
- * @member {Array.<Number>} module:engine/model/position~Position#path
- */
- this.path = path;
- /**
- * Position stickiness. See {@link module:engine/model/position~PositionStickiness}.
- *
- * @member {module:engine/model/position~PositionStickiness} module:engine/model/position~Position#stickiness
- */
- this.stickiness = stickiness;
- }
- /**
- * Offset at which this position is located in its {@link module:engine/model/position~Position#parent parent}. It is equal
- * to the last item in position {@link module:engine/model/position~Position#path path}.
- *
- * @type {Number}
- */
- get offset() {
- return this.path[ this.path.length - 1 ];
- }
- set offset( newOffset ) {
- this.path[ this.path.length - 1 ] = newOffset;
- }
- /**
- * Parent element of this position.
- *
- * Keep in mind that `parent` value is calculated when the property is accessed.
- * If {@link module:engine/model/position~Position#path position path}
- * leads to a non-existing element, `parent` property will throw error.
- *
- * Also it is a good idea to cache `parent` property if it is used frequently in an algorithm (i.e. in a long loop).
- *
- * @readonly
- * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
- */
- get parent() {
- let parent = this.root;
- for ( let i = 0; i < this.path.length - 1; i++ ) {
- parent = parent.getChild( parent.offsetToIndex( this.path[ i ] ) );
- if ( !parent ) {
- /**
- * The position's path is incorrect. This means that a position does not point to
- * a correct place in the tree and hence, some of its methods and getters cannot work correctly.
- *
- * **Note**: Unlike DOM and view positions, in the model, the
- * {@link module:engine/model/position~Position#parent position's parent} is always an element or a document fragment.
- * The last offset in the {@link module:engine/model/position~Position#path position's path} is the point in this element
- * where this position points.
- *
- * Read more about model positions and offsets in
- * the {@glink framework/guides/architecture/editing-engine#indexes-and-offsets Editing engine architecture guide}.
- *
- * @error model-position-path-incorrect
- * @param {module:engine/model/position~Position} position The incorrect position.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'model-position-path-incorrect', this, { position: this } );
- }
- }
- if ( parent.is( '$text' ) ) {
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'model-position-path-incorrect', this, { position: this } );
- }
- return parent;
- }
- /**
- * Position {@link module:engine/model/position~Position#offset offset} converted to an index in position's parent node. It is
- * equal to the {@link module:engine/model/node~Node#index index} of a node after this position. If position is placed
- * in text node, position index is equal to the index of that text node.
- *
- * @readonly
- * @type {Number}
- */
- get index() {
- return this.parent.offsetToIndex( this.offset );
- }
- /**
- * Returns {@link module:engine/model/text~Text text node} instance in which this position is placed or `null` if this
- * position is not in a text node.
- *
- * @readonly
- * @type {module:engine/model/text~Text|null}
- */
- get textNode() {
- return getTextNodeAtPosition( this, this.parent );
- }
- /**
- * Node directly after this position or `null` if this position is in text node.
- *
- * @readonly
- * @type {module:engine/model/node~Node|null}
- */
- get nodeAfter() {
- // Cache the parent and reuse for performance reasons. See #6579 and #6582.
- const parent = this.parent;
- return getNodeAfterPosition( this, parent, getTextNodeAtPosition( this, parent ) );
- }
- /**
- * Node directly before this position or `null` if this position is in text node.
- *
- * @readonly
- * @type {module:engine/model/node~Node|null}
- */
- get nodeBefore() {
- // Cache the parent and reuse for performance reasons. See #6579 and #6582.
- const parent = this.parent;
- return getNodeBeforePosition( this, parent, getTextNodeAtPosition( this, parent ) );
- }
- /**
- * Is `true` if position is at the beginning of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.
- *
- * @readonly
- * @type {Boolean}
- */
- get isAtStart() {
- return this.offset === 0;
- }
- /**
- * Is `true` if position is at the end of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.
- *
- * @readonly
- * @type {Boolean}
- */
- get isAtEnd() {
- return this.offset == this.parent.maxOffset;
- }
- /**
- * Checks whether this position is before or after given position.
- *
- * This method is safe to use it on non-existing positions (for example during operational transformation).
- *
- * @param {module:engine/model/position~Position} otherPosition Position to compare with.
- * @returns {module:engine/model/position~PositionRelation}
- */
- compareWith( otherPosition ) {
- if ( this.root != otherPosition.root ) {
- return 'different';
- }
- const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( this.path, otherPosition.path );
- switch ( result ) {
- case 'same':
- return 'same';
- case 'prefix':
- return 'before';
- case 'extension':
- return 'after';
- default:
- return this.path[ result ] < otherPosition.path[ result ] ? 'before' : 'after';
- }
- }
- /**
- * Gets the farthest position which matches the callback using
- * {@link module:engine/model/treewalker~TreeWalker TreeWalker}.
- *
- * For example:
- *
- * getLastMatchingPosition( value => value.type == 'text' );
- * // <paragraph>[]foo</paragraph> -> <paragraph>foo[]</paragraph>
- *
- * getLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } );
- * // <paragraph>foo[]</paragraph> -> <paragraph>[]foo</paragraph>
- *
- * getLastMatchingPosition( value => false );
- * // Do not move the position.
- *
- * @param {Function} skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should
- * return `true` if the value should be skipped or `false` if not.
- * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
- *
- * @returns {module:engine/model/position~Position} The position after the last item which matches the `skip` callback test.
- */
- getLastMatchingPosition( skip, options = {} ) {
- options.startPosition = this;
- const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( options );
- treeWalker.skip( skip );
- return treeWalker.position;
- }
- /**
- * Returns a path to this position's parent. Parent path is equal to position {@link module:engine/model/position~Position#path path}
- * but without the last item.
- *
- * This method is safe to use it on non-existing positions (for example during operational transformation).
- *
- * @returns {Array.<Number>} Path to the parent.
- */
- getParentPath() {
- return this.path.slice( 0, -1 );
- }
- /**
- * Returns ancestors array of this position, that is this position's parent and its ancestors.
- *
- * @returns {Array.<module:engine/model/item~Item>} Array with ancestors.
- */
- getAncestors() {
- const parent = this.parent;
- if ( parent.is( 'documentFragment' ) ) {
- return [ parent ];
- } else {
- return parent.getAncestors( { includeSelf: true } );
- }
- }
- /**
- * Returns the parent element of the given name. Returns null if the position is not inside the desired parent.
- *
- * @param {String} parentName The name of the parent element to find.
- * @returns {module:engine/model/element~Element|null}
- */
- findAncestor( parentName ) {
- const parent = this.parent;
- if ( parent.is( 'element' ) ) {
- return parent.findAncestor( parentName, { includeSelf: true } );
- }
- return null;
- }
- /**
- * Returns the slice of two position {@link #path paths} which is identical. The {@link #root roots}
- * of these two paths must be identical.
- *
- * This method is safe to use it on non-existing positions (for example during operational transformation).
- *
- * @param {module:engine/model/position~Position} position The second position.
- * @returns {Array.<Number>} The common path.
- */
- getCommonPath( position ) {
- if ( this.root != position.root ) {
- return [];
- }
- // We find on which tree-level start and end have the lowest common ancestor
- const cmp = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( this.path, position.path );
- // If comparison returned string it means that arrays are same.
- const diffAt = ( typeof cmp == 'string' ) ? Math.min( this.path.length, position.path.length ) : cmp;
- return this.path.slice( 0, diffAt );
- }
- /**
- * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
- * which is a common ancestor of both positions. The {@link #root roots} of these two positions must be identical.
- *
- * @param {module:engine/model/position~Position} position The second position.
- * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
- */
- getCommonAncestor( position ) {
- const ancestorsA = this.getAncestors();
- const ancestorsB = position.getAncestors();
- let i = 0;
- while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
- i++;
- }
- return i === 0 ? null : ancestorsA[ i - 1 ];
- }
- /**
- * Returns a new instance of `Position`, that has same {@link #parent parent} but it's offset
- * is shifted by `shift` value (can be a negative value).
- *
- * This method is safe to use it on non-existing positions (for example during operational transformation).
- *
- * @param {Number} shift Offset shift. Can be a negative value.
- * @returns {module:engine/model/position~Position} Shifted position.
- */
- getShiftedBy( shift ) {
- const shifted = this.clone();
- const offset = shifted.offset + shift;
- shifted.offset = offset < 0 ? 0 : offset;
- return shifted;
- }
- /**
- * Checks whether this position is after given position.
- *
- * This method is safe to use it on non-existing positions (for example during operational transformation).
- *
- * @see module:engine/model/position~Position#isBefore
- * @param {module:engine/model/position~Position} otherPosition Position to compare with.
- * @returns {Boolean} True if this position is after given position.
- */
- isAfter( otherPosition ) {
- return this.compareWith( otherPosition ) == 'after';
- }
- /**
- * Checks whether this position is before given position.
- *
- * **Note:** watch out when using negation of the value returned by this method, because the negation will also
- * be `true` if positions are in different roots and you might not expect this. You should probably use
- * `a.isAfter( b ) || a.isEqual( b )` or `!a.isBefore( p ) && a.root == b.root` in most scenarios. If your
- * condition uses multiple `isAfter` and `isBefore` checks, build them so they do not use negated values, i.e.:
- *
- * if ( a.isBefore( b ) && c.isAfter( d ) ) {
- * // do A.
- * } else {
- * // do B.
- * }
- *
- * or, if you have only one if-branch:
- *
- * if ( !( a.isBefore( b ) && c.isAfter( d ) ) {
- * // do B.
- * }
- *
- * rather than:
- *
- * if ( !a.isBefore( b ) || && !c.isAfter( d ) ) {
- * // do B.
- * } else {
- * // do A.
- * }
- *
- * This method is safe to use it on non-existing positions (for example during operational transformation).
- *
- * @param {module:engine/model/position~Position} otherPosition Position to compare with.
- * @returns {Boolean} True if this position is before given position.
- */
- isBefore( otherPosition ) {
- return this.compareWith( otherPosition ) == 'before';
- }
- /**
- * Checks whether this position is equal to given position.
- *
- * This method is safe to use it on non-existing positions (for example during operational transformation).
- *
- * @param {module:engine/model/position~Position} otherPosition Position to compare with.
- * @returns {Boolean} True if positions are same.
- */
- isEqual( otherPosition ) {
- return this.compareWith( otherPosition ) == 'same';
- }
- /**
- * Checks whether this position is touching given position. Positions touch when there are no text nodes
- * or empty nodes in a range between them. Technically, those positions are not equal but in many cases
- * they are very similar or even indistinguishable.
- *
- * @param {module:engine/model/position~Position} otherPosition Position to compare with.
- * @returns {Boolean} True if positions touch.
- */
- isTouching( otherPosition ) {
- let left = null;
- let right = null;
- const compare = this.compareWith( otherPosition );
- switch ( compare ) {
- case 'same':
- return true;
- case 'before':
- left = Position._createAt( this );
- right = Position._createAt( otherPosition );
- break;
- case 'after':
- left = Position._createAt( otherPosition );
- right = Position._createAt( this );
- break;
- default:
- return false;
- }
- // Cached for optimization purposes.
- let leftParent = left.parent;
- while ( left.path.length + right.path.length ) {
- if ( left.isEqual( right ) ) {
- return true;
- }
- if ( left.path.length > right.path.length ) {
- if ( left.offset !== leftParent.maxOffset ) {
- return false;
- }
- left.path = left.path.slice( 0, -1 );
- leftParent = leftParent.parent;
- left.offset++;
- } else {
- if ( right.offset !== 0 ) {
- return false;
- }
- right.path = right.path.slice( 0, -1 );
- }
- }
- }
- /**
- * Checks whether this object is of the given.
- *
- * position.is( 'position' ); // -> true
- * position.is( 'model:position' ); // -> true
- *
- * position.is( 'view:position' ); // -> false
- * position.is( 'documentSelection' ); // -> false
- *
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'position' || type === 'model:position';
- }
- /**
- * Checks if two positions are in the same parent.
- *
- * This method is safe to use it on non-existing positions (for example during operational transformation).
- *
- * @param {module:engine/model/position~Position} position Position to compare with.
- * @returns {Boolean} `true` if positions have the same parent, `false` otherwise.
- */
- hasSameParentAs( position ) {
- if ( this.root !== position.root ) {
- return false;
- }
- const thisParentPath = this.getParentPath();
- const posParentPath = position.getParentPath();
- return Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( thisParentPath, posParentPath ) == 'same';
- }
- /**
- * Returns a copy of this position that is transformed by given `operation`.
- *
- * The new position's parameters are updated accordingly to the effect of the `operation`.
- *
- * For example, if `n` nodes are inserted before the position, the returned position {@link ~Position#offset} will be
- * increased by `n`. If the position was in a merged element, it will be accordingly moved to the new element, etc.
- *
- * This method is safe to use it on non-existing positions (for example during operational transformation).
- *
- * @param {module:engine/model/operation/operation~Operation} operation Operation to transform by.
- * @returns {module:engine/model/position~Position} Transformed position.
- */
- getTransformedByOperation( operation ) {
- let result;
- switch ( operation.type ) {
- case 'insert':
- result = this._getTransformedByInsertOperation( operation );
- break;
- case 'move':
- case 'remove':
- case 'reinsert':
- result = this._getTransformedByMoveOperation( operation );
- break;
- case 'split':
- result = this._getTransformedBySplitOperation( operation );
- break;
- case 'merge':
- result = this._getTransformedByMergeOperation( operation );
- break;
- default:
- result = Position._createAt( this );
- break;
- }
- return result;
- }
- /**
- * Returns a copy of this position transformed by an insert operation.
- *
- * @protected
- * @param {module:engine/model/operation/insertoperation~InsertOperation} operation
- * @returns {module:engine/model/position~Position}
- */
- _getTransformedByInsertOperation( operation ) {
- return this._getTransformedByInsertion( operation.position, operation.howMany );
- }
- /**
- * Returns a copy of this position transformed by a move operation.
- *
- * @protected
- * @param {module:engine/model/operation/moveoperation~MoveOperation} operation
- * @returns {module:engine/model/position~Position}
- */
- _getTransformedByMoveOperation( operation ) {
- return this._getTransformedByMove( operation.sourcePosition, operation.targetPosition, operation.howMany );
- }
- /**
- * Returns a copy of this position transformed by a split operation.
- *
- * @protected
- * @param {module:engine/model/operation/splitoperation~SplitOperation} operation
- * @returns {module:engine/model/position~Position}
- */
- _getTransformedBySplitOperation( operation ) {
- const movedRange = operation.movedRange;
- const isContained = movedRange.containsPosition( this ) ||
- ( movedRange.start.isEqual( this ) && this.stickiness == 'toNext' );
- if ( isContained ) {
- return this._getCombined( operation.splitPosition, operation.moveTargetPosition );
- } else {
- if ( operation.graveyardPosition ) {
- return this._getTransformedByMove( operation.graveyardPosition, operation.insertionPosition, 1 );
- } else {
- return this._getTransformedByInsertion( operation.insertionPosition, 1 );
- }
- }
- }
- /**
- * Returns a copy of this position transformed by merge operation.
- *
- * @protected
- * @param {module:engine/model/operation/mergeoperation~MergeOperation} operation
- * @returns {module:engine/model/position~Position}
- */
- _getTransformedByMergeOperation( operation ) {
- const movedRange = operation.movedRange;
- const isContained = movedRange.containsPosition( this ) || movedRange.start.isEqual( this );
- let pos;
- if ( isContained ) {
- pos = this._getCombined( operation.sourcePosition, operation.targetPosition );
- if ( operation.sourcePosition.isBefore( operation.targetPosition ) ) {
- // Above happens during OT when the merged element is moved before the merged-to element.
- pos = pos._getTransformedByDeletion( operation.deletionPosition, 1 );
- }
- } else if ( this.isEqual( operation.deletionPosition ) ) {
- pos = Position._createAt( operation.deletionPosition );
- } else {
- pos = this._getTransformedByMove( operation.deletionPosition, operation.graveyardPosition, 1 );
- }
- return pos;
- }
- /**
- * Returns a copy of this position that is updated by removing `howMany` nodes starting from `deletePosition`.
- * It may happen that this position is in a removed node. If that is the case, `null` is returned instead.
- *
- * @protected
- * @param {module:engine/model/position~Position} deletePosition Position before the first removed node.
- * @param {Number} howMany How many nodes are removed.
- * @returns {module:engine/model/position~Position|null} Transformed position or `null`.
- */
- _getTransformedByDeletion( deletePosition, howMany ) {
- const transformed = Position._createAt( this );
- // This position can't be affected if deletion was in a different root.
- if ( this.root != deletePosition.root ) {
- return transformed;
- }
- if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( deletePosition.getParentPath(), this.getParentPath() ) == 'same' ) {
- // If nodes are removed from the node that is pointed by this position...
- if ( deletePosition.offset < this.offset ) {
- // And are removed from before an offset of that position...
- if ( deletePosition.offset + howMany > this.offset ) {
- // Position is in removed range, it's no longer in the tree.
- return null;
- } else {
- // Decrement the offset accordingly.
- transformed.offset -= howMany;
- }
- }
- } else if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( deletePosition.getParentPath(), this.getParentPath() ) == 'prefix' ) {
- // If nodes are removed from a node that is on a path to this position...
- const i = deletePosition.path.length - 1;
- if ( deletePosition.offset <= this.path[ i ] ) {
- // And are removed from before next node of that path...
- if ( deletePosition.offset + howMany > this.path[ i ] ) {
- // If the next node of that path is removed return null
- // because the node containing this position got removed.
- return null;
- } else {
- // Otherwise, decrement index on that path.
- transformed.path[ i ] -= howMany;
- }
- }
- }
- return transformed;
- }
- /**
- * Returns a copy of this position that is updated by inserting `howMany` nodes at `insertPosition`.
- *
- * @protected
- * @param {module:engine/model/position~Position} insertPosition Position where nodes are inserted.
- * @param {Number} howMany How many nodes are inserted.
- * @returns {module:engine/model/position~Position} Transformed position.
- */
- _getTransformedByInsertion( insertPosition, howMany ) {
- const transformed = Position._createAt( this );
- // This position can't be affected if insertion was in a different root.
- if ( this.root != insertPosition.root ) {
- return transformed;
- }
- if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( insertPosition.getParentPath(), this.getParentPath() ) == 'same' ) {
- // If nodes are inserted in the node that is pointed by this position...
- if ( insertPosition.offset < this.offset || ( insertPosition.offset == this.offset && this.stickiness != 'toPrevious' ) ) {
- // And are inserted before an offset of that position...
- // "Push" this positions offset.
- transformed.offset += howMany;
- }
- } else if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( insertPosition.getParentPath(), this.getParentPath() ) == 'prefix' ) {
- // If nodes are inserted in a node that is on a path to this position...
- const i = insertPosition.path.length - 1;
- if ( insertPosition.offset <= this.path[ i ] ) {
- // And are inserted before next node of that path...
- // "Push" the index on that path.
- transformed.path[ i ] += howMany;
- }
- }
- return transformed;
- }
- /**
- * Returns a copy of this position that is updated by moving `howMany` nodes from `sourcePosition` to `targetPosition`.
- *
- * @protected
- * @param {module:engine/model/position~Position} sourcePosition Position before the first element to move.
- * @param {module:engine/model/position~Position} targetPosition Position where moved elements will be inserted.
- * @param {Number} howMany How many consecutive nodes to move, starting from `sourcePosition`.
- * @returns {module:engine/model/position~Position} Transformed position.
- */
- _getTransformedByMove( sourcePosition, targetPosition, howMany ) {
- // Update target position, as it could be affected by nodes removal.
- targetPosition = targetPosition._getTransformedByDeletion( sourcePosition, howMany );
- if ( sourcePosition.isEqual( targetPosition ) ) {
- // If `targetPosition` is equal to `sourcePosition` this isn't really any move. Just return position as it is.
- return Position._createAt( this );
- }
- // Moving a range removes nodes from their original position. We acknowledge this by proper transformation.
- const transformed = this._getTransformedByDeletion( sourcePosition, howMany );
- const isMoved = transformed === null ||
- ( sourcePosition.isEqual( this ) && this.stickiness == 'toNext' ) ||
- ( sourcePosition.getShiftedBy( howMany ).isEqual( this ) && this.stickiness == 'toPrevious' );
- if ( isMoved ) {
- // This position is inside moved range (or sticks to it).
- // In this case, we calculate a combination of this position, move source position and target position.
- return this._getCombined( sourcePosition, targetPosition );
- } else {
- // This position is not inside a removed range.
- //
- // In next step, we simply reflect inserting `howMany` nodes, which might further affect the position.
- return transformed._getTransformedByInsertion( targetPosition, howMany );
- }
- }
- /**
- * Returns a new position that is a combination of this position and given positions.
- *
- * The combined position is a copy of this position transformed by moving a range starting at `source` position
- * to the `target` position. It is expected that this position is inside the moved range.
- *
- * Example:
- *
- * let original = model.createPositionFromPath( root, [ 2, 3, 1 ] );
- * let source = model.createPositionFromPath( root, [ 2, 2 ] );
- * let target = model.createPositionFromPath( otherRoot, [ 1, 1, 3 ] );
- * original._getCombined( source, target ); // path is [ 1, 1, 4, 1 ], root is `otherRoot`
- *
- * Explanation:
- *
- * We have a position `[ 2, 3, 1 ]` and move some nodes from `[ 2, 2 ]` to `[ 1, 1, 3 ]`. The original position
- * was inside moved nodes and now should point to the new place. The moved nodes will be after
- * positions `[ 1, 1, 3 ]`, `[ 1, 1, 4 ]`, `[ 1, 1, 5 ]`. Since our position was in the second moved node,
- * the transformed position will be in a sub-tree of a node at `[ 1, 1, 4 ]`. Looking at original path, we
- * took care of `[ 2, 3 ]` part of it. Now we have to add the rest of the original path to the transformed path.
- * Finally, the transformed position will point to `[ 1, 1, 4, 1 ]`.
- *
- * @protected
- * @param {module:engine/model/position~Position} source Beginning of the moved range.
- * @param {module:engine/model/position~Position} target Position where the range is moved.
- * @returns {module:engine/model/position~Position} Combined position.
- */
- _getCombined( source, target ) {
- const i = source.path.length - 1;
- // The first part of a path to combined position is a path to the place where nodes were moved.
- const combined = Position._createAt( target );
- combined.stickiness = this.stickiness;
- // Then we have to update the rest of the path.
- // Fix the offset because this position might be after `from` position and we have to reflect that.
- combined.offset = combined.offset + this.path[ i ] - source.offset;
- // Then, add the rest of the path.
- // If this position is at the same level as `from` position nothing will get added.
- combined.path = [ ...combined.path, ...this.path.slice( i + 1 ) ];
- return combined;
- }
- /**
- * @inheritDoc
- */
- toJSON() {
- return {
- root: this.root.toJSON(),
- path: Array.from( this.path ),
- stickiness: this.stickiness
- };
- }
- /**
- * Returns a new position that is equal to current position.
- *
- * @returns {module:engine/model/position~Position}
- */
- clone() {
- return new this.constructor( this.root, this.path, this.stickiness );
- }
- /**
- * Creates position at the given location. The location can be specified as:
- *
- * * a {@link module:engine/model/position~Position position},
- * * parent element and offset (offset defaults to `0`),
- * * parent element and `'end'` (sets position at the end of that element),
- * * {@link module:engine/model/item~Item model item} and `'before'` or `'after'` (sets position before or after given model item).
- *
- * This method is a shortcut to other factory methods such as:
- *
- * * {@link module:engine/model/position~Position._createBefore},
- * * {@link module:engine/model/position~Position._createAfter}.
- *
- * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when the
- * first parameter is a {@link module:engine/model/item~Item model item}.
- * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness. Used only when the
- * first parameter is a {@link module:engine/model/item~Item model item}.
- * @protected
- */
- static _createAt( itemOrPosition, offset, stickiness = 'toNone' ) {
- if ( itemOrPosition instanceof Position ) {
- return new Position( itemOrPosition.root, itemOrPosition.path, itemOrPosition.stickiness );
- } else {
- const node = itemOrPosition;
- if ( offset == 'end' ) {
- offset = node.maxOffset;
- } else if ( offset == 'before' ) {
- return this._createBefore( node, stickiness );
- } else if ( offset == 'after' ) {
- return this._createAfter( node, stickiness );
- } else if ( offset !== 0 && !offset ) {
- /**
- * {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}
- * requires the offset to be specified when the first parameter is a model item.
- *
- * @error model-createpositionat-offset-required
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'model-createpositionat-offset-required', [ this, itemOrPosition ] );
- }
- if ( !node.is( 'element' ) && !node.is( 'documentFragment' ) ) {
- /**
- * Position parent have to be a model element or model document fragment.
- *
- * @error model-position-parent-incorrect
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
- 'model-position-parent-incorrect',
- [ this, itemOrPosition ]
- );
- }
- const path = node.getPath();
- path.push( offset );
- return new this( node.root, path, stickiness );
- }
- }
- /**
- * Creates a new position, after given {@link module:engine/model/item~Item model item}.
- *
- * @param {module:engine/model/item~Item} item Item after which the position should be placed.
- * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
- * @returns {module:engine/model/position~Position}
- * @protected
- */
- static _createAfter( item, stickiness ) {
- if ( !item.parent ) {
- /**
- * You can not make a position after a root element.
- *
- * @error model-position-after-root
- * @param {module:engine/model/item~Item} root
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
- 'model-position-after-root',
- [ this, item ],
- { root: item }
- );
- }
- return this._createAt( item.parent, item.endOffset, stickiness );
- }
- /**
- * Creates a new position, before the given {@link module:engine/model/item~Item model item}.
- *
- * @param {module:engine/model/item~Item} item Item before which the position should be placed.
- * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
- * @returns {module:engine/model/position~Position}
- * @protected
- */
- static _createBefore( item, stickiness ) {
- if ( !item.parent ) {
- /**
- * You can not make a position before a root element.
- *
- * @error model-position-before-root
- * @param {module:engine/model/item~Item} root
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
- 'model-position-before-root',
- item,
- { root: item }
- );
- }
- return this._createAt( item.parent, item.startOffset, stickiness );
- }
- /**
- * Creates a `Position` instance from given plain object (i.e. parsed JSON string).
- *
- * @param {Object} json Plain object to be converted to `Position`.
- * @param {module:engine/model/document~Document} doc Document object that will be position owner.
- * @returns {module:engine/model/position~Position} `Position` instance created using given plain object.
- */
- static fromJSON( json, doc ) {
- if ( json.root === '$graveyard' ) {
- const pos = new Position( doc.graveyard, json.path );
- pos.stickiness = json.stickiness;
- return pos;
- }
- if ( !doc.getRoot( json.root ) ) {
- /**
- * Cannot create position for document. Root with specified name does not exist.
- *
- * @error model-position-fromjson-no-root
- * @param {String} rootName
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
- 'model-position-fromjson-no-root',
- doc,
- { rootName: json.root }
- );
- }
- return new Position( doc.getRoot( json.root ), json.path, json.stickiness );
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `${ this.root } [ ${ this.path.join( ', ' ) } ]`;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // log() {
- // @if CK_DEBUG_ENGINE // console.log( 'ModelPosition: ' + this );
- // @if CK_DEBUG_ENGINE // }
- }
- /**
- * A flag indicating whether this position is `'before'` or `'after'` or `'same'` as given position.
- * If positions are in different roots `'different'` flag is returned.
- *
- * @typedef {String} module:engine/model/position~PositionRelation
- */
- /**
- * Represents how position is "sticking" with neighbour nodes. Used to define how position should be transformed (moved)
- * in edge cases. Possible values: `'toNone'`, `'toNext'`, `'toPrevious'`.
- *
- * Examples:
- *
- * Insert. Position is at | and nodes are inserted at the same position, marked as ^:
- *
- * - sticks to none: <p>f^|oo</p> -> <p>fbar|oo</p>
- * - sticks to next node: <p>f^|oo</p> -> <p>fbar|oo</p>
- * - sticks to previous node: <p>f|^oo</p> -> <p>f|baroo</p>
- *
- *
- * Move. Position is at | and range [oo] is moved to position ^:
- *
- * - sticks to none: <p>f|[oo]</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
- * - sticks to none: <p>f[oo]|</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
- *
- * - sticks to next node: <p>f|[oo]</p><p>b^ar</p> -> <p>f</p><p>b|ooar</p>
- * - sticks to next node: <p>f[oo]|</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
- *
- * - sticks to previous node: <p>f|[oo]</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
- * - sticks to previous node: <p>f[oo]|</p><p>b^ar</p> -> <p>f</p><p>boo|ar</p>
- *
- * @typedef {String} module:engine/model/position~PositionStickiness
- */
- /**
- * Returns a text node at the given position.
- *
- * This is a helper function optimized to reuse the position parent instance for performance reasons.
- *
- * Normally, you should use {@link module:engine/model/position~Position#textNode `Position#textNode`}.
- * If you start hitting performance issues with {@link module:engine/model/position~Position#parent `Position#parent`}
- * check if your algorithm does not access it multiple times (which can happen directly or indirectly via other position properties).
- *
- * See https://github.com/ckeditor/ckeditor5/issues/6579.
- *
- * See also:
- *
- * * {@link module:engine/model/position~getNodeAfterPosition}
- * * {@link module:engine/model/position~getNodeBeforePosition}
- *
- * @param {module:engine/model/position~Position} position
- * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} positionParent The parent of the
- * given position.
- * @returns {module:engine/model/text~Text|null}
- */
- function getTextNodeAtPosition( position, positionParent ) {
- const node = positionParent.getChild( positionParent.offsetToIndex( position.offset ) );
- if ( node && node.is( '$text' ) && node.startOffset < position.offset ) {
- return node;
- }
- return null;
- }
- /**
- * Returns the node after the given position.
- *
- * This is a helper function optimized to reuse the position parent instance and the calculation of the text node at the
- * specific position for performance reasons.
- *
- * Normally, you should use {@link module:engine/model/position~Position#nodeAfter `Position#nodeAfter`}.
- * If you start hitting performance issues with {@link module:engine/model/position~Position#parent `Position#parent`} and/or
- * {@link module:engine/model/position~Position#textNode `Position#textNode`}
- * check if your algorithm does not access those properties multiple times
- * (which can happen directly or indirectly via other position properties).
- *
- * See https://github.com/ckeditor/ckeditor5/issues/6579 and https://github.com/ckeditor/ckeditor5/issues/6582.
- *
- * See also:
- *
- * * {@link module:engine/model/position~getTextNodeAtPosition}
- * * {@link module:engine/model/position~getNodeBeforePosition}
- *
- * @param {module:engine/model/position~Position} position
- * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} positionParent The parent of the
- * given position.
- * @param {module:engine/model/text~Text|null} textNode Text node at the given position.
- * @returns {module:engine/model/node~Node|null}
- */
- function getNodeAfterPosition( position, positionParent, textNode ) {
- if ( textNode !== null ) {
- return null;
- }
- return positionParent.getChild( positionParent.offsetToIndex( position.offset ) );
- }
- /**
- * Returns the node before the given position.
- *
- * Refer to {@link module:engine/model/position~getNodeBeforePosition} for documentation on when to use this util method.
- *
- * See also:
- *
- * * {@link module:engine/model/position~getTextNodeAtPosition}
- * * {@link module:engine/model/position~getNodeAfterPosition}
- *
- * @param {module:engine/model/position~Position} position
- * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} positionParent The parent of the
- * given position.
- * @param {module:engine/model/text~Text|null} textNode Text node at the given position.
- * @returns {module:engine/model/node~Node|null}
- */
- function getNodeBeforePosition( position, positionParent, textNode ) {
- if ( textNode !== null ) {
- return null;
- }
- return positionParent.getChild( positionParent.offsetToIndex( position.offset ) - 1 );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Range; });
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/range
- */
- /**
- * Represents a range in the model tree.
- *
- * A range is defined by its {@link module:engine/model/range~Range#start} and {@link module:engine/model/range~Range#end}
- * positions.
- *
- * You can create range instances via its constructor or the `createRange*()` factory methods of
- * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.
- */
- class Range {
- /**
- * Creates a range spanning from `start` position to `end` position.
- *
- * @param {module:engine/model/position~Position} start Start position.
- * @param {module:engine/model/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
- */
- constructor( start, end = null ) {
- /**
- * Start position.
- *
- * @readonly
- * @member {module:engine/model/position~Position}
- */
- this.start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( start );
- /**
- * End position.
- *
- * @readonly
- * @member {module:engine/model/position~Position}
- */
- this.end = end ? _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( end ) : _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( start );
- // If the range is collapsed, treat in a similar way as a position and set its boundaries stickiness to 'toNone'.
- // In other case, make the boundaries stick to the "inside" of the range.
- this.start.stickiness = this.isCollapsed ? 'toNone' : 'toNext';
- this.end.stickiness = this.isCollapsed ? 'toNone' : 'toPrevious';
- }
- /**
- * Iterable interface.
- *
- * Iterates over all {@link module:engine/model/item~Item items} that are in this range and returns
- * them together with additional information like length or {@link module:engine/model/position~Position positions},
- * grouped as {@link module:engine/model/treewalker~TreeWalkerValue}.
- * It iterates over all {@link module:engine/model/textproxy~TextProxy text contents} that are inside the range
- * and all the {@link module:engine/model/element~Element}s that are entered into when iterating over this range.
- *
- * This iterator uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range
- * and `ignoreElementEnd` option set to `true`.
- *
- * @returns {Iterable.<module:engine/model/treewalker~TreeWalkerValue>}
- */
- * [ Symbol.iterator ]() {
- yield* new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( { boundaries: this, ignoreElementEnd: true } );
- }
- /**
- * Returns whether the range is collapsed, that is if {@link #start} and
- * {@link #end} positions are equal.
- *
- * @type {Boolean}
- */
- get isCollapsed() {
- return this.start.isEqual( this.end );
- }
- /**
- * Returns whether this range is flat, that is if {@link #start} position and
- * {@link #end} position are in the same {@link module:engine/model/position~Position#parent}.
- *
- * @type {Boolean}
- */
- get isFlat() {
- const startParentPath = this.start.getParentPath();
- const endParentPath = this.end.getParentPath();
- return Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__["default"])( startParentPath, endParentPath ) == 'same';
- }
- /**
- * Range root element.
- *
- * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
- */
- get root() {
- return this.start.root;
- }
- /**
- * Checks whether this range contains given {@link module:engine/model/position~Position position}.
- *
- * @param {module:engine/model/position~Position} position Position to check.
- * @returns {Boolean} `true` if given {@link module:engine/model/position~Position position} is contained
- * in this range,`false` otherwise.
- */
- containsPosition( position ) {
- return position.isAfter( this.start ) && position.isBefore( this.end );
- }
- /**
- * Checks whether this range contains given {@link ~Range range}.
- *
- * @param {module:engine/model/range~Range} otherRange Range to check.
- * @param {Boolean} [loose=false] Whether the check is loose or strict. If the check is strict (`false`), compared range cannot
- * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or
- * even be equal to this range. Note that collapsed ranges are always compared in strict mode.
- * @returns {Boolean} `true` if given {@link ~Range range} boundaries are contained by this range, `false` otherwise.
- */
- containsRange( otherRange, loose = false ) {
- if ( otherRange.isCollapsed ) {
- loose = false;
- }
- const containsStart = this.containsPosition( otherRange.start ) || ( loose && this.start.isEqual( otherRange.start ) );
- const containsEnd = this.containsPosition( otherRange.end ) || ( loose && this.end.isEqual( otherRange.end ) );
- return containsStart && containsEnd;
- }
- /**
- * Checks whether given {@link module:engine/model/item~Item} is inside this range.
- *
- * @param {module:engine/model/item~Item} item Model item to check.
- */
- containsItem( item ) {
- const pos = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item );
- return this.containsPosition( pos ) || this.start.isEqual( pos );
- }
- /**
- * Checks whether this object is of the given.
- *
- * range.is( 'range' ); // -> true
- * range.is( 'model:range' ); // -> true
- *
- * range.is( 'view:range' ); // -> false
- * range.is( 'documentSelection' ); // -> false
- *
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'range' || type === 'model:range';
- }
- /**
- * Two ranges are equal if their {@link #start} and {@link #end} positions are equal.
- *
- * @param {module:engine/model/range~Range} otherRange Range to compare with.
- * @returns {Boolean} `true` if ranges are equal, `false` otherwise.
- */
- isEqual( otherRange ) {
- return this.start.isEqual( otherRange.start ) && this.end.isEqual( otherRange.end );
- }
- /**
- * Checks and returns whether this range intersects with given range.
- *
- * @param {module:engine/model/range~Range} otherRange Range to compare with.
- * @returns {Boolean} `true` if ranges intersect, `false` otherwise.
- */
- isIntersecting( otherRange ) {
- return this.start.isBefore( otherRange.end ) && this.end.isAfter( otherRange.start );
- }
- /**
- * Computes which part(s) of this {@link ~Range range} is not a part of given {@link ~Range range}.
- * Returned array contains zero, one or two {@link ~Range ranges}.
- *
- * Examples:
- *
- * let range = model.createRange(
- * model.createPositionFromPath( root, [ 2, 7 ] ),
- * model.createPositionFromPath( root, [ 4, 0, 1 ] )
- * );
- * let otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 5 ] ) );
- * let transformed = range.getDifference( otherRange );
- * // transformed array has no ranges because `otherRange` contains `range`
- *
- * otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 3 ] ) );
- * transformed = range.getDifference( otherRange );
- * // transformed array has one range: from [ 3 ] to [ 4, 0, 1 ]
- *
- * otherRange = model.createRange( model.createPositionFromPath( root, [ 3 ] ), model.createPositionFromPath( root, [ 4 ] ) );
- * transformed = range.getDifference( otherRange );
- * // transformed array has two ranges: from [ 2, 7 ] to [ 3 ] and from [ 4 ] to [ 4, 0, 1 ]
- *
- * @param {module:engine/model/range~Range} otherRange Range to differentiate against.
- * @returns {Array.<module:engine/model/range~Range>} The difference between ranges.
- */
- getDifference( otherRange ) {
- const ranges = [];
- if ( this.isIntersecting( otherRange ) ) {
- // Ranges intersect.
- if ( this.containsPosition( otherRange.start ) ) {
- // Given range start is inside this range. This means that we have to
- // add shrunken range - from the start to the middle of this range.
- ranges.push( new Range( this.start, otherRange.start ) );
- }
- if ( this.containsPosition( otherRange.end ) ) {
- // Given range end is inside this range. This means that we have to
- // add shrunken range - from the middle of this range to the end.
- ranges.push( new Range( otherRange.end, this.end ) );
- }
- } else {
- // Ranges do not intersect, return the original range.
- ranges.push( new Range( this.start, this.end ) );
- }
- return ranges;
- }
- /**
- * Returns an intersection of this {@link ~Range range} and given {@link ~Range range}.
- * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.
- *
- * Examples:
- *
- * let range = model.createRange(
- * model.createPositionFromPath( root, [ 2, 7 ] ),
- * model.createPositionFromPath( root, [ 4, 0, 1 ] )
- * );
- * let otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 2 ] ) );
- * let transformed = range.getIntersection( otherRange ); // null - ranges have no common part
- *
- * otherRange = model.createRange( model.createPositionFromPath( root, [ 3 ] ), model.createPositionFromPath( root, [ 5 ] ) );
- * transformed = range.getIntersection( otherRange ); // range from [ 3 ] to [ 4, 0, 1 ]
- *
- * @param {module:engine/model/range~Range} otherRange Range to check for intersection.
- * @returns {module:engine/model/range~Range|null} A common part of given ranges or `null` if ranges have no common part.
- */
- getIntersection( otherRange ) {
- if ( this.isIntersecting( otherRange ) ) {
- // Ranges intersect, so a common range will be returned.
- // At most, it will be same as this range.
- let commonRangeStart = this.start;
- let commonRangeEnd = this.end;
- if ( this.containsPosition( otherRange.start ) ) {
- // Given range start is inside this range. This means thaNt we have to
- // shrink common range to the given range start.
- commonRangeStart = otherRange.start;
- }
- if ( this.containsPosition( otherRange.end ) ) {
- // Given range end is inside this range. This means that we have to
- // shrink common range to the given range end.
- commonRangeEnd = otherRange.end;
- }
- return new Range( commonRangeStart, commonRangeEnd );
- }
- // Ranges do not intersect, so they do not have common part.
- return null;
- }
- /**
- * Returns a range created by joining this {@link ~Range range} with the given {@link ~Range range}.
- * If ranges have no common part, returns `null`.
- *
- * Examples:
- *
- * let range = model.createRange(
- * model.createPositionFromPath( root, [ 2, 7 ] ),
- * model.createPositionFromPath( root, [ 4, 0, 1 ] )
- * );
- * let otherRange = model.createRange(
- * model.createPositionFromPath( root, [ 1 ] ),
- * model.createPositionFromPath( root, [ 2 ] )
- * );
- * let transformed = range.getJoined( otherRange ); // null - ranges have no common part
- *
- * otherRange = model.createRange(
- * model.createPositionFromPath( root, [ 3 ] ),
- * model.createPositionFromPath( root, [ 5 ] )
- * );
- * transformed = range.getJoined( otherRange ); // range from [ 2, 7 ] to [ 5 ]
- *
- * @param {module:engine/model/range~Range} otherRange Range to be joined.
- * @param {Boolean} [loose=false] Whether the intersection check is loose or strict. If the check is strict (`false`),
- * ranges are tested for intersection or whether start/end positions are equal. If the check is loose (`true`),
- * compared range is also checked if it's {@link module:engine/model/position~Position#isTouching touching} current range.
- * @returns {module:engine/model/range~Range|null} A sum of given ranges or `null` if ranges have no common part.
- */
- getJoined( otherRange, loose = false ) {
- let shouldJoin = this.isIntersecting( otherRange );
- if ( !shouldJoin ) {
- if ( this.start.isBefore( otherRange.start ) ) {
- shouldJoin = loose ? this.end.isTouching( otherRange.start ) : this.end.isEqual( otherRange.start );
- } else {
- shouldJoin = loose ? otherRange.end.isTouching( this.start ) : otherRange.end.isEqual( this.start );
- }
- }
- if ( !shouldJoin ) {
- return null;
- }
- let startPosition = this.start;
- let endPosition = this.end;
- if ( otherRange.start.isBefore( startPosition ) ) {
- startPosition = otherRange.start;
- }
- if ( otherRange.end.isAfter( endPosition ) ) {
- endPosition = otherRange.end;
- }
- return new Range( startPosition, endPosition );
- }
- /**
- * Computes and returns the smallest set of {@link #isFlat flat} ranges, that covers this range in whole.
- *
- * See an example of a model structure (`[` and `]` are range boundaries):
- *
- * root root
- * |- element DIV DIV P2 P3 DIV
- * | |- element H H P1 f o o b a r H P4
- * | | |- "fir[st" fir[st lorem se]cond ipsum
- * | |- element P1
- * | | |- "lorem" ||
- * |- element P2 ||
- * | |- "foo" VV
- * |- element P3
- * | |- "bar" root
- * |- element DIV DIV [P2 P3] DIV
- * | |- element H H [P1] f o o b a r H P4
- * | | |- "se]cond" fir[st] lorem [se]cond ipsum
- * | |- element P4
- * | | |- "ipsum"
- *
- * As it can be seen, letters contained in the range are: `stloremfoobarse`, spread across different parents.
- * We are looking for minimal set of flat ranges that contains the same nodes.
- *
- * Minimal flat ranges for above range `( [ 0, 0, 3 ], [ 3, 0, 2 ] )` will be:
- *
- * ( [ 0, 0, 3 ], [ 0, 0, 5 ] ) = "st"
- * ( [ 0, 1 ], [ 0, 2 ] ) = element P1 ("lorem")
- * ( [ 1 ], [ 3 ] ) = element P2, element P3 ("foobar")
- * ( [ 3, 0, 0 ], [ 3, 0, 2 ] ) = "se"
- *
- * **Note:** if an {@link module:engine/model/element~Element element} is not wholly contained in this range, it won't be returned
- * in any of the returned flat ranges. See in the example how `H` elements at the beginning and at the end of the range
- * were omitted. Only their parts that were wholly in the range were returned.
- *
- * **Note:** this method is not returning flat ranges that contain no nodes.
- *
- * @returns {Array.<module:engine/model/range~Range>} Array of flat ranges covering this range.
- */
- getMinimalFlatRanges() {
- const ranges = [];
- const diffAt = this.start.getCommonPath( this.end ).length;
- const pos = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( this.start );
- let posParent = pos.parent;
- // Go up.
- while ( pos.path.length > diffAt + 1 ) {
- const howMany = posParent.maxOffset - pos.offset;
- if ( howMany !== 0 ) {
- ranges.push( new Range( pos, pos.getShiftedBy( howMany ) ) );
- }
- pos.path = pos.path.slice( 0, -1 );
- pos.offset++;
- posParent = posParent.parent;
- }
- // Go down.
- while ( pos.path.length <= this.end.path.length ) {
- const offset = this.end.path[ pos.path.length - 1 ];
- const howMany = offset - pos.offset;
- if ( howMany !== 0 ) {
- ranges.push( new Range( pos, pos.getShiftedBy( howMany ) ) );
- }
- pos.offset = offset;
- pos.path.push( 0 );
- }
- return ranges;
- }
- /**
- * Creates a {@link module:engine/model/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.
- *
- * For example, to iterate over all items in the entire document root:
- *
- * // Create a range spanning over the entire root content:
- * const range = editor.model.createRangeIn( editor.model.document.getRoot() );
- *
- * // Iterate over all items in this range:
- * for ( const value of range.getWalker() ) {
- * console.log( value.item );
- * }
- *
- * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
- * @param {module:engine/model/position~Position} [options.startPosition]
- * @param {Boolean} [options.singleCharacters=false]
- * @param {Boolean} [options.shallow=false]
- * @param {Boolean} [options.ignoreElementEnd=false]
- * @returns {module:engine/model/treewalker~TreeWalker}
- */
- getWalker( options = {} ) {
- options.boundaries = this;
- return new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
- }
- /**
- * Returns an iterator that iterates over all {@link module:engine/model/item~Item items} that are in this range and returns
- * them.
- *
- * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option
- * set to `true`. However it returns only {@link module:engine/model/item~Item model items},
- * not {@link module:engine/model/treewalker~TreeWalkerValue}.
- *
- * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for
- * a full list of available options.
- *
- * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
- * @returns {Iterable.<module:engine/model/item~Item>}
- */
- * getItems( options = {} ) {
- options.boundaries = this;
- options.ignoreElementEnd = true;
- const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
- for ( const value of treeWalker ) {
- yield value.item;
- }
- }
- /**
- * Returns an iterator that iterates over all {@link module:engine/model/position~Position positions} that are boundaries or
- * contained in this range.
- *
- * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only
- * {@link module:engine/model/position~Position positions}, not {@link module:engine/model/treewalker~TreeWalkerValue}.
- *
- * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for
- * a full list of available options.
- *
- * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
- * @returns {Iterable.<module:engine/model/position~Position>}
- */
- * getPositions( options = {} ) {
- options.boundaries = this;
- const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
- yield treeWalker.position;
- for ( const value of treeWalker ) {
- yield value.nextPosition;
- }
- }
- /**
- * Returns a range that is a result of transforming this range by given `operation`.
- *
- * **Note:** transformation may break one range into multiple ranges (for example, when a part of the range is
- * moved to a different part of document tree). For this reason, an array is returned by this method and it
- * may contain one or more `Range` instances.
- *
- * @param {module:engine/model/operation/operation~Operation} operation Operation to transform range by.
- * @returns {Array.<module:engine/model/range~Range>} Range which is the result of transformation.
- */
- getTransformedByOperation( operation ) {
- switch ( operation.type ) {
- case 'insert':
- return this._getTransformedByInsertOperation( operation );
- case 'move':
- case 'remove':
- case 'reinsert':
- return this._getTransformedByMoveOperation( operation );
- case 'split':
- return [ this._getTransformedBySplitOperation( operation ) ];
- case 'merge':
- return [ this._getTransformedByMergeOperation( operation ) ];
- }
- return [ new Range( this.start, this.end ) ];
- }
- /**
- * Returns a range that is a result of transforming this range by multiple `operations`.
- *
- * @see ~Range#getTransformedByOperation
- * @param {Iterable.<module:engine/model/operation/operation~Operation>} operations Operations to transform the range by.
- * @returns {Array.<module:engine/model/range~Range>} Range which is the result of transformation.
- */
- getTransformedByOperations( operations ) {
- const ranges = [ new Range( this.start, this.end ) ];
- for ( const operation of operations ) {
- for ( let i = 0; i < ranges.length; i++ ) {
- const result = ranges[ i ].getTransformedByOperation( operation );
- ranges.splice( i, 1, ...result );
- i += result.length - 1;
- }
- }
- // It may happen that a range is split into two, and then the part of second "piece" is moved into first
- // "piece". In this case we will have incorrect third range, which should not be included in the result --
- // because it is already included in the first "piece". In this loop we are looking for all such ranges that
- // are inside other ranges and we simply remove them.
- for ( let i = 0; i < ranges.length; i++ ) {
- const range = ranges[ i ];
- for ( let j = i + 1; j < ranges.length; j++ ) {
- const next = ranges[ j ];
- if ( range.containsRange( next ) || next.containsRange( range ) || range.isEqual( next ) ) {
- ranges.splice( j, 1 );
- }
- }
- }
- return ranges;
- }
- /**
- * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
- * which is a common ancestor of the range's both ends (in which the entire range is contained).
- *
- * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
- */
- getCommonAncestor() {
- return this.start.getCommonAncestor( this.end );
- }
- /**
- * Returns an {@link module:engine/model/element~Element Element} contained by the range.
- * The element will be returned when it is the **only** node within the range and **fully–contained**
- * at the same time.
- *
- * @returns {module:engine/model/element~Element|null}
- */
- getContainedElement() {
- if ( this.isCollapsed ) {
- return null;
- }
- const nodeAfterStart = this.start.nodeAfter;
- const nodeBeforeEnd = this.end.nodeBefore;
- if ( nodeAfterStart && nodeAfterStart.is( 'element' ) && nodeAfterStart === nodeBeforeEnd ) {
- return nodeAfterStart;
- }
- return null;
- }
- /**
- * Converts `Range` to plain object and returns it.
- *
- * @returns {Object} `Node` converted to plain object.
- */
- toJSON() {
- return {
- start: this.start.toJSON(),
- end: this.end.toJSON()
- };
- }
- /**
- * Returns a new range that is equal to current range.
- *
- * @returns {module:engine/model/range~Range}
- */
- clone() {
- return new this.constructor( this.start, this.end );
- }
- /**
- * Returns a result of transforming a copy of this range by insert operation.
- *
- * One or more ranges may be returned as a result of this transformation.
- *
- * @protected
- * @param {module:engine/model/operation/insertoperation~InsertOperation} operation
- * @returns {Array.<module:engine/model/range~Range>}
- */
- _getTransformedByInsertOperation( operation, spread = false ) {
- return this._getTransformedByInsertion( operation.position, operation.howMany, spread );
- }
- /**
- * Returns a result of transforming a copy of this range by move operation.
- *
- * One or more ranges may be returned as a result of this transformation.
- *
- * @protected
- * @param {module:engine/model/operation/moveoperation~MoveOperation} operation
- * @returns {Array.<module:engine/model/range~Range>}
- */
- _getTransformedByMoveOperation( operation, spread = false ) {
- const sourcePosition = operation.sourcePosition;
- const howMany = operation.howMany;
- const targetPosition = operation.targetPosition;
- return this._getTransformedByMove( sourcePosition, targetPosition, howMany, spread );
- }
- /**
- * Returns a result of transforming a copy of this range by split operation.
- *
- * Always one range is returned. The transformation is done in a way to not break the range.
- *
- * @protected
- * @param {module:engine/model/operation/splitoperation~SplitOperation} operation
- * @returns {module:engine/model/range~Range}
- */
- _getTransformedBySplitOperation( operation ) {
- const start = this.start._getTransformedBySplitOperation( operation );
- let end = this.end._getTransformedBySplitOperation( operation );
- if ( this.end.isEqual( operation.insertionPosition ) ) {
- end = this.end.getShiftedBy( 1 );
- }
- // Below may happen when range contains graveyard element used by split operation.
- if ( start.root != end.root ) {
- // End position was next to the moved graveyard element and was moved with it.
- // Fix it by using old `end` which has proper `root`.
- end = this.end.getShiftedBy( -1 );
- }
- return new Range( start, end );
- }
- /**
- * Returns a result of transforming a copy of this range by merge operation.
- *
- * Always one range is returned. The transformation is done in a way to not break the range.
- *
- * @protected
- * @param {module:engine/model/operation/mergeoperation~MergeOperation} operation
- * @returns {module:engine/model/range~Range}
- */
- _getTransformedByMergeOperation( operation ) {
- // Special case when the marker is set on "the closing tag" of an element. Marker can be set like that during
- // transformations, especially when a content of a few block elements were removed. For example:
- //
- // {} is the transformed range, [] is the removed range.
- // <p>F[o{o</p><p>B}ar</p><p>Xy]z</p>
- //
- // <p>Fo{o</p><p>B}ar</p><p>z</p>
- // <p>F{</p><p>B}ar</p><p>z</p>
- // <p>F{</p>}<p>z</p>
- // <p>F{}z</p>
- //
- if ( this.start.isEqual( operation.targetPosition ) && this.end.isEqual( operation.deletionPosition ) ) {
- return new Range( this.start );
- }
- let start = this.start._getTransformedByMergeOperation( operation );
- let end = this.end._getTransformedByMergeOperation( operation );
- if ( start.root != end.root ) {
- // This happens when the end position was next to the merged (deleted) element.
- // Then, the end position was moved to the graveyard root. In this case we need to fix
- // the range cause its boundaries would be in different roots.
- end = this.end.getShiftedBy( -1 );
- }
- if ( start.isAfter( end ) ) {
- // This happens in three following cases:
- //
- // Case 1: Merge operation source position is before the target position (due to some transformations, OT, etc.)
- // This means that start can be moved before the end of the range.
- //
- // Before: <p>a{a</p><p>b}b</p><p>cc</p>
- // Merge: <p>b}b</p><p>cca{a</p>
- // Fix: <p>{b}b</p><p>ccaa</p>
- //
- // Case 2: Range start is before merged node but not directly.
- // Result should include all nodes that were in the original range.
- //
- // Before: <p>aa</p>{<p>cc</p><p>b}b</p>
- // Merge: <p>aab}b</p>{<p>cc</p>
- // Fix: <p>aa{bb</p><p>cc</p>}
- //
- // The range is expanded by an additional `b` letter but it is better than dropping the whole `cc` paragraph.
- //
- // Case 3: Range start is directly before merged node.
- // Resulting range should include only nodes from the merged element:
- //
- // Before: <p>aa</p>{<p>b}b</p><p>cc</p>
- // Merge: <p>aab}b</p>{<p>cc</p>
- // Fix: <p>aa{b}b</p><p>cc</p>
- //
- if ( operation.sourcePosition.isBefore( operation.targetPosition ) ) {
- // Case 1.
- start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( end );
- start.offset = 0;
- } else {
- if ( !operation.deletionPosition.isEqual( start ) ) {
- // Case 2.
- end = operation.deletionPosition;
- }
- // In both case 2 and 3 start is at the end of the merge-to element.
- start = operation.targetPosition;
- }
- return new Range( start, end );
- }
- return new Range( start, end );
- }
- /**
- * Returns an array containing one or two {@link ~Range ranges} that are a result of transforming this
- * {@link ~Range range} by inserting `howMany` nodes at `insertPosition`. Two {@link ~Range ranges} are
- * returned if the insertion was inside this {@link ~Range range} and `spread` is set to `true`.
- *
- * Examples:
- *
- * let range = model.createRange(
- * model.createPositionFromPath( root, [ 2, 7 ] ),
- * model.createPositionFromPath( root, [ 4, 0, 1 ] )
- * );
- * let transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 1 ] ), 2 );
- * // transformed array has one range from [ 4, 7 ] to [ 6, 0, 1 ]
- *
- * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 4, 0, 0 ] ), 4 );
- * // transformed array has one range from [ 2, 7 ] to [ 4, 0, 5 ]
- *
- * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4 );
- * // transformed array has one range, which is equal to original range
- *
- * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4, true );
- * // transformed array has two ranges: from [ 2, 7 ] to [ 3, 2 ] and from [ 3, 6 ] to [ 4, 0, 1 ]
- *
- * @protected
- * @param {module:engine/model/position~Position} insertPosition Position where nodes are inserted.
- * @param {Number} howMany How many nodes are inserted.
- * @param {Boolean} [spread] Flag indicating whether this {~Range range} should be spread if insertion
- * was inside the range. Defaults to `false`.
- * @returns {Array.<module:engine/model/range~Range>} Result of the transformation.
- */
- _getTransformedByInsertion( insertPosition, howMany, spread = false ) {
- if ( spread && this.containsPosition( insertPosition ) ) {
- // Range has to be spread. The first part is from original start to the spread point.
- // The other part is from spread point to the original end, but transformed by
- // insertion to reflect insertion changes.
- return [
- new Range( this.start, insertPosition ),
- new Range(
- insertPosition.getShiftedBy( howMany ),
- this.end._getTransformedByInsertion( insertPosition, howMany )
- )
- ];
- } else {
- const range = new Range( this.start, this.end );
- range.start = range.start._getTransformedByInsertion( insertPosition, howMany );
- range.end = range.end._getTransformedByInsertion( insertPosition, howMany );
- return [ range ];
- }
- }
- /**
- * Returns an array containing {@link ~Range ranges} that are a result of transforming this
- * {@link ~Range range} by moving `howMany` nodes from `sourcePosition` to `targetPosition`.
- *
- * @protected
- * @param {module:engine/model/position~Position} sourcePosition Position from which nodes are moved.
- * @param {module:engine/model/position~Position} targetPosition Position to where nodes are moved.
- * @param {Number} howMany How many nodes are moved.
- * @param {Boolean} [spread=false] Whether the range should be spread if the move points inside the range.
- * @returns {Array.<module:engine/model/range~Range>} Result of the transformation.
- */
- _getTransformedByMove( sourcePosition, targetPosition, howMany, spread = false ) {
- // Special case for transforming a collapsed range. Just transform it like a position.
- if ( this.isCollapsed ) {
- const newPos = this.start._getTransformedByMove( sourcePosition, targetPosition, howMany );
- return [ new Range( newPos ) ];
- }
- // Special case for transformation when a part of the range is moved towards the range.
- //
- // Examples:
- //
- // <div><p>ab</p><p>c[d</p></div><p>e]f</p> --> <div><p>ab</p></div><p>c[d</p><p>e]f</p>
- // <p>e[f</p><div><p>a]b</p><p>cd</p></div> --> <p>e[f</p><p>a]b</p><div><p>cd</p></div>
- //
- // Without this special condition, the default algorithm leaves an "artifact" range from one of `differenceSet` parts:
- //
- // <div><p>ab</p><p>c[d</p></div><p>e]f</p> --> <div><p>ab</p>{</div>}<p>c[d</p><p>e]f</p>
- //
- // This special case is applied only if the range is to be kept together (not spread).
- const moveRange = Range._createFromPositionAndShift( sourcePosition, howMany );
- const insertPosition = targetPosition._getTransformedByDeletion( sourcePosition, howMany );
- if ( this.containsPosition( targetPosition ) && !spread ) {
- if ( moveRange.containsPosition( this.start ) || moveRange.containsPosition( this.end ) ) {
- const start = this.start._getTransformedByMove( sourcePosition, targetPosition, howMany );
- const end = this.end._getTransformedByMove( sourcePosition, targetPosition, howMany );
- return [ new Range( start, end ) ];
- }
- }
- // Default algorithm.
- let result;
- const differenceSet = this.getDifference( moveRange );
- let difference = null;
- const common = this.getIntersection( moveRange );
- if ( differenceSet.length == 1 ) {
- // `moveRange` and this range may intersect but may be separate.
- difference = new Range(
- differenceSet[ 0 ].start._getTransformedByDeletion( sourcePosition, howMany ),
- differenceSet[ 0 ].end._getTransformedByDeletion( sourcePosition, howMany )
- );
- } else if ( differenceSet.length == 2 ) {
- // `moveRange` is inside this range.
- difference = new Range(
- this.start,
- this.end._getTransformedByDeletion( sourcePosition, howMany )
- );
- } // else, `moveRange` contains this range.
- if ( difference ) {
- result = difference._getTransformedByInsertion( insertPosition, howMany, common !== null || spread );
- } else {
- result = [];
- }
- if ( common ) {
- const transformedCommon = new Range(
- common.start._getCombined( moveRange.start, insertPosition ),
- common.end._getCombined( moveRange.start, insertPosition )
- );
- if ( result.length == 2 ) {
- result.splice( 1, 0, transformedCommon );
- } else {
- result.push( transformedCommon );
- }
- }
- return result;
- }
- /**
- * Returns a copy of this range that is transformed by deletion of `howMany` nodes from `deletePosition`.
- *
- * If the deleted range is intersecting with the transformed range, the transformed range will be shrank.
- *
- * If the deleted range contains transformed range, `null` will be returned.
- *
- * @protected
- * @param {module:engine/model/position~Position} deletionPosition Position from which nodes are removed.
- * @param {Number} howMany How many nodes are removed.
- * @returns {module:engine/model/range~Range|null} Result of the transformation.
- */
- _getTransformedByDeletion( deletePosition, howMany ) {
- let newStart = this.start._getTransformedByDeletion( deletePosition, howMany );
- let newEnd = this.end._getTransformedByDeletion( deletePosition, howMany );
- if ( newStart == null && newEnd == null ) {
- return null;
- }
- if ( newStart == null ) {
- newStart = deletePosition;
- }
- if ( newEnd == null ) {
- newEnd = deletePosition;
- }
- return new Range( newStart, newEnd );
- }
- /**
- * Creates a new range, spreading from specified {@link module:engine/model/position~Position position} to a position moved by
- * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.
- *
- * @protected
- * @param {module:engine/model/position~Position} position Beginning of the range.
- * @param {Number} shift How long the range should be.
- * @returns {module:engine/model/range~Range}
- */
- static _createFromPositionAndShift( position, shift ) {
- const start = position;
- const end = position.getShiftedBy( shift );
- return shift > 0 ? new this( start, end ) : new this( end, start );
- }
- /**
- * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
- * that element and ends after the last child of that element.
- *
- * @protected
- * @param {module:engine/model/element~Element} element Element which is a parent for the range.
- * @returns {module:engine/model/range~Range}
- */
- static _createIn( element ) {
- return new this( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 0 ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, element.maxOffset ) );
- }
- /**
- * Creates a range that starts before given {@link module:engine/model/item~Item model item} and ends after it.
- *
- * @protected
- * @param {module:engine/model/item~Item} item
- * @returns {module:engine/model/range~Range}
- */
- static _createOn( item ) {
- return this._createFromPositionAndShift( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item ), item.offsetSize );
- }
- /**
- * Combines all ranges from the passed array into a one range. At least one range has to be passed.
- * Passed ranges must not have common parts.
- *
- * The first range from the array is a reference range. If other ranges start or end on the exactly same position where
- * the reference range, they get combined into one range.
- *
- * [ ][] [ ][ ][ ][ ][] [ ] // Passed ranges, shown sorted
- * [ ] // The result of the function if the first range was a reference range.
- * [ ] // The result of the function if the third-to-seventh range was a reference range.
- * [ ] // The result of the function if the last range was a reference range.
- *
- * @param {Array.<module:engine/model/range~Range>} ranges Ranges to combine.
- * @returns {module:engine/model/range~Range} Combined range.
- */
- static _createFromRanges( ranges ) {
- if ( ranges.length === 0 ) {
- /**
- * At least one range has to be passed to
- * {@link module:engine/model/range~Range._createFromRanges `Range._createFromRanges()`}.
- *
- * @error range-create-from-ranges-empty-array
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
- 'range-create-from-ranges-empty-array',
- null
- );
- } else if ( ranges.length == 1 ) {
- return ranges[ 0 ].clone();
- }
- // 1. Set the first range in `ranges` array as a reference range.
- // If we are going to return just a one range, one of the ranges need to be the reference one.
- // Other ranges will be stuck to that range, if possible.
- const ref = ranges[ 0 ];
- // 2. Sort all the ranges so it's easier to process them.
- ranges.sort( ( a, b ) => {
- return a.start.isAfter( b.start ) ? 1 : -1;
- } );
- // 3. Check at which index the reference range is now.
- const refIndex = ranges.indexOf( ref );
- // 4. At this moment we don't need the original range.
- // We are going to modify the result and we need to return a new instance of Range.
- // We have to create a copy of the reference range.
- const result = new this( ref.start, ref.end );
- // 5. Ranges should be checked and glued starting from the range that is closest to the reference range.
- // Since ranges are sorted, start with the range with index that is closest to reference range index.
- if ( refIndex > 0 ) {
- for ( let i = refIndex - 1; true; i++ ) {
- if ( ranges[ i ].end.isEqual( result.start ) ) {
- result.start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( ranges[ i ].start );
- } else {
- // If ranges are not starting/ending at the same position there is no point in looking further.
- break;
- }
- }
- }
- // 6. Ranges should be checked and glued starting from the range that is closest to the reference range.
- // Since ranges are sorted, start with the range with index that is closest to reference range index.
- for ( let i = refIndex + 1; i < ranges.length; i++ ) {
- if ( ranges[ i ].start.isEqual( result.end ) ) {
- result.end = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( ranges[ i ].end );
- } else {
- // If ranges are not starting/ending at the same position there is no point in looking further.
- break;
- }
- }
- return result;
- }
- /**
- * Creates a `Range` instance from given plain object (i.e. parsed JSON string).
- *
- * @param {Object} json Plain object to be converted to `Range`.
- * @param {module:engine/model/document~Document} doc Document object that will be range owner.
- * @returns {module:engine/model/range~Range} `Range` instance created using given plain object.
- */
- static fromJSON( json, doc ) {
- return new this( _position__WEBPACK_IMPORTED_MODULE_0__["default"].fromJSON( json.start, doc ), _position__WEBPACK_IMPORTED_MODULE_0__["default"].fromJSON( json.end, doc ) );
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `${ this.root } [ ${ this.start.path.join( ', ' ) } ] - [ ${ this.end.path.join( ', ' ) } ]`;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // log() {
- // @if CK_DEBUG_ENGINE // console.log( 'ModelPosition: ' + this );
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RootElement; });
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/rootelement
- */
- /**
- * Type of {@link module:engine/model/element~Element} that is a root of a model tree.
- * @extends module:engine/model/element~Element
- */
- class RootElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates root element.
- *
- * @param {module:engine/model/document~Document} document Document that is an owner of this root.
- * @param {String} name Node name.
- * @param {String} [rootName='main'] Unique root name used to identify this root
- * element by {@link module:engine/model/document~Document}.
- */
- constructor( document, name, rootName = 'main' ) {
- super( name );
- /**
- * Document that is an owner of this root.
- *
- * @private
- * @member {module:engine/model/document~Document}
- */
- this._document = document;
- /**
- * Unique root name used to identify this root element by {@link module:engine/model/document~Document}.
- *
- * @readonly
- * @member {String}
- */
- this.rootName = rootName;
- }
- /**
- * {@link module:engine/model/document~Document Document} that owns this root element.
- *
- * @readonly
- * @type {module:engine/model/document~Document|null}
- */
- get document() {
- return this._document;
- }
- /**
- * Checks whether this object is of the given.
- *
- * rootElement.is( 'rootElement' ); // -> true
- * rootElement.is( 'element' ); // -> true
- * rootElement.is( 'node' ); // -> true
- * rootElement.is( 'model:rootElement' ); // -> true
- * rootElement.is( 'model:element' ); // -> true
- * rootElement.is( 'model:node' ); // -> true
- *
- * rootElement.is( 'view:element' ); // -> false
- * rootElement.is( 'documentFragment' ); // -> false
- *
- * Assuming that the object being checked is an element, you can also check its
- * {@link module:engine/model/element~Element#name name}:
- *
- * rootElement.is( 'rootElement', '$root' ); // -> same as above
- *
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
- *
- * @param {String} type Type to check.
- * @param {String} [name] Element name.
- * @returns {Boolean}
- */
- is( type, name ) {
- if ( !name ) {
- return type === 'rootElement' || type === 'model:rootElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'element' || type === 'model:element' ||
- type === 'node' || type === 'model:node';
- }
- return name === this.name && (
- type === 'rootElement' || type === 'model:rootElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'element' || type === 'model:element'
- );
- }
- /**
- * Converts `RootElement` instance to `String` containing it's name.
- *
- * @returns {String} `RootElement` instance converted to `String`.
- */
- toJSON() {
- return this.rootName;
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return this.rootName;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // log() {
- // @if CK_DEBUG_ENGINE // console.log( 'ModelRootElement: ' + this );
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js ***!
- \*********************************************************************/
- /*! exports provided: default, SchemaContext */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Schema; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SchemaContext", function() { return SchemaContext; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
- /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/schema
- */
- /**
- * The model's schema. It defines allowed and disallowed structures of nodes as well as nodes' attributes.
- * The schema is usually defined by features and based on them the editing framework and features
- * make decisions how to change and process the model.
- *
- * The instance of schema is available in {@link module:engine/model/model~Model#schema `editor.model.schema`}.
- *
- * Read more about the schema in:
- *
- * * {@glink framework/guides/architecture/editing-engine#schema Schema} section of the
- * {@glink framework/guides/architecture/editing-engine Introduction to the Editing engine architecture}.
- * * {@glink framework/guides/deep-dive/schema Schema deep dive} guide.
- *
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class Schema {
- /**
- * Creates schema instance.
- */
- constructor() {
- this._sourceDefinitions = {};
- /**
- * A dictionary containing attribute properties.
- *
- * @private
- * @member {Object.<String,String>}
- */
- this._attributeProperties = {};
- this.decorate( 'checkChild' );
- this.decorate( 'checkAttribute' );
- this.on( 'checkAttribute', ( evt, args ) => {
- args[ 0 ] = new SchemaContext( args[ 0 ] );
- }, { priority: 'highest' } );
- this.on( 'checkChild', ( evt, args ) => {
- args[ 0 ] = new SchemaContext( args[ 0 ] );
- args[ 1 ] = this.getDefinition( args[ 1 ] );
- }, { priority: 'highest' } );
- }
- /**
- * Registers schema item. Can only be called once for every item name.
- *
- * schema.register( 'paragraph', {
- * inheritAllFrom: '$block'
- * } );
- *
- * @param {String} itemName
- * @param {module:engine/model/schema~SchemaItemDefinition} definition
- */
- register( itemName, definition ) {
- if ( this._sourceDefinitions[ itemName ] ) {
- /**
- * A single item cannot be registered twice in the schema.
- *
- * This situation may happen when:
- *
- * * Two or more plugins called {@link #register `register()`} with the same name. This will usually mean that
- * there is a collision between plugins which try to use the same element in the model. Unfortunately,
- * the only way to solve this is by modifying one of these plugins to use a unique model element name.
- * * A single plugin was loaded twice. This happens when it is installed by npm/yarn in two versions
- * and usually means one or more of the following issues:
- * * a version mismatch (two of your dependencies require two different versions of this plugin),
- * * incorrect imports (this plugin is somehow imported twice in a way which confuses webpack),
- * * mess in `node_modules/` (`rm -rf node_modules/` may help).
- *
- * **Note:** Check the logged `itemName` to better understand which plugin was duplicated/conflicting.
- *
- * @param itemName The name of the model element that is being registered twice.
- * @error schema-cannot-register-item-twice
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'schema-cannot-register-item-twice',
- this,
- {
- itemName
- }
- );
- }
- this._sourceDefinitions[ itemName ] = [
- Object.assign( {}, definition )
- ];
- this._clearCache();
- }
- /**
- * Extends a {@link #register registered} item's definition.
- *
- * Extending properties such as `allowIn` will add more items to the existing properties,
- * while redefining properties such as `isBlock` will override the previously defined ones.
- *
- * schema.register( 'foo', {
- * allowIn: '$root',
- * isBlock: true;
- * } );
- * schema.extend( 'foo', {
- * allowIn: 'blockQuote',
- * isBlock: false
- * } );
- *
- * schema.getDefinition( 'foo' );
- * // {
- * // allowIn: [ '$root', 'blockQuote' ],
- * // isBlock: false
- * // }
- *
- * @param {String} itemName
- * @param {module:engine/model/schema~SchemaItemDefinition} definition
- */
- extend( itemName, definition ) {
- if ( !this._sourceDefinitions[ itemName ] ) {
- /**
- * Cannot extend an item which was not registered yet.
- *
- * This error happens when a plugin tries to extend the schema definition of an item which was not
- * {@link #register registered} yet.
- *
- * @param itemName The name of the model element which is being extended.
- * @error schema-cannot-extend-missing-item
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'schema-cannot-extend-missing-item', this, {
- itemName
- } );
- }
- this._sourceDefinitions[ itemName ].push( Object.assign( {}, definition ) );
- this._clearCache();
- }
- /**
- * Returns data of all registered items.
- *
- * This method should normally be used for reflection purposes (e.g. defining a clone of a certain element,
- * checking a list of all block elements, etc).
- * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})
- * in other cases.
- *
- * @returns {Object.<String,module:engine/model/schema~SchemaCompiledItemDefinition>}
- */
- getDefinitions() {
- if ( !this._compiledDefinitions ) {
- this._compile();
- }
- return this._compiledDefinitions;
- }
- /**
- * Returns a definition of the given item or `undefined` if an item is not registered.
- *
- * This method should normally be used for reflection purposes (e.g. defining a clone of a certain element,
- * checking a list of all block elements, etc).
- * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})
- * in other cases.
- *
- * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
- * @returns {module:engine/model/schema~SchemaCompiledItemDefinition}
- */
- getDefinition( item ) {
- let itemName;
- if ( typeof item == 'string' ) {
- itemName = item;
- } else if ( item.is && ( item.is( '$text' ) || item.is( '$textProxy' ) ) ) {
- itemName = '$text';
- }
- // Element or module:engine/model/schema~SchemaContextItem.
- else {
- itemName = item.name;
- }
- return this.getDefinitions()[ itemName ];
- }
- /**
- * Returns `true` if the given item is registered in the schema.
- *
- * schema.isRegistered( 'paragraph' ); // -> true
- * schema.isRegistered( editor.model.document.getRoot() ); // -> true
- * schema.isRegistered( 'foo' ); // -> false
- *
- * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
- */
- isRegistered( item ) {
- return !!this.getDefinition( item );
- }
- /**
- * Returns `true` if the given item is defined to be
- * a block by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isBlock` property.
- *
- * schema.isBlock( 'paragraph' ); // -> true
- * schema.isBlock( '$root' ); // -> false
- *
- * const paragraphElement = writer.createElement( 'paragraph' );
- * schema.isBlock( paragraphElement ); // -> true
- *
- * See the {@glink framework/guides/deep-dive/schema#block-elements Block elements} section of the Schema deep dive
- * guide for more details.
- *
- * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
- */
- isBlock( item ) {
- const def = this.getDefinition( item );
- return !!( def && def.isBlock );
- }
- /**
- * Returns `true` if the given item should be treated as a limit element.
- *
- * It considers an item to be a limit element if its
- * {@link module:engine/model/schema~SchemaItemDefinition}'s
- * {@link module:engine/model/schema~SchemaItemDefinition#isLimit `isLimit`} or
- * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property
- * was set to `true`.
- *
- * schema.isLimit( 'paragraph' ); // -> false
- * schema.isLimit( '$root' ); // -> true
- * schema.isLimit( editor.model.document.getRoot() ); // -> true
- * schema.isLimit( 'image' ); // -> true
- *
- * See the {@glink framework/guides/deep-dive/schema#limit-elements Limit elements} section of the Schema deep dive
- * guide for more details.
- *
- * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
- */
- isLimit( item ) {
- const def = this.getDefinition( item );
- if ( !def ) {
- return false;
- }
- return !!( def.isLimit || def.isObject );
- }
- /**
- * Returns `true` if the given item should be treated as an object element.
- *
- * It considers an item to be an object element if its
- * {@link module:engine/model/schema~SchemaItemDefinition}'s
- * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property
- * was set to `true`.
- *
- * schema.isObject( 'paragraph' ); // -> false
- * schema.isObject( 'image' ); // -> true
- *
- * const imageElement = writer.createElement( 'image' );
- * schema.isObject( imageElement ); // -> true
- *
- * See the {@glink framework/guides/deep-dive/schema#object-elements Object elements} section of the Schema deep dive
- * guide for more details.
- *
- * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
- */
- isObject( item ) {
- const def = this.getDefinition( item );
- if ( !def ) {
- return false;
- }
- // Note: Check out the implementation of #isLimit(), #isSelectable(), and #isContent()
- // to understand why these three constitute an object.
- return !!( def.isObject || ( def.isLimit && def.isSelectable && def.isContent ) );
- }
- /**
- * Returns `true` if the given item is defined to be
- * an inline element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isInline` property.
- *
- * schema.isInline( 'paragraph' ); // -> false
- * schema.isInline( 'softBreak' ); // -> true
- *
- * const text = writer.createText( 'foo' );
- * schema.isInline( text ); // -> true
- *
- * See the {@glink framework/guides/deep-dive/schema#inline-elements Inline elements} section of the Schema deep dive
- * guide for more details.
- *
- * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
- */
- isInline( item ) {
- const def = this.getDefinition( item );
- return !!( def && def.isInline );
- }
- /**
- * Returns `true` if the given item is defined to be
- * a selectable element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isSelectable` property.
- *
- * schema.isSelectable( 'paragraph' ); // -> false
- * schema.isSelectable( 'heading1' ); // -> false
- * schema.isSelectable( 'image' ); // -> true
- * schema.isSelectable( 'tableCell' ); // -> true
- *
- * const text = writer.createText( 'foo' );
- * schema.isSelectable( text ); // -> false
- *
- * See the {@glink framework/guides/deep-dive/schema#selectable-elements Selectable elements section} of the Schema deep dive
- * guide for more details.
- *
- * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
- */
- isSelectable( item ) {
- const def = this.getDefinition( item );
- if ( !def ) {
- return false;
- }
- return !!( def.isSelectable || def.isObject );
- }
- /**
- * Returns `true` if the given item is defined to be
- * a content by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isContent` property.
- *
- * schema.isContent( 'paragraph' ); // -> false
- * schema.isContent( 'heading1' ); // -> false
- * schema.isContent( 'image' ); // -> true
- * schema.isContent( 'horizontalLine' ); // -> true
- *
- * const text = writer.createText( 'foo' );
- * schema.isContent( text ); // -> true
- *
- * See the {@glink framework/guides/deep-dive/schema#content-elements Content elements section} of the Schema deep dive
- * guide for more details.
- *
- * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
- */
- isContent( item ) {
- const def = this.getDefinition( item );
- if ( !def ) {
- return false;
- }
- return !!( def.isContent || def.isObject );
- }
- /**
- * Checks whether the given node (`child`) can be a child of the given context.
- *
- * schema.checkChild( model.document.getRoot(), paragraph ); // -> false
- *
- * schema.register( 'paragraph', {
- * allowIn: '$root'
- * } );
- * schema.checkChild( model.document.getRoot(), paragraph ); // -> true
- *
- * Note: When verifying whether the given node can be a child of the given context, the
- * schema also verifies the entire context — from its root to its last element. Therefore, it is possible
- * for `checkChild()` to return `false` even though the context's last element can contain the checked child.
- * It happens if one of the context's elements does not allow its child.
- *
- * @fires checkChild
- * @param {module:engine/model/schema~SchemaContextDefinition} context The context in which the child will be checked.
- * @param {module:engine/model/node~Node|String} def The child to check.
- */
- checkChild( context, def ) {
- // Note: context and child are already normalized here to a SchemaContext and SchemaCompiledItemDefinition.
- if ( !def ) {
- return false;
- }
- return this._checkContextMatch( def, context );
- }
- /**
- * Checks whether the given attribute can be applied in the given context (on the last
- * item of the context).
- *
- * schema.checkAttribute( textNode, 'bold' ); // -> false
- *
- * schema.extend( '$text', {
- * allowAttributes: 'bold'
- * } );
- * schema.checkAttribute( textNode, 'bold' ); // -> true
- *
- * @fires checkAttribute
- * @param {module:engine/model/schema~SchemaContextDefinition} context The context in which the attribute will be checked.
- * @param {String} attributeName
- */
- checkAttribute( context, attributeName ) {
- const def = this.getDefinition( context.last );
- if ( !def ) {
- return false;
- }
- return def.allowAttributes.includes( attributeName );
- }
- /**
- * Checks whether the given element (`elementToMerge`) can be merged with the specified base element (`positionOrBaseElement`).
- *
- * In other words — whether `elementToMerge`'s children {@link #checkChild are allowed} in the `positionOrBaseElement`.
- *
- * This check ensures that elements merged with {@link module:engine/model/writer~Writer#merge `Writer#merge()`}
- * will be valid.
- *
- * Instead of elements, you can pass the instance of the {@link module:engine/model/position~Position} class as the
- * `positionOrBaseElement`. It means that the elements before and after the position will be checked whether they can be merged.
- *
- * @param {module:engine/model/position~Position|module:engine/model/element~Element} positionOrBaseElement The position or base
- * element to which the `elementToMerge` will be merged.
- * @param {module:engine/model/element~Element} elementToMerge The element to merge. Required if `positionOrBaseElement` is an element.
- * @returns {Boolean}
- */
- checkMerge( positionOrBaseElement, elementToMerge = null ) {
- if ( positionOrBaseElement instanceof _position__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
- const nodeBefore = positionOrBaseElement.nodeBefore;
- const nodeAfter = positionOrBaseElement.nodeAfter;
- if ( !( nodeBefore instanceof _element__WEBPACK_IMPORTED_MODULE_5__["default"] ) ) {
- /**
- * The node before the merge position must be an element.
- *
- * @error schema-check-merge-no-element-before
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'schema-check-merge-no-element-before',
- this
- );
- }
- if ( !( nodeAfter instanceof _element__WEBPACK_IMPORTED_MODULE_5__["default"] ) ) {
- /**
- * The node after the merge position must be an element.
- *
- * @error schema-check-merge-no-element-after
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'schema-check-merge-no-element-after',
- this
- );
- }
- return this.checkMerge( nodeBefore, nodeAfter );
- }
- for ( const child of elementToMerge.getChildren() ) {
- if ( !this.checkChild( positionOrBaseElement, child ) ) {
- return false;
- }
- }
- return true;
- }
- /**
- * Allows registering a callback to the {@link #checkChild} method calls.
- *
- * Callbacks allow you to implement rules which are not otherwise possible to achieve
- * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.
- * For example, by using this method you can disallow elements in specific contexts.
- *
- * This method is a shorthand for using the {@link #event:checkChild} event. For even better control,
- * you can use that event instead.
- *
- * Example:
- *
- * // Disallow heading1 directly inside a blockQuote.
- * schema.addChildCheck( ( context, childDefinition ) => {
- * if ( context.endsWith( 'blockQuote' ) && childDefinition.name == 'heading1' ) {
- * return false;
- * }
- * } );
- *
- * Which translates to:
- *
- * schema.on( 'checkChild', ( evt, args ) => {
- * const context = args[ 0 ];
- * const childDefinition = args[ 1 ];
- *
- * if ( context.endsWith( 'blockQuote' ) && childDefinition && childDefinition.name == 'heading1' ) {
- * // Prevent next listeners from being called.
- * evt.stop();
- * // Set the checkChild()'s return value.
- * evt.return = false;
- * }
- * }, { priority: 'high' } );
- *
- * @param {Function} callback The callback to be called. It is called with two parameters:
- * {@link module:engine/model/schema~SchemaContext} (context) instance and
- * {@link module:engine/model/schema~SchemaCompiledItemDefinition} (child-to-check definition).
- * The callback may return `true/false` to override `checkChild()`'s return value. If it does not return
- * a boolean value, the default algorithm (or other callbacks) will define `checkChild()`'s return value.
- */
- addChildCheck( callback ) {
- this.on( 'checkChild', ( evt, [ ctx, childDef ] ) => {
- // checkChild() was called with a non-registered child.
- // In 99% cases such check should return false, so not to overcomplicate all callbacks
- // don't even execute them.
- if ( !childDef ) {
- return;
- }
- const retValue = callback( ctx, childDef );
- if ( typeof retValue == 'boolean' ) {
- evt.stop();
- evt.return = retValue;
- }
- }, { priority: 'high' } );
- }
- /**
- * Allows registering a callback to the {@link #checkAttribute} method calls.
- *
- * Callbacks allow you to implement rules which are not otherwise possible to achieve
- * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.
- * For example, by using this method you can disallow attribute if node to which it is applied
- * is contained within some other element (e.g. you want to disallow `bold` on `$text` within `heading1`).
- *
- * This method is a shorthand for using the {@link #event:checkAttribute} event. For even better control,
- * you can use that event instead.
- *
- * Example:
- *
- * // Disallow bold on $text inside heading1.
- * schema.addAttributeCheck( ( context, attributeName ) => {
- * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {
- * return false;
- * }
- * } );
- *
- * Which translates to:
- *
- * schema.on( 'checkAttribute', ( evt, args ) => {
- * const context = args[ 0 ];
- * const attributeName = args[ 1 ];
- *
- * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {
- * // Prevent next listeners from being called.
- * evt.stop();
- * // Set the checkAttribute()'s return value.
- * evt.return = false;
- * }
- * }, { priority: 'high' } );
- *
- * @param {Function} callback The callback to be called. It is called with two parameters:
- * {@link module:engine/model/schema~SchemaContext} (context) instance and attribute name.
- * The callback may return `true/false` to override `checkAttribute()`'s return value. If it does not return
- * a boolean value, the default algorithm (or other callbacks) will define `checkAttribute()`'s return value.
- */
- addAttributeCheck( callback ) {
- this.on( 'checkAttribute', ( evt, [ ctx, attributeName ] ) => {
- const retValue = callback( ctx, attributeName );
- if ( typeof retValue == 'boolean' ) {
- evt.stop();
- evt.return = retValue;
- }
- }, { priority: 'high' } );
- }
- /**
- * This method allows assigning additional metadata to the model attributes. For example,
- * {@link module:engine/model/schema~AttributeProperties `AttributeProperties#isFormatting` property} is
- * used to mark formatting attributes (like `bold` or `italic`).
- *
- * // Mark bold as a formatting attribute.
- * schema.setAttributeProperties( 'bold', {
- * isFormatting: true
- * } );
- *
- * // Override code not to be considered a formatting markup.
- * schema.setAttributeProperties( 'code', {
- * isFormatting: false
- * } );
- *
- * Properties are not limited to members defined in the
- * {@link module:engine/model/schema~AttributeProperties `AttributeProperties` type} and you can also use custom properties:
- *
- * schema.setAttributeProperties( 'blockQuote', {
- * customProperty: 'value'
- * } );
- *
- * Subsequent calls with the same attribute will extend its custom properties:
- *
- * schema.setAttributeProperties( 'blockQuote', {
- * one: 1
- * } );
- *
- * schema.setAttributeProperties( 'blockQuote', {
- * two: 2
- * } );
- *
- * console.log( schema.getAttributeProperties( 'blockQuote' ) );
- * // Logs: { one: 1, two: 2 }
- *
- * @param {String} attributeName A name of the attribute to receive the properties.
- * @param {module:engine/model/schema~AttributeProperties} properties A dictionary of properties.
- */
- setAttributeProperties( attributeName, properties ) {
- this._attributeProperties[ attributeName ] = Object.assign( this.getAttributeProperties( attributeName ), properties );
- }
- /**
- * Returns properties associated with a given model attribute. See {@link #setAttributeProperties `setAttributeProperties()`}.
- *
- * @param {String} attributeName A name of the attribute.
- * @returns {module:engine/model/schema~AttributeProperties}
- */
- getAttributeProperties( attributeName ) {
- return this._attributeProperties[ attributeName ] || {};
- }
- /**
- * Returns the lowest {@link module:engine/model/schema~Schema#isLimit limit element} containing the entire
- * selection/range/position or the root otherwise.
- *
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
- * module:engine/model/range~Range|module:engine/model/position~Position} selectionOrRangeOrPosition
- * The selection/range/position to check.
- * @returns {module:engine/model/element~Element} The lowest limit element containing
- * the entire `selectionOrRangeOrPosition`.
- */
- getLimitElement( selectionOrRangeOrPosition ) {
- let element;
- if ( selectionOrRangeOrPosition instanceof _position__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
- element = selectionOrRangeOrPosition.parent;
- } else {
- const ranges = selectionOrRangeOrPosition instanceof _range__WEBPACK_IMPORTED_MODULE_3__["default"] ?
- [ selectionOrRangeOrPosition ] :
- Array.from( selectionOrRangeOrPosition.getRanges() );
- // Find the common ancestor for all selection's ranges.
- element = ranges
- .reduce( ( element, range ) => {
- const rangeCommonAncestor = range.getCommonAncestor();
- if ( !element ) {
- return rangeCommonAncestor;
- }
- return element.getCommonAncestor( rangeCommonAncestor, { includeSelf: true } );
- }, null );
- }
- while ( !this.isLimit( element ) ) {
- if ( element.parent ) {
- element = element.parent;
- } else {
- break;
- }
- }
- return element;
- }
- /**
- * Checks whether the attribute is allowed in selection:
- *
- * * if the selection is not collapsed, then checks if the attribute is allowed on any of nodes in that range,
- * * if the selection is collapsed, then checks if on the selection position there's a text with the
- * specified attribute allowed.
- *
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- * Selection which will be checked.
- * @param {String} attribute The name of the attribute to check.
- * @returns {Boolean}
- */
- checkAttributeInSelection( selection, attribute ) {
- if ( selection.isCollapsed ) {
- const firstPosition = selection.getFirstPosition();
- const context = [
- ...firstPosition.getAncestors(),
- new _text__WEBPACK_IMPORTED_MODULE_6__["default"]( '', selection.getAttributes() )
- ];
- // Check whether schema allows for a text with the attribute in the selection.
- return this.checkAttribute( context, attribute );
- } else {
- const ranges = selection.getRanges();
- // For all ranges, check nodes in them until you find a node that is allowed to have the attribute.
- for ( const range of ranges ) {
- for ( const value of range ) {
- if ( this.checkAttribute( value.item, attribute ) ) {
- // If we found a node that is allowed to have the attribute, return true.
- return true;
- }
- }
- }
- }
- // If we haven't found such node, return false.
- return false;
- }
- /**
- * Transforms the given set of ranges into a set of ranges where the given attribute is allowed (and can be applied).
- *
- * @param {Array.<module:engine/model/range~Range>} ranges Ranges to be validated.
- * @param {String} attribute The name of the attribute to check.
- * @returns {Iterable.<module:engine/model/range~Range>} Ranges in which the attribute is allowed.
- */
- * getValidRanges( ranges, attribute ) {
- ranges = convertToMinimalFlatRanges( ranges );
- for ( const range of ranges ) {
- yield* this._getValidRangesForRange( range, attribute );
- }
- }
- /**
- * Basing on given `position`, finds and returns a {@link module:engine/model/range~Range range} which is
- * nearest to that `position` and is a correct range for selection.
- *
- * The correct selection range might be collapsed when it is located in a position where the text node can be placed.
- * Non-collapsed range is returned when selection can be placed around element marked as an "object" in
- * the {@link module:engine/model/schema~Schema schema}.
- *
- * Direction of searching for the nearest correct selection range can be specified as:
- *
- * * `both` - searching will be performed in both ways,
- * * `forward` - searching will be performed only forward,
- * * `backward` - searching will be performed only backward.
- *
- * When valid selection range cannot be found, `null` is returned.
- *
- * @param {module:engine/model/position~Position} position Reference position where new selection range should be looked for.
- * @param {'both'|'forward'|'backward'} [direction='both'] Search direction.
- * @returns {module:engine/model/range~Range|null} Nearest selection range or `null` if one cannot be found.
- */
- getNearestSelectionRange( position, direction = 'both' ) {
- // Return collapsed range if provided position is valid.
- if ( this.checkChild( position, '$text' ) ) {
- return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( position );
- }
- let backwardWalker, forwardWalker;
- // Never leave a limit element.
- const limitElement = position.getAncestors().reverse().find( item => this.isLimit( item ) ) || position.root;
- if ( direction == 'both' || direction == 'backward' ) {
- backwardWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_7__["default"]( {
- boundaries: _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( limitElement ),
- startPosition: position,
- direction: 'backward'
- } );
- }
- if ( direction == 'both' || direction == 'forward' ) {
- forwardWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_7__["default"]( {
- boundaries: _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( limitElement ),
- startPosition: position
- } );
- }
- for ( const data of combineWalkers( backwardWalker, forwardWalker ) ) {
- const type = ( data.walker == backwardWalker ? 'elementEnd' : 'elementStart' );
- const value = data.value;
- if ( value.type == type && this.isObject( value.item ) ) {
- return _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createOn( value.item );
- }
- if ( this.checkChild( value.nextPosition, '$text' ) ) {
- return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( value.nextPosition );
- }
- }
- return null;
- }
- /**
- * Tries to find position ancestors that allow to insert a given node.
- * It starts searching from the given position and goes node by node to the top of the model tree
- * as long as a {@link module:engine/model/schema~Schema#isLimit limit element}, an
- * {@link module:engine/model/schema~Schema#isObject object element} or a topmost ancestor is not reached.
- *
- * @param {module:engine/model/position~Position} position The position that the search will start from.
- * @param {module:engine/model/node~Node|String} node The node for which an allowed parent should be found or its name.
- * @returns {module:engine/model/element~Element|null} element Allowed parent or null if nothing was found.
- */
- findAllowedParent( position, node ) {
- let parent = position.parent;
- while ( parent ) {
- if ( this.checkChild( parent, node ) ) {
- return parent;
- }
- // Do not split limit elements.
- if ( this.isLimit( parent ) ) {
- return null;
- }
- parent = parent.parent;
- }
- return null;
- }
- /**
- * Removes attributes disallowed by the schema.
- *
- * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes that will be filtered.
- * @param {module:engine/model/writer~Writer} writer
- */
- removeDisallowedAttributes( nodes, writer ) {
- for ( const node of nodes ) {
- // When node is a `Text` it has no children, so just filter it out.
- if ( node.is( '$text' ) ) {
- removeDisallowedAttributeFromNode( this, node, writer );
- }
- // In a case of `Element` iterates through positions between nodes inside this element
- // and filter out node before the current position, or position parent when position
- // is at start of an element. Using positions prevent from omitting merged nodes
- // see https://github.com/ckeditor/ckeditor5-engine/issues/1789.
- else {
- const rangeInNode = _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( node );
- const positionsInRange = rangeInNode.getPositions();
- for ( const position of positionsInRange ) {
- const item = position.nodeBefore || position.parent;
- removeDisallowedAttributeFromNode( this, item, writer );
- }
- }
- }
- }
- /**
- * Creates an instance of the schema context.
- *
- * @param {module:engine/model/schema~SchemaContextDefinition} context
- * @returns {module:engine/model/schema~SchemaContext}
- */
- createContext( context ) {
- return new SchemaContext( context );
- }
- /**
- * @private
- */
- _clearCache() {
- this._compiledDefinitions = null;
- }
- /**
- * @private
- */
- _compile() {
- const compiledDefinitions = {};
- const sourceRules = this._sourceDefinitions;
- const itemNames = Object.keys( sourceRules );
- for ( const itemName of itemNames ) {
- compiledDefinitions[ itemName ] = compileBaseItemRule( sourceRules[ itemName ], itemName );
- }
- for ( const itemName of itemNames ) {
- compileAllowChildren( compiledDefinitions, itemName );
- }
- for ( const itemName of itemNames ) {
- compileAllowContentOf( compiledDefinitions, itemName );
- }
- for ( const itemName of itemNames ) {
- compileAllowWhere( compiledDefinitions, itemName );
- }
- for ( const itemName of itemNames ) {
- compileAllowAttributesOf( compiledDefinitions, itemName );
- compileInheritPropertiesFrom( compiledDefinitions, itemName );
- }
- for ( const itemName of itemNames ) {
- cleanUpAllowIn( compiledDefinitions, itemName );
- setupAllowChildren( compiledDefinitions, itemName );
- cleanUpAllowAttributes( compiledDefinitions, itemName );
- }
- this._compiledDefinitions = compiledDefinitions;
- }
- /**
- * @private
- * @param {module:engine/model/schema~SchemaCompiledItemDefinition} def
- * @param {module:engine/model/schema~SchemaContext} context
- * @param {Number} contextItemIndex
- */
- _checkContextMatch( def, context, contextItemIndex = context.length - 1 ) {
- const contextItem = context.getItem( contextItemIndex );
- if ( def.allowIn.includes( contextItem.name ) ) {
- if ( contextItemIndex == 0 ) {
- return true;
- } else {
- const parentRule = this.getDefinition( contextItem );
- return this._checkContextMatch( parentRule, context, contextItemIndex - 1 );
- }
- } else {
- return false;
- }
- }
- /**
- * Takes a flat range and an attribute name. Traverses the range recursively and deeply to find and return all ranges
- * inside the given range on which the attribute can be applied.
- *
- * This is a helper function for {@link ~Schema#getValidRanges}.
- *
- * @private
- * @param {module:engine/model/range~Range} range The range to process.
- * @param {String} attribute The name of the attribute to check.
- * @returns {Iterable.<module:engine/model/range~Range>} Ranges in which the attribute is allowed.
- */
- * _getValidRangesForRange( range, attribute ) {
- let start = range.start;
- let end = range.start;
- for ( const item of range.getItems( { shallow: true } ) ) {
- if ( item.is( 'element' ) ) {
- yield* this._getValidRangesForRange( _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( item ), attribute );
- }
- if ( !this.checkAttribute( item, attribute ) ) {
- if ( !start.isEqual( end ) ) {
- yield new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( start, end );
- }
- start = _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
- }
- end = _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
- }
- if ( !start.isEqual( end ) ) {
- yield new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( start, end );
- }
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Schema, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /**
- * Event fired when the {@link #checkChild} method is called. It allows plugging in
- * additional behavior, for example implementing rules which cannot be defined using the declarative
- * {@link module:engine/model/schema~SchemaItemDefinition} interface.
- *
- * **Note:** The {@link #addChildCheck} method is a more handy way to register callbacks. Internally,
- * it registers a listener to this event but comes with a simpler API and it is the recommended choice
- * in most of the cases.
- *
- * The {@link #checkChild} method fires an event because it is
- * {@link module:utils/observablemixin~ObservableMixin#decorate decorated} with it. Thanks to that you can
- * use this event in various ways, but the most important use case is overriding standard behavior of the
- * `checkChild()` method. Let's see a typical listener template:
- *
- * schema.on( 'checkChild', ( evt, args ) => {
- * const context = args[ 0 ];
- * const childDefinition = args[ 1 ];
- * }, { priority: 'high' } );
- *
- * The listener is added with a `high` priority to be executed before the default method is really called. The `args` callback
- * parameter contains arguments passed to `checkChild( context, child )`. However, the `context` parameter is already
- * normalized to a {@link module:engine/model/schema~SchemaContext} instance and `child` to a
- * {@link module:engine/model/schema~SchemaCompiledItemDefinition} instance, so you do not have to worry about
- * the various ways how `context` and `child` may be passed to `checkChild()`.
- *
- * **Note:** `childDefinition` may be `undefined` if `checkChild()` was called with a non-registered element.
- *
- * So, in order to implement a rule "disallow `heading1` in `blockQuote`", you can add such a listener:
- *
- * schema.on( 'checkChild', ( evt, args ) => {
- * const context = args[ 0 ];
- * const childDefinition = args[ 1 ];
- *
- * if ( context.endsWith( 'blockQuote' ) && childDefinition && childDefinition.name == 'heading1' ) {
- * // Prevent next listeners from being called.
- * evt.stop();
- * // Set the checkChild()'s return value.
- * evt.return = false;
- * }
- * }, { priority: 'high' } );
- *
- * Allowing elements in specific contexts will be a far less common use case, because it is normally handled by the
- * `allowIn` rule from {@link module:engine/model/schema~SchemaItemDefinition}. But if you have a complex scenario
- * where `listItem` should be allowed only in element `foo` which must be in element `bar`, then this would be the way:
- *
- * schema.on( 'checkChild', ( evt, args ) => {
- * const context = args[ 0 ];
- * const childDefinition = args[ 1 ];
- *
- * if ( context.endsWith( 'bar foo' ) && childDefinition.name == 'listItem' ) {
- * // Prevent next listeners from being called.
- * evt.stop();
- * // Set the checkChild()'s return value.
- * evt.return = true;
- * }
- * }, { priority: 'high' } );
- *
- * @event checkChild
- * @param {Array} args The `checkChild()`'s arguments.
- */
- /**
- * Event fired when the {@link #checkAttribute} method is called. It allows plugging in
- * additional behavior, for example implementing rules which cannot be defined using the declarative
- * {@link module:engine/model/schema~SchemaItemDefinition} interface.
- *
- * **Note:** The {@link #addAttributeCheck} method is a more handy way to register callbacks. Internally,
- * it registers a listener to this event but comes with a simpler API and it is the recommended choice
- * in most of the cases.
- *
- * The {@link #checkAttribute} method fires an event because it is
- * {@link module:utils/observablemixin~ObservableMixin#decorate decorated} with it. Thanks to that you can
- * use this event in various ways, but the most important use case is overriding the standard behavior of the
- * `checkAttribute()` method. Let's see a typical listener template:
- *
- * schema.on( 'checkAttribute', ( evt, args ) => {
- * const context = args[ 0 ];
- * const attributeName = args[ 1 ];
- * }, { priority: 'high' } );
- *
- * The listener is added with a `high` priority to be executed before the default method is really called. The `args` callback
- * parameter contains arguments passed to `checkAttribute( context, attributeName )`. However, the `context` parameter is already
- * normalized to a {@link module:engine/model/schema~SchemaContext} instance, so you do not have to worry about
- * the various ways how `context` may be passed to `checkAttribute()`.
- *
- * So, in order to implement a rule "disallow `bold` in a text which is in a `heading1`, you can add such a listener:
- *
- * schema.on( 'checkAttribute', ( evt, args ) => {
- * const context = args[ 0 ];
- * const attributeName = args[ 1 ];
- *
- * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {
- * // Prevent next listeners from being called.
- * evt.stop();
- * // Set the checkAttribute()'s return value.
- * evt.return = false;
- * }
- * }, { priority: 'high' } );
- *
- * Allowing attributes in specific contexts will be a far less common use case, because it is normally handled by the
- * `allowAttributes` rule from {@link module:engine/model/schema~SchemaItemDefinition}. But if you have a complex scenario
- * where `bold` should be allowed only in element `foo` which must be in element `bar`, then this would be the way:
- *
- * schema.on( 'checkAttribute', ( evt, args ) => {
- * const context = args[ 0 ];
- * const attributeName = args[ 1 ];
- *
- * if ( context.endsWith( 'bar foo $text' ) && attributeName == 'bold' ) {
- * // Prevent next listeners from being called.
- * evt.stop();
- * // Set the checkAttribute()'s return value.
- * evt.return = true;
- * }
- * }, { priority: 'high' } );
- *
- * @event checkAttribute
- * @param {Array} args The `checkAttribute()`'s arguments.
- */
- /**
- * A definition of a {@link module:engine/model/schema~Schema schema} item.
- *
- * You can define the following rules:
- *
- * * {@link ~SchemaItemDefinition#allowIn `allowIn`} – Defines in which other items this item will be allowed.
- * * {@link ~SchemaItemDefinition#allowChildren `allowChildren`} – Defines which other items are allowed inside this item.
- * * {@link ~SchemaItemDefinition#allowAttributes `allowAttributes`} – Defines allowed attributes of the given item.
- * * {@link ~SchemaItemDefinition#allowContentOf `allowContentOf`} – Inherits "allowed children" from other items.
- * * {@link ~SchemaItemDefinition#allowWhere `allowWhere`} – Inherits "allowed in" from other items.
- * * {@link ~SchemaItemDefinition#allowAttributesOf `allowAttributesOf`} – Inherits attributes from other items.
- * * {@link ~SchemaItemDefinition#inheritTypesFrom `inheritTypesFrom`} – Inherits `is*` properties of other items.
- * * {@link ~SchemaItemDefinition#inheritAllFrom `inheritAllFrom`} –
- * A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`.
- *
- * # The `is*` properties
- *
- * There are a couple commonly used `is*` properties. Their role is to assign additional semantics to schema items.
- * You can define more properties but you will also need to implement support for them in the existing editor features.
- *
- * * {@link ~SchemaItemDefinition#isBlock `isBlock`} – Whether this item is paragraph-like.
- * Generally speaking, content is usually made out of blocks like paragraphs, list items, images, headings, etc.
- * * {@link ~SchemaItemDefinition#isInline `isInline`} – Whether an item is "text-like" and should be treated as an inline node.
- * Examples of inline elements: `$text`, `softBreak` (`<br>`), etc.
- * * {@link ~SchemaItemDefinition#isLimit `isLimit`} – It can be understood as whether this element
- * should not be split by <kbd>Enter</kbd>. Examples of limit elements: `$root`, table cell, image caption, etc.
- * In other words, all actions that happen inside a limit element are limited to its content.
- * All objects are treated as limit elements, too.
- * * {@link ~SchemaItemDefinition#isObject `isObject`} – Whether an item is "self-contained" and should be treated as a whole.
- * Examples of object elements: `image`, `table`, `video`, etc. An object is also a limit, so
- * {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically.
- *
- * Read more about the meaning of these types in the
- * {@glink framework/guides/deep-dive/schema#defining-additional-semantics dedicated section of the Schema deep dive} guide.
- *
- * # Generic items
- *
- * There are three basic generic items: `$root`, `$block` and `$text`.
- * They are defined as follows:
- *
- * this.schema.register( '$root', {
- * isLimit: true
- * } );
- * this.schema.register( '$block', {
- * allowIn: '$root',
- * isBlock: true
- * } );
- * this.schema.register( '$text', {
- * allowIn: '$block',
- * isInline: true
- * } );
- *
- * They reflect typical editor content that is contained within one root, consists of several blocks
- * (paragraphs, lists items, headings, images) which, in turn, may contain text inside.
- *
- * By inheriting from the generic items you can define new items which will get extended by other editor features.
- * Read more about generic types in the {@glink framework/guides/deep-dive/schema Schema deep dive} guide.
- *
- * # Example definitions
- *
- * Allow `paragraph` in roots and block quotes:
- *
- * schema.register( 'paragraph', {
- * allowIn: [ '$root', 'blockQuote' ],
- * isBlock: true
- * } );
- *
- * Allow `paragraph` everywhere where `$block` is allowed (i.e. in `$root`):
- *
- * schema.register( 'paragraph', {
- * allowWhere: '$block',
- * isBlock: true
- * } );
- *
- * Allow `paragraph` inside a `$root` and allow `$text` as a `paragraph` child:
- *
- * schema.register( 'paragraph', {
- * allowIn: '$root',
- * allowChildren: '$text',
- * isBlock: true
- * } );
- *
- * Make `image` a block object, which is allowed everywhere where `$block` is.
- * Also, allow `src` and `alt` attributes in it:
- *
- * schema.register( 'image', {
- * allowWhere: '$block',
- * allowAttributes: [ 'src', 'alt' ],
- * isBlock: true,
- * isObject: true
- * } );
- *
- * Make `caption` allowed in `image` and make it allow all the content of `$block`s (usually, `$text`).
- * Also, mark it as a limit element so it cannot be split:
- *
- * schema.register( 'caption', {
- * allowIn: 'image',
- * allowContentOf: '$block',
- * isLimit: true
- * } );
- *
- * Make `listItem` inherit all from `$block` but also allow additional attributes:
- *
- * schema.register( 'listItem', {
- * inheritAllFrom: '$block',
- * allowAttributes: [ 'listType', 'listIndent' ]
- * } );
- *
- * Which translates to:
- *
- * schema.register( 'listItem', {
- * allowWhere: '$block',
- * allowContentOf: '$block',
- * allowAttributesOf: '$block',
- * inheritTypesFrom: '$block',
- * allowAttributes: [ 'listType', 'listIndent' ]
- * } );
- *
- * # Tips
- *
- * * Check schema definitions of existing features to see how they are defined.
- * * If you want to publish your feature so other developers can use it, try to use
- * generic items as much as possible.
- * * Keep your model clean. Limit it to the actual data and store information in a normalized way.
- * * Remember about defining the `is*` properties. They do not affect the allowed structures, but they can
- * affect how the editor features treat your elements.
- *
- * @typedef {Object} module:engine/model/schema~SchemaItemDefinition
- *
- * @property {String|Array.<String>} allowIn Defines in which other items this item will be allowed.
- * @property {String|Array.<String>} allowChildren Defines which other items are allowed inside this item.
- * @property {String|Array.<String>} allowAttributes Defines allowed attributes of the given item.
- * @property {String|Array.<String>} allowContentOf Inherits "allowed children" from other items.
- * @property {String|Array.<String>} allowWhere Inherits "allowed in" from other items.
- * @property {String|Array.<String>} allowAttributesOf Inherits attributes from other items.
- * @property {String|Array.<String>} inheritTypesFrom Inherits `is*` properties of other items.
- * @property {String} inheritAllFrom A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`.
- *
- * @property {Boolean} isBlock
- * Whether this item is paragraph-like. Generally speaking, content is usually made out of blocks
- * like paragraphs, list items, images, headings, etc. All these elements are marked as blocks. A block
- * should not allow another block inside. Note: There is also the `$block` generic item which has `isBlock` set to `true`.
- * Most block type items will inherit from `$block` (through `inheritAllFrom`).
- *
- * Read more about the block elements in the
- * {@glink framework/guides/deep-dive/schema#block-elements Block elements section} of the Schema deep dive guide.
- *
- * @property {Boolean} isInline
- * Whether an item is "text-like" and should be treated as an inline node. Examples of inline elements:
- * `$text`, `softBreak` (`<br>`), etc.
- *
- * Read more about the inline elements in the
- * {@glink framework/guides/deep-dive/schema#inline-elements Inline elements section} of the Schema deep dive guide.
- *
- * @property {Boolean} isLimit
- * It can be understood as whether this element should not be split by <kbd>Enter</kbd>.
- * Examples of limit elements: `$root`, table cell, image caption, etc. In other words, all actions that happen inside
- * a limit element are limited to its content.
- *
- * Read more about the limit elements in the
- * {@glink framework/guides/deep-dive/schema#limit-elements Limit elements section} of the Schema deep dive guide.
- *
- * @property {Boolean} isObject
- * Whether an item is "self-contained" and should be treated as a whole. Examples of object elements:
- * `image`, `table`, `video`, etc.
- *
- * **Note:** An object is also a limit, so
- * {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically.
- *
- * Read more about the object elements in the
- * {@glink framework/guides/deep-dive/schema#object-elements Object elements section} of the Schema deep dive guide.
- *
- * @property {Boolean} isSelectable
- * `true` when an element should be selectable as a whole by the user. Examples of selectable elements: `image`, `table`, `tableCell`, etc.
- *
- * **Note:** An object is also a selectable element, so
- * {@link module:engine/model/schema~Schema#isSelectable `isSelectable()`} returns `true` for object elements automatically.
- *
- * Read more about selectable elements in the
- * {@glink framework/guides/deep-dive/schema#selectable-elements Selectable elements section} of the Schema deep dive guide.
- *
- * @property {Boolean} isContent
- * An item is a content when it always finds its way to the editor data output regardless of the number and type of its descendants.
- * Examples of content elements: `$text`, `image`, `table`, etc. (but not `paragraph`, `heading1` or `tableCell`).
- *
- * **Note:** An object is also a content element, so
- * {@link module:engine/model/schema~Schema#isContent `isContent()`} returns `true` for object elements automatically.
- *
- * Read more about content elements in the
- * {@glink framework/guides/deep-dive/schema#content-elements Content elements section} of the Schema deep dive guide.
- */
- /**
- * A simplified version of {@link module:engine/model/schema~SchemaItemDefinition} after
- * compilation by the {@link module:engine/model/schema~Schema schema}.
- * Rules fed to the schema by {@link module:engine/model/schema~Schema#register}
- * and {@link module:engine/model/schema~Schema#extend} methods are defined in the
- * {@link module:engine/model/schema~SchemaItemDefinition} format.
- * Later on, they are compiled to `SchemaCompiledItemDefinition` so when you use e.g.
- * the {@link module:engine/model/schema~Schema#getDefinition} method you get the compiled version.
- *
- * The compiled version contains only the following properties:
- *
- * * The `name` property,
- * * The `is*` properties,
- * * The `allowIn` array,
- * * The `allowChildren` array,
- * * The `allowAttributes` array.
- *
- * @typedef {Object} module:engine/model/schema~SchemaCompiledItemDefinition
- */
- /**
- * A schema context — a list of ancestors of a given position in the document.
- *
- * Considering such position:
- *
- * <$root>
- * <blockQuote>
- * <paragraph>
- * ^
- * </paragraph>
- * </blockQuote>
- * </$root>
- *
- * The context of this position is its {@link module:engine/model/position~Position#getAncestors lists of ancestors}:
- *
- * [ rootElement, blockQuoteElement, paragraphElement ]
- *
- * Contexts are used in the {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`} and
- * {@link module:engine/model/schema~Schema#event:checkAttribute `Schema#checkAttribute`} events as a definition
- * of a place in the document where the check occurs. The context instances are created based on the first arguments
- * of the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`} and
- * {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} methods so when
- * using these methods you need to use {@link module:engine/model/schema~SchemaContextDefinition}s.
- */
- class SchemaContext {
- /**
- * Creates an instance of the context.
- *
- * @param {module:engine/model/schema~SchemaContextDefinition} context
- */
- constructor( context ) {
- if ( context instanceof SchemaContext ) {
- return context;
- }
- if ( typeof context == 'string' ) {
- context = [ context ];
- } else if ( !Array.isArray( context ) ) {
- // `context` is item or position.
- // Position#getAncestors() doesn't accept any parameters but it works just fine here.
- context = context.getAncestors( { includeSelf: true } );
- }
- this._items = context.map( mapContextItem );
- }
- /**
- * The number of items.
- *
- * @type {Number}
- */
- get length() {
- return this._items.length;
- }
- /**
- * The last item (the lowest node).
- *
- * @type {module:engine/model/schema~SchemaContextItem}
- */
- get last() {
- return this._items[ this._items.length - 1 ];
- }
- /**
- * Iterable interface.
- *
- * Iterates over all context items.
- *
- * @returns {Iterable.<module:engine/model/schema~SchemaContextItem>}
- */
- [ Symbol.iterator ]() {
- return this._items[ Symbol.iterator ]();
- }
- /**
- * Returns a new schema context instance with an additional item.
- *
- * Item can be added as:
- *
- * const context = new SchemaContext( [ '$root' ] );
- *
- * // An element.
- * const fooElement = writer.createElement( 'fooElement' );
- * const newContext = context.push( fooElement ); // [ '$root', 'fooElement' ]
- *
- * // A text node.
- * const text = writer.createText( 'foobar' );
- * const newContext = context.push( text ); // [ '$root', '$text' ]
- *
- * // A string (element name).
- * const newContext = context.push( 'barElement' ); // [ '$root', 'barElement' ]
- *
- * **Note** {@link module:engine/model/node~Node} that is already in the model tree will be added as the only item
- * (without ancestors).
- *
- * @param {String|module:engine/model/node~Node|Array<String|module:engine/model/node~Node>} item An item that will be added
- * to the current context.
- * @returns {module:engine/model/schema~SchemaContext} A new schema context instance with an additional item.
- */
- push( item ) {
- const ctx = new SchemaContext( [ item ] );
- ctx._items = [ ...this._items, ...ctx._items ];
- return ctx;
- }
- /**
- * Gets an item on the given index.
- *
- * @returns {module:engine/model/schema~SchemaContextItem}
- */
- getItem( index ) {
- return this._items[ index ];
- }
- /**
- * Returns the names of items.
- *
- * @returns {Iterable.<String>}
- */
- * getNames() {
- yield* this._items.map( item => item.name );
- }
- /**
- * Checks whether the context ends with the given nodes.
- *
- * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );
- *
- * ctx.endsWith( '$text' ); // -> true
- * ctx.endsWith( 'paragraph $text' ); // -> true
- * ctx.endsWith( '$root' ); // -> false
- * ctx.endsWith( 'paragraph' ); // -> false
- *
- * @param {String} query
- * @returns {Boolean}
- */
- endsWith( query ) {
- return Array.from( this.getNames() ).join( ' ' ).endsWith( query );
- }
- /**
- * Checks whether the context starts with the given nodes.
- *
- * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );
- *
- * ctx.endsWith( '$root' ); // -> true
- * ctx.endsWith( '$root paragraph' ); // -> true
- * ctx.endsWith( '$text' ); // -> false
- * ctx.endsWith( 'paragraph' ); // -> false
- *
- * @param {String} query
- * @returns {Boolean}
- */
- startsWith( query ) {
- return Array.from( this.getNames() ).join( ' ' ).startsWith( query );
- }
- }
- /**
- * The definition of a {@link module:engine/model/schema~SchemaContext schema context}.
- *
- * Contexts can be created in multiple ways:
- *
- * * By defining a **node** – in this cases this node and all its ancestors will be used.
- * * By defining a **position** in the document – in this case all its ancestors will be used.
- * * By defining an **array of nodes** – in this case this array defines the entire context.
- * * By defining a **name of node** - in this case node will be "mocked". It is not recommended because context
- * will be unrealistic (e.g. attributes of these nodes are not specified). However, at times this may be the only
- * way to define the context (e.g. when checking some hypothetical situation).
- * * By defining an **array of node names** (potentially, mixed with real nodes) – The same as **name of node**
- * but it is possible to create a path.
- * * By defining a {@link module:engine/model/schema~SchemaContext} instance - in this case the same instance as provided
- * will be return.
- *
- * Examples of context definitions passed to the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`}
- * method:
- *
- * // Assuming that we have a $root > blockQuote > paragraph structure, the following code
- * // will check node 'foo' in the following context:
- * // [ rootElement, blockQuoteElement, paragraphElement ]
- * const contextDefinition = paragraphElement;
- * const childToCheck = 'foo';
- * schema.checkChild( contextDefinition, childToCheck );
- *
- * // Also check in [ rootElement, blockQuoteElement, paragraphElement ].
- * schema.checkChild( model.createPositionAt( paragraphElement, 0 ), 'foo' );
- *
- * // Check in [ rootElement, paragraphElement ].
- * schema.checkChild( [ rootElement, paragraphElement ], 'foo' );
- *
- * // Check only fakeParagraphElement.
- * schema.checkChild( 'paragraph', 'foo' );
- *
- * // Check in [ fakeRootElement, fakeBarElement, paragraphElement ].
- * schema.checkChild( [ '$root', 'bar', paragraphElement ], 'foo' );
- *
- * All these `checkChild()` calls will fire {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`}
- * events in which `args[ 0 ]` is an instance of the context. Therefore, you can write a listener like this:
- *
- * schema.on( 'checkChild', ( evt, args ) => {
- * const ctx = args[ 0 ];
- *
- * console.log( Array.from( ctx.getNames() ) );
- * } );
- *
- * Which will log the following:
- *
- * [ '$root', 'blockQuote', 'paragraph' ]
- * [ '$root', 'paragraph' ]
- * [ '$root', 'bar', 'paragraph' ]
- *
- * Note: When using the {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} method
- * you may want to check whether a text node may have an attribute. A {@link module:engine/model/text~Text} is a
- * correct way to define a context so you can do this:
- *
- * schema.checkAttribute( textNode, 'bold' );
- *
- * But sometimes you want to check whether a text at a given position might've had some attribute,
- * in which case you can create a context by mixing in an array of elements with a `'$text'` string:
- *
- * // Check in [ rootElement, paragraphElement, textNode ].
- * schema.checkChild( [ ...positionInParagraph.getAncestors(), '$text' ], 'bold' );
- *
- * @typedef {module:engine/model/node~Node|module:engine/model/position~Position|module:engine/model/schema~SchemaContext|
- * String|Array.<String|module:engine/model/node~Node>} module:engine/model/schema~SchemaContextDefinition
- */
- /**
- * An item of the {@link module:engine/model/schema~SchemaContext schema context}.
- *
- * It contains 3 properties:
- *
- * * `name` – the name of this item,
- * * `* getAttributeKeys()` – a generator of keys of item attributes,
- * * `getAttribute( keyName )` – a method to get attribute values.
- *
- * The context item interface is a highly simplified version of {@link module:engine/model/node~Node} and its role
- * is to expose only the information which schema checks are able to provide (which is the name of the node and
- * node's attributes).
- *
- * schema.on( 'checkChild', ( evt, args ) => {
- * const ctx = args[ 0 ];
- * const firstItem = ctx.getItem( 0 );
- *
- * console.log( firstItem.name ); // -> '$root'
- * console.log( firstItem.getAttribute( 'foo' ) ); // -> 'bar'
- * console.log( Array.from( firstItem.getAttributeKeys() ) ); // -> [ 'foo', 'faa' ]
- * } );
- *
- * @typedef {Object} module:engine/model/schema~SchemaContextItem
- */
- /**
- * A structure containing additional metadata describing the attribute.
- *
- * See {@link module:engine/model/schema~Schema#setAttributeProperties `Schema#setAttributeProperties()`} for usage examples.
- *
- * @typedef {Object} module:engine/model/schema~AttributeProperties
- * @property {Boolean} [isFormatting] Indicates that the attribute should be considered as a visual formatting, like `bold`, `italic` or
- * `fontSize` rather than semantic attribute (such as `src`, `listType`, etc.). For example, it is used by the "Remove format" feature.
- * @property {Boolean} [copyOnEnter] Indicates that given text attribute should be copied to the next block when enter is pressed.
- */
- function compileBaseItemRule( sourceItemRules, itemName ) {
- const itemRule = {
- name: itemName,
- allowIn: [],
- allowContentOf: [],
- allowWhere: [],
- allowAttributes: [],
- allowAttributesOf: [],
- allowChildren: [],
- inheritTypesFrom: []
- };
- copyTypes( sourceItemRules, itemRule );
- copyProperty( sourceItemRules, itemRule, 'allowIn' );
- copyProperty( sourceItemRules, itemRule, 'allowContentOf' );
- copyProperty( sourceItemRules, itemRule, 'allowWhere' );
- copyProperty( sourceItemRules, itemRule, 'allowAttributes' );
- copyProperty( sourceItemRules, itemRule, 'allowAttributesOf' );
- copyProperty( sourceItemRules, itemRule, 'allowChildren' );
- copyProperty( sourceItemRules, itemRule, 'inheritTypesFrom' );
- makeInheritAllWork( sourceItemRules, itemRule );
- return itemRule;
- }
- function compileAllowChildren( compiledDefinitions, itemName ) {
- const item = compiledDefinitions[ itemName ];
- for ( const allowChildrenItem of item.allowChildren ) {
- const allowedChildren = compiledDefinitions[ allowChildrenItem ];
- // The allowChildren property may point to an unregistered element.
- if ( !allowedChildren ) {
- continue;
- }
- allowedChildren.allowIn.push( itemName );
- }
- // The allowIn property already includes correct items, reset the allowChildren property
- // to avoid duplicates later when setting up compilation results.
- item.allowChildren.length = 0;
- }
- function compileAllowContentOf( compiledDefinitions, itemName ) {
- for ( const allowContentOfItemName of compiledDefinitions[ itemName ].allowContentOf ) {
- // The allowContentOf property may point to an unregistered element.
- if ( compiledDefinitions[ allowContentOfItemName ] ) {
- const allowedChildren = getAllowedChildren( compiledDefinitions, allowContentOfItemName );
- allowedChildren.forEach( allowedItem => {
- allowedItem.allowIn.push( itemName );
- } );
- }
- }
- delete compiledDefinitions[ itemName ].allowContentOf;
- }
- function compileAllowWhere( compiledDefinitions, itemName ) {
- for ( const allowWhereItemName of compiledDefinitions[ itemName ].allowWhere ) {
- const inheritFrom = compiledDefinitions[ allowWhereItemName ];
- // The allowWhere property may point to an unregistered element.
- if ( inheritFrom ) {
- const allowedIn = inheritFrom.allowIn;
- compiledDefinitions[ itemName ].allowIn.push( ...allowedIn );
- }
- }
- delete compiledDefinitions[ itemName ].allowWhere;
- }
- function compileAllowAttributesOf( compiledDefinitions, itemName ) {
- for ( const allowAttributeOfItem of compiledDefinitions[ itemName ].allowAttributesOf ) {
- const inheritFrom = compiledDefinitions[ allowAttributeOfItem ];
- if ( inheritFrom ) {
- const inheritAttributes = inheritFrom.allowAttributes;
- compiledDefinitions[ itemName ].allowAttributes.push( ...inheritAttributes );
- }
- }
- delete compiledDefinitions[ itemName ].allowAttributesOf;
- }
- function compileInheritPropertiesFrom( compiledDefinitions, itemName ) {
- const item = compiledDefinitions[ itemName ];
- for ( const inheritPropertiesOfItem of item.inheritTypesFrom ) {
- const inheritFrom = compiledDefinitions[ inheritPropertiesOfItem ];
- if ( inheritFrom ) {
- const typeNames = Object.keys( inheritFrom ).filter( name => name.startsWith( 'is' ) );
- for ( const name of typeNames ) {
- if ( !( name in item ) ) {
- item[ name ] = inheritFrom[ name ];
- }
- }
- }
- }
- delete item.inheritTypesFrom;
- }
- // Remove items which weren't registered (because it may break some checks or we'd need to complicate them).
- // Make sure allowIn doesn't contain repeated values.
- function cleanUpAllowIn( compiledDefinitions, itemName ) {
- const itemRule = compiledDefinitions[ itemName ];
- const existingItems = itemRule.allowIn.filter( itemToCheck => compiledDefinitions[ itemToCheck ] );
- itemRule.allowIn = Array.from( new Set( existingItems ) );
- }
- // Setup allowChildren items based on allowIn.
- function setupAllowChildren( compiledDefinitions, itemName ) {
- const itemRule = compiledDefinitions[ itemName ];
- for ( const allowedParentItemName of itemRule.allowIn ) {
- const allowedParentItem = compiledDefinitions[ allowedParentItemName ];
- allowedParentItem.allowChildren.push( itemName );
- }
- }
- function cleanUpAllowAttributes( compiledDefinitions, itemName ) {
- const itemRule = compiledDefinitions[ itemName ];
- itemRule.allowAttributes = Array.from( new Set( itemRule.allowAttributes ) );
- }
- function copyTypes( sourceItemRules, itemRule ) {
- for ( const sourceItemRule of sourceItemRules ) {
- const typeNames = Object.keys( sourceItemRule ).filter( name => name.startsWith( 'is' ) );
- for ( const name of typeNames ) {
- itemRule[ name ] = sourceItemRule[ name ];
- }
- }
- }
- function copyProperty( sourceItemRules, itemRule, propertyName ) {
- for ( const sourceItemRule of sourceItemRules ) {
- if ( typeof sourceItemRule[ propertyName ] == 'string' ) {
- itemRule[ propertyName ].push( sourceItemRule[ propertyName ] );
- } else if ( Array.isArray( sourceItemRule[ propertyName ] ) ) {
- itemRule[ propertyName ].push( ...sourceItemRule[ propertyName ] );
- }
- }
- }
- function makeInheritAllWork( sourceItemRules, itemRule ) {
- for ( const sourceItemRule of sourceItemRules ) {
- const inheritFrom = sourceItemRule.inheritAllFrom;
- if ( inheritFrom ) {
- itemRule.allowContentOf.push( inheritFrom );
- itemRule.allowWhere.push( inheritFrom );
- itemRule.allowAttributesOf.push( inheritFrom );
- itemRule.inheritTypesFrom.push( inheritFrom );
- }
- }
- }
- function getAllowedChildren( compiledDefinitions, itemName ) {
- const itemRule = compiledDefinitions[ itemName ];
- return getValues( compiledDefinitions ).filter( def => def.allowIn.includes( itemRule.name ) );
- }
- function getValues( obj ) {
- return Object.keys( obj ).map( key => obj[ key ] );
- }
- function mapContextItem( ctxItem ) {
- if ( typeof ctxItem == 'string' || ctxItem.is( 'documentFragment' ) ) {
- return {
- name: typeof ctxItem == 'string' ? ctxItem : '$documentFragment',
- * getAttributeKeys() {},
- getAttribute() {}
- };
- } else {
- return {
- // '$text' means text nodes and text proxies.
- name: ctxItem.is( 'element' ) ? ctxItem.name : '$text',
- * getAttributeKeys() {
- yield* ctxItem.getAttributeKeys();
- },
- getAttribute( key ) {
- return ctxItem.getAttribute( key );
- }
- };
- }
- }
- // Generator function returning values from provided walkers, switching between them at each iteration. If only one walker
- // is provided it will return data only from that walker.
- //
- // @param {module:engine/module/treewalker~TreeWalker} [backward] Walker iterating in backward direction.
- // @param {module:engine/module/treewalker~TreeWalker} [forward] Walker iterating in forward direction.
- // @returns {Iterable.<Object>} Object returned at each iteration contains `value` and `walker` (informing which walker returned
- // given value) fields.
- function* combineWalkers( backward, forward ) {
- let done = false;
- while ( !done ) {
- done = true;
- if ( backward ) {
- const step = backward.next();
- if ( !step.done ) {
- done = false;
- yield {
- walker: backward,
- value: step.value
- };
- }
- }
- if ( forward ) {
- const step = forward.next();
- if ( !step.done ) {
- done = false;
- yield {
- walker: forward,
- value: step.value
- };
- }
- }
- }
- }
- // Takes an array of non-intersecting ranges. For each of them gets minimal flat ranges covering that range and returns
- // all those minimal flat ranges.
- //
- // @param {Array.<module:engine/model/range~Range>} ranges Ranges to process.
- // @returns {Iterable.<module:engine/model/range~Range>} Minimal flat ranges of given `ranges`.
- function* convertToMinimalFlatRanges( ranges ) {
- for ( const range of ranges ) {
- yield* range.getMinimalFlatRanges();
- }
- }
- function removeDisallowedAttributeFromNode( schema, node, writer ) {
- for ( const attribute of node.getAttributeKeys() ) {
- if ( !schema.checkAttribute( node, attribute ) ) {
- writer.removeAttribute( attribute, node );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Selection; });
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/selection
- */
- /**
- * Selection is a set of {@link module:engine/model/range~Range ranges}. It has a direction specified by its
- * {@link module:engine/model/selection~Selection#anchor anchor} and {@link module:engine/model/selection~Selection#focus focus}
- * (it can be {@link module:engine/model/selection~Selection#isBackward forward or backward}).
- * Additionally, selection may have its own attributes (think – whether text typed in in this selection
- * should have those attributes – e.g. whether you type a bolded text).
- *
- * @mixes module:utils/emittermixin~EmitterMixin
- */
- class Selection {
- /**
- * Creates a new selection instance based on the given {@link module:engine/model/selection~Selectable selectable}
- * or creates an empty selection if no arguments were passed.
- *
- * // Creates empty selection without ranges.
- * const selection = writer.createSelection();
- *
- * // Creates selection at the given range.
- * const range = writer.createRange( start, end );
- * const selection = writer.createSelection( range );
- *
- * // Creates selection at the given ranges
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
- * const selection = writer.createSelection( ranges );
- *
- * // Creates selection from the other selection.
- * // Note: It doesn't copies selection attributes.
- * const otherSelection = writer.createSelection();
- * const selection = writer.createSelection( otherSelection );
- *
- * // Creates selection from the given document selection.
- * // Note: It doesn't copies selection attributes.
- * const documentSelection = model.document.selection;
- * const selection = writer.createSelection( documentSelection );
- *
- * // Creates selection at the given position.
- * const position = writer.createPositionFromPath( root, path );
- * const selection = writer.createSelection( position );
- *
- * // Creates selection at the given offset in the given element.
- * const paragraph = writer.createElement( 'paragraph' );
- * const selection = writer.createSelection( paragraph, offset );
- *
- * // Creates a range inside an {@link module:engine/model/element~Element element} which starts before the
- * // first child of that element and ends after the last child of that element.
- * const selection = writer.createSelection( paragraph, 'in' );
- *
- * // Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends
- * // just after the item.
- * const selection = writer.createSelection( paragraph, 'on' );
- *
- * Selection's constructor allow passing additional options (`'backward'`) as the last argument.
- *
- * // Creates backward selection.
- * const selection = writer.createSelection( range, { backward: true } );
- *
- * @param {module:engine/model/selection~Selectable} selectable
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- */
- constructor( selectable, placeOrOffset, options ) {
- /**
- * Specifies whether the last added range was added as a backward or forward range.
- *
- * @private
- * @type {Boolean}
- */
- this._lastRangeBackward = false;
- /**
- * Stores selection ranges.
- *
- * @protected
- * @type {Array.<module:engine/model/range~Range>}
- */
- this._ranges = [];
- /**
- * List of attributes set on current selection.
- *
- * @protected
- * @type {Map.<String,*>}
- */
- this._attrs = new Map();
- if ( selectable ) {
- this.setTo( selectable, placeOrOffset, options );
- }
- }
- /**
- * Selection anchor. Anchor is the position from which the selection was started. If a user is making a selection
- * by dragging the mouse, the anchor is where the user pressed the mouse button (the beginning of the selection).
- *
- * Anchor and {@link #focus} define the direction of the selection, which is important
- * when expanding/shrinking selection. The focus moves, while the anchor should remain in the same place.
- *
- * Anchor is always set to the {@link module:engine/model/range~Range#start start} or
- * {@link module:engine/model/range~Range#end end} position of the last of selection's ranges. Whether it is
- * the `start` or `end` depends on the specified `options.backward`. See the {@link #setTo `setTo()`} method.
- *
- * May be set to `null` if there are no ranges in the selection.
- *
- * @see #focus
- * @readonly
- * @type {module:engine/model/position~Position|null}
- */
- get anchor() {
- if ( this._ranges.length > 0 ) {
- const range = this._ranges[ this._ranges.length - 1 ];
- return this._lastRangeBackward ? range.end : range.start;
- }
- return null;
- }
- /**
- * Selection focus. Focus is the position where the selection ends. If a user is making a selection
- * by dragging the mouse, the focus is where the mouse cursor is.
- *
- * May be set to `null` if there are no ranges in the selection.
- *
- * @see #anchor
- * @readonly
- * @type {module:engine/model/position~Position|null}
- */
- get focus() {
- if ( this._ranges.length > 0 ) {
- const range = this._ranges[ this._ranges.length - 1 ];
- return this._lastRangeBackward ? range.start : range.end;
- }
- return null;
- }
- /**
- * Whether the selection is collapsed. Selection is collapsed when there is exactly one range in it
- * and it is collapsed.
- *
- * @readonly
- * @type {Boolean}
- */
- get isCollapsed() {
- const length = this._ranges.length;
- if ( length === 1 ) {
- return this._ranges[ 0 ].isCollapsed;
- } else {
- return false;
- }
- }
- /**
- * Returns the number of ranges in the selection.
- *
- * @readonly
- * @type {Number}
- */
- get rangeCount() {
- return this._ranges.length;
- }
- /**
- * Specifies whether the selection's {@link #focus} precedes the selection's {@link #anchor}.
- *
- * @readonly
- * @type {Boolean}
- */
- get isBackward() {
- return !this.isCollapsed && this._lastRangeBackward;
- }
- /**
- * Checks whether this selection is equal to the given selection. Selections are equal if they have the same directions,
- * the same number of ranges and all ranges from one selection equal to ranges from the another selection.
- *
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} otherSelection
- * Selection to compare with.
- * @returns {Boolean} `true` if selections are equal, `false` otherwise.
- */
- isEqual( otherSelection ) {
- if ( this.rangeCount != otherSelection.rangeCount ) {
- return false;
- } else if ( this.rangeCount === 0 ) {
- return true;
- }
- if ( !this.anchor.isEqual( otherSelection.anchor ) || !this.focus.isEqual( otherSelection.focus ) ) {
- return false;
- }
- for ( const thisRange of this._ranges ) {
- let found = false;
- for ( const otherRange of otherSelection._ranges ) {
- if ( thisRange.isEqual( otherRange ) ) {
- found = true;
- break;
- }
- }
- if ( !found ) {
- return false;
- }
- }
- return true;
- }
- /**
- * Returns an iterable object that iterates over copies of selection ranges.
- *
- * @returns {Iterable.<module:engine/model/range~Range>}
- */
- * getRanges() {
- for ( const range of this._ranges ) {
- yield new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( range.start, range.end );
- }
- }
- /**
- * Returns a copy of the first range in the selection.
- * First range is the one which {@link module:engine/model/range~Range#start start} position
- * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges
- * (not to confuse with the first range added to the selection).
- *
- * Returns `null` if there are no ranges in selection.
- *
- * @returns {module:engine/model/range~Range|null}
- */
- getFirstRange() {
- let first = null;
- for ( const range of this._ranges ) {
- if ( !first || range.start.isBefore( first.start ) ) {
- first = range;
- }
- }
- return first ? new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( first.start, first.end ) : null;
- }
- /**
- * Returns a copy of the last range in the selection.
- * Last range is the one which {@link module:engine/model/range~Range#end end} position
- * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most
- * recently added to the selection).
- *
- * Returns `null` if there are no ranges in selection.
- *
- * @returns {module:engine/model/range~Range|null}
- */
- getLastRange() {
- let last = null;
- for ( const range of this._ranges ) {
- if ( !last || range.end.isAfter( last.end ) ) {
- last = range;
- }
- }
- return last ? new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( last.start, last.end ) : null;
- }
- /**
- * Returns the first position in the selection.
- * First position is the position that {@link module:engine/model/position~Position#isBefore is before}
- * any other position in the selection.
- *
- * Returns `null` if there are no ranges in selection.
- *
- * @returns {module:engine/model/position~Position|null}
- */
- getFirstPosition() {
- const first = this.getFirstRange();
- return first ? first.start.clone() : null;
- }
- /**
- * Returns the last position in the selection.
- * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}
- * any other position in the selection.
- *
- * Returns `null` if there are no ranges in selection.
- *
- * @returns {module:engine/model/position~Position|null}
- */
- getLastPosition() {
- const lastRange = this.getLastRange();
- return lastRange ? lastRange.end.clone() : null;
- }
- /**
- * Sets this selection's ranges and direction to the specified location based on the given
- * {@link module:engine/model/selection~Selectable selectable}.
- *
- * // Removes all selection's ranges.
- * selection.setTo( null );
- *
- * // Sets selection to the given range.
- * const range = writer.createRange( start, end );
- * selection.setTo( range );
- *
- * // Sets selection to given ranges.
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
- * selection.setTo( ranges );
- *
- * // Sets selection to other selection.
- * // Note: It doesn't copies selection attributes.
- * const otherSelection = writer.createSelection();
- * selection.setTo( otherSelection );
- *
- * // Sets selection to the given document selection.
- * // Note: It doesn't copies selection attributes.
- * const documentSelection = new DocumentSelection( doc );
- * selection.setTo( documentSelection );
- *
- * // Sets collapsed selection at the given position.
- * const position = writer.createPositionFromPath( root, path );
- * selection.setTo( position );
- *
- * // Sets collapsed selection at the position of the given node and an offset.
- * selection.setTo( paragraph, offset );
- *
- * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
- * that element and ends after the last child of that element.
- *
- * selection.setTo( paragraph, 'in' );
- *
- * Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends just after the item.
- *
- * selection.setTo( paragraph, 'on' );
- *
- * `Selection#setTo()`' method allow passing additional options (`backward`) as the last argument.
- *
- * // Sets backward selection.
- * const selection = writer.createSelection( range, { backward: true } );
- *
- * @param {module:engine/model/selection~Selectable} selectable
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- */
- setTo( selectable, placeOrOffset, options ) {
- if ( selectable === null ) {
- this._setRanges( [] );
- } else if ( selectable instanceof Selection ) {
- this._setRanges( selectable.getRanges(), selectable.isBackward );
- } else if ( selectable && typeof selectable.getRanges == 'function' ) {
- // We assume that the selectable is a DocumentSelection.
- // It can't be imported here, because it would lead to circular imports.
- this._setRanges( selectable.getRanges(), selectable.isBackward );
- } else if ( selectable instanceof _range__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
- this._setRanges( [ selectable ], !!placeOrOffset && !!placeOrOffset.backward );
- } else if ( selectable instanceof _position__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- this._setRanges( [ new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( selectable ) ] );
- } else if ( selectable instanceof _node__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
- const backward = !!options && !!options.backward;
- let range;
- if ( placeOrOffset == 'in' ) {
- range = _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createIn( selectable );
- } else if ( placeOrOffset == 'on' ) {
- range = _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createOn( selectable );
- } else if ( placeOrOffset !== undefined ) {
- range = new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( selectable, placeOrOffset ) );
- } else {
- /**
- * selection.setTo requires the second parameter when the first parameter is a node.
- *
- * @error model-selection-setto-required-second-parameter
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-selection-setto-required-second-parameter', [ this, selectable ] );
- }
- this._setRanges( [ range ], backward );
- } else if ( Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_6__["default"])( selectable ) ) {
- // We assume that the selectable is an iterable of ranges.
- this._setRanges( selectable, placeOrOffset && !!placeOrOffset.backward );
- } else {
- /**
- * Cannot set the selection to the given place.
- *
- * Invalid parameters were specified when setting the selection. Common issues:
- *
- * * A {@link module:engine/model/textproxy~TextProxy} instance was passed instead of
- * a real {@link module:engine/model/text~Text}.
- * * View nodes were passed instead of model nodes.
- * * `null`/`undefined` was passed.
- *
- * @error model-selection-setto-not-selectable
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-selection-setto-not-selectable', [ this, selectable ] );
- }
- }
- /**
- * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array
- * is treated like the last added range and is used to set {@link module:engine/model/selection~Selection#anchor} and
- * {@link module:engine/model/selection~Selection#focus}. Accepts a flag describing in which direction the selection is made.
- *
- * @protected
- * @fires change:range
- * @param {Iterable.<module:engine/model/range~Range>} newRanges Ranges to set.
- * @param {Boolean} [isLastBackward=false] Flag describing if last added range was selected forward - from start to end (`false`)
- * or backward - from end to start (`true`).
- */
- _setRanges( newRanges, isLastBackward = false ) {
- newRanges = Array.from( newRanges );
- // Check whether there is any range in new ranges set that is different than all already added ranges.
- const anyNewRange = newRanges.some( newRange => {
- if ( !( newRange instanceof _range__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
- /**
- * Selection range set to an object that is not an instance of {@link module:engine/model/range~Range}.
- *
- * Only {@link module:engine/model/range~Range} instances can be used to set a selection.
- * Common mistakes leading to this error are:
- *
- * * using DOM `Range` object,
- * * incorrect CKEditor 5 installation with multiple `ckeditor5-engine` packages having different versions.
- *
- * @error model-selection-set-ranges-not-range
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
- 'model-selection-set-ranges-not-range',
- [ this, newRanges ]
- );
- }
- return this._ranges.every( oldRange => {
- return !oldRange.isEqual( newRange );
- } );
- } );
- // Don't do anything if nothing changed.
- if ( newRanges.length === this._ranges.length && !anyNewRange ) {
- return;
- }
- this._removeAllRanges();
- for ( const range of newRanges ) {
- this._pushRange( range );
- }
- this._lastRangeBackward = !!isLastBackward;
- this.fire( 'change:range', { directChange: true } );
- }
- /**
- * Moves {@link module:engine/model/selection~Selection#focus} to the specified location.
- *
- * The location can be specified in the same form as
- * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.
- *
- * @fires change:range
- * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * first parameter is a {@link module:engine/model/item~Item model item}.
- */
- setFocus( itemOrPosition, offset ) {
- if ( this.anchor === null ) {
- /**
- * Cannot set selection focus if there are no ranges in selection.
- *
- * @error model-selection-setfocus-no-ranges
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-selection-setfocus-no-ranges', [ this, itemOrPosition ] );
- }
- const newFocus = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( itemOrPosition, offset );
- if ( newFocus.compareWith( this.focus ) == 'same' ) {
- return;
- }
- const anchor = this.anchor;
- if ( this._ranges.length ) {
- this._popRange();
- }
- if ( newFocus.compareWith( anchor ) == 'before' ) {
- this._pushRange( new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( newFocus, anchor ) );
- this._lastRangeBackward = true;
- } else {
- this._pushRange( new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( anchor, newFocus ) );
- this._lastRangeBackward = false;
- }
- this.fire( 'change:range', { directChange: true } );
- }
- /**
- * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.
- *
- * @param {String} key Key of attribute to look for.
- * @returns {*} Attribute value or `undefined`.
- */
- getAttribute( key ) {
- return this._attrs.get( key );
- }
- /**
- * Returns iterable that iterates over this selection's attributes.
- *
- * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
- * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
- *
- * @returns {Iterable.<*>}
- */
- getAttributes() {
- return this._attrs.entries();
- }
- /**
- * Returns iterable that iterates over this selection's attribute keys.
- *
- * @returns {Iterable.<String>}
- */
- getAttributeKeys() {
- return this._attrs.keys();
- }
- /**
- * Checks if the selection has an attribute for given key.
- *
- * @param {String} key Key of attribute to check.
- * @returns {Boolean} `true` if attribute with given key is set on selection, `false` otherwise.
- */
- hasAttribute( key ) {
- return this._attrs.has( key );
- }
- /**
- * Removes an attribute with given key from the selection.
- *
- * If given attribute was set on the selection, fires the {@link #event:change:range} event with
- * removed attribute key.
- *
- * @fires change:attribute
- * @param {String} key Key of attribute to remove.
- */
- removeAttribute( key ) {
- if ( this.hasAttribute( key ) ) {
- this._attrs.delete( key );
- this.fire( 'change:attribute', { attributeKeys: [ key ], directChange: true } );
- }
- }
- /**
- * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.
- *
- * If the attribute value has changed, fires the {@link #event:change:range} event with
- * the attribute key.
- *
- * @fires change:attribute
- * @param {String} key Key of attribute to set.
- * @param {*} value Attribute value.
- */
- setAttribute( key, value ) {
- if ( this.getAttribute( key ) !== value ) {
- this._attrs.set( key, value );
- this.fire( 'change:attribute', { attributeKeys: [ key ], directChange: true } );
- }
- }
- /**
- * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only
- * one range in the selection, and that range contains exactly one element.
- * Returns `null` if there is no selected element.
- *
- * @returns {module:engine/model/element~Element|null}
- */
- getSelectedElement() {
- if ( this.rangeCount !== 1 ) {
- return null;
- }
- return this.getFirstRange().getContainedElement();
- }
- /**
- * Checks whether this object is of the given.
- *
- * selection.is( 'selection' ); // -> true
- * selection.is( 'model:selection' ); // -> true
- *
- * selection.is( 'view:selection' ); // -> false
- * selection.is( 'range' ); // -> false
- *
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'selection' || type === 'model:selection';
- }
- /**
- * Gets elements of type {@link module:engine/model/schema~Schema#isBlock "block"} touched by the selection.
- *
- * This method's result can be used for example to apply block styling to all blocks covered by this selection.
- *
- * **Note:** `getSelectedBlocks()` returns blocks that are nested in other non-block elements
- * but will not return blocks nested in other blocks.
- *
- * In this case the function will return exactly all 3 paragraphs (note: `<blockQuote>` is not a block itself):
- *
- * <paragraph>[a</paragraph>
- * <blockQuote>
- * <paragraph>b</paragraph>
- * </blockQuote>
- * <paragraph>c]d</paragraph>
- *
- * In this case the paragraph will also be returned, despite the collapsed selection:
- *
- * <paragraph>[]a</paragraph>
- *
- * In such a scenario, however, only blocks A, B & E will be returned as blocks C & D are nested in block B:
- *
- * [<blockA></blockA>
- * <blockB>
- * <blockC></blockC>
- * <blockD></blockD>
- * </blockB>
- * <blockE></blockE>]
- *
- * If the selection is inside a block all the inner blocks (A & B) are returned:
- *
- * <block>
- * <blockA>[a</blockA>
- * <blockB>b]</blockB>
- * </block>
- *
- * **Special case**: If a selection ends at the beginning of a block, that block is not returned as from user perspective
- * this block wasn't selected. See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.
- *
- * <paragraph>[a</paragraph>
- * <paragraph>b</paragraph>
- * <paragraph>]c</paragraph> // this block will not be returned
- *
- * @returns {Iterable.<module:engine/model/element~Element>}
- */
- * getSelectedBlocks() {
- const visited = new WeakSet();
- for ( const range of this.getRanges() ) {
- // Get start block of range in case of a collapsed range.
- const startBlock = getParentBlock( range.start, visited );
- if ( startBlock && isTopBlockInRange( startBlock, range ) ) {
- yield startBlock;
- }
- for ( const value of range.getWalker() ) {
- const block = value.item;
- if ( value.type == 'elementEnd' && isUnvisitedTopBlock( block, visited, range ) ) {
- yield block;
- }
- }
- const endBlock = getParentBlock( range.end, visited );
- // #984. Don't return the end block if the range ends right at its beginning.
- if ( endBlock && !range.end.isTouching( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( endBlock, 0 ) ) && isTopBlockInRange( endBlock, range ) ) {
- yield endBlock;
- }
- }
- }
- /**
- * Checks whether the selection contains the entire content of the given element. This means that selection must start
- * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position
- * touching the element's end.
- *
- * By default, this method will check whether the entire content of the selection's current root is selected.
- * Useful to check if e.g. the user has just pressed <kbd>Ctrl</kbd> + <kbd>A</kbd>.
- *
- * @param {module:engine/model/element~Element} [element=this.anchor.root]
- * @returns {Boolean}
- */
- containsEntireContent( element = this.anchor.root ) {
- const limitStartPosition = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 0 );
- const limitEndPosition = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 'end' );
- return limitStartPosition.isTouching( this.getFirstPosition() ) &&
- limitEndPosition.isTouching( this.getLastPosition() );
- }
- /**
- * Adds given range to internal {@link #_ranges ranges array}. Throws an error
- * if given range is intersecting with any range that is already stored in this selection.
- *
- * @protected
- * @param {module:engine/model/range~Range} range Range to add.
- */
- _pushRange( range ) {
- this._checkRange( range );
- this._ranges.push( new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( range.start, range.end ) );
- }
- /**
- * Checks if given range intersects with ranges that are already in the selection. Throws an error if it does.
- *
- * @protected
- * @param {module:engine/model/range~Range} range Range to check.
- */
- _checkRange( range ) {
- for ( let i = 0; i < this._ranges.length; i++ ) {
- if ( range.isIntersecting( this._ranges[ i ] ) ) {
- /**
- * Trying to add a range that intersects with another range in the selection.
- *
- * @error model-selection-range-intersects
- * @param {module:engine/model/range~Range} addedRange Range that was added to the selection.
- * @param {module:engine/model/range~Range} intersectingRange Range in the selection that intersects with `addedRange`.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
- 'model-selection-range-intersects',
- [ this, range ],
- { addedRange: range, intersectingRange: this._ranges[ i ] }
- );
- }
- }
- }
- /**
- * Deletes ranges from internal range array. Uses {@link #_popRange _popRange} to
- * ensure proper ranges removal.
- *
- * @protected
- */
- _removeAllRanges() {
- while ( this._ranges.length > 0 ) {
- this._popRange();
- }
- }
- /**
- * Removes most recently added range from the selection.
- *
- * @protected
- */
- _popRange() {
- this._ranges.pop();
- }
- /**
- * Fired when selection range(s) changed.
- *
- * @event change:range
- * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
- * to `true` which indicates that the selection change was caused by a direct use of selection's API.
- * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its position
- * was directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
- * changed because the structure of the model has been changed (which means an indirect change).
- * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
- * which mean that they are not updated once the document changes.
- */
- /**
- * Fired when selection attribute changed.
- *
- * @event change:attribute
- * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
- * to `true` which indicates that the selection change was caused by a direct use of selection's API.
- * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its attributes
- * were directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
- * changed in the model and its attributes were refreshed (which means an indirect change).
- * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
- * which mean that they are not updated once the document changes.
- * @param {Array.<String>} attributeKeys Array containing keys of attributes that changed.
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( Selection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
- // Checks whether the given element extends $block in the schema and has a parent (is not a root).
- // Marks it as already visited.
- function isUnvisitedBlock( element, visited ) {
- if ( visited.has( element ) ) {
- return false;
- }
- visited.add( element );
- return element.root.document.model.schema.isBlock( element ) && element.parent;
- }
- // Checks if the given element is a $block was not previously visited and is a top block in a range.
- function isUnvisitedTopBlock( element, visited, range ) {
- return isUnvisitedBlock( element, visited ) && isTopBlockInRange( element, range );
- }
- // Finds the lowest element in position's ancestors which is a block.
- // It will search until first ancestor that is a limit element.
- // Marks all ancestors as already visited to not include any of them later on.
- function getParentBlock( position, visited ) {
- const element = position.parent;
- const schema = element.root.document.model.schema;
- const ancestors = position.parent.getAncestors( { parentFirst: true, includeSelf: true } );
- let hasParentLimit = false;
- const block = ancestors.find( element => {
- // Stop searching after first parent node that is limit element.
- if ( hasParentLimit ) {
- return false;
- }
- hasParentLimit = schema.isLimit( element );
- return !hasParentLimit && isUnvisitedBlock( element, visited );
- } );
- // Mark all ancestors of this position's parent, because find() might've stopped early and
- // the found block may be a child of another block.
- ancestors.forEach( element => visited.add( element ) );
- return block;
- }
- // Checks if the blocks is not nested in other block inside a range.
- //
- // @param {module:engine/model/element~Element} block Block to check.
- // @param {module:engine/model/range~Range} range Range to check.
- function isTopBlockInRange( block, range ) {
- const parentBlock = findAncestorBlock( block );
- if ( !parentBlock ) {
- return true;
- }
- // Add loose flag to check as parentRange can be equal to range.
- const isParentInRange = range.containsRange( _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createOn( parentBlock ), true );
- return !isParentInRange;
- }
- // Returns first ancestor block of a node.
- //
- // @param {module:engine/model/node~Node} node
- // @returns {module:engine/model/node~Node|undefined}
- function findAncestorBlock( node ) {
- const schema = node.root.document.model.schema;
- let parent = node.parent;
- while ( parent ) {
- if ( schema.isBlock( parent ) ) {
- return parent;
- }
- parent = parent.parent;
- }
- }
- /**
- * An entity that is used to set selection.
- *
- * See also {@link module:engine/model/selection~Selection#setTo}
- *
- * @typedef {
- * module:engine/model/selection~Selection|
- * module:engine/model/documentselection~DocumentSelection|
- * module:engine/model/position~Position|
- * module:engine/model/range~Range|
- * module:engine/model/node~Node|
- * Iterable.<module:engine/model/range~Range>|
- * null
- * } module:engine/model/selection~Selectable
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Text; });
- /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/text
- */
- // @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );
- /**
- * Model text node. Type of {@link module:engine/model/node~Node node} that contains {@link module:engine/model/text~Text#data text data}.
- *
- * **Important:** see {@link module:engine/model/node~Node} to read about restrictions using `Text` and `Node` API.
- *
- * **Note:** keep in mind that `Text` instances might indirectly got removed from model tree when model is changed.
- * This happens when {@link module:engine/model/writer~Writer model writer} is used to change model and the text node is merged with
- * another text node. Then, both text nodes are removed and a new text node is inserted into the model. Because of
- * this behavior, keeping references to `Text` is not recommended. Instead, consider creating
- * {@link module:engine/model/liveposition~LivePosition live position} placed before the text node.
- *
- * @extends module:engine/model/node~Node
- */
- class Text extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates a text node.
- *
- * **Note:** Constructor of this class shouldn't be used directly in the code.
- * Use the {@link module:engine/model/writer~Writer#createText} method instead.
- *
- * @protected
- * @param {String} data Node's text.
- * @param {Object} [attrs] Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
- */
- constructor( data, attrs ) {
- super( attrs );
- /**
- * Text data contained in this text node.
- *
- * @protected
- * @type {String}
- */
- this._data = data || '';
- }
- /**
- * @inheritDoc
- */
- get offsetSize() {
- return this.data.length;
- }
- /**
- * Returns a text data contained in the node.
- *
- * @readonly
- * @type {String}
- */
- get data() {
- return this._data;
- }
- /**
- * Checks whether this object is of the given.
- *
- * text.is( '$text' ); // -> true
- * text.is( 'node' ); // -> true
- * text.is( 'model:$text' ); // -> true
- * text.is( 'model:node' ); // -> true
- *
- * text.is( 'view:$text' ); // -> false
- * text.is( 'documentSelection' ); // -> false
- *
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
- *
- * **Note:** Until version 20.0.0 this method wasn't accepting `'$text'` type. The legacy `'text'` type is still
- * accepted for backward compatibility.
- *
- * @param {String} type Type to check.
- * @returns {Boolean}
- */
- is( type ) {
- return type === '$text' || type === 'model:$text' ||
- // This are legacy values kept for backward compatibility.
- type === 'text' || type === 'model:text' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'node' || type === 'model:node';
- }
- /**
- * Converts `Text` instance to plain object and returns it.
- *
- * @returns {Object} `Text` instance converted to plain object.
- */
- toJSON() {
- const json = super.toJSON();
- json.data = this.data;
- return json;
- }
- /**
- * Creates a copy of this text node and returns it. Created text node has same text data and attributes as original text node.
- *
- * @protected
- * @returns {module:engine/model/text~Text} `Text` instance created using given plain object.
- */
- _clone() {
- return new Text( this.data, this.getAttributes() );
- }
- /**
- * Creates a `Text` instance from given plain object (i.e. parsed JSON string).
- *
- * @param {Object} json Plain object to be converted to `Text`.
- * @returns {module:engine/model/text~Text} `Text` instance created using given plain object.
- */
- static fromJSON( json ) {
- return new Text( json.data, json.attributes );
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // logExtended() {
- // @if CK_DEBUG_ENGINE // console.log( `ModelText: ${ this }, attrs: ${ convertMapToStringifiedObject( this.getAttributes() ) }` );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // log() {
- // @if CK_DEBUG_ENGINE // console.log( 'ModelText: ' + this );
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextProxy; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/textproxy
- */
- // @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );
- /**
- * `TextProxy` represents a part of {@link module:engine/model/text~Text text node}.
- *
- * Since {@link module:engine/model/position~Position positions} can be placed between characters of a text node,
- * {@link module:engine/model/range~Range ranges} may contain only parts of text nodes. When {@link module:engine/model/range~Range#getItems
- * getting items}
- * contained in such range, we need to represent a part of that text node, since returning the whole text node would be incorrect.
- * `TextProxy` solves this issue.
- *
- * `TextProxy` has an API similar to {@link module:engine/model/text~Text Text} and allows to do most of the common tasks performed
- * on model nodes.
- *
- * **Note:** Some `TextProxy` instances may represent whole text node, not just a part of it.
- * See {@link module:engine/model/textproxy~TextProxy#isPartial}.
- *
- * **Note:** `TextProxy` is not an instance of {@link module:engine/model/node~Node node}. Keep this in mind when using it as a
- * parameter of methods.
- *
- * **Note:** `TextProxy` is a readonly interface. If you want to perform changes on model data represented by a `TextProxy`
- * use {@link module:engine/model/writer~Writer model writer API}.
- *
- * **Note:** `TextProxy` instances are created on the fly, basing on the current state of model. Because of this, it is
- * highly unrecommended to store references to `TextProxy` instances. `TextProxy` instances are not refreshed when
- * model changes, so they might get invalidated. Instead, consider creating {@link module:engine/model/liveposition~LivePosition live
- * position}.
- *
- * `TextProxy` instances are created by {@link module:engine/model/treewalker~TreeWalker model tree walker}. You should not need to create
- * an instance of this class by your own.
- */
- class TextProxy {
- /**
- * Creates a text proxy.
- *
- * @protected
- * @param {module:engine/model/text~Text} textNode Text node which part is represented by this text proxy.
- * @param {Number} offsetInText Offset in {@link module:engine/model/textproxy~TextProxy#textNode text node} from which the text proxy
- * starts.
- * @param {Number} length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.
- * @constructor
- */
- constructor( textNode, offsetInText, length ) {
- /**
- * Text node which part is represented by this text proxy.
- *
- * @readonly
- * @member {module:engine/model/text~Text}
- */
- this.textNode = textNode;
- if ( offsetInText < 0 || offsetInText > textNode.offsetSize ) {
- /**
- * Given `offsetInText` value is incorrect.
- *
- * @error model-textproxy-wrong-offsetintext
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'model-textproxy-wrong-offsetintext', this );
- }
- if ( length < 0 || offsetInText + length > textNode.offsetSize ) {
- /**
- * Given `length` value is incorrect.
- *
- * @error model-textproxy-wrong-length
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'model-textproxy-wrong-length', this );
- }
- /**
- * Text data represented by this text proxy.
- *
- * @readonly
- * @member {String}
- */
- this.data = textNode.data.substring( offsetInText, offsetInText + length );
- /**
- * Offset in {@link module:engine/model/textproxy~TextProxy#textNode text node} from which the text proxy starts.
- *
- * @readonly
- * @member {Number}
- */
- this.offsetInText = offsetInText;
- }
- /**
- * Offset at which this text proxy starts in it's parent.
- *
- * @see module:engine/model/node~Node#startOffset
- * @readonly
- * @type {Number}
- */
- get startOffset() {
- return this.textNode.startOffset !== null ? this.textNode.startOffset + this.offsetInText : null;
- }
- /**
- * Offset size of this text proxy. Equal to the number of characters represented by the text proxy.
- *
- * @see module:engine/model/node~Node#offsetSize
- * @readonly
- * @type {Number}
- */
- get offsetSize() {
- return this.data.length;
- }
- /**
- * Offset at which this text proxy ends in it's parent.
- *
- * @see module:engine/model/node~Node#endOffset
- * @readonly
- * @type {Number}
- */
- get endOffset() {
- return this.startOffset !== null ? this.startOffset + this.offsetSize : null;
- }
- /**
- * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/model/text~Text text node}
- * (`true`) or the whole text node (`false`).
- *
- * This is `false` when text proxy starts at the very beginning of {@link module:engine/model/textproxy~TextProxy#textNode textNode}
- * ({@link module:engine/model/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to
- * text node size.
- *
- * @readonly
- * @type {Boolean}
- */
- get isPartial() {
- return this.offsetSize !== this.textNode.offsetSize;
- }
- /**
- * Parent of this text proxy, which is same as parent of text node represented by this text proxy.
- *
- * @readonly
- * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
- */
- get parent() {
- return this.textNode.parent;
- }
- /**
- * Root of this text proxy, which is same as root of text node represented by this text proxy.
- *
- * @readonly
- * @type {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}
- */
- get root() {
- return this.textNode.root;
- }
- /**
- * Checks whether this object is of the given.
- *
- * textProxy.is( '$textProxy' ); // -> true
- * textProxy.is( 'model:$textProxy' ); // -> true
- *
- * textProxy.is( 'view:$textProxy' ); // -> false
- * textProxy.is( 'range' ); // -> false
- *
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
- *
- * **Note:** Until version 20.0.0 this method wasn't accepting `'$textProxy'` type. The legacy `'textProxt'` type is still
- * accepted for backward compatibility.
- *
- * @param {String} type Type to check.
- * @returns {Boolean}
- */
- is( type ) {
- return type === '$textProxy' || type === 'model:$textProxy' ||
- // This are legacy values kept for backward compatibility.
- type === 'textProxy' || type === 'model:textProxy';
- }
- /**
- * Gets path to this text proxy.
- *
- * @see module:engine/model/node~Node#getPath
- * @returns {Array.<Number>}
- */
- getPath() {
- const path = this.textNode.getPath();
- if ( path.length > 0 ) {
- path[ path.length - 1 ] += this.offsetInText;
- }
- return path;
- }
- /**
- * Returns ancestors array of this text proxy.
- *
- * @param {Object} options Options object.
- * @param {Boolean} [options.includeSelf=false] When set to `true` this text proxy will be also included in parent's array.
- * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from text proxy parent to root element,
- * otherwise root element will be the first item in the array.
- * @returns {Array} Array with ancestors.
- */
- getAncestors( options = { includeSelf: false, parentFirst: false } ) {
- const ancestors = [];
- let parent = options.includeSelf ? this : this.parent;
- while ( parent ) {
- ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
- parent = parent.parent;
- }
- return ancestors;
- }
- /**
- * Checks if this text proxy has an attribute for given key.
- *
- * @param {String} key Key of attribute to check.
- * @returns {Boolean} `true` if attribute with given key is set on text proxy, `false` otherwise.
- */
- hasAttribute( key ) {
- return this.textNode.hasAttribute( key );
- }
- /**
- * Gets an attribute value for given key or `undefined` if that attribute is not set on text proxy.
- *
- * @param {String} key Key of attribute to look for.
- * @returns {*} Attribute value or `undefined`.
- */
- getAttribute( key ) {
- return this.textNode.getAttribute( key );
- }
- /**
- * Returns iterator that iterates over this node's attributes. Attributes are returned as arrays containing two
- * items. First one is attribute key and second is attribute value.
- *
- * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
- *
- * @returns {Iterable.<*>}
- */
- getAttributes() {
- return this.textNode.getAttributes();
- }
- /**
- * Returns iterator that iterates over this node's attribute keys.
- *
- * @returns {Iterable.<String>}
- */
- getAttributeKeys() {
- return this.textNode.getAttributeKeys();
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // log() {
- // @if CK_DEBUG_ENGINE // console.log( 'ModelTextProxy: ' + this );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // logExtended() {
- // @if CK_DEBUG_ENGINE // console.log( `ModelTextProxy: ${ this }, ` +
- // @if CK_DEBUG_ENGINE // `attrs: ${ convertMapToStringifiedObject( this.getAttributes() ) }` );
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js ***!
- \*************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TreeWalker; });
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
- /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/treewalker
- */
- /**
- * Position iterator class. It allows to iterate forward and backward over the document.
- */
- class TreeWalker {
- /**
- * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.
- *
- * @constructor
- * @param {Object} [options={}] Object with configuration.
- * @param {'forward'|'backward'} [options.direction='forward'] Walking direction.
- * @param {module:engine/model/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.
- * @param {module:engine/model/position~Position} [options.startPosition] Starting position.
- * @param {Boolean} [options.singleCharacters=false] Flag indicating whether all consecutive characters with the same attributes
- * should be returned one by one as multiple {@link module:engine/model/textproxy~TextProxy} (`true`) objects or as one
- * {@link module:engine/model/textproxy~TextProxy} (`false`).
- * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the
- * iterator is shallow child nodes of any iterated node will not be returned along with `elementEnd` tag.
- * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `elementEnd`
- * tags. If the option is true walker will not return a parent node of start position. If this option is `true`
- * each {@link module:engine/model/element~Element} will be returned once, while if the option is `false` they might be returned
- * twice: for `'elementStart'` and `'elementEnd'`.
- */
- constructor( options = {} ) {
- if ( !options.boundaries && !options.startPosition ) {
- /**
- * Neither boundaries nor starting position of a `TreeWalker` have been defined.
- *
- * @error model-tree-walker-no-start-position
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
- 'model-tree-walker-no-start-position',
- null
- );
- }
- const direction = options.direction || 'forward';
- if ( direction != 'forward' && direction != 'backward' ) {
- /**
- * Only `backward` and `forward` direction allowed.
- *
- * @error model-tree-walker-unknown-direction
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-tree-walker-unknown-direction', options, { direction } );
- }
- /**
- * Walking direction. Defaults `'forward'`.
- *
- * @readonly
- * @member {'backward'|'forward'} module:engine/model/treewalker~TreeWalker#direction
- */
- this.direction = direction;
- /**
- * Iterator boundaries.
- *
- * When the iterator is walking `'forward'` on the end of boundary or is walking `'backward'`
- * on the start of boundary, then `{ done: true }` is returned.
- *
- * If boundaries are not defined they are set before first and after last child of the root node.
- *
- * @readonly
- * @member {module:engine/model/range~Range} module:engine/model/treewalker~TreeWalker#boundaries
- */
- this.boundaries = options.boundaries || null;
- /**
- * Iterator position. This is always static position, even if the initial position was a
- * {@link module:engine/model/liveposition~LivePosition live position}. If start position is not defined then position depends
- * on {@link #direction}. If direction is `'forward'` position starts form the beginning, when direction
- * is `'backward'` position starts from the end.
- *
- * @readonly
- * @member {module:engine/model/position~Position} module:engine/model/treewalker~TreeWalker#position
- */
- if ( options.startPosition ) {
- this.position = options.startPosition.clone();
- } else {
- this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAt( this.boundaries[ this.direction == 'backward' ? 'end' : 'start' ] );
- }
- // Reset position stickiness in case it was set to other value, as the stickiness is kept after cloning.
- this.position.stickiness = 'toNone';
- /**
- * Flag indicating whether all consecutive characters with the same attributes should be
- * returned as one {@link module:engine/model/textproxy~TextProxy} (`true`) or one by one (`false`).
- *
- * @readonly
- * @member {Boolean} module:engine/model/treewalker~TreeWalker#singleCharacters
- */
- this.singleCharacters = !!options.singleCharacters;
- /**
- * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
- * iterated node will not be returned along with `elementEnd` tag.
- *
- * @readonly
- * @member {Boolean} module:engine/model/treewalker~TreeWalker#shallow
- */
- this.shallow = !!options.shallow;
- /**
- * Flag indicating whether iterator should ignore `elementEnd` tags. If the option is true walker will not
- * return a parent node of the start position. If this option is `true` each {@link module:engine/model/element~Element} will
- * be returned once, while if the option is `false` they might be returned twice:
- * for `'elementStart'` and `'elementEnd'`.
- *
- * @readonly
- * @member {Boolean} module:engine/model/treewalker~TreeWalker#ignoreElementEnd
- */
- this.ignoreElementEnd = !!options.ignoreElementEnd;
- /**
- * Start boundary cached for optimization purposes.
- *
- * @private
- * @member {module:engine/model/element~Element} module:engine/model/treewalker~TreeWalker#_boundaryStartParent
- */
- this._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;
- /**
- * End boundary cached for optimization purposes.
- *
- * @private
- * @member {module:engine/model/element~Element} module:engine/model/treewalker~TreeWalker#_boundaryEndParent
- */
- this._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;
- /**
- * Parent of the most recently visited node. Cached for optimization purposes.
- *
- * @private
- * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
- * module:engine/model/treewalker~TreeWalker#_visitedParent
- */
- this._visitedParent = this.position.parent;
- }
- /**
- * Iterable interface.
- *
- * @returns {Iterable.<module:engine/model/treewalker~TreeWalkerValue>}
- */
- [ Symbol.iterator ]() {
- return this;
- }
- /**
- * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.
- *
- * For example:
- *
- * walker.skip( value => value.type == 'text' ); // <paragraph>[]foo</paragraph> -> <paragraph>foo[]</paragraph>
- * walker.skip( () => true ); // Move the position to the end: <paragraph>[]foo</paragraph> -> <paragraph>foo</paragraph>[]
- * walker.skip( () => false ); // Do not move the position.
- *
- * @param {Function} skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should
- * return `true` if the value should be skipped or `false` if not.
- */
- skip( skip ) {
- let done, value, prevPosition, prevVisitedParent;
- do {
- prevPosition = this.position;
- prevVisitedParent = this._visitedParent;
- ( { done, value } = this.next() );
- } while ( !done && skip( value ) );
- if ( !done ) {
- this.position = prevPosition;
- this._visitedParent = prevVisitedParent;
- }
- }
- /**
- * Gets the next tree walker's value.
- *
- * @returns {module:engine/model/treewalker~TreeWalkerValue} Next tree walker's value.
- */
- next() {
- if ( this.direction == 'forward' ) {
- return this._next();
- } else {
- return this._previous();
- }
- }
- /**
- * Makes a step forward in model. Moves the {@link #position} to the next position and returns the encountered value.
- *
- * @private
- * @returns {Object}
- * @returns {Boolean} return.done True if iterator is done.
- * @returns {module:engine/model/treewalker~TreeWalkerValue} return.value Information about taken step.
- */
- _next() {
- const previousPosition = this.position;
- const position = this.position.clone();
- const parent = this._visitedParent;
- // We are at the end of the root.
- if ( parent.parent === null && position.offset === parent.maxOffset ) {
- return { done: true };
- }
- // We reached the walker boundary.
- if ( parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset ) {
- return { done: true };
- }
- // Get node just after the current position.
- // Use a highly optimized version instead of checking the text node first and then getting the node after. See #6582.
- const positionParent = position.parent;
- const textNodeAtPosition = Object(_position__WEBPACK_IMPORTED_MODULE_3__["getTextNodeAtPosition"])( position, positionParent );
- const node = textNodeAtPosition ? textNodeAtPosition : Object(_position__WEBPACK_IMPORTED_MODULE_3__["getNodeAfterPosition"])( position, positionParent, textNodeAtPosition );
- if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
- if ( !this.shallow ) {
- // Manual operations on path internals for optimization purposes. Here and in the rest of the method.
- position.path.push( 0 );
- this._visitedParent = node;
- } else {
- position.offset++;
- }
- this.position = position;
- return formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
- } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- let charactersCount;
- if ( this.singleCharacters ) {
- charactersCount = 1;
- } else {
- let offset = node.endOffset;
- if ( this._boundaryEndParent == parent && this.boundaries.end.offset < offset ) {
- offset = this.boundaries.end.offset;
- }
- charactersCount = offset - position.offset;
- }
- const offsetInTextNode = position.offset - node.startOffset;
- const item = new _textproxy__WEBPACK_IMPORTED_MODULE_1__["default"]( node, offsetInTextNode, charactersCount );
- position.offset += charactersCount;
- this.position = position;
- return formatReturnValue( 'text', item, previousPosition, position, charactersCount );
- } else {
- // `node` is not set, we reached the end of current `parent`.
- position.path.pop();
- position.offset++;
- this.position = position;
- this._visitedParent = parent.parent;
- if ( this.ignoreElementEnd ) {
- return this._next();
- } else {
- return formatReturnValue( 'elementEnd', parent, previousPosition, position );
- }
- }
- }
- /**
- * Makes a step backward in model. Moves the {@link #position} to the previous position and returns the encountered value.
- *
- * @private
- * @returns {Object}
- * @returns {Boolean} return.done True if iterator is done.
- * @returns {module:engine/model/treewalker~TreeWalkerValue} return.value Information about taken step.
- */
- _previous() {
- const previousPosition = this.position;
- const position = this.position.clone();
- const parent = this._visitedParent;
- // We are at the beginning of the root.
- if ( parent.parent === null && position.offset === 0 ) {
- return { done: true };
- }
- // We reached the walker boundary.
- if ( parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset ) {
- return { done: true };
- }
- // Get node just before the current position.
- // Use a highly optimized version instead of checking the text node first and then getting the node before. See #6582.
- const positionParent = position.parent;
- const textNodeAtPosition = Object(_position__WEBPACK_IMPORTED_MODULE_3__["getTextNodeAtPosition"])( position, positionParent );
- const node = textNodeAtPosition ? textNodeAtPosition : Object(_position__WEBPACK_IMPORTED_MODULE_3__["getNodeBeforePosition"])( position, positionParent, textNodeAtPosition );
- if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
- position.offset--;
- if ( !this.shallow ) {
- position.path.push( node.maxOffset );
- this.position = position;
- this._visitedParent = node;
- if ( this.ignoreElementEnd ) {
- return this._previous();
- } else {
- return formatReturnValue( 'elementEnd', node, previousPosition, position );
- }
- } else {
- this.position = position;
- return formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
- }
- } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- let charactersCount;
- if ( this.singleCharacters ) {
- charactersCount = 1;
- } else {
- let offset = node.startOffset;
- if ( this._boundaryStartParent == parent && this.boundaries.start.offset > offset ) {
- offset = this.boundaries.start.offset;
- }
- charactersCount = position.offset - offset;
- }
- const offsetInTextNode = position.offset - node.startOffset;
- const item = new _textproxy__WEBPACK_IMPORTED_MODULE_1__["default"]( node, offsetInTextNode - charactersCount, charactersCount );
- position.offset -= charactersCount;
- this.position = position;
- return formatReturnValue( 'text', item, previousPosition, position, charactersCount );
- } else {
- // `node` is not set, we reached the beginning of current `parent`.
- position.path.pop();
- this.position = position;
- this._visitedParent = parent.parent;
- return formatReturnValue( 'elementStart', parent, previousPosition, position, 1 );
- }
- }
- }
- function formatReturnValue( type, item, previousPosition, nextPosition, length ) {
- return {
- done: false,
- value: {
- type,
- item,
- previousPosition,
- nextPosition,
- length
- }
- };
- }
- /**
- * Type of the step made by {@link module:engine/model/treewalker~TreeWalker}.
- * Possible values: `'elementStart'` if walker is at the beginning of a node, `'elementEnd'` if walker is at the end of node,
- * or `'text'` if walker traversed over text.
- *
- * @typedef {'elementStart'|'elementEnd'|'text'} module:engine/model/treewalker~TreeWalkerValueType
- */
- /**
- * Object returned by {@link module:engine/model/treewalker~TreeWalker} when traversing tree model.
- *
- * @typedef {Object} module:engine/model/treewalker~TreeWalkerValue
- * @property {module:engine/model/treewalker~TreeWalkerValueType} type
- * @property {module:engine/model/item~Item} item Item between old and new positions of {@link module:engine/model/treewalker~TreeWalker}.
- * @property {module:engine/model/position~Position} previousPosition Previous position of the iterator.
- * * Forward iteration: For `'elementEnd'` it is the last position inside the element. For all other types it is the
- * position before the item.
- * * Backward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
- * the position after item.
- * @property {module:engine/model/position~Position} nextPosition Next position of the iterator.
- * * Forward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
- * the position after the item.
- * * Backward iteration: For `'elementEnd'` it is last position inside element. For all other types it is the position
- * before the item.
- * @property {Number} [length] Length of the item. For `'elementStart'` it is 1. For `'text'` it is
- * the length of the text. For `'elementEnd'` it is `undefined`.
- */
- /**
- * Tree walking directions.
- *
- * @typedef {'forward'|'backward'} module:engine/model/treewalker~TreeWalkerDirection
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js":
- /*!*************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js ***!
- \*************************************************************************************/
- /*! exports provided: autoParagraphEmptyRoots, isParagraphable, wrapInParagraph */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoParagraphEmptyRoots", function() { return autoParagraphEmptyRoots; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isParagraphable", function() { return isParagraphable; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapInParagraph", function() { return wrapInParagraph; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/utils/autoparagraphing
- */
- /**
- * Fixes all empty roots.
- *
- * @protected
- * @param {module:engine/model/writer~Writer} writer The model writer.
- * @returns {Boolean} `true` if any change has been applied, `false` otherwise.
- */
- function autoParagraphEmptyRoots( writer ) {
- const { schema, document } = writer.model;
- for ( const rootName of document.getRootNames() ) {
- const root = document.getRoot( rootName );
- if ( root.isEmpty && !schema.checkChild( root, '$text' ) ) {
- // If paragraph element is allowed in the root, create paragraph element.
- if ( schema.checkChild( root, 'paragraph' ) ) {
- writer.insertElement( 'paragraph', root );
- // Other roots will get fixed in the next post-fixer round. Those will be triggered
- // in the same batch no matter if this method was triggered by the post-fixing or not
- // (the above insertElement call will trigger the post-fixers).
- return true;
- }
- }
- }
- return false;
- }
- /**
- * Checks if the given node wrapped with a paragraph would be accepted by the schema in the given position.
- *
- * @protected
- * @param {module:engine/model/position~Position} position The position at which to check.
- * @param {module:engine/model/node~Node|String} nodeOrType The child node or child type to check.
- * @param {module:engine/model/schema~Schema} schema A schema instance used for element validation.
- */
- function isParagraphable( position, nodeOrType, schema ) {
- const context = schema.createContext( position );
- // When paragraph is allowed in this context...
- if ( !schema.checkChild( context, 'paragraph' ) ) {
- return false;
- }
- // And a node would be allowed in this paragraph...
- if ( !schema.checkChild( context.push( 'paragraph' ), nodeOrType ) ) {
- return false;
- }
- return true;
- }
- /**
- * Inserts a new paragraph at the given position and returns a position inside that paragraph.
- *
- * @protected
- * @param {module:engine/model/position~Position} position The position where a paragraph should be inserted.
- * @param {module:engine/model/writer~Writer} writer The model writer.
- * @returns {module:engine/model/position~Position} Position inside the created paragraph.
- */
- function wrapInParagraph( position, writer ) {
- const paragraph = writer.createElement( 'paragraph' );
- writer.insert( paragraph, position );
- return writer.createPositionAt( paragraph, 0 );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return deleteContent; });
- /* harmony import */ var _liveposition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../liveposition */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/utils/deletecontent
- */
- /**
- * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
- *
- * **Note:** Use {@link module:engine/model/model~Model#deleteContent} instead of this function.
- * This function is only exposed to be reusable in algorithms
- * which change the {@link module:engine/model/model~Model#deleteContent}
- * method's behavior.
- *
- * @param {module:engine/model/model~Model} model The model in context of which the insertion
- * should be performed.
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- * Selection of which the content should be deleted.
- * @param {Object} [options]
- * @param {Boolean} [options.leaveUnmerged=false] Whether to merge elements after removing the content of the selection.
- *
- * For example `<heading>x[x</heading><paragraph>y]y</paragraph>` will become:
- *
- * * `<heading>x^y</heading>` with the option disabled (`leaveUnmerged == false`)
- * * `<heading>x^</heading><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).
- *
- * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}
- * elements will not be merged.
- *
- * @param {Boolean} [options.doNotResetEntireContent=false] Whether to skip replacing the entire content with a
- * paragraph when the entire content was selected.
- *
- * For example `<heading>[x</heading><paragraph>y]</paragraph>` will become:
- *
- * * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)
- * * `<heading>^</heading>` with enabled (`doNotResetEntireContent == true`).
- *
- * @param {Boolean} [options.doNotAutoparagraph=false] Whether to create a paragraph if after content deletion selection is moved
- * to a place where text cannot be inserted.
- *
- * For example `<paragraph>x</paragraph>[<image src="foo.jpg"></image>]` will become:
- *
- * * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)
- * * `<paragraph>x</paragraph>[]` with the option enabled (`doNotAutoparagraph == true`).
- *
- * If you use this option you need to make sure to handle invalid selections yourself or leave
- * them to the selection post-fixer (may not always work).
- *
- * **Note:** if there is no valid position for the selection, the paragraph will always be created:
- *
- * `[<image src="foo.jpg"></image>]` -> `<paragraph>[]</paragraph>`.
- */
- function deleteContent( model, selection, options = {} ) {
- if ( selection.isCollapsed ) {
- return;
- }
- const selRange = selection.getFirstRange();
- // If the selection is already removed, don't do anything.
- if ( selRange.root.rootName == '$graveyard' ) {
- return;
- }
- const schema = model.schema;
- model.change( writer => {
- // 1. Replace the entire content with paragraph.
- // See: https://github.com/ckeditor/ckeditor5-engine/issues/1012#issuecomment-315017594.
- if ( !options.doNotResetEntireContent && shouldEntireContentBeReplacedWithParagraph( schema, selection ) ) {
- replaceEntireContentWithParagraph( writer, selection, schema );
- return;
- }
- // Get the live positions for the range adjusted to span only blocks selected from the user perspective.
- const [ startPosition, endPosition ] = getLivePositionsForSelectedBlocks( selRange );
- // 2. Remove the content if there is any.
- if ( !startPosition.isTouching( endPosition ) ) {
- writer.remove( writer.createRange( startPosition, endPosition ) );
- }
- // 3. Merge elements in the right branch to the elements in the left branch.
- // The only reasonable (in terms of data and selection correctness) case in which we need to do that is:
- //
- // <heading type=1>Fo[</heading><paragraph>]ar</paragraph> => <heading type=1>Fo^ar</heading>
- //
- // However, the algorithm supports also merging deeper structures (up to the depth of the shallower branch),
- // as it's hard to imagine what should actually be the default behavior. Usually, specific features will
- // want to override that behavior anyway.
- if ( !options.leaveUnmerged ) {
- mergeBranches( writer, startPosition, endPosition );
- // TMP this will be replaced with a postfixer.
- // We need to check and strip disallowed attributes in all nested nodes because after merge
- // some attributes could end up in a path where are disallowed.
- //
- // e.g. bold is disallowed for <H1>
- // <h1>Fo{o</h1><p>b}a<b>r</b><p> -> <h1>Fo{}a<b>r</b><h1> -> <h1>Fo{}ar<h1>.
- schema.removeDisallowedAttributes( startPosition.parent.getChildren(), writer );
- }
- collapseSelectionAt( writer, selection, startPosition );
- // 4. Add a paragraph to set selection in it.
- // Check if a text is allowed in the new container. If not, try to create a new paragraph (if it's allowed here).
- // If autoparagraphing is off, we assume that you know what you do so we leave the selection wherever it was.
- if ( !options.doNotAutoparagraph && shouldAutoparagraph( schema, startPosition ) ) {
- insertParagraph( writer, startPosition, selection );
- }
- startPosition.detach();
- endPosition.detach();
- } );
- }
- // Returns the live positions for the range adjusted to span only blocks selected from the user perspective. Example:
- //
- // <heading1>[foo</heading1>
- // <paragraph>bar</paragraph>
- // <heading1>]abc</heading1> <-- this block is not considered as selected
- //
- // This is the same behavior as in Selection#getSelectedBlocks() "special case".
- function getLivePositionsForSelectedBlocks( range ) {
- const model = range.root.document.model;
- const startPosition = range.start;
- let endPosition = range.end;
- // If the end of selection is at the start position of last block in the selection, then
- // shrink it to not include that trailing block. Note that this should happen only for not empty selection.
- if ( model.hasContent( range, { ignoreMarkers: true } ) ) {
- const endBlock = getParentBlock( endPosition );
- if ( endBlock && endPosition.isTouching( model.createPositionAt( endBlock, 0 ) ) ) {
- // Create forward selection as a probe to find a valid position after excluding last block from the range.
- const selection = model.createSelection( range );
- // Modify the forward selection in backward direction to shrink it and remove first position of following block from it.
- // This is how modifySelection works and here we are making use of it.
- model.modifySelection( selection, { direction: 'backward' } );
- const newEndPosition = selection.getLastPosition();
- // For such model and selection:
- // <paragraph>A[</paragraph><image></image><paragraph>]B</paragraph>
- //
- // After modifySelection() we would end up with this:
- // <paragraph>A[</paragraph>]<image></image><paragraph>B</paragraph>
- //
- // So we need to check if there is no content in the skipped range (because we want to include the <image>).
- const skippedRange = model.createRange( newEndPosition, endPosition );
- if ( !model.hasContent( skippedRange, { ignoreMarkers: true } ) ) {
- endPosition = newEndPosition;
- }
- }
- }
- return [
- _liveposition__WEBPACK_IMPORTED_MODULE_0__["default"].fromPosition( startPosition, 'toPrevious' ),
- _liveposition__WEBPACK_IMPORTED_MODULE_0__["default"].fromPosition( endPosition, 'toNext' )
- ];
- }
- // Finds the lowest element in position's ancestors which is a block.
- // Returns null if a limit element is encountered before reaching a block element.
- function getParentBlock( position ) {
- const element = position.parent;
- const schema = element.root.document.model.schema;
- const ancestors = element.getAncestors( { parentFirst: true, includeSelf: true } );
- for ( const element of ancestors ) {
- if ( schema.isLimit( element ) ) {
- return null;
- }
- if ( schema.isBlock( element ) ) {
- return element;
- }
- }
- }
- // This function is a result of reaching the Ballmer's peak for just the right amount of time.
- // Even I had troubles documenting it after a while and after reading it again I couldn't believe that it really works.
- function mergeBranches( writer, startPosition, endPosition ) {
- const model = writer.model;
- // Verify if there is a need and possibility to merge.
- if ( !checkShouldMerge( writer.model.schema, startPosition, endPosition ) ) {
- return;
- }
- // If the start element on the common ancestor level is empty, and the end element on the same level is not empty
- // then merge those to the right element so that it's properties are preserved (name, attributes).
- // Because of OT merging is used instead of removing elements.
- //
- // Merge left:
- // <heading1>foo[</heading1> -> <heading1>foo[]bar</heading1>
- // <paragraph>]bar</paragraph> -> --^
- //
- // Merge right:
- // <heading1>[</heading1> ->
- // <paragraph>]bar</paragraph> -> <paragraph>[]bar</paragraph>
- //
- // Merge left:
- // <blockQuote> -> <blockQuote>
- // <heading1>foo[</heading1> -> <heading1>foo[]bar</heading1>
- // <paragraph>]bar</paragraph> -> --^
- // </blockQuote> -> </blockQuote>
- //
- // Merge right:
- // <blockQuote> -> <blockQuote>
- // <heading1>[</heading1> ->
- // <paragraph>]bar</paragraph> -> <paragraph>[]bar</paragraph>
- // </blockQuote> -> </blockQuote>
- // Merging should not go deeper than common ancestor.
- const [ startAncestor, endAncestor ] = getAncestorsJustBelowCommonAncestor( startPosition, endPosition );
- // Branches can't be merged if one of the positions is directly inside a common ancestor.
- //
- // Example:
- // <blockQuote>
- // <paragraph>[foo</paragraph>]
- // <table> ... </table>
- // <blockQuote>
- //
- if ( !startAncestor || !endAncestor ) {
- return;
- }
- if ( !model.hasContent( startAncestor, { ignoreMarkers: true } ) && model.hasContent( endAncestor, { ignoreMarkers: true } ) ) {
- mergeBranchesRight( writer, startPosition, endPosition, startAncestor.parent );
- } else {
- mergeBranchesLeft( writer, startPosition, endPosition, startAncestor.parent );
- }
- }
- // Merging blocks to the left (properties of the left block are preserved).
- // Simple example:
- // <heading1>foo[</heading1> -> <heading1>foo[bar</heading1>]
- // <paragraph>]bar</paragraph> -> --^
- //
- // Nested example:
- // <blockQuote> -> <blockQuote>
- // <heading1>foo[</heading1> -> <heading1>foo[bar</heading1>
- // </blockQuote> -> </blockQuote>] ^
- // <blockBlock> -> |
- // <paragraph>]bar</paragraph> -> ---
- // </blockBlock> ->
- //
- function mergeBranchesLeft( writer, startPosition, endPosition, commonAncestor ) {
- const startElement = startPosition.parent;
- const endElement = endPosition.parent;
- // Merging reached the common ancestor element, stop here.
- if ( startElement == commonAncestor || endElement == commonAncestor ) {
- return;
- }
- // Remember next positions to merge in next recursive step (also used as modification points pointers).
- startPosition = writer.createPositionAfter( startElement );
- endPosition = writer.createPositionBefore( endElement );
- // Move endElement just after startElement if they aren't siblings.
- if ( !endPosition.isEqual( startPosition ) ) {
- //
- // <blockQuote> -> <blockQuote>
- // <heading1>foo[</heading1> -> <heading1>foo</heading1>[<paragraph>bar</paragraph>
- // </blockQuote> -> </blockQuote> ^
- // <blockBlock> -> <blockBlock> |
- // <paragraph>]bar</paragraph> -> ] ---
- // </blockBlock> -> </blockBlock>
- //
- writer.insert( endElement, startPosition );
- }
- // Merge two siblings (nodes on sides of startPosition):
- //
- // <blockQuote> -> <blockQuote>
- // <heading1>foo</heading1>[<paragraph>bar</paragraph> -> <heading1>foo[bar</heading1>
- // </blockQuote> -> </blockQuote>
- // <blockBlock> -> <blockBlock>
- // ] -> ]
- // </blockBlock> -> </blockBlock>
- //
- // Or in simple case (without moving elements in above if):
- // <heading1>foo</heading1>[<paragraph>bar</paragraph>] -> <heading1>foo[bar</heading1>]
- //
- writer.merge( startPosition );
- // Remove empty end ancestors:
- //
- // <blockQuote> -> <blockQuote>
- // <heading1>foo[bar</heading1> -> <heading1>foo[bar</heading1>
- // </blockQuote> -> </blockQuote>
- // <blockBlock> ->
- // ] -> ]
- // </blockBlock> ->
- //
- while ( endPosition.parent.isEmpty ) {
- const parentToRemove = endPosition.parent;
- endPosition = writer.createPositionBefore( parentToRemove );
- writer.remove( parentToRemove );
- }
- // Verify if there is a need and possibility to merge next level.
- if ( !checkShouldMerge( writer.model.schema, startPosition, endPosition ) ) {
- return;
- }
- // Continue merging next level (blockQuote with blockBlock in the examples above if it would not be empty and got removed).
- mergeBranchesLeft( writer, startPosition, endPosition, commonAncestor );
- }
- // Merging blocks to the right (properties of the right block are preserved).
- // Simple example:
- // <heading1>foo[</heading1> -> --v
- // <paragraph>]bar</paragraph> -> [<paragraph>foo]bar</paragraph>
- //
- // Nested example:
- // <blockQuote> ->
- // <heading1>foo[</heading1> -> ---
- // </blockQuote> -> |
- // <blockBlock> -> [<blockBlock> v
- // <paragraph>]bar</paragraph> -> <paragraph>foo]bar</paragraph>
- // </blockBlock> -> </blockBlock>
- //
- function mergeBranchesRight( writer, startPosition, endPosition, commonAncestor ) {
- const startElement = startPosition.parent;
- const endElement = endPosition.parent;
- // Merging reached the common ancestor element, stop here.
- if ( startElement == commonAncestor || endElement == commonAncestor ) {
- return;
- }
- // Remember next positions to merge in next recursive step (also used as modification points pointers).
- startPosition = writer.createPositionAfter( startElement );
- endPosition = writer.createPositionBefore( endElement );
- // Move startElement just before endElement if they aren't siblings.
- if ( !endPosition.isEqual( startPosition ) ) {
- //
- // <blockQuote> -> <blockQuote>
- // <heading1>foo[</heading1> -> [ ---
- // </blockQuote> -> </blockQuote> |
- // <blockBlock> -> <blockBlock> v
- // <paragraph>]bar</paragraph> -> <heading1>foo</heading1>]<paragraph>bar</paragraph>
- // </blockBlock> -> </blockBlock>
- //
- writer.insert( startElement, endPosition );
- }
- // Remove empty end ancestors:
- //
- // <blockQuote> ->
- // [ -> [
- // </blockQuote> ->
- // <blockBlock> -> <blockBlock>
- // <heading1>foo</heading1>]<paragraph>bar</paragraph> -> <heading1>foo</heading1>]<paragraph>bar</paragraph>
- // </blockBlock> -> </blockBlock>
- //
- while ( startPosition.parent.isEmpty ) {
- const parentToRemove = startPosition.parent;
- startPosition = writer.createPositionBefore( parentToRemove );
- writer.remove( parentToRemove );
- }
- // Update endPosition after inserting and removing elements.
- endPosition = writer.createPositionBefore( endElement );
- // Merge right two siblings (nodes on sides of endPosition):
- // ->
- // [ -> [
- // ->
- // <blockBlock> -> <blockBlock>
- // <heading1>foo</heading1>]<paragraph>bar</paragraph> -> <paragraph>foo]bar</paragraph>
- // </blockBlock> -> </blockBlock>
- //
- // Or in simple case (without moving elements in above if):
- // [<heading1>foo</heading1>]<paragraph>bar</paragraph> -> [<heading1>foo]bar</heading1>
- //
- mergeRight( writer, endPosition );
- // Verify if there is a need and possibility to merge next level.
- if ( !checkShouldMerge( writer.model.schema, startPosition, endPosition ) ) {
- return;
- }
- // Continue merging next level (blockQuote with blockBlock in the examples above if it would not be empty and got removed).
- mergeBranchesRight( writer, startPosition, endPosition, commonAncestor );
- }
- // There is no right merge operation so we need to simulate it.
- function mergeRight( writer, position ) {
- const startElement = position.nodeBefore;
- const endElement = position.nodeAfter;
- if ( startElement.name != endElement.name ) {
- writer.rename( startElement, endElement.name );
- }
- writer.clearAttributes( startElement );
- writer.setAttributes( Object.fromEntries( endElement.getAttributes() ), startElement );
- writer.merge( position );
- }
- // Verifies if merging is needed and possible. It's not needed if both positions are in the same element
- // and it's not possible if some element is a limit or the range crosses a limit element.
- function checkShouldMerge( schema, startPosition, endPosition ) {
- const startElement = startPosition.parent;
- const endElement = endPosition.parent;
- // If both positions ended up in the same parent, then there's nothing more to merge:
- // <$root><p>x[</p><p>]y</p></$root> => <$root><p>xy</p>[]</$root>
- if ( startElement == endElement ) {
- return false;
- }
- // If one of the positions is a limit element, then there's nothing to merge because we don't want to cross the limit boundaries.
- if ( schema.isLimit( startElement ) || schema.isLimit( endElement ) ) {
- return false;
- }
- // Check if operations we'll need to do won't need to cross object or limit boundaries.
- // E.g., we can't merge endElement into startElement in this case:
- // <limit><startElement>x[</startElement></limit><endElement>]</endElement>
- return isCrossingLimitElement( startPosition, endPosition, schema );
- }
- // Returns the elements that are the ancestors of the provided positions that are direct children of the common ancestor.
- function getAncestorsJustBelowCommonAncestor( positionA, positionB ) {
- const ancestorsA = positionA.getAncestors();
- const ancestorsB = positionB.getAncestors();
- let i = 0;
- while ( ancestorsA[ i ] && ancestorsA[ i ] == ancestorsB[ i ] ) {
- i++;
- }
- return [ ancestorsA[ i ], ancestorsB[ i ] ];
- }
- function shouldAutoparagraph( schema, position ) {
- const isTextAllowed = schema.checkChild( position, '$text' );
- const isParagraphAllowed = schema.checkChild( position, 'paragraph' );
- return !isTextAllowed && isParagraphAllowed;
- }
- // Check if parents of two positions can be merged by checking if there are no limit/object
- // boundaries between those two positions.
- //
- // E.g. in <bQ><p>x[]</p></bQ><widget><caption>{}</caption></widget>
- // we'll check <p>, <bQ>, <widget> and <caption>.
- // Usually, widget and caption are marked as objects/limits in the schema, so in this case merging will be blocked.
- function isCrossingLimitElement( leftPos, rightPos, schema ) {
- const rangeToCheck = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( leftPos, rightPos );
- for ( const value of rangeToCheck.getWalker() ) {
- if ( schema.isLimit( value.item ) ) {
- return false;
- }
- }
- return true;
- }
- function insertParagraph( writer, position, selection ) {
- const paragraph = writer.createElement( 'paragraph' );
- writer.insert( paragraph, position );
- collapseSelectionAt( writer, selection, writer.createPositionAt( paragraph, 0 ) );
- }
- function replaceEntireContentWithParagraph( writer, selection ) {
- const limitElement = writer.model.schema.getLimitElement( selection );
- writer.remove( writer.createRangeIn( limitElement ) );
- insertParagraph( writer, writer.createPositionAt( limitElement, 0 ), selection );
- }
- // We want to replace the entire content with a paragraph when:
- // * the entire content is selected,
- // * selection contains at least two elements,
- // * whether the paragraph is allowed in schema in the common ancestor.
- function shouldEntireContentBeReplacedWithParagraph( schema, selection ) {
- const limitElement = schema.getLimitElement( selection );
- if ( !selection.containsEntireContent( limitElement ) ) {
- return false;
- }
- const range = selection.getFirstRange();
- if ( range.start.parent == range.end.parent ) {
- return false;
- }
- return schema.checkChild( limitElement, 'paragraph' );
- }
- // Helper function that sets the selection. Depending whether given `selection` is a document selection or not,
- // uses a different method to set it.
- function collapseSelectionAt( writer, selection, positionOrRange ) {
- if ( selection instanceof _documentselection__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
- writer.setSelection( positionOrRange );
- } else {
- selection.setTo( positionOrRange );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js ***!
- \***************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getSelectedContent; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/utils/getselectedcontent
- */
- /**
- * Gets a clone of the selected content.
- *
- * For example, for the following selection:
- *
- * ```html
- * <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>
- * ```
- *
- * It will return a document fragment with such a content:
- *
- * ```html
- * <quote><h>st</h></quote><p>se</p>
- * ```
- *
- * @param {module:engine/model/model~Model} model The model in context of which
- * the selection modification should be performed.
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- * The selection of which content will be returned.
- * @returns {module:engine/model/documentfragment~DocumentFragment}
- */
- function getSelectedContent( model, selection ) {
- return model.change( writer => {
- const frag = writer.createDocumentFragment();
- const range = selection.getFirstRange();
- if ( !range || range.isCollapsed ) {
- return frag;
- }
- const root = range.start.root;
- const commonPath = range.start.getCommonPath( range.end );
- const commonParent = root.getNodeByPath( commonPath );
- // ## 1st step
- //
- // First, we'll clone a fragment represented by a minimal flat range
- // containing the original range to be cloned.
- // E.g. let's consider such a range:
- //
- // <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>
- //
- // A minimal flat range containing this one is:
- //
- // <p>x</p>[<quote><p>y</p><h>first</h></quote><p>second</p>]<p>z</p>
- //
- // We can easily clone this structure, preserving e.g. the <quote> element.
- let flatSubtreeRange;
- if ( range.start.parent == range.end.parent ) {
- // The original range is flat, so take it.
- flatSubtreeRange = range;
- } else {
- flatSubtreeRange = writer.createRange(
- writer.createPositionAt( commonParent, range.start.path[ commonPath.length ] ),
- writer.createPositionAt( commonParent, range.end.path[ commonPath.length ] + 1 )
- );
- }
- const howMany = flatSubtreeRange.end.offset - flatSubtreeRange.start.offset;
- // Clone the whole contents.
- for ( const item of flatSubtreeRange.getItems( { shallow: true } ) ) {
- if ( item.is( '$textProxy' ) ) {
- writer.appendText( item.data, item.getAttributes(), frag );
- } else {
- writer.append( writer.cloneElement( item, true ), frag );
- }
- }
- // ## 2nd step
- //
- // If the original range wasn't flat, then we need to remove the excess nodes from the both ends of the cloned fragment.
- //
- // For example, for the range shown in the 1st step comment, we need to remove these pieces:
- //
- // <quote>[<p>y</p>]<h>[fir]st</h></quote><p>se[cond]</p>
- //
- // So this will be the final copied content:
- //
- // <quote><h>st</h></quote><p>se</p>
- //
- // In order to do that, we remove content from these two ranges:
- //
- // [<quote><p>y</p><h>fir]st</h></quote><p>se[cond</p>]
- if ( flatSubtreeRange != range ) {
- // Find the position of the original range in the cloned fragment.
- const newRange = range._getTransformedByMove( flatSubtreeRange.start, writer.createPositionAt( frag, 0 ), howMany )[ 0 ];
- const leftExcessRange = writer.createRange( writer.createPositionAt( frag, 0 ), newRange.start );
- const rightExcessRange = writer.createRange( newRange.end, writer.createPositionAt( frag, 'end' ) );
- removeRangeContent( rightExcessRange, writer );
- removeRangeContent( leftExcessRange, writer );
- }
- return frag;
- } );
- }
- // After https://github.com/ckeditor/ckeditor5-engine/issues/690 is fixed,
- // this function will, most likely, be able to rewritten using getMinimalFlatRanges().
- function removeRangeContent( range, writer ) {
- const parentsToCheck = [];
- Array.from( range.getItems( { direction: 'backward' } ) )
- // We should better store ranges because text proxies will lose integrity
- // with the text nodes when we'll start removing content.
- .map( item => writer.createRangeOn( item ) )
- // Filter only these items which are fully contained in the passed range.
- //
- // E.g. for the following range: [<quote><p>y</p><h>fir]st</h>
- // the walker will return the entire <h> element, when only the "fir" item inside it is fully contained.
- .filter( itemRange => {
- // We should be able to use Range.containsRange, but https://github.com/ckeditor/ckeditor5-engine/issues/691.
- const contained =
- ( itemRange.start.isAfter( range.start ) || itemRange.start.isEqual( range.start ) ) &&
- ( itemRange.end.isBefore( range.end ) || itemRange.end.isEqual( range.end ) );
- return contained;
- } )
- .forEach( itemRange => {
- parentsToCheck.push( itemRange.start.parent );
- writer.remove( itemRange );
- } );
- // Remove ancestors of the removed items if they turned to be empty now
- // (their whole content was contained in the range).
- parentsToCheck.forEach( parentToCheck => {
- let parent = parentToCheck;
- while ( parent.parent && parent.isEmpty ) {
- const removeRange = writer.createRangeOn( parent );
- parent = parent.parent;
- writer.remove( removeRange );
- }
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return insertContent; });
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _liveposition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../liveposition */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js");
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
- /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/utils/insertcontent
- */
- /**
- * Inserts content into the editor (specified selection) as one would expect the paste functionality to work.
- *
- * It takes care of removing the selected content, splitting elements (if needed), inserting elements and merging elements appropriately.
- *
- * Some examples:
- *
- * <p>x^</p> + <p>y</p> => <p>x</p><p>y</p> => <p>xy[]</p>
- * <p>x^y</p> + <p>z</p> => <p>x</p>^<p>y</p> + <p>z</p> => <p>x</p><p>z</p><p>y</p> => <p>xz[]y</p>
- * <p>x^y</p> + <img /> => <p>x</p>^<p>y</p> + <img /> => <p>x</p><img /><p>y</p>
- * <p>x</p><p>^</p><p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p> (no merging)
- * <p>x</p>[<img />]<p>z</p> + <p>y</p> => <p>x</p>^<p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p>
- *
- * If an instance of {@link module:engine/model/selection~Selection} is passed as `selectable` it will be modified
- * to the insertion selection (equal to a range to be selected after insertion).
- *
- * If `selectable` is not passed, the content will be inserted using the current selection of the model document.
- *
- * **Note:** Use {@link module:engine/model/model~Model#insertContent} instead of this function.
- * This function is only exposed to be reusable in algorithms which change the {@link module:engine/model/model~Model#insertContent}
- * method's behavior.
- *
- * @param {module:engine/model/model~Model} model The model in context of which the insertion
- * should be performed.
- * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
- * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
- * Selection into which the content should be inserted.
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
- * @returns {module:engine/model/range~Range} Range which contains all the performed changes. This is a range that, if removed,
- * would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed
- * at the insertion position.
- */
- function insertContent( model, content, selectable, placeOrOffset ) {
- return model.change( writer => {
- let selection;
- if ( !selectable ) {
- selection = model.document.selection;
- } else if ( selectable instanceof _selection__WEBPACK_IMPORTED_MODULE_5__["default"] || selectable instanceof _documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
- selection = selectable;
- } else {
- selection = writer.createSelection( selectable, placeOrOffset );
- }
- if ( !selection.isCollapsed ) {
- model.deleteContent( selection, { doNotAutoparagraph: true } );
- }
- const insertion = new Insertion( model, writer, selection.anchor );
- let nodesToInsert;
- if ( content.is( 'documentFragment' ) ) {
- nodesToInsert = content.getChildren();
- } else {
- nodesToInsert = [ content ];
- }
- insertion.handleNodes( nodesToInsert );
- const newRange = insertion.getSelectionRange();
- /* istanbul ignore else */
- if ( newRange ) {
- if ( selection instanceof _documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
- writer.setSelection( newRange );
- } else {
- selection.setTo( newRange );
- }
- } else {
- // We are not testing else because it's a safe check for unpredictable edge cases:
- // an insertion without proper range to select.
- //
- // @if CK_DEBUG // console.warn( 'Cannot determine a proper selection range after insertion.' );
- }
- const affectedRange = insertion.getAffectedRange() || model.createRange( selection.anchor );
- insertion.destroy();
- return affectedRange;
- } );
- }
- /**
- * Utility class for performing content insertion.
- *
- * @private
- */
- class Insertion {
- constructor( model, writer, position ) {
- /**
- * The model in context of which the insertion should be performed.
- *
- * @member {module:engine/model~Model} #model
- */
- this.model = model;
- /**
- * Batch to which operations will be added.
- *
- * @member {module:engine/controller/writer~Batch} #writer
- */
- this.writer = writer;
- /**
- * The position at which (or near which) the next node will be inserted.
- *
- * @member {module:engine/model/position~Position} #position
- */
- this.position = position;
- /**
- * Elements with which the inserted elements can be merged.
- *
- * <p>x^</p><p>y</p> + <p>z</p> (can merge to <p>x</p>)
- * <p>x</p><p>^y</p> + <p>z</p> (can merge to <p>y</p>)
- * <p>x^y</p> + <p>z</p> (can merge to <p>xy</p> which will be split during the action,
- * so both its pieces will be added to this set)
- *
- *
- * @member {Set} #canMergeWith
- */
- this.canMergeWith = new Set( [ this.position.parent ] );
- /**
- * Schema of the model.
- *
- * @member {module:engine/model/schema~Schema} #schema
- */
- this.schema = model.schema;
- /**
- * The temporary DocumentFragment used for grouping multiple nodes for single insert operation.
- *
- * @private
- * @type {module:engine/model/documentfragment~DocumentFragment}
- */
- this._documentFragment = writer.createDocumentFragment();
- /**
- * The current position in the temporary DocumentFragment.
- *
- * @private
- * @type {module:engine/model/position~Position}
- */
- this._documentFragmentPosition = writer.createPositionAt( this._documentFragment, 0 );
- /**
- * The reference to the first inserted node.
- *
- * @private
- * @type {module:engine/model/node~Node}
- */
- this._firstNode = null;
- /**
- * The reference to the last inserted node.
- *
- * @private
- * @type {module:engine/model/node~Node}
- */
- this._lastNode = null;
- /**
- * The reference to the last auto paragraph node.
- *
- * @private
- * @type {module:engine/model/node~Node}
- */
- this._lastAutoParagraph = null;
- /**
- * The array of nodes that should be cleaned of not allowed attributes.
- *
- * @private
- * @type {Array.<module:engine/model/node~Node>}
- */
- this._filterAttributesOf = [];
- /**
- * Beginning of the affected range. See {@link module:engine/model/utils/insertcontent~Insertion#getAffectedRange}.
- *
- * @private
- * @member {module:engine/model/liveposition~LivePosition|null} #_affectedStart
- */
- this._affectedStart = null;
- /**
- * End of the affected range. See {@link module:engine/model/utils/insertcontent~Insertion#getAffectedRange}.
- *
- * @private
- * @member {module:engine/model/liveposition~LivePosition|null} #_affectedEnd
- */
- this._affectedEnd = null;
- }
- /**
- * Handles insertion of a set of nodes.
- *
- * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes to insert.
- */
- handleNodes( nodes ) {
- for ( const node of Array.from( nodes ) ) {
- this._handleNode( node );
- }
- // Insert nodes collected in temporary DocumentFragment.
- this._insertPartialFragment();
- // If there was an auto paragraph then we might need to adjust the end of insertion.
- if ( this._lastAutoParagraph ) {
- this._updateLastNodeFromAutoParagraph( this._lastAutoParagraph );
- }
- // After the content was inserted we may try to merge it with its next sibling if the selection was in it initially.
- // Merging with the previous sibling was performed just after inserting the first node to the document.
- this._mergeOnRight();
- // TMP this will become a post-fixer.
- this.schema.removeDisallowedAttributes( this._filterAttributesOf, this.writer );
- this._filterAttributesOf = [];
- }
- /**
- * Updates the last node after the auto paragraphing.
- *
- * @private
- * @param {module:engine/model/node~Node} node The last auto paragraphing node.
- */
- _updateLastNodeFromAutoParagraph( node ) {
- const positionAfterLastNode = this.writer.createPositionAfter( this._lastNode );
- const positionAfterNode = this.writer.createPositionAfter( node );
- // If the real end was after the last auto paragraph then update relevant properties.
- if ( positionAfterNode.isAfter( positionAfterLastNode ) ) {
- this._lastNode = node;
- /* istanbul ignore if */
- if ( this.position.parent != node || !this.position.isAtEnd ) {
- // Algorithm's correctness check. We should never end up here but it's good to know that we did.
- // At this point the insertion position should be at the end of the last auto paragraph.
- // Note: This error is documented in other place in this file.
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'insertcontent-invalid-insertion-position', this );
- }
- this.position = positionAfterNode;
- this._setAffectedBoundaries( this.position );
- }
- }
- /**
- * Returns range to be selected after insertion.
- * Returns `null` if there is no valid range to select after insertion.
- *
- * @returns {module:engine/model/range~Range|null}
- */
- getSelectionRange() {
- if ( this.nodeToSelect ) {
- return _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createOn( this.nodeToSelect );
- }
- return this.model.schema.getNearestSelectionRange( this.position );
- }
- /**
- * Returns a range which contains all the performed changes. This is a range that, if removed, would return the model to the state
- * before the insertion. Returns `null` if no changes were done.
- *
- * @returns {module:engine/model/range~Range|null}
- */
- getAffectedRange() {
- if ( !this._affectedStart ) {
- return null;
- }
- return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( this._affectedStart, this._affectedEnd );
- }
- /**
- * Destroys `Insertion` instance.
- */
- destroy() {
- if ( this._affectedStart ) {
- this._affectedStart.detach();
- }
- if ( this._affectedEnd ) {
- this._affectedEnd.detach();
- }
- }
- /**
- * Handles insertion of a single node.
- *
- * @private
- * @param {module:engine/model/node~Node} node
- */
- _handleNode( node ) {
- // Let's handle object in a special way.
- // * They should never be merged with other elements.
- // * If they are not allowed in any of the selection ancestors, they could be either autoparagraphed or totally removed.
- if ( this.schema.isObject( node ) ) {
- this._handleObject( node );
- return;
- }
- // Try to find a place for the given node.
- // Check if a node can be inserted in the given position or it would be accepted if a paragraph would be inserted.
- // Inserts the auto paragraph if it would allow for insertion.
- let isAllowed = this._checkAndAutoParagraphToAllowedPosition( node );
- if ( !isAllowed ) {
- // Split the position.parent's branch up to a point where the node can be inserted.
- // If it isn't allowed in the whole branch, then of course don't split anything.
- isAllowed = this._checkAndSplitToAllowedPosition( node );
- if ( !isAllowed ) {
- this._handleDisallowedNode( node );
- return;
- }
- }
- // Add node to the current temporary DocumentFragment.
- this._appendToFragment( node );
- // Store the first and last nodes for easy access for merging with sibling nodes.
- if ( !this._firstNode ) {
- this._firstNode = node;
- }
- this._lastNode = node;
- }
- /**
- * Inserts the temporary DocumentFragment into the model.
- *
- * @private
- */
- _insertPartialFragment() {
- if ( this._documentFragment.isEmpty ) {
- return;
- }
- const livePosition = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( this.position, 'toNext' );
- this._setAffectedBoundaries( this.position );
- // If the very first node of the whole insertion process is inserted, insert it separately for OT reasons (undo).
- // Note: there can be multiple calls to `_insertPartialFragment()` during one insertion process.
- // Note: only the very first node can be merged so we have to do separate operation only for it.
- if ( this._documentFragment.getChild( 0 ) == this._firstNode ) {
- this.writer.insert( this._firstNode, this.position );
- // We must merge the first node just after inserting it to avoid problems with OT.
- // (See: https://github.com/ckeditor/ckeditor5/pull/8773#issuecomment-760945652).
- this._mergeOnLeft();
- this.position = livePosition.toPosition();
- }
- // Insert the remaining nodes from document fragment.
- if ( !this._documentFragment.isEmpty ) {
- this.writer.insert( this._documentFragment, this.position );
- }
- this._documentFragmentPosition = this.writer.createPositionAt( this._documentFragment, 0 );
- this.position = livePosition.toPosition();
- livePosition.detach();
- }
- /**
- * @private
- * @param {module:engine/model/element~Element} node The object element.
- */
- _handleObject( node ) {
- // Try finding it a place in the tree.
- if ( this._checkAndSplitToAllowedPosition( node ) ) {
- this._appendToFragment( node );
- }
- // Try autoparagraphing.
- else {
- this._tryAutoparagraphing( node );
- }
- }
- /**
- * @private
- * @param {module:engine/model/node~Node} node The disallowed node which needs to be handled.
- */
- _handleDisallowedNode( node ) {
- // If the node is an element, try inserting its children (strip the parent).
- if ( node.is( 'element' ) ) {
- this.handleNodes( node.getChildren() );
- }
- // If text is not allowed, try autoparagraphing it.
- else {
- this._tryAutoparagraphing( node );
- }
- }
- /**
- * Append a node to the temporary DocumentFragment.
- *
- * @private
- * @param {module:engine/model/node~Node} node The node to insert.
- */
- _appendToFragment( node ) {
- /* istanbul ignore if */
- if ( !this.schema.checkChild( this.position, node ) ) {
- // Algorithm's correctness check. We should never end up here but it's good to know that we did.
- // Note that it would often be a silent issue if we insert node in a place where it's not allowed.
- /**
- * Given node cannot be inserted on the given position.
- *
- * @error insertcontent-wrong-position
- * @param {module:engine/model/node~Node} node Node to insert.
- * @param {module:engine/model/position~Position} position Position to insert the node at.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"](
- 'insertcontent-wrong-position',
- this,
- { node, position: this.position }
- );
- }
- this.writer.insert( node, this._documentFragmentPosition );
- this._documentFragmentPosition = this._documentFragmentPosition.getShiftedBy( node.offsetSize );
- // The last inserted object should be selected because we can't put a collapsed selection after it.
- if ( this.schema.isObject( node ) && !this.schema.checkChild( this.position, '$text' ) ) {
- this.nodeToSelect = node;
- } else {
- this.nodeToSelect = null;
- }
- this._filterAttributesOf.push( node );
- }
- /**
- * Sets `_affectedStart` and `_affectedEnd` to the given `position`. Should be used before a change is done during insertion process to
- * mark the affected range.
- *
- * This method is used before inserting a node or splitting a parent node. `_affectedStart` and `_affectedEnd` are also changed
- * during merging, but the logic there is more complicated so it is left out of this function.
- *
- * @private
- * @param {module:engine/model/position~Position} position
- */
- _setAffectedBoundaries( position ) {
- // Set affected boundaries stickiness so that those position will "expand" when something is inserted in between them:
- // <paragraph>Foo][bar</paragraph> -> <paragraph>Foo]xx[bar</paragraph>
- // This is why it cannot be a range but two separate positions.
- if ( !this._affectedStart ) {
- this._affectedStart = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( position, 'toPrevious' );
- }
- // If `_affectedEnd` is before the new boundary position, expand `_affectedEnd`. This can happen if first inserted node was
- // inserted into the parent but the next node is moved-out of that parent:
- // (1) <paragraph>Foo][</paragraph> -> <paragraph>Foo]xx[</paragraph>
- // (2) <paragraph>Foo]xx[</paragraph> -> <paragraph>Foo]xx</paragraph><widget></widget>[
- if ( !this._affectedEnd || this._affectedEnd.isBefore( position ) ) {
- if ( this._affectedEnd ) {
- this._affectedEnd.detach();
- }
- this._affectedEnd = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( position, 'toNext' );
- }
- }
- /**
- * Merges the previous sibling of the first node if it should be merged.
- *
- * After the content was inserted we may try to merge it with its siblings.
- * This should happen only if the selection was in those elements initially.
- *
- * @private
- */
- _mergeOnLeft() {
- const node = this._firstNode;
- if ( !( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
- return;
- }
- if ( !this._canMergeLeft( node ) ) {
- return;
- }
- const mergePosLeft = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createBefore( node );
- mergePosLeft.stickiness = 'toNext';
- const livePosition = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( this.position, 'toNext' );
- // If `_affectedStart` is sames as merge position, it means that the element "marked" by `_affectedStart` is going to be
- // removed and its contents will be moved. This won't transform `LivePosition` so `_affectedStart` needs to be moved
- // by hand to properly reflect affected range. (Due to `_affectedStart` and `_affectedEnd` stickiness, the "range" is
- // shown as `][`).
- //
- // Example - insert `<paragraph>Abc</paragraph><paragraph>Xyz</paragraph>` at the end of `<paragraph>Foo^</paragraph>`:
- //
- // <paragraph>Foo</paragraph><paragraph>Bar</paragraph> -->
- // <paragraph>Foo</paragraph>]<paragraph>Abc</paragraph><paragraph>Xyz</paragraph>[<paragraph>Bar</paragraph> -->
- // <paragraph>Foo]Abc</paragraph><paragraph>Xyz</paragraph>[<paragraph>Bar</paragraph>
- //
- // Note, that if we are here then something must have been inserted, so `_affectedStart` and `_affectedEnd` have to be set.
- if ( this._affectedStart.isEqual( mergePosLeft ) ) {
- this._affectedStart.detach();
- this._affectedStart = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosLeft.nodeBefore, 'end', 'toPrevious' );
- }
- // We need to update the references to the first and last nodes if they will be merged into the previous sibling node
- // because the reference would point to the removed node.
- //
- // <p>A^A</p> + <p>X</p>
- //
- // <p>A</p>^<p>A</p>
- // <p>A</p><p>X</p><p>A</p>
- // <p>AX</p><p>A</p>
- // <p>AXA</p>
- if ( this._firstNode === this._lastNode ) {
- this._firstNode = mergePosLeft.nodeBefore;
- this._lastNode = mergePosLeft.nodeBefore;
- }
- this.writer.merge( mergePosLeft );
- // If only one element (the merged one) is in the "affected range", also move the affected range end appropriately.
- //
- // Example - insert `<paragraph>Abc</paragraph>` at the of `<paragraph>Foo^</paragraph>`:
- //
- // <paragraph>Foo</paragraph><paragraph>Bar</paragraph> -->
- // <paragraph>Foo</paragraph>]<paragraph>Abc</paragraph>[<paragraph>Bar</paragraph> -->
- // <paragraph>Foo]Abc</paragraph>[<paragraph>Bar</paragraph> -->
- // <paragraph>Foo]Abc[</paragraph><paragraph>Bar</paragraph>
- if ( mergePosLeft.isEqual( this._affectedEnd ) && this._firstNode === this._lastNode ) {
- this._affectedEnd.detach();
- this._affectedEnd = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosLeft.nodeBefore, 'end', 'toNext' );
- }
- this.position = livePosition.toPosition();
- livePosition.detach();
- // After merge elements that were marked by _insert() to be filtered might be gone so
- // we need to mark the new container.
- this._filterAttributesOf.push( this.position.parent );
- mergePosLeft.detach();
- }
- /**
- * Merges the next sibling of the last node if it should be merged.
- *
- * After the content was inserted we may try to merge it with its siblings.
- * This should happen only if the selection was in those elements initially.
- *
- * @private
- */
- _mergeOnRight() {
- const node = this._lastNode;
- if ( !( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
- return;
- }
- if ( !this._canMergeRight( node ) ) {
- return;
- }
- const mergePosRight = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAfter( node );
- mergePosRight.stickiness = 'toNext';
- /* istanbul ignore if */
- if ( !this.position.isEqual( mergePosRight ) ) {
- // Algorithm's correctness check. We should never end up here but it's good to know that we did.
- // At this point the insertion position should be after the node we'll merge. If it isn't,
- // it should need to be secured as in the left merge case.
- /**
- * An internal error occurred when merging inserted content with its siblings.
- * The insertion position should equal the merge position.
- *
- * If you encountered this error, report it back to the CKEditor 5 team
- * with as many details as possible regarding the content being inserted and the insertion position.
- *
- * @error insertcontent-invalid-insertion-position
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'insertcontent-invalid-insertion-position', this );
- }
- // Move the position to the previous node, so it isn't moved to the graveyard on merge.
- // <p>x</p>[]<p>y</p> => <p>x[]</p><p>y</p>
- this.position = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( mergePosRight.nodeBefore, 'end' );
- // Explanation of setting position stickiness to `'toPrevious'`:
- // OK: <p>xx[]</p> + <p>yy</p> => <p>xx[]yy</p> (when sticks to previous)
- // NOK: <p>xx[]</p> + <p>yy</p> => <p>xxyy[]</p> (when sticks to next)
- const livePosition = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( this.position, 'toPrevious' );
- // See comment in `_mergeOnLeft()` on moving `_affectedStart`.
- if ( this._affectedEnd.isEqual( mergePosRight ) ) {
- this._affectedEnd.detach();
- this._affectedEnd = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosRight.nodeBefore, 'end', 'toNext' );
- }
- // We need to update the references to the first and last nodes if they will be merged into the previous sibling node
- // because the reference would point to the removed node.
- //
- // <p>A^A</p> + <p>X</p>
- //
- // <p>A</p>^<p>A</p>
- // <p>A</p><p>X</p><p>A</p>
- // <p>AX</p><p>A</p>
- // <p>AXA</p>
- if ( this._firstNode === this._lastNode ) {
- this._firstNode = mergePosRight.nodeBefore;
- this._lastNode = mergePosRight.nodeBefore;
- }
- this.writer.merge( mergePosRight );
- // See comment in `_mergeOnLeft()` on moving `_affectedStart`.
- if ( mergePosRight.getShiftedBy( -1 ).isEqual( this._affectedStart ) && this._firstNode === this._lastNode ) {
- this._affectedStart.detach();
- this._affectedStart = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosRight.nodeBefore, 0, 'toPrevious' );
- }
- this.position = livePosition.toPosition();
- livePosition.detach();
- // After merge elements that were marked by _insert() to be filtered might be gone so
- // we need to mark the new container.
- this._filterAttributesOf.push( this.position.parent );
- mergePosRight.detach();
- }
- /**
- * Checks whether specified node can be merged with previous sibling element.
- *
- * @private
- * @param {module:engine/model/node~Node} node The node which could potentially be merged.
- * @returns {Boolean}
- */
- _canMergeLeft( node ) {
- const previousSibling = node.previousSibling;
- return ( previousSibling instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) &&
- this.canMergeWith.has( previousSibling ) &&
- this.model.schema.checkMerge( previousSibling, node );
- }
- /**
- * Checks whether specified node can be merged with next sibling element.
- *
- * @private
- * @param {module:engine/model/node~Node} node The node which could potentially be merged.
- * @returns {Boolean}
- */
- _canMergeRight( node ) {
- const nextSibling = node.nextSibling;
- return ( nextSibling instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) &&
- this.canMergeWith.has( nextSibling ) &&
- this.model.schema.checkMerge( node, nextSibling );
- }
- /**
- * Tries wrapping the node in a new paragraph and inserting it this way.
- *
- * @private
- * @param {module:engine/model/node~Node} node The node which needs to be autoparagraphed.
- */
- _tryAutoparagraphing( node ) {
- const paragraph = this.writer.createElement( 'paragraph' );
- // Do not autoparagraph if the paragraph won't be allowed there,
- // cause that would lead to an infinite loop. The paragraph would be rejected in
- // the next _handleNode() call and we'd be here again.
- if ( this._getAllowedIn( paragraph, this.position.parent ) && this.schema.checkChild( paragraph, node ) ) {
- paragraph._appendChild( node );
- this._handleNode( paragraph );
- }
- }
- /**
- * Checks if a node can be inserted in the given position or it would be accepted if a paragraph would be inserted.
- * It also handles inserting the paragraph.
- *
- * @private
- * @param {module:engine/model/node~Node} node The node.
- * @returns {Boolean} Whether an allowed position was found.
- * `false` is returned if the node isn't allowed at the current position or in auto paragraph, `true` if was.
- */
- _checkAndAutoParagraphToAllowedPosition( node ) {
- if ( this.schema.checkChild( this.position.parent, node ) ) {
- return true;
- }
- // Do not auto paragraph if the paragraph won't be allowed there,
- // cause that would lead to an infinite loop. The paragraph would be rejected in
- // the next _handleNode() call and we'd be here again.
- if ( !this.schema.checkChild( this.position.parent, 'paragraph' ) || !this.schema.checkChild( 'paragraph', node ) ) {
- return false;
- }
- // Insert nodes collected in temporary DocumentFragment if the position parent needs change to process further nodes.
- this._insertPartialFragment();
- // Insert a paragraph and move insertion position to it.
- const paragraph = this.writer.createElement( 'paragraph' );
- this.writer.insert( paragraph, this.position );
- this._setAffectedBoundaries( this.position );
- this._lastAutoParagraph = paragraph;
- this.position = this.writer.createPositionAt( paragraph, 0 );
- return true;
- }
- /**
- * @private
- * @param {module:engine/model/node~Node} node
- * @returns {Boolean} Whether an allowed position was found.
- * `false` is returned if the node isn't allowed at any position up in the tree, `true` if was.
- */
- _checkAndSplitToAllowedPosition( node ) {
- const allowedIn = this._getAllowedIn( node, this.position.parent );
- if ( !allowedIn ) {
- return false;
- }
- // Insert nodes collected in temporary DocumentFragment if the position parent needs change to process further nodes.
- if ( allowedIn != this.position.parent ) {
- this._insertPartialFragment();
- }
- while ( allowedIn != this.position.parent ) {
- // If a parent which we'd need to leave is a limit element, break.
- if ( this.schema.isLimit( this.position.parent ) ) {
- return false;
- }
- if ( this.position.isAtStart ) {
- // If insertion position is at the beginning of the parent, move it out instead of splitting.
- // <p>^Foo</p> -> ^<p>Foo</p>
- const parent = this.position.parent;
- this.position = this.writer.createPositionBefore( parent );
- // Special case – parent is empty (<p>^</p>).
- //
- // 1. parent.isEmpty
- // We can remove the element after moving insertion position out of it.
- //
- // 2. parent.parent === allowedIn
- // However parent should remain in place when allowed element is above limit element in document tree.
- // For example there shouldn't be allowed to remove empty paragraph from tableCell, when is pasted
- // content allowed in $root.
- if ( parent.isEmpty && parent.parent === allowedIn ) {
- this.writer.remove( parent );
- }
- } else if ( this.position.isAtEnd ) {
- // If insertion position is at the end of the parent, move it out instead of splitting.
- // <p>Foo^</p> -> <p>Foo</p>^
- this.position = this.writer.createPositionAfter( this.position.parent );
- } else {
- const tempPos = this.writer.createPositionAfter( this.position.parent );
- this._setAffectedBoundaries( this.position );
- this.writer.split( this.position );
- this.position = tempPos;
- this.canMergeWith.add( this.position.nodeAfter );
- }
- }
- return true;
- }
- /**
- * Gets the element in which the given node is allowed. It checks the passed element and all its ancestors.
- *
- * @private
- * @param {module:engine/model/node~Node} node The node to check.
- * @param {module:engine/model/element~Element} element The element in which the node's correctness should be checked.
- * @returns {module:engine/model/element~Element|null}
- */
- _getAllowedIn( node, element ) {
- if ( this.schema.checkChild( element, node ) ) {
- return element;
- }
- if ( element.parent ) {
- return this._getAllowedIn( node, element.parent );
- }
- return null;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return modifySelection; });
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/unicode */ "./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js");
- /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/utils/modifyselection
- */
- const wordBoundaryCharacters = ' ,.?!:;"-()';
- /**
- * Modifies the selection. Currently, the supported modifications are:
- *
- * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.
- * Possible values for `unit` are:
- * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one
- * character in `String` sense. However, unicode also defines "combing marks". These are special symbols, that combines
- * with a symbol before it ("base character") to create one user-perceived character. For example, `q̣̇` is a normal
- * letter `q` with two "combining marks": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending
- * selection by one position, it is correct to include both "base character" and all of it's "combining marks". That is
- * why `'character'` value is most natural and common method of modifying selection.
- * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert
- * selection between "base character" and "combining mark", because "combining marks" have their own unicode code points.
- * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by
- * two characters, called "surrogate pairs". Halves of "surrogate pairs" have a meaning only when placed next to each other.
- * For example `𨭎` is represented in `String` by `\uD862\uDF4E`. Both `\uD862` and `\uDF4E` do not have any meaning
- * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection
- * extension will include whole "surrogate pair".
- * * `'word'` - moves selection by a whole word.
- *
- * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.
- *
- * **Note:** Use {@link module:engine/model/model~Model#modifySelection} instead of this function.
- * This function is only exposed to be reusable in algorithms
- * which change the {@link module:engine/model/model~Model#modifySelection}
- * method's behavior.
- *
- * @param {module:engine/model/model~Model} model The model in context of which
- * the selection modification should be performed.
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- * The selection to modify.
- * @param {Object} [options]
- * @param {'forward'|'backward'} [options.direction='forward'] The direction in which the selection should be modified.
- * @param {'character'|'codePoint'|'word'} [options.unit='character'] The unit by which selection should be modified.
- */
- function modifySelection( model, selection, options = {} ) {
- const schema = model.schema;
- const isForward = options.direction != 'backward';
- const unit = options.unit ? options.unit : 'character';
- const focus = selection.focus;
- const walker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( {
- boundaries: getSearchRange( focus, isForward ),
- singleCharacters: true,
- direction: isForward ? 'forward' : 'backward'
- } );
- const data = { walker, schema, isForward, unit };
- let next;
- while ( ( next = walker.next() ) ) {
- if ( next.done ) {
- return;
- }
- const position = tryExtendingTo( data, next.value );
- if ( position ) {
- if ( selection instanceof _documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
- model.change( writer => {
- writer.setSelectionFocus( position );
- } );
- } else {
- selection.setFocus( position );
- }
- return;
- }
- }
- }
- // Checks whether the selection can be extended to the the walker's next value (next position).
- // @param {{ walker, unit, isForward, schema }} data
- // @param {module:engine/view/treewalker~TreeWalkerValue} value
- function tryExtendingTo( data, value ) {
- const { isForward, walker, unit, schema } = data;
- const { type, item, nextPosition } = value;
- // If found text, we can certainly put the focus in it. Let's just find a correct position
- // based on the unit.
- if ( type == 'text' ) {
- if ( data.unit === 'word' ) {
- return getCorrectWordBreakPosition( walker, isForward );
- }
- return getCorrectPosition( walker, unit, isForward );
- }
- // Entering an element.
- if ( type == ( isForward ? 'elementStart' : 'elementEnd' ) ) {
- // If it's a selectable, we can select it now.
- if ( schema.isSelectable( item ) ) {
- return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( item, isForward ? 'after' : 'before' );
- }
- // If text allowed on this position, extend to this place.
- if ( schema.checkChild( nextPosition, '$text' ) ) {
- return nextPosition;
- }
- }
- // Leaving an element.
- else {
- // If leaving a limit element, stop.
- if ( schema.isLimit( item ) ) {
- // NOTE: Fast-forward the walker until the end.
- walker.skip( () => true );
- return;
- }
- // If text allowed on this position, extend to this place.
- if ( schema.checkChild( nextPosition, '$text' ) ) {
- return nextPosition;
- }
- }
- }
- // Finds a correct position by walking in a text node and checking whether selection can be extended to given position
- // or should be extended further.
- //
- // @param {module:engine/model/treewalker~TreeWalker} walker
- // @param {String} unit The unit by which selection should be modified.
- function getCorrectPosition( walker, unit ) {
- const textNode = walker.position.textNode;
- if ( textNode ) {
- const data = textNode.data;
- let offset = walker.position.offset - textNode.startOffset;
- while ( Object(_ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_3__["isInsideSurrogatePair"])( data, offset ) || ( unit == 'character' && Object(_ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_3__["isInsideCombinedSymbol"])( data, offset ) ) ) {
- walker.next();
- offset = walker.position.offset - textNode.startOffset;
- }
- }
- return walker.position;
- }
- // Finds a correct position of a word break by walking in a text node and checking whether selection can be extended to given position
- // or should be extended further.
- //
- // @param {module:engine/model/treewalker~TreeWalker} walker
- // @param {Boolean} isForward Is the direction in which the selection should be modified is forward.
- function getCorrectWordBreakPosition( walker, isForward ) {
- let textNode = walker.position.textNode;
- if ( textNode ) {
- let offset = walker.position.offset - textNode.startOffset;
- while ( !isAtWordBoundary( textNode.data, offset, isForward ) && !isAtNodeBoundary( textNode, offset, isForward ) ) {
- walker.next();
- // Check of adjacent text nodes with different attributes (like BOLD).
- // Example : 'foofoo []bar<$text bold="true">bar</$text> bazbaz'
- // should expand to : 'foofoo [bar<$text bold="true">bar</$text>] bazbaz'.
- const nextNode = isForward ? walker.position.nodeAfter : walker.position.nodeBefore;
- // Scan only text nodes. Ignore inline elements (like `<softBreak>`).
- if ( nextNode && nextNode.is( '$text' ) ) {
- // Check boundary char of an adjacent text node.
- const boundaryChar = nextNode.data.charAt( isForward ? 0 : nextNode.data.length - 1 );
- // Go to the next node if the character at the boundary of that node belongs to the same word.
- if ( !wordBoundaryCharacters.includes( boundaryChar ) ) {
- // If adjacent text node belongs to the same word go to it & reset values.
- walker.next();
- textNode = walker.position.textNode;
- }
- }
- offset = walker.position.offset - textNode.startOffset;
- }
- }
- return walker.position;
- }
- function getSearchRange( start, isForward ) {
- const root = start.root;
- const searchEnd = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( root, isForward ? 'end' : 0 );
- if ( isForward ) {
- return new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( start, searchEnd );
- } else {
- return new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( searchEnd, start );
- }
- }
- // Checks if selection is on word boundary.
- //
- // @param {String} data The text node value to investigate.
- // @param {Number} offset Position offset.
- // @param {Boolean} isForward Is the direction in which the selection should be modified is forward.
- function isAtWordBoundary( data, offset, isForward ) {
- // The offset to check depends on direction.
- const offsetToCheck = offset + ( isForward ? 0 : -1 );
- return wordBoundaryCharacters.includes( data.charAt( offsetToCheck ) );
- }
- // Checks if selection is on node boundary.
- //
- // @param {module:engine/model/text~Text} textNode The text node to investigate.
- // @param {Number} offset Position offset.
- // @param {Boolean} isForward Is the direction in which the selection should be modified is forward.
- function isAtNodeBoundary( textNode, offset, isForward ) {
- return offset === ( isForward ? textNode.endOffset : 0 );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js":
- /*!*****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js ***!
- \*****************************************************************************************/
- /*! exports provided: injectSelectionPostFixer */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectSelectionPostFixer", function() { return injectSelectionPostFixer; });
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/utils/selection-post-fixer
- */
- /**
- * Injects selection post-fixer to the model.
- *
- * The role of the selection post-fixer is to ensure that the selection is in a correct place
- * after a {@link module:engine/model/model~Model#change `change()`} block was executed.
- *
- * The correct position means that:
- *
- * * All collapsed selection ranges are in a place where the {@link module:engine/model/schema~Schema}
- * allows a `$text`.
- * * None of the selection's non-collapsed ranges crosses a {@link module:engine/model/schema~Schema#isLimit limit element}
- * boundary (a range must be rooted within one limit element).
- * * Only {@link module:engine/model/schema~Schema#isSelectable selectable elements} can be selected from the outside
- * (e.g. `[<paragraph>foo</paragraph>]` is invalid). This rule applies independently to both selection ends, so this
- * selection is correct: `<paragraph>f[oo</paragraph><image></image>]`.
- *
- * If the position is not correct, the post-fixer will automatically correct it.
- *
- * ## Fixing a non-collapsed selection
- *
- * See as an example a selection that starts in a P1 element and ends inside the text of a TD element
- * (`[` and `]` are range boundaries and `(l)` denotes an element defined as `isLimit=true`):
- *
- * root
- * |- element P1
- * | |- "foo" root
- * |- element TABLE (l) P1 TABLE P2
- * | |- element TR (l) f o[o TR TR b a r
- * | | |- element TD (l) TD TD
- * | | |- "aaa" a]a a b b b
- * | |- element TR (l)
- * | | |- element TD (l) ||
- * | | |- "bbb" ||
- * |- element P2 VV
- * | |- "bar"
- * root
- * P1 TABLE] P2
- * f o[o TR TR b a r
- * TD TD
- * a a a b b b
- *
- * In the example above, the TABLE, TR and TD are defined as `isLimit=true` in the schema. The range which is not contained within
- * a single limit element must be expanded to select the outermost limit element. The range end is inside the text node of the TD element.
- * As the TD element is a child of the TR and TABLE elements, where both are defined as `isLimit=true` in the schema, the range must be
- * expanded to select the whole TABLE element.
- *
- * **Note** If the selection contains multiple ranges, the method returns a minimal set of ranges that are not intersecting after expanding
- * them to select `isLimit=true` elements.
- *
- * @param {module:engine/model/model~Model} model
- */
- function injectSelectionPostFixer( model ) {
- model.document.registerPostFixer( writer => selectionPostFixer( writer, model ) );
- }
- // The selection post-fixer.
- //
- // @param {module:engine/model/writer~Writer} writer
- // @param {module:engine/model/model~Model} model
- function selectionPostFixer( writer, model ) {
- const selection = model.document.selection;
- const schema = model.schema;
- const ranges = [];
- let wasFixed = false;
- for ( const modelRange of selection.getRanges() ) {
- // Go through all ranges in selection and try fixing each of them.
- // Those ranges might overlap but will be corrected later.
- const correctedRange = tryFixingRange( modelRange, schema );
- // "Selection fixing" algorithms sometimes get lost. In consequence, it may happen
- // that a new range is returned but, in fact, it has the same positions as the original
- // range anyway. If this range is not discarded, a new selection will be set and that,
- // for instance, would destroy the selection attributes. Let's make sure that the post-fixer
- // actually worked first before setting a new selection.
- //
- // https://github.com/ckeditor/ckeditor5/issues/6693
- if ( correctedRange && !correctedRange.isEqual( modelRange ) ) {
- ranges.push( correctedRange );
- wasFixed = true;
- } else {
- ranges.push( modelRange );
- }
- }
- // If any of ranges were corrected update the selection.
- if ( wasFixed ) {
- writer.setSelection( mergeIntersectingRanges( ranges ), { backward: selection.isBackward } );
- }
- }
- // Tries fixing a range if it's incorrect.
- //
- // @param {module:engine/model/range~Range} range
- // @param {module:engine/model/schema~Schema} schema
- // @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.
- function tryFixingRange( range, schema ) {
- if ( range.isCollapsed ) {
- return tryFixingCollapsedRange( range, schema );
- }
- return tryFixingNonCollapsedRage( range, schema );
- }
- // Tries to fix collapsed ranges.
- //
- // * Fixes situation when a range is in a place where $text is not allowed
- //
- // @param {module:engine/model/range~Range} range Collapsed range to fix.
- // @param {module:engine/model/schema~Schema} schema
- // @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.
- function tryFixingCollapsedRange( range, schema ) {
- const originalPosition = range.start;
- const nearestSelectionRange = schema.getNearestSelectionRange( originalPosition );
- // This might be null ie when editor data is empty.
- // In such cases there is no need to fix the selection range.
- if ( !nearestSelectionRange ) {
- return null;
- }
- if ( !nearestSelectionRange.isCollapsed ) {
- return nearestSelectionRange;
- }
- const fixedPosition = nearestSelectionRange.start;
- // Fixed position is the same as original - no need to return corrected range.
- if ( originalPosition.isEqual( fixedPosition ) ) {
- return null;
- }
- return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( fixedPosition );
- }
- // Tries to fix an expanded range.
- //
- // @param {module:engine/model/range~Range} range Expanded range to fix.
- // @param {module:engine/model/schema~Schema} schema
- // @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.
- function tryFixingNonCollapsedRage( range, schema ) {
- const { start, end } = range;
- const isTextAllowedOnStart = schema.checkChild( start, '$text' );
- const isTextAllowedOnEnd = schema.checkChild( end, '$text' );
- const startLimitElement = schema.getLimitElement( start );
- const endLimitElement = schema.getLimitElement( end );
- // Ranges which both end are inside the same limit element (or root) might needs only minor fix.
- if ( startLimitElement === endLimitElement ) {
- // Range is valid when both position allows to place a text:
- // - <block>f[oobarba]z</block>
- // This would be "fixed" by a next check but as it will be the same it's better to return null so the selection stays the same.
- if ( isTextAllowedOnStart && isTextAllowedOnEnd ) {
- return null;
- }
- // Range that is on non-limit element (or is partially) must be fixed so it is placed inside the block around $text:
- // - [<block>foo</block>] -> <block>[foo]</block>
- // - [<block>foo]</block> -> <block>[foo]</block>
- // - <block>f[oo</block>] -> <block>f[oo]</block>
- // - [<block>foo</block><selectable></selectable>] -> <block>[foo</block><selectable></selectable>]
- if ( checkSelectionOnNonLimitElements( start, end, schema ) ) {
- const isStartBeforeSelectable = start.nodeAfter && schema.isSelectable( start.nodeAfter );
- const fixedStart = isStartBeforeSelectable ? null : schema.getNearestSelectionRange( start, 'forward' );
- const isEndAfterSelectable = end.nodeBefore && schema.isSelectable( end.nodeBefore );
- const fixedEnd = isEndAfterSelectable ? null : schema.getNearestSelectionRange( end, 'backward' );
- // The schema.getNearestSelectionRange might return null - if that happens use original position.
- const rangeStart = fixedStart ? fixedStart.start : start;
- const rangeEnd = fixedEnd ? fixedEnd.end : end;
- return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( rangeStart, rangeEnd );
- }
- }
- const isStartInLimit = startLimitElement && !startLimitElement.is( 'rootElement' );
- const isEndInLimit = endLimitElement && !endLimitElement.is( 'rootElement' );
- // At this point we eliminated valid positions on text nodes so if one of range positions is placed inside a limit element
- // then the range crossed limit element boundaries and needs to be fixed.
- if ( isStartInLimit || isEndInLimit ) {
- const bothInSameParent = ( start.nodeAfter && end.nodeBefore ) && start.nodeAfter.parent === end.nodeBefore.parent;
- const expandStart = isStartInLimit && ( !bothInSameParent || !isSelectable( start.nodeAfter, schema ) );
- const expandEnd = isEndInLimit && ( !bothInSameParent || !isSelectable( end.nodeBefore, schema ) );
- // Although we've already found limit element on start/end positions we must find the outer-most limit element.
- // as limit elements might be nested directly inside (ie table > tableRow > tableCell).
- let fixedStart = start;
- let fixedEnd = end;
- if ( expandStart ) {
- fixedStart = _position__WEBPACK_IMPORTED_MODULE_1__["default"]._createBefore( findOutermostLimitAncestor( startLimitElement, schema ) );
- }
- if ( expandEnd ) {
- fixedEnd = _position__WEBPACK_IMPORTED_MODULE_1__["default"]._createAfter( findOutermostLimitAncestor( endLimitElement, schema ) );
- }
- return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( fixedStart, fixedEnd );
- }
- // Range was not fixed at this point so it is valid - ie it was placed around limit element already.
- return null;
- }
- // Finds the outer-most ancestor.
- //
- // @param {module:engine/model/node~Node} startingNode
- // @param {module:engine/model/schema~Schema} schema
- // @param {String} expandToDirection Direction of expansion - either 'start' or 'end' of the range.
- // @returns {module:engine/model/node~Node}
- function findOutermostLimitAncestor( startingNode, schema ) {
- let isLimitNode = startingNode;
- let parent = isLimitNode;
- // Find outer most isLimit block as such blocks might be nested (ie. in tables).
- while ( schema.isLimit( parent ) && parent.parent ) {
- isLimitNode = parent;
- parent = parent.parent;
- }
- return isLimitNode;
- }
- // Checks whether any of range boundaries is placed around non-limit elements.
- //
- // @param {module:engine/model/position~Position} start
- // @param {module:engine/model/position~Position} end
- // @param {module:engine/model/schema~Schema} schema
- // @returns {Boolean}
- function checkSelectionOnNonLimitElements( start, end, schema ) {
- const startIsOnBlock = ( start.nodeAfter && !schema.isLimit( start.nodeAfter ) ) || schema.checkChild( start, '$text' );
- const endIsOnBlock = ( end.nodeBefore && !schema.isLimit( end.nodeBefore ) ) || schema.checkChild( end, '$text' );
- // We should fix such selection when one of those nodes needs fixing.
- return startIsOnBlock || endIsOnBlock;
- }
- // Returns a minimal non-intersecting array of ranges.
- //
- // @param {Array.<module:engine/model/range~Range>} ranges
- // @returns {Array.<module:engine/model/range~Range>}
- function mergeIntersectingRanges( ranges ) {
- const nonIntersectingRanges = [];
- // First range will always be fine.
- nonIntersectingRanges.push( ranges.shift() );
- for ( const range of ranges ) {
- const previousRange = nonIntersectingRanges.pop();
- if ( range.isEqual( previousRange ) ) {
- // Use only one of two identical ranges.
- nonIntersectingRanges.push( previousRange );
- } else if ( range.isIntersecting( previousRange ) ) {
- // Get the sum of two ranges.
- const start = previousRange.start.isAfter( range.start ) ? range.start : previousRange.start;
- const end = previousRange.end.isAfter( range.end ) ? previousRange.end : range.end;
- const merged = new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( start, end );
- nonIntersectingRanges.push( merged );
- } else {
- nonIntersectingRanges.push( previousRange );
- nonIntersectingRanges.push( range );
- }
- }
- return nonIntersectingRanges;
- }
- // Checks if node exists and if it's a selectable.
- //
- // @param {module:engine/model/node~Node} node
- // @param {module:engine/model/schema~Schema} schema
- // @returns {Boolean}
- function isSelectable( node, schema ) {
- return node && schema.isSelectable( node );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Writer; });
- /* harmony import */ var _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation/attributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js");
- /* harmony import */ var _operation_detachoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./operation/detachoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js");
- /* harmony import */ var _operation_insertoperation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./operation/insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
- /* harmony import */ var _operation_markeroperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./operation/markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
- /* harmony import */ var _operation_moveoperation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./operation/moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
- /* harmony import */ var _operation_renameoperation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./operation/renameoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js");
- /* harmony import */ var _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./operation/rootattributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js");
- /* harmony import */ var _operation_splitoperation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./operation/splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
- /* harmony import */ var _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./operation/mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
- /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js");
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
- /* harmony import */ var _rootelement__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./rootelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
- /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./range.js */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
- /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/model/writer
- */
- /**
- * The model can only be modified by using the writer. It should be used whenever you want to create a node, modify
- * child nodes, attributes or text, set the selection's position and its attributes.
- *
- * The instance of the writer is only available in the {@link module:engine/model/model~Model#change `change()`} or
- * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`}.
- *
- * model.change( writer => {
- * writer.insertText( 'foo', paragraph, 'end' );
- * } );
- *
- * Note that the writer should never be stored and used outside of the `change()` and
- * `enqueueChange()` blocks.
- *
- * Note that writer's methods do not check the {@link module:engine/model/schema~Schema}. It is possible
- * to create incorrect model structures by using the writer. Read more about in
- * {@glink framework/guides/deep-dive/schema#who-checks-the-schema "Who checks the schema?"}.
- *
- * @see module:engine/model/model~Model#change
- * @see module:engine/model/model~Model#enqueueChange
- */
- class Writer {
- /**
- * Creates a writer instance.
- *
- * **Note:** It is not recommended to use it directly. Use {@link module:engine/model/model~Model#change `Model#change()`} or
- * {@link module:engine/model/model~Model#enqueueChange `Model#enqueueChange()`} instead.
- *
- * @protected
- * @param {module:engine/model/model~Model} model
- * @param {module:engine/model/batch~Batch} batch
- */
- constructor( model, batch ) {
- /**
- * Instance of the model on which this writer operates.
- *
- * @readonly
- * @type {module:engine/model/model~Model}
- */
- this.model = model;
- /**
- * The batch to which this writer will add changes.
- *
- * @readonly
- * @type {module:engine/model/batch~Batch}
- */
- this.batch = batch;
- }
- /**
- * Creates a new {@link module:engine/model/text~Text text node}.
- *
- * writer.createText( 'foo' );
- * writer.createText( 'foo', { bold: true } );
- *
- * @param {String} data Text data.
- * @param {Object} [attributes] Text attributes.
- * @returns {module:engine/model/text~Text} Created text node.
- */
- createText( data, attributes ) {
- return new _text__WEBPACK_IMPORTED_MODULE_10__["default"]( data, attributes );
- }
- /**
- * Creates a new {@link module:engine/model/element~Element element}.
- *
- * writer.createElement( 'paragraph' );
- * writer.createElement( 'paragraph', { alignment: 'center' } );
- *
- * @param {String} name Name of the element.
- * @param {Object} [attributes] Elements attributes.
- * @returns {module:engine/model/element~Element} Created element.
- */
- createElement( name, attributes ) {
- return new _element__WEBPACK_IMPORTED_MODULE_11__["default"]( name, attributes );
- }
- /**
- * Creates a new {@link module:engine/model/documentfragment~DocumentFragment document fragment}.
- *
- * @returns {module:engine/model/documentfragment~DocumentFragment} Created document fragment.
- */
- createDocumentFragment() {
- return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]();
- }
- /**
- * Creates a copy of the element and returns it. Created element has the same name and attributes as the original element.
- * If clone is deep, the original element's children are also cloned. If not, then empty element is returned.
- *
- * @param {module:engine/model/element~Element} element The element to clone.
- * @param {Boolean} [deep=true] If set to `true` clones element and all its children recursively. When set to `false`,
- * element will be cloned without any child.
- */
- cloneElement( element, deep = true ) {
- return element._clone( deep );
- }
- /**
- * Inserts item on given position.
- *
- * const paragraph = writer.createElement( 'paragraph' );
- * writer.insert( paragraph, position );
- *
- * Instead of using position you can use parent and offset:
- *
- * const text = writer.createText( 'foo' );
- * writer.insert( text, paragraph, 5 );
- *
- * You can also use `end` instead of the offset to insert at the end:
- *
- * const text = writer.createText( 'foo' );
- * writer.insert( text, paragraph, 'end' );
- *
- * Or insert before or after another element:
- *
- * const paragraph = writer.createElement( 'paragraph' );
- * writer.insert( paragraph, anotherParagraph, 'after' );
- *
- * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.
- *
- * Note that if the item already has parent it will be removed from the previous parent.
- *
- * Note that you cannot re-insert a node from a document to a different document or a document fragment. In this case,
- * `model-writer-insert-forbidden-move` is thrown.
- *
- * If you want to move {@link module:engine/model/range~Range range} instead of an
- * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.
- *
- * **Note:** For a paste-like content insertion mechanism see
- * {@link module:engine/model/model~Model#insertContent `model.insertContent()`}.
- *
- * @param {module:engine/model/item~Item|module:engine/model/documentfragment~DocumentFragment} item Item or document
- * fragment to insert.
- * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * second parameter is a {@link module:engine/model/item~Item model item}.
- */
- insert( item, itemOrPosition, offset = 0 ) {
- this._assertWriterUsedCorrectly();
- if ( item instanceof _text__WEBPACK_IMPORTED_MODULE_10__["default"] && item.data == '' ) {
- return;
- }
- const position = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( itemOrPosition, offset );
- // If item has a parent already.
- if ( item.parent ) {
- // We need to check if item is going to be inserted within the same document.
- if ( isSameTree( item.root, position.root ) ) {
- // If it's we just need to move it.
- this.move( _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createOn( item ), position );
- return;
- }
- // If it isn't the same root.
- else {
- if ( item.root.document ) {
- /**
- * Cannot move a node from a document to a different tree.
- * It is forbidden to move a node that was already in a document outside of it.
- *
- * @error model-writer-insert-forbidden-move
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"](
- 'model-writer-insert-forbidden-move',
- this
- );
- } else {
- // Move between two different document fragments or from document fragment to a document is possible.
- // In that case, remove the item from it's original parent.
- this.remove( item );
- }
- }
- }
- const version = position.root.document ? position.root.document.version : null;
- const insert = new _operation_insertoperation__WEBPACK_IMPORTED_MODULE_2__["default"]( position, item, version );
- if ( item instanceof _text__WEBPACK_IMPORTED_MODULE_10__["default"] ) {
- insert.shouldReceiveAttributes = true;
- }
- this.batch.addOperation( insert );
- this.model.applyOperation( insert );
- // When element is a DocumentFragment we need to move its markers to Document#markers.
- if ( item instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] ) {
- for ( const [ markerName, markerRange ] of item.markers ) {
- // We need to migrate marker range from DocumentFragment to Document.
- const rangeRootPosition = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( markerRange.root, 0 );
- const range = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"](
- markerRange.start._getCombined( rangeRootPosition, position ),
- markerRange.end._getCombined( rangeRootPosition, position )
- );
- const options = { range, usingOperation: true, affectsData: true };
- if ( this.model.markers.has( markerName ) ) {
- this.updateMarker( markerName, options );
- } else {
- this.addMarker( markerName, options );
- }
- }
- }
- }
- /**
- * Creates and inserts text on given position. You can optionally set text attributes:
- *
- * writer.insertText( 'foo', position );
- * writer.insertText( 'foo', { bold: true }, position );
- *
- * Instead of using position you can use parent and offset or define that text should be inserted at the end
- * or before or after other node:
- *
- * // Inserts 'foo' in paragraph, at offset 5:
- * writer.insertText( 'foo', paragraph, 5 );
- * // Inserts 'foo' at the end of a paragraph:
- * writer.insertText( 'foo', paragraph, 'end' );
- * // Inserts 'foo' after an image:
- * writer.insertText( 'foo', image, 'after' );
- *
- * These parameters work in the same way as {@link #createPositionAt `writer.createPositionAt()`}.
- *
- * @param {String} data Text data.
- * @param {Object} [attributes] Text attributes.
- * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * third parameter is a {@link module:engine/model/item~Item model item}.
- */
- insertText( text, attributes, itemOrPosition, offset ) {
- if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] || attributes instanceof _position__WEBPACK_IMPORTED_MODULE_13__["default"] ) {
- this.insert( this.createText( text ), attributes, itemOrPosition );
- } else {
- this.insert( this.createText( text, attributes ), itemOrPosition, offset );
- }
- }
- /**
- * Creates and inserts element on given position. You can optionally set attributes:
- *
- * writer.insertElement( 'paragraph', position );
- * writer.insertElement( 'paragraph', { alignment: 'center' }, position );
- *
- * Instead of using position you can use parent and offset or define that text should be inserted at the end
- * or before or after other node:
- *
- * // Inserts paragraph in the root at offset 5:
- * writer.insertElement( 'paragraph', root, 5 );
- * // Inserts paragraph at the end of a blockquote:
- * writer.insertElement( 'paragraph', blockquote, 'end' );
- * // Inserts after an image:
- * writer.insertElement( 'paragraph', image, 'after' );
- *
- * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.
- *
- * @param {String} name Name of the element.
- * @param {Object} [attributes] Elements attributes.
- * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * third parameter is a {@link module:engine/model/item~Item model item}.
- */
- insertElement( name, attributes, itemOrPosition, offset ) {
- if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] || attributes instanceof _position__WEBPACK_IMPORTED_MODULE_13__["default"] ) {
- this.insert( this.createElement( name ), attributes, itemOrPosition );
- } else {
- this.insert( this.createElement( name, attributes ), itemOrPosition, offset );
- }
- }
- /**
- * Inserts item at the end of the given parent.
- *
- * const paragraph = writer.createElement( 'paragraph' );
- * writer.append( paragraph, root );
- *
- * Note that if the item already has parent it will be removed from the previous parent.
- *
- * If you want to move {@link module:engine/model/range~Range range} instead of an
- * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.
- *
- * @param {module:engine/model/item~Item|module:engine/model/documentfragment~DocumentFragment}
- * item Item or document fragment to insert.
- * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent
- */
- append( item, parent ) {
- this.insert( item, parent, 'end' );
- }
- /**
- * Creates text node and inserts it at the end of the parent. You can optionally set text attributes:
- *
- * writer.appendText( 'foo', paragraph );
- * writer.appendText( 'foo', { bold: true }, paragraph );
- *
- * @param {String} text Text data.
- * @param {Object} [attributes] Text attributes.
- * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent
- */
- appendText( text, attributes, parent ) {
- if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) {
- this.insert( this.createText( text ), attributes, 'end' );
- } else {
- this.insert( this.createText( text, attributes ), parent, 'end' );
- }
- }
- /**
- * Creates element and inserts it at the end of the parent. You can optionally set attributes:
- *
- * writer.appendElement( 'paragraph', root );
- * writer.appendElement( 'paragraph', { alignment: 'center' }, root );
- *
- * @param {String} name Name of the element.
- * @param {Object} [attributes] Elements attributes.
- * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent
- */
- appendElement( name, attributes, parent ) {
- if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) {
- this.insert( this.createElement( name ), attributes, 'end' );
- } else {
- this.insert( this.createElement( name, attributes ), parent, 'end' );
- }
- }
- /**
- * Sets value of the attribute with given key on a {@link module:engine/model/item~Item model item}
- * or on a {@link module:engine/model/range~Range range}.
- *
- * @param {String} key Attribute key.
- * @param {*} value Attribute new value.
- * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
- * Model item or range on which the attribute will be set.
- */
- setAttribute( key, value, itemOrRange ) {
- this._assertWriterUsedCorrectly();
- if ( itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) {
- const ranges = itemOrRange.getMinimalFlatRanges();
- for ( const range of ranges ) {
- setAttributeOnRange( this, key, value, range );
- }
- } else {
- setAttributeOnItem( this, key, value, itemOrRange );
- }
- }
- /**
- * Sets values of attributes on a {@link module:engine/model/item~Item model item}
- * or on a {@link module:engine/model/range~Range range}.
- *
- * writer.setAttributes( {
- * bold: true,
- * italic: true
- * }, range );
- *
- * @param {Object} attributes Attributes keys and values.
- * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
- * Model item or range on which the attributes will be set.
- */
- setAttributes( attributes, itemOrRange ) {
- for ( const [ key, val ] of Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_16__["default"])( attributes ) ) {
- this.setAttribute( key, val, itemOrRange );
- }
- }
- /**
- * Removes an attribute with given key from a {@link module:engine/model/item~Item model item}
- * or from a {@link module:engine/model/range~Range range}.
- *
- * @param {String} key Attribute key.
- * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
- * Model item or range from which the attribute will be removed.
- */
- removeAttribute( key, itemOrRange ) {
- this._assertWriterUsedCorrectly();
- if ( itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) {
- const ranges = itemOrRange.getMinimalFlatRanges();
- for ( const range of ranges ) {
- setAttributeOnRange( this, key, null, range );
- }
- } else {
- setAttributeOnItem( this, key, null, itemOrRange );
- }
- }
- /**
- * Removes all attributes from all elements in the range or from the given item.
- *
- * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
- * Model item or range from which all attributes will be removed.
- */
- clearAttributes( itemOrRange ) {
- this._assertWriterUsedCorrectly();
- const removeAttributesFromItem = item => {
- for ( const attribute of item.getAttributeKeys() ) {
- this.removeAttribute( attribute, item );
- }
- };
- if ( !( itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) ) {
- removeAttributesFromItem( itemOrRange );
- } else {
- for ( const item of itemOrRange.getItems() ) {
- removeAttributesFromItem( item );
- }
- }
- }
- /**
- * Moves all items in the source range to the target position.
- *
- * writer.move( sourceRange, targetPosition );
- *
- * Instead of the target position you can use parent and offset or define that range should be moved to the end
- * or before or after chosen item:
- *
- * // Moves all items in the range to the paragraph at offset 5:
- * writer.move( sourceRange, paragraph, 5 );
- * // Moves all items in the range to the end of a blockquote:
- * writer.move( sourceRange, blockquote, 'end' );
- * // Moves all items in the range to a position after an image:
- * writer.move( sourceRange, image, 'after' );
- *
- * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.
- *
- * Note that items can be moved only within the same tree. It means that you can move items within the same root
- * (element or document fragment) or between {@link module:engine/model/document~Document#roots documents roots},
- * but you can not move items from document fragment to the document or from one detached element to another. Use
- * {@link module:engine/model/writer~Writer#insert} in such cases.
- *
- * @param {module:engine/model/range~Range} range Source range.
- * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * second parameter is a {@link module:engine/model/item~Item model item}.
- */
- move( range, itemOrPosition, offset ) {
- this._assertWriterUsedCorrectly();
- if ( !( range instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) ) {
- /**
- * Invalid range to move.
- *
- * @error writer-move-invalid-range
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-move-invalid-range', this );
- }
- if ( !range.isFlat ) {
- /**
- * Range to move is not flat.
- *
- * @error writer-move-range-not-flat
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-move-range-not-flat', this );
- }
- const position = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( itemOrPosition, offset );
- // Do not move anything if the move target is same as moved range start.
- if ( position.isEqual( range.start ) ) {
- return;
- }
- // If part of the marker is removed, create additional marker operation for undo purposes.
- this._addOperationForAffectedMarkers( 'move', range );
- if ( !isSameTree( range.root, position.root ) ) {
- /**
- * Range is going to be moved within not the same document. Please use
- * {@link module:engine/model/writer~Writer#insert insert} instead.
- *
- * @error writer-move-different-document
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-move-different-document', this );
- }
- const version = range.root.document ? range.root.document.version : null;
- const operation = new _operation_moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( range.start, range.end.offset - range.start.offset, position, version );
- this.batch.addOperation( operation );
- this.model.applyOperation( operation );
- }
- /**
- * Removes given model {@link module:engine/model/item~Item item} or {@link module:engine/model/range~Range range}.
- *
- * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange Model item or range to remove.
- */
- remove( itemOrRange ) {
- this._assertWriterUsedCorrectly();
- const rangeToRemove = itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ? itemOrRange : _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createOn( itemOrRange );
- const ranges = rangeToRemove.getMinimalFlatRanges().reverse();
- for ( const flat of ranges ) {
- // If part of the marker is removed, create additional marker operation for undo purposes.
- this._addOperationForAffectedMarkers( 'move', flat );
- applyRemoveOperation( flat.start, flat.end.offset - flat.start.offset, this.batch, this.model );
- }
- }
- /**
- * Merges two siblings at the given position.
- *
- * Node before and after the position have to be an element. Otherwise `writer-merge-no-element-before` or
- * `writer-merge-no-element-after` error will be thrown.
- *
- * @param {module:engine/model/position~Position} position Position between merged elements.
- */
- merge( position ) {
- this._assertWriterUsedCorrectly();
- const nodeBefore = position.nodeBefore;
- const nodeAfter = position.nodeAfter;
- // If part of the marker is removed, create additional marker operation for undo purposes.
- this._addOperationForAffectedMarkers( 'merge', position );
- if ( !( nodeBefore instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) ) {
- /**
- * Node before merge position must be an element.
- *
- * @error writer-merge-no-element-before
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-merge-no-element-before', this );
- }
- if ( !( nodeAfter instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) ) {
- /**
- * Node after merge position must be an element.
- *
- * @error writer-merge-no-element-after
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-merge-no-element-after', this );
- }
- if ( !position.root.document ) {
- this._mergeDetached( position );
- } else {
- this._merge( position );
- }
- }
- /**
- * Shortcut for {@link module:engine/model/model~Model#createPositionFromPath `Model#createPositionFromPath()`}.
- *
- * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.
- * @param {Array.<Number>} path Position path. See {@link module:engine/model/position~Position#path}.
- * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
- * See {@link module:engine/model/position~PositionStickiness}.
- * @returns {module:engine/model/position~Position}
- */
- createPositionFromPath( root, path, stickiness ) {
- return this.model.createPositionFromPath( root, path, stickiness );
- }
- /**
- * Shortcut for {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}.
- *
- * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * first parameter is a {@link module:engine/model/item~Item model item}.
- * @returns {module:engine/model/position~Position}
- */
- createPositionAt( itemOrPosition, offset ) {
- return this.model.createPositionAt( itemOrPosition, offset );
- }
- /**
- * Shortcut for {@link module:engine/model/model~Model#createPositionAfter `Model#createPositionAfter()`}.
- *
- * @param {module:engine/model/item~Item} item Item after which the position should be placed.
- * @returns {module:engine/model/position~Position}
- */
- createPositionAfter( item ) {
- return this.model.createPositionAfter( item );
- }
- /**
- * Shortcut for {@link module:engine/model/model~Model#createPositionBefore `Model#createPositionBefore()`}.
- *
- * @param {module:engine/model/item~Item} item Item after which the position should be placed.
- * @returns {module:engine/model/position~Position}
- */
- createPositionBefore( item ) {
- return this.model.createPositionBefore( item );
- }
- /**
- * Shortcut for {@link module:engine/model/model~Model#createRange `Model#createRange()`}.
- *
- * @param {module:engine/model/position~Position} start Start position.
- * @param {module:engine/model/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
- * @returns {module:engine/model/range~Range}
- */
- createRange( start, end ) {
- return this.model.createRange( start, end );
- }
- /**
- * Shortcut for {@link module:engine/model/model~Model#createRangeIn `Model#createRangeIn()`}.
- *
- * @param {module:engine/model/element~Element} element Element which is a parent for the range.
- * @returns {module:engine/model/range~Range}
- */
- createRangeIn( element ) {
- return this.model.createRangeIn( element );
- }
- /**
- * Shortcut for {@link module:engine/model/model~Model#createRangeOn `Model#createRangeOn()`}.
- *
- * @param {module:engine/model/element~Element} element Element which is a parent for the range.
- * @returns {module:engine/model/range~Range}
- */
- createRangeOn( element ) {
- return this.model.createRangeOn( element );
- }
- /**
- * Shortcut for {@link module:engine/model/model~Model#createSelection `Model#createSelection()`}.
- *
- * @param {module:engine/model/selection~Selectable} selectable
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- * @returns {module:engine/model/selection~Selection}
- */
- createSelection( selectable, placeOrOffset, options ) {
- return this.model.createSelection( selectable, placeOrOffset, options );
- }
- /**
- * Performs merge action in a detached tree.
- *
- * @private
- * @param {module:engine/model/position~Position} position Position between merged elements.
- */
- _mergeDetached( position ) {
- const nodeBefore = position.nodeBefore;
- const nodeAfter = position.nodeAfter;
- this.move( _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createIn( nodeAfter ), _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( nodeBefore, 'end' ) );
- this.remove( nodeAfter );
- }
- /**
- * Performs merge action in a non-detached tree.
- *
- * @private
- * @param {module:engine/model/position~Position} position Position between merged elements.
- */
- _merge( position ) {
- const targetPosition = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( position.nodeBefore, 'end' );
- const sourcePosition = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( position.nodeAfter, 0 );
- const graveyard = position.root.document.graveyard;
- const graveyardPosition = new _position__WEBPACK_IMPORTED_MODULE_13__["default"]( graveyard, [ 0 ] );
- const version = position.root.document.version;
- const merge = new _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_8__["default"]( sourcePosition, position.nodeAfter.maxOffset, targetPosition, graveyardPosition, version );
- this.batch.addOperation( merge );
- this.model.applyOperation( merge );
- }
- /**
- * Renames the given element.
- *
- * @param {module:engine/model/element~Element} element The element to rename.
- * @param {String} newName New element name.
- */
- rename( element, newName ) {
- this._assertWriterUsedCorrectly();
- if ( !( element instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) ) {
- /**
- * Trying to rename an object which is not an instance of Element.
- *
- * @error writer-rename-not-element-instance
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"](
- 'writer-rename-not-element-instance',
- this
- );
- }
- const version = element.root.document ? element.root.document.version : null;
- const renameOperation = new _operation_renameoperation__WEBPACK_IMPORTED_MODULE_5__["default"]( _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createBefore( element ), element.name, newName, version );
- this.batch.addOperation( renameOperation );
- this.model.applyOperation( renameOperation );
- }
- /**
- * Splits elements starting from the given position and going to the top of the model tree as long as given
- * `limitElement` is reached. When `limitElement` is not defined then only the parent of the given position will be split.
- *
- * The element needs to have a parent. It cannot be a root element nor a document fragment.
- * The `writer-split-element-no-parent` error will be thrown if you try to split an element with no parent.
- *
- * @param {module:engine/model/position~Position} position Position of split.
- * @param {module:engine/model/node~Node} [limitElement] Stop splitting when this element will be reached.
- * @returns {Object} result Split result.
- * @returns {module:engine/model/position~Position} result.position Position between split elements.
- * @returns {module:engine/model/range~Range} result.range Range that stars from the end of the first split element and ends
- * at the beginning of the first copy element.
- */
- split( position, limitElement ) {
- this._assertWriterUsedCorrectly();
- let splitElement = position.parent;
- if ( !splitElement.parent ) {
- /**
- * Element with no parent can not be split.
- *
- * @error writer-split-element-no-parent
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-split-element-no-parent', this );
- }
- // When limit element is not defined lets set splitElement parent as limit.
- if ( !limitElement ) {
- limitElement = splitElement.parent;
- }
- if ( !position.parent.getAncestors( { includeSelf: true } ).includes( limitElement ) ) {
- /**
- * Limit element is not a position ancestor.
- *
- * @error writer-split-invalid-limit-element
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-split-invalid-limit-element', this );
- }
- // We need to cache elements that will be created as a result of the first split because
- // we need to create a range from the end of the first split element to the beginning of the
- // first copy element. This should be handled by LiveRange but it doesn't work on detached nodes.
- let firstSplitElement, firstCopyElement;
- do {
- const version = splitElement.root.document ? splitElement.root.document.version : null;
- const howMany = splitElement.maxOffset - position.offset;
- const insertionPosition = _operation_splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( position );
- const split = new _operation_splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]( position, howMany, insertionPosition, null, version );
- this.batch.addOperation( split );
- this.model.applyOperation( split );
- // Cache result of the first split.
- if ( !firstSplitElement && !firstCopyElement ) {
- firstSplitElement = splitElement;
- firstCopyElement = position.parent.nextSibling;
- }
- position = this.createPositionAfter( position.parent );
- splitElement = position.parent;
- } while ( splitElement !== limitElement );
- return {
- position,
- range: new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( firstSplitElement, 'end' ), _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( firstCopyElement, 0 ) )
- };
- }
- /**
- * Wraps the given range with the given element or with a new element (if a string was passed).
- *
- * **Note:** range to wrap should be a "flat range" (see {@link module:engine/model/range~Range#isFlat `Range#isFlat`}).
- * If not, an error will be thrown.
- *
- * @param {module:engine/model/range~Range} range Range to wrap.
- * @param {module:engine/model/element~Element|String} elementOrString Element or name of element to wrap the range with.
- */
- wrap( range, elementOrString ) {
- this._assertWriterUsedCorrectly();
- if ( !range.isFlat ) {
- /**
- * Range to wrap is not flat.
- *
- * @error writer-wrap-range-not-flat
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-wrap-range-not-flat', this );
- }
- const element = elementOrString instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ? elementOrString : new _element__WEBPACK_IMPORTED_MODULE_11__["default"]( elementOrString );
- if ( element.childCount > 0 ) {
- /**
- * Element to wrap with is not empty.
- *
- * @error writer-wrap-element-not-empty
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-wrap-element-not-empty', this );
- }
- if ( element.parent !== null ) {
- /**
- * Element to wrap with is already attached to a tree model.
- *
- * @error writer-wrap-element-attached
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-wrap-element-attached', this );
- }
- this.insert( element, range.start );
- // Shift the range-to-wrap because we just inserted an element before that range.
- const shiftedRange = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( range.start.getShiftedBy( 1 ), range.end.getShiftedBy( 1 ) );
- this.move( shiftedRange, _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( element, 0 ) );
- }
- /**
- * Unwraps children of the given element – all its children are moved before it and then the element is removed.
- * Throws error if you try to unwrap an element which does not have a parent.
- *
- * @param {module:engine/model/element~Element} element Element to unwrap.
- */
- unwrap( element ) {
- this._assertWriterUsedCorrectly();
- if ( element.parent === null ) {
- /**
- * Trying to unwrap an element which has no parent.
- *
- * @error writer-unwrap-element-no-parent
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-unwrap-element-no-parent', this );
- }
- this.move( _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createIn( element ), this.createPositionAfter( element ) );
- this.remove( element );
- }
- /**
- * Adds a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks
- * changes in the document and updates its range automatically, when model tree changes.
- *
- * As the first parameter you can set marker name.
- *
- * The required `options.usingOperation` parameter lets you decide if the marker should be managed by operations or not. See
- * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between
- * markers managed by operations and not-managed by operations.
- *
- * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be
- * `true` when the marker change changes the data returned by the
- * {@link module:core/editor/utils/dataapimixin~DataApi#getData `editor.getData()`} method.
- * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.
- * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.
- *
- * Create marker directly base on marker's name:
- *
- * addMarker( markerName, { range, usingOperation: false } );
- *
- * Create marker using operation:
- *
- * addMarker( markerName, { range, usingOperation: true } );
- *
- * Create marker that affects the editor data:
- *
- * addMarker( markerName, { range, usingOperation: false, affectsData: true } );
- *
- * Note: For efficiency reasons, it's best to create and keep as little markers as possible.
- *
- * @see module:engine/model/markercollection~Marker
- * @param {String} name Name of a marker to create - must be unique.
- * @param {Object} options
- * @param {Boolean} options.usingOperation Flag indicating that the marker should be added by MarkerOperation.
- * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.
- * @param {module:engine/model/range~Range} options.range Marker range.
- * @param {Boolean} [options.affectsData=false] Flag indicating that the marker changes the editor data.
- * @returns {module:engine/model/markercollection~Marker} Marker that was set.
- */
- addMarker( name, options ) {
- this._assertWriterUsedCorrectly();
- if ( !options || typeof options.usingOperation != 'boolean' ) {
- /**
- * The `options.usingOperation` parameter is required when adding a new marker.
- *
- * @error writer-addmarker-no-usingoperation
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-addmarker-no-usingoperation', this );
- }
- const usingOperation = options.usingOperation;
- const range = options.range;
- const affectsData = options.affectsData === undefined ? false : options.affectsData;
- if ( this.model.markers.has( name ) ) {
- /**
- * Marker with provided name already exists.
- *
- * @error writer-addmarker-marker-exists
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-addmarker-marker-exists', this );
- }
- if ( !range ) {
- /**
- * Range parameter is required when adding a new marker.
- *
- * @error writer-addmarker-no-range
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-addmarker-no-range', this );
- }
- if ( !usingOperation ) {
- return this.model.markers._set( name, range, usingOperation, affectsData );
- }
- applyMarkerOperation( this, name, null, range, affectsData );
- return this.model.markers.get( name );
- }
- /**
- * Adds, updates or refreshes a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks
- * changes in the document and updates its range automatically, when model tree changes. Still, it is possible to change the
- * marker's range directly using this method.
- *
- * As the first parameter you can set marker name or instance. If none of them is provided, new marker, with a unique
- * name is created and returned.
- *
- * As the second parameter you can set the new marker data or leave this parameter as empty which will just refresh
- * the marker by triggering downcast conversion for it. Refreshing the marker is useful when you want to change
- * the marker {@link module:engine/view/element~Element view element} without changing any marker data.
- *
- * let isCommentActive = false;
- *
- * model.conversion.markerToHighlight( {
- * model: 'comment',
- * view: data => {
- * const classes = [ 'comment-marker' ];
- *
- * if ( isCommentActive ) {
- * classes.push( 'comment-marker--active' );
- * }
- *
- * return { classes };
- * }
- * } );
- *
- * // Change the property that indicates if marker is displayed as active or not.
- * isCommentActive = true;
- *
- * // And refresh the marker to convert it with additional class.
- * model.change( writer => writer.updateMarker( 'comment' ) );
- *
- * The `options.usingOperation` parameter lets you change if the marker should be managed by operations or not. See
- * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between
- * markers managed by operations and not-managed by operations. It is possible to change this option for an existing marker.
- *
- * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be
- * `true` when the marker change changes the data returned by
- * the {@link module:core/editor/utils/dataapimixin~DataApi#getData `editor.getData()`} method.
- * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.
- * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.
- *
- * Update marker directly base on marker's name:
- *
- * updateMarker( markerName, { range } );
- *
- * Update marker using operation:
- *
- * updateMarker( marker, { range, usingOperation: true } );
- * updateMarker( markerName, { range, usingOperation: true } );
- *
- * Change marker's option (start using operations to manage it):
- *
- * updateMarker( marker, { usingOperation: true } );
- *
- * Change marker's option (inform the engine, that the marker does not affect the data anymore):
- *
- * updateMarker( markerName, { affectsData: false } );
- *
- * @see module:engine/model/markercollection~Marker
- * @param {String|module:engine/model/markercollection~Marker} markerOrName Name of a marker to update, or a marker instance.
- * @param {Object} [options] If options object is not defined then marker will be refreshed by triggering
- * downcast conversion for this marker with the same data.
- * @param {module:engine/model/range~Range} [options.range] Marker range to update.
- * @param {Boolean} [options.usingOperation] Flag indicated whether the marker should be added by MarkerOperation.
- * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.
- * @param {Boolean} [options.affectsData] Flag indicating that the marker changes the editor data.
- */
- updateMarker( markerOrName, options ) {
- this._assertWriterUsedCorrectly();
- const markerName = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;
- const currentMarker = this.model.markers.get( markerName );
- if ( !currentMarker ) {
- /**
- * Marker with provided name does not exists.
- *
- * @error writer-updatemarker-marker-not-exists
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-updatemarker-marker-not-exists', this );
- }
- if ( !options ) {
- this.model.markers._refresh( currentMarker );
- return;
- }
- const hasUsingOperationDefined = typeof options.usingOperation == 'boolean';
- const affectsDataDefined = typeof options.affectsData == 'boolean';
- // Use previously defined marker's affectsData if the property is not provided.
- const affectsData = affectsDataDefined ? options.affectsData : currentMarker.affectsData;
- if ( !hasUsingOperationDefined && !options.range && !affectsDataDefined ) {
- /**
- * One of the options is required - provide range, usingOperations or affectsData.
- *
- * @error writer-updatemarker-wrong-options
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-updatemarker-wrong-options', this );
- }
- const currentRange = currentMarker.getRange();
- const updatedRange = options.range ? options.range : currentRange;
- if ( hasUsingOperationDefined && options.usingOperation !== currentMarker.managedUsingOperations ) {
- // The marker type is changed so it's necessary to create proper operations.
- if ( options.usingOperation ) {
- // If marker changes to a managed one treat this as synchronizing existing marker.
- // Create `MarkerOperation` with `oldRange` set to `null`, so reverse operation will remove the marker.
- applyMarkerOperation( this, markerName, null, updatedRange, affectsData );
- } else {
- // If marker changes to a marker that do not use operations then we need to create additional operation
- // that removes that marker first.
- applyMarkerOperation( this, markerName, currentRange, null, affectsData );
- // Although not managed the marker itself should stay in model and its range should be preserver or changed to passed range.
- this.model.markers._set( markerName, updatedRange, undefined, affectsData );
- }
- return;
- }
- // Marker's type doesn't change so update it accordingly.
- if ( currentMarker.managedUsingOperations ) {
- applyMarkerOperation( this, markerName, currentRange, updatedRange, affectsData );
- } else {
- this.model.markers._set( markerName, updatedRange, undefined, affectsData );
- }
- }
- /**
- * Removes given {@link module:engine/model/markercollection~Marker marker} or marker with given name.
- * The marker is removed accordingly to how it has been created, so if the marker was created using operation,
- * it will be destroyed using operation.
- *
- * @param {module:engine/model/markercollection~Marker|String} markerOrName Marker or marker name to remove.
- */
- removeMarker( markerOrName ) {
- this._assertWriterUsedCorrectly();
- const name = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;
- if ( !this.model.markers.has( name ) ) {
- /**
- * Trying to remove marker which does not exist.
- *
- * @error writer-removemarker-no-marker
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-removemarker-no-marker', this );
- }
- const marker = this.model.markers.get( name );
- if ( !marker.managedUsingOperations ) {
- this.model.markers._remove( name );
- return;
- }
- const oldRange = marker.getRange();
- applyMarkerOperation( this, name, oldRange, null, marker.affectsData );
- }
- /**
- * Sets the document's selection (ranges and direction) to the specified location based on the given
- * {@link module:engine/model/selection~Selectable selectable} or creates an empty selection if no arguments were passed.
- *
- * // Sets selection to the given range.
- * const range = writer.createRange( start, end );
- * writer.setSelection( range );
- *
- * // Sets selection to given ranges.
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
- * writer.setSelection( ranges );
- *
- * // Sets selection to other selection.
- * const otherSelection = writer.createSelection();
- * writer.setSelection( otherSelection );
- *
- * // Sets selection to the given document selection.
- * const documentSelection = model.document.selection;
- * writer.setSelection( documentSelection );
- *
- * // Sets collapsed selection at the given position.
- * const position = writer.createPosition( root, path );
- * writer.setSelection( position );
- *
- * // Sets collapsed selection at the position of the given node and an offset.
- * writer.setSelection( paragraph, offset );
- *
- * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
- * that element and ends after the last child of that element.
- *
- * writer.setSelection( paragraph, 'in' );
- *
- * Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends just after the item.
- *
- * writer.setSelection( paragraph, 'on' );
- *
- * // Removes all selection's ranges.
- * writer.setSelection( null );
- *
- * `Writer#setSelection()` allow passing additional options (`backward`) as the last argument.
- *
- * // Sets selection as backward.
- * writer.setSelection( range, { backward: true } );
- *
- * Throws `writer-incorrect-use` error when the writer is used outside the `change()` block.
- *
- * @param {module:engine/model/selection~Selectable} selectable
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- */
- setSelection( selectable, placeOrOffset, options ) {
- this._assertWriterUsedCorrectly();
- this.model.document.selection._setTo( selectable, placeOrOffset, options );
- }
- /**
- * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.
- *
- * The location can be specified in the same form as
- * {@link #createPositionAt `writer.createPositionAt()`} parameters.
- *
- * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset=0] Offset or one of the flags. Used only when
- * first parameter is a {@link module:engine/model/item~Item model item}.
- */
- setSelectionFocus( itemOrPosition, offset ) {
- this._assertWriterUsedCorrectly();
- this.model.document.selection._setFocus( itemOrPosition, offset );
- }
- /**
- * Sets attribute(s) on the selection. If attribute with the same key already is set, it's value is overwritten.
- *
- * Using key and value pair:
- *
- * writer.setSelectionAttribute( 'italic', true );
- *
- * Using key-value object:
- *
- * writer.setSelectionAttribute( { italic: true, bold: false } );
- *
- * Using iterable object:
- *
- * writer.setSelectionAttribute( new Map( [ [ 'italic', true ] ] ) );
- *
- * @param {String|Object|Iterable.<*>} keyOrObjectOrIterable Key of the attribute to set
- * or object / iterable of key => value attribute pairs.
- * @param {*} [value] Attribute value.
- */
- setSelectionAttribute( keyOrObjectOrIterable, value ) {
- this._assertWriterUsedCorrectly();
- if ( typeof keyOrObjectOrIterable === 'string' ) {
- this._setSelectionAttribute( keyOrObjectOrIterable, value );
- } else {
- for ( const [ key, value ] of Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_16__["default"])( keyOrObjectOrIterable ) ) {
- this._setSelectionAttribute( key, value );
- }
- }
- }
- /**
- * Removes attribute(s) with given key(s) from the selection.
- *
- * Remove one attribute:
- *
- * writer.removeSelectionAttribute( 'italic' );
- *
- * Remove multiple attributes:
- *
- * writer.removeSelectionAttribute( [ 'italic', 'bold' ] );
- *
- * @param {String|Iterable.<String>} keyOrIterableOfKeys Key of the attribute to remove or an iterable of attribute keys to remove.
- */
- removeSelectionAttribute( keyOrIterableOfKeys ) {
- this._assertWriterUsedCorrectly();
- if ( typeof keyOrIterableOfKeys === 'string' ) {
- this._removeSelectionAttribute( keyOrIterableOfKeys );
- } else {
- for ( const key of keyOrIterableOfKeys ) {
- this._removeSelectionAttribute( key );
- }
- }
- }
- /**
- * Temporarily changes the {@link module:engine/model/documentselection~DocumentSelection#isGravityOverridden gravity}
- * of the selection from left to right.
- *
- * The gravity defines from which direction the selection inherits its attributes. If it's the default left gravity,
- * then the selection (after being moved by the user) inherits attributes from its left-hand side.
- * This method allows to temporarily override this behavior by forcing the gravity to the right.
- *
- * For the following model fragment:
- *
- * <$text bold="true" linkHref="url">bar[]</$text><$text bold="true">biz</$text>
- *
- * * Default gravity: selection will have the `bold` and `linkHref` attributes.
- * * Overridden gravity: selection will have `bold` attribute.
- *
- * **Note**: It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry
- * of the process.
- *
- * @returns {String} The unique id which allows restoring the gravity.
- */
- overrideSelectionGravity() {
- return this.model.document.selection._overrideGravity();
- }
- /**
- * Restores {@link ~Writer#overrideSelectionGravity} gravity to default.
- *
- * Restoring the gravity is only possible using the unique identifier returned by
- * {@link ~Writer#overrideSelectionGravity}. Note that the gravity remains overridden as long as won't be restored
- * the same number of times it was overridden.
- *
- * @param {String} uid The unique id returned by {@link ~Writer#overrideSelectionGravity}.
- */
- restoreSelectionGravity( uid ) {
- this.model.document.selection._restoreGravity( uid );
- }
- /**
- * @private
- * @param {String} key Key of the attribute to remove.
- * @param {*} value Attribute value.
- */
- _setSelectionAttribute( key, value ) {
- const selection = this.model.document.selection;
- // Store attribute in parent element if the selection is collapsed in an empty node.
- if ( selection.isCollapsed && selection.anchor.parent.isEmpty ) {
- const storeKey = _documentselection__WEBPACK_IMPORTED_MODULE_15__["default"]._getStoreAttributeKey( key );
- this.setAttribute( storeKey, value, selection.anchor.parent );
- }
- selection._setAttribute( key, value );
- }
- /**
- * @private
- * @param {String} key Key of the attribute to remove.
- */
- _removeSelectionAttribute( key ) {
- const selection = this.model.document.selection;
- // Remove stored attribute from parent element if the selection is collapsed in an empty node.
- if ( selection.isCollapsed && selection.anchor.parent.isEmpty ) {
- const storeKey = _documentselection__WEBPACK_IMPORTED_MODULE_15__["default"]._getStoreAttributeKey( key );
- this.removeAttribute( storeKey, selection.anchor.parent );
- }
- selection._removeAttribute( key );
- }
- /**
- * Throws `writer-detached-writer-tries-to-modify-model` error when the writer is used outside of the `change()` block.
- *
- * @private
- */
- _assertWriterUsedCorrectly() {
- /**
- * Trying to use a writer outside a {@link module:engine/model/model~Model#change `change()`} or
- * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`} blocks.
- *
- * The writer can only be used inside these blocks which ensures that the model
- * can only be changed during such "sessions".
- *
- * @error writer-incorrect-use
- */
- if ( this.model._currentWriter !== this ) {
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-incorrect-use', this );
- }
- }
- /**
- * For given action `type` and `positionOrRange` where the action happens, this function finds all affected markers
- * and applies a marker operation with the new marker range equal to the current range. Thanks to this, the marker range
- * can be later correctly processed during undo.
- *
- * @private
- * @param {'move'|'merge'} type Writer action type.
- * @param {module:engine/model/position~Position|module:engine/model/range~Range} positionOrRange Position or range
- * where the writer action happens.
- */
- _addOperationForAffectedMarkers( type, positionOrRange ) {
- for ( const marker of this.model.markers ) {
- if ( !marker.managedUsingOperations ) {
- continue;
- }
- const markerRange = marker.getRange();
- let isAffected = false;
- if ( type === 'move' ) {
- isAffected =
- positionOrRange.containsPosition( markerRange.start ) ||
- positionOrRange.start.isEqual( markerRange.start ) ||
- positionOrRange.containsPosition( markerRange.end ) ||
- positionOrRange.end.isEqual( markerRange.end );
- } else {
- // if type === 'merge'.
- const elementBefore = positionOrRange.nodeBefore;
- const elementAfter = positionOrRange.nodeAfter;
- // Start: <p>Foo[</p><p>Bar]</p>
- // After merge: <p>Foo[Bar]</p>
- // After undoing split: <p>Foo</p><p>[Bar]</p> <-- incorrect, needs remembering for undo.
- //
- const affectedInLeftElement = markerRange.start.parent == elementBefore && markerRange.start.isAtEnd;
- // Start: <p>[Foo</p><p>]Bar</p>
- // After merge: <p>[Foo]Bar</p>
- // After undoing split: <p>[Foo]</p><p>Bar</p> <-- incorrect, needs remembering for undo.
- //
- const affectedInRightElement = markerRange.end.parent == elementAfter && markerRange.end.offset == 0;
- // Start: <p>[Foo</p>]<p>Bar</p>
- // After merge: <p>[Foo]Bar</p>
- // After undoing split: <p>[Foo]</p><p>Bar</p> <-- incorrect, needs remembering for undo.
- //
- const affectedAfterLeftElement = markerRange.end.nodeAfter == elementAfter;
- // Start: <p>Foo</p>[<p>Bar]</p>
- // After merge: <p>Foo[Bar]</p>
- // After undoing split: <p>Foo</p><p>[Bar]</p> <-- incorrect, needs remembering for undo.
- //
- const affectedBeforeRightElement = markerRange.start.nodeAfter == elementAfter;
- isAffected = affectedInLeftElement || affectedInRightElement || affectedAfterLeftElement || affectedBeforeRightElement;
- }
- if ( isAffected ) {
- this.updateMarker( marker.name, { range: markerRange } );
- }
- }
- }
- }
- // Sets given attribute to each node in given range. When attribute value is null then attribute will be removed.
- //
- // Because attribute operation needs to have the same attribute value on the whole range, this function splits
- // the range into smaller parts.
- //
- // Given `range` must be flat.
- //
- // @private
- // @param {module:engine/model/writer~Writer} writer
- // @param {String} key Attribute key.
- // @param {*} value Attribute new value.
- // @param {module:engine/model/range~Range} range Model range on which the attribute will be set.
- function setAttributeOnRange( writer, key, value, range ) {
- const model = writer.model;
- const doc = model.document;
- // Position of the last split, the beginning of the new range.
- let lastSplitPosition = range.start;
- // Currently position in the scanning range. Because we need value after the position, it is not a current
- // position of the iterator but the previous one (we need to iterate one more time to get the value after).
- let position;
- // Value before the currently position.
- let valueBefore;
- // Value after the currently position.
- let valueAfter;
- for ( const val of range.getWalker( { shallow: true } ) ) {
- valueAfter = val.item.getAttribute( key );
- // At the first run of the iterator the position in undefined. We also do not have a valueBefore, but
- // because valueAfter may be null, valueBefore may be equal valueAfter ( undefined == null ).
- if ( position && valueBefore != valueAfter ) {
- // if valueBefore == value there is nothing to change, so we add operation only if these values are different.
- if ( valueBefore != value ) {
- addOperation();
- }
- lastSplitPosition = position;
- }
- position = val.nextPosition;
- valueBefore = valueAfter;
- }
- // Because position in the loop is not the iterator position (see let position comment), the last position in
- // the while loop will be last but one position in the range. We need to check the last position manually.
- if ( position instanceof _position__WEBPACK_IMPORTED_MODULE_13__["default"] && position != lastSplitPosition && valueBefore != value ) {
- addOperation();
- }
- function addOperation() {
- const range = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( lastSplitPosition, position );
- const version = range.root.document ? doc.version : null;
- const operation = new _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"]( range, key, valueBefore, value, version );
- writer.batch.addOperation( operation );
- model.applyOperation( operation );
- }
- }
- // Sets given attribute to the given node. When attribute value is null then attribute will be removed.
- //
- // @private
- // @param {module:engine/model/writer~Writer} writer
- // @param {String} key Attribute key.
- // @param {*} value Attribute new value.
- // @param {module:engine/model/item~Item} item Model item on which the attribute will be set.
- function setAttributeOnItem( writer, key, value, item ) {
- const model = writer.model;
- const doc = model.document;
- const previousValue = item.getAttribute( key );
- let range, operation;
- if ( previousValue != value ) {
- const isRootChanged = item.root === item;
- if ( isRootChanged ) {
- // If we change attributes of root element, we have to use `RootAttributeOperation`.
- const version = item.document ? doc.version : null;
- operation = new _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]( item, key, previousValue, value, version );
- } else {
- range = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createBefore( item ), writer.createPositionAfter( item ) );
- const version = range.root.document ? doc.version : null;
- operation = new _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"]( range, key, previousValue, value, version );
- }
- writer.batch.addOperation( operation );
- model.applyOperation( operation );
- }
- }
- // Creates and applies marker operation to {@link module:engine/model/operation/operation~Operation operation}.
- //
- // @private
- // @param {module:engine/model/writer~Writer} writer
- // @param {String} name Marker name.
- // @param {module:engine/model/range~Range} oldRange Marker range before the change.
- // @param {module:engine/model/range~Range} newRange Marker range after the change.
- // @param {Boolean} affectsData
- function applyMarkerOperation( writer, name, oldRange, newRange, affectsData ) {
- const model = writer.model;
- const doc = model.document;
- const operation = new _operation_markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"]( name, oldRange, newRange, model.markers, affectsData, doc.version );
- writer.batch.addOperation( operation );
- model.applyOperation( operation );
- }
- // Creates `MoveOperation` or `DetachOperation` that removes `howMany` nodes starting from `position`.
- // The operation will be applied on given model instance and added to given operation instance.
- //
- // @private
- // @param {module:engine/model/position~Position} position Position from which nodes are removed.
- // @param {Number} howMany Number of nodes to remove.
- // @param {Batch} batch Batch to which the operation will be added.
- // @param {module:engine/model/model~Model} model Model instance on which operation will be applied.
- function applyRemoveOperation( position, howMany, batch, model ) {
- let operation;
- if ( position.root.document ) {
- const doc = model.document;
- const graveyardPosition = new _position__WEBPACK_IMPORTED_MODULE_13__["default"]( doc.graveyard, [ 0 ] );
- operation = new _operation_moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( position, howMany, graveyardPosition, doc.version );
- } else {
- operation = new _operation_detachoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( position, howMany );
- }
- batch.addOperation( operation );
- model.applyOperation( operation );
- }
- // Returns `true` if both root elements are the same element or both are documents root elements.
- //
- // Elements in the same tree can be moved (for instance you can move element form one documents root to another, or
- // within the same document fragment), but when element supposed to be moved from document fragment to the document, or
- // to another document it should be removed and inserted to avoid problems with OT. This is because features like undo or
- // collaboration may track changes on the document but ignore changes on detached fragments and should not get
- // unexpected `move` operation.
- function isSameTree( rootA, rootB ) {
- // If it is the same root this is the same tree.
- if ( rootA === rootB ) {
- return true;
- }
- // If both roots are documents root it is operation within the document what we still treat as the same tree.
- if ( rootA instanceof _rootelement__WEBPACK_IMPORTED_MODULE_12__["default"] && rootB instanceof _rootelement__WEBPACK_IMPORTED_MODULE_12__["default"] ) {
- return true;
- }
- return false;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AttributeElement; });
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/attributeelement
- */
- // Default attribute priority.
- const DEFAULT_PRIORITY = 10;
- /**
- * Attribute elements are used to represent formatting elements in the view (think – `<b>`, `<span style="font-size: 2em">`, etc.).
- * Most often they are created when downcasting model text attributes.
- *
- * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
- * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
- * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
- *
- * To create a new attribute element instance use the
- * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `DowncastWriter#createAttributeElement()`} method.
- *
- * **Note:** Attribute elements by default can wrap {@link module:engine/view/text~Text},
- * {@link module:engine/view/emptyelement~EmptyElement}, {@link module:engine/view/uielement~UIElement},
- * {@link module:engine/view/rawelement~RawElement} and other attribute elements with higher priority. Other elements while placed inside
- * an attribute element will split it (or nest in case of an `AttributeElement`). This behavior can be modified by changing
- * the `isAllowedInsideAttributeElement` option while creating
- * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement},
- * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement},
- * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement} or
- * {@link module:engine/view/downcastwriter~DowncastWriter#createRawElement}.
- *
- * @extends module:engine/view/element~Element
- */
- class AttributeElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an attribute element.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#createAttributeElement
- * @see module:engine/view/element~Element
- * @protected
- * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
- * @param {String} name Node name.
- * @param {Object|Iterable} [attrs] Collection of attributes.
- * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
- * A list of nodes to be inserted into created element.
- */
- constructor( document, name, attrs, children ) {
- super( document, name, attrs, children );
- /**
- * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
- *
- * @method #getFillerOffset
- * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
- */
- this.getFillerOffset = getFillerOffset;
- /**
- * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
- *
- * @protected
- * @member {Number}
- */
- this._priority = DEFAULT_PRIORITY;
- /**
- * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
- * and then two elements are considered similar if, and only if they have the same `_id`.
- *
- * @protected
- * @member {String|Number}
- */
- this._id = null;
- /**
- * Keeps all the attribute elements that have the same {@link module:engine/view/attributeelement~AttributeElement#id ids}
- * and still exist in the view tree.
- *
- * This property is managed by {@link module:engine/view/downcastwriter~DowncastWriter}.
- *
- * @protected
- * @member {Set.<module:engine/view/attributeelement~AttributeElement>|null}
- */
- this._clonesGroup = null;
- }
- /**
- * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
- *
- * @readonly
- * @type {Number}
- */
- get priority() {
- return this._priority;
- }
- /**
- * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
- * and then two elements are considered similar if, and only if they have the same `id`.
- *
- * @readonly
- * @type {String|Number}
- */
- get id() {
- return this._id;
- }
- /**
- * Returns all {@link module:engine/view/attributeelement~AttributeElement attribute elements} that has the
- * same {@link module:engine/view/attributeelement~AttributeElement#id id} and are in the view tree (were not removed).
- *
- * Note: If this element has been removed from the tree, returned set will not include it.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError attribute-element-get-elements-with-same-id-no-id}
- * if this element has no `id`.
- *
- * @returns {Set.<module:engine/view/attributeelement~AttributeElement>} Set containing all the attribute elements
- * with the same `id` that were added and not removed from the view tree.
- */
- getElementsWithSameId() {
- if ( this.id === null ) {
- /**
- * Cannot get elements with the same id for an attribute element without id.
- *
- * @error attribute-element-get-elements-with-same-id-no-id
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
- 'attribute-element-get-elements-with-same-id-no-id',
- this
- );
- }
- return new Set( this._clonesGroup );
- }
- /**
- * Checks whether this object is of the given.
- *
- * attributeElement.is( 'attributeElement' ); // -> true
- * attributeElement.is( 'element' ); // -> true
- * attributeElement.is( 'node' ); // -> true
- * attributeElement.is( 'view:attributeElement' ); // -> true
- * attributeElement.is( 'view:element' ); // -> true
- * attributeElement.is( 'view:node' ); // -> true
- *
- * attributeElement.is( 'model:element' ); // -> false
- * attributeElement.is( 'documentFragment' ); // -> false
- *
- * Assuming that the object being checked is an attribute element, you can also check its
- * {@link module:engine/view/attributeelement~AttributeElement#name name}:
- *
- * attributeElement.is( 'element', 'b' ); // -> true if this is a bold element
- * attributeElement.is( 'attributeElement', 'b' ); // -> same as above
- * text.is( 'element', 'b' ); -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type Type to check.
- * @param {String} [name] Element name.
- * @returns {Boolean}
- */
- is( type, name = null ) {
- if ( !name ) {
- return type === 'attributeElement' || type === 'view:attributeElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'element' || type === 'view:element' ||
- type === 'node' || type === 'view:node';
- } else {
- return name === this.name && (
- type === 'attributeElement' || type === 'view:attributeElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'element' || type === 'view:element'
- );
- }
- }
- /**
- * Checks if this element is similar to other element.
- *
- * If none of elements has set {@link module:engine/view/attributeelement~AttributeElement#id}, then both elements
- * should have the same name, attributes and priority to be considered as similar. Two similar elements can contain
- * different set of children nodes.
- *
- * If at least one element has {@link module:engine/view/attributeelement~AttributeElement#id} set, then both
- * elements have to have the same {@link module:engine/view/attributeelement~AttributeElement#id} value to be
- * considered similar.
- *
- * Similarity is important for {@link module:engine/view/downcastwriter~DowncastWriter}. For example:
- *
- * * two following similar elements can be merged together into one, longer element,
- * * {@link module:engine/view/downcastwriter~DowncastWriter#unwrap} checks similarity of passed element and processed element to
- * decide whether processed element should be unwrapped,
- * * etc.
- *
- * @param {module:engine/view/element~Element} otherElement
- * @returns {Boolean}
- */
- isSimilar( otherElement ) {
- // If any element has an `id` set, just compare the ids.
- if ( this.id !== null || otherElement.id !== null ) {
- return this.id === otherElement.id;
- }
- return super.isSimilar( otherElement ) && this.priority == otherElement.priority;
- }
- /**
- * Clones provided element with priority.
- *
- * @protected
- * @param {Boolean} deep If set to `true` clones element and all its children recursively. When set to `false`,
- * element will be cloned without any children.
- * @returns {module:engine/view/attributeelement~AttributeElement} Clone of this element.
- */
- _clone( deep ) {
- const cloned = super._clone( deep );
- // Clone priority too.
- cloned._priority = this._priority;
- // And id too.
- cloned._id = this._id;
- return cloned;
- }
- }
- /**
- * Default attribute priority.
- *
- * @member {Number} module:engine/view/attributeelement~AttributeElement.DEFAULT_PRIORITY
- */
- AttributeElement.DEFAULT_PRIORITY = DEFAULT_PRIORITY;
- // Returns block {@link module:engine/view/filler~Filler filler} offset or `null` if block filler is not needed.
- //
- // @returns {Number|null} Block filler offset or `null` if block filler is not needed.
- function getFillerOffset() {
- // <b>foo</b> does not need filler.
- if ( nonUiChildrenCount( this ) ) {
- return null;
- }
- let element = this.parent;
- // <p><b></b></p> needs filler -> <p><b><br></b></p>
- while ( element && element.is( 'attributeElement' ) ) {
- if ( nonUiChildrenCount( element ) > 1 ) {
- return null;
- }
- element = element.parent;
- }
- if ( !element || nonUiChildrenCount( element ) > 1 ) {
- return null;
- }
- // Render block filler at the end of element (after all ui elements).
- return this.childCount;
- }
- // Returns total count of children that are not {@link module:engine/view/uielement~UIElement UIElements}.
- //
- // @param {module:engine/view/element~Element} element
- // @returns {Number}
- function nonUiChildrenCount( element ) {
- return Array.from( element.getChildren() ).filter( element => !element.is( 'uiElement' ) ).length;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js ***!
- \******************************************************************************/
- /*! exports provided: default, getFillerOffset */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContainerElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFillerOffset", function() { return getFillerOffset; });
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/containerelement
- */
- /**
- * Containers are elements which define document structure. They define boundaries for
- * {@link module:engine/view/attributeelement~AttributeElement attributes}. They are mostly used for block elements like `<p>` or `<div>`.
- *
- * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
- * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
- * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
- *
- * The container element should be your default choice when writing a converter, unless:
- *
- * * this element represents a model text attribute (then use {@link module:engine/view/attributeelement~AttributeElement}),
- * * this is an empty element like `<img>` (then use {@link module:engine/view/emptyelement~EmptyElement}),
- * * this is a root element,
- * * this is a nested editable element (then use {@link module:engine/view/editableelement~EditableElement}).
- *
- * To create a new container element instance use the
- * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `DowncastWriter#createContainerElement()`}
- * method.
- *
- * @extends module:engine/view/element~Element
- */
- class ContainerElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates a container element.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#createContainerElement
- * @see module:engine/view/element~Element
- * @protected
- * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
- * @param {String} name Node name.
- * @param {Object|Iterable} [attrs] Collection of attributes.
- * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
- * A list of nodes to be inserted into created element.
- */
- constructor( document, name, attrs, children ) {
- super( document, name, attrs, children );
- /**
- * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
- *
- * @method #getFillerOffset
- * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
- */
- this.getFillerOffset = getFillerOffset;
- }
- /**
- * Checks whether this object is of the given.
- *
- * containerElement.is( 'containerElement' ); // -> true
- * containerElement.is( 'element' ); // -> true
- * containerElement.is( 'node' ); // -> true
- * containerElement.is( 'view:containerElement' ); // -> true
- * containerElement.is( 'view:element' ); // -> true
- * containerElement.is( 'view:node' ); // -> true
- *
- * containerElement.is( 'model:element' ); // -> false
- * containerElement.is( 'documentFragment' ); // -> false
- *
- * Assuming that the object being checked is a container element, you can also check its
- * {@link module:engine/view/containerelement~ContainerElement#name name}:
- *
- * containerElement.is( 'element', 'div' ); // -> true if this is a div container element
- * containerElement.is( 'contaienrElement', 'div' ); // -> same as above
- * text.is( 'element', 'div' ); -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type Type to check.
- * @param {String} [name] Element name.
- * @returns {Boolean}
- */
- is( type, name = null ) {
- if ( !name ) {
- return type === 'containerElement' || type === 'view:containerElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'element' || type === 'view:element' ||
- type === 'node' || type === 'view:node';
- } else {
- return name === this.name && (
- type === 'containerElement' || type === 'view:containerElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'element' || type === 'view:element'
- );
- }
- }
- }
- /**
- * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
- *
- * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
- */
- function getFillerOffset() {
- const children = [ ...this.getChildren() ];
- const lastChild = children[ this.childCount - 1 ];
- // Block filler is required after a `<br>` if it's the last element in its container. See #1422.
- if ( lastChild && lastChild.is( 'element', 'br' ) ) {
- return this.childCount;
- }
- for ( const child of children ) {
- // If there's any non-UI element – don't render the bogus.
- if ( !child.is( 'uiElement' ) ) {
- return null;
- }
- }
- // If there are only UI elements – render the bogus at the end of the element.
- return this.childCount;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Document; });
- /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _observer_bubblingemittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./observer/bubblingemittermixin */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/document
- */
- // @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );
- /**
- * Document class creates an abstract layer over the content editable area, contains a tree of view elements and
- * {@link module:engine/view/documentselection~DocumentSelection view selection} associated with this document.
- *
- * @mixes module:engine/view/observer/bubblingemittermixin~BubblingEmitterMixin
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class Document {
- /**
- * Creates a Document instance.
- *
- * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
- */
- constructor( stylesProcessor ) {
- /**
- * Selection done on this document.
- *
- * @readonly
- * @member {module:engine/view/documentselection~DocumentSelection} module:engine/view/document~Document#selection
- */
- this.selection = new _documentselection__WEBPACK_IMPORTED_MODULE_0__["default"]();
- /**
- * Roots of the view tree. Collection of the {@link module:engine/view/element~Element view elements}.
- *
- * View roots are created as a result of binding between {@link module:engine/view/document~Document#roots} and
- * {@link module:engine/model/document~Document#roots} and this is handled by
- * {@link module:engine/controller/editingcontroller~EditingController}, so to create view root we need to create
- * model root using {@link module:engine/model/document~Document#createRoot}.
- *
- * @readonly
- * @member {module:utils/collection~Collection} module:engine/view/document~Document#roots
- */
- this.roots = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__["default"]( { idProperty: 'rootName' } );
- /**
- * The styles processor instance used by this document when normalizing styles.
- *
- * @readonly
- * @member {module:engine/view/stylesmap~StylesProcessor}
- */
- this.stylesProcessor = stylesProcessor;
- /**
- * Defines whether document is in read-only mode.
- *
- * When document is read-ony then all roots are read-only as well and caret placed inside this root is hidden.
- *
- * @observable
- * @member {Boolean} #isReadOnly
- */
- this.set( 'isReadOnly', false );
- /**
- * True if document is focused.
- *
- * This property is updated by the {@link module:engine/view/observer/focusobserver~FocusObserver}.
- * If the {@link module:engine/view/observer/focusobserver~FocusObserver} is disabled this property will not change.
- *
- * @readonly
- * @observable
- * @member {Boolean} module:engine/view/document~Document#isFocused
- */
- this.set( 'isFocused', false );
- /**
- * True if composition is in progress inside the document.
- *
- * This property is updated by the {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
- * If the {@link module:engine/view/observer/compositionobserver~CompositionObserver} is disabled this property will not change.
- *
- * @readonly
- * @observable
- * @member {Boolean} module:engine/view/document~Document#isComposing
- */
- this.set( 'isComposing', false );
- /**
- * Post-fixer callbacks registered to the view document.
- *
- * @private
- * @member {Set}
- */
- this._postFixers = new Set();
- }
- /**
- * Gets a {@link module:engine/view/document~Document#roots view root element} with the specified name. If the name is not
- * specific "main" root is returned.
- *
- * @param {String} [name='main'] Name of the root.
- * @returns {module:engine/view/rooteditableelement~RootEditableElement|null} The view root element with the specified name
- * or null when there is no root of given name.
- */
- getRoot( name = 'main' ) {
- return this.roots.get( name );
- }
- /**
- * Allows registering post-fixer callbacks. A post-fixers mechanism allows to update the view tree just before it is rendered
- * to the DOM.
- *
- * Post-fixers are executed right after all changes from the outermost change block were applied but
- * before the {@link module:engine/view/view~View#event:render render event} is fired. If a post-fixer callback made
- * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should
- * not be fixed in the new document tree state.
- *
- * View post-fixers are useful when you want to apply some fixes whenever the view structure changes. Keep in mind that
- * changes executed in a view post-fixer should not break model-view mapping.
- *
- * The types of changes which should be safe:
- *
- * * adding or removing attribute from elements,
- * * changes inside of {@link module:engine/view/uielement~UIElement UI elements},
- * * {@link module:engine/model/differ~Differ#refreshItem marking some of the model elements to be re-converted}.
- *
- * Try to avoid changes which touch view structure:
- *
- * * you should not add or remove nor wrap or unwrap any view elements,
- * * you should not change the editor data model in a view post-fixer.
- *
- * As a parameter, a post-fixer callback receives a {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.
- *
- * Typically, a post-fixer will look like this:
- *
- * editor.editing.view.document.registerPostFixer( writer => {
- * if ( checkSomeCondition() ) {
- * writer.doSomething();
- *
- * // Let other post-fixers know that something changed.
- * return true;
- * }
- * } );
- *
- * Note that nothing happens right after you register a post-fixer (e.g. execute such a code in the console).
- * That is because adding a post-fixer does not execute it.
- * The post-fixer will be executed as soon as any change in the document needs to cause its rendering.
- * If you want to re-render the editor's view after registering the post-fixer then you should do it manually by calling
- * {@link module:engine/view/view~View#forceRender `view.forceRender()`}.
- *
- * If you need to register a callback which is executed when DOM elements are already updated,
- * use {@link module:engine/view/view~View#event:render render event}.
- *
- * @param {Function} postFixer
- */
- registerPostFixer( postFixer ) {
- this._postFixers.add( postFixer );
- }
- /**
- * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.
- */
- destroy() {
- this.roots.map( root => root.destroy() );
- this.stopListening();
- }
- /**
- * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.
- *
- * @protected
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer
- */
- _callPostFixers( writer ) {
- let wasFixed = false;
- do {
- for ( const callback of this._postFixers ) {
- wasFixed = callback( writer );
- if ( wasFixed ) {
- break;
- }
- }
- } while ( wasFixed );
- }
- /**
- * Event fired whenever document content layout changes. It is fired whenever content is
- * {@link module:engine/view/view~View#event:render rendered}, but should be also fired by observers in case of
- * other actions which may change layout, for instance when image loads.
- *
- * @event layoutChanged
- */
- // @if CK_DEBUG_ENGINE // log( version ) {
- // @if CK_DEBUG_ENGINE // logDocument( this, version );
- // @if CK_DEBUG_ENGINE // }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Document, _observer_bubblingemittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Document, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
- /**
- * Enum representing type of the change.
- *
- * Possible values:
- *
- * * `children` - for child list changes,
- * * `attributes` - for element attributes changes,
- * * `text` - for text nodes changes.
- *
- * @typedef {String} module:engine/view/document~ChangeType
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentFragment; });
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
- /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/documentfragment
- */
- /**
- * Document fragment.
- *
- * To create a new document fragment instance use the
- * {@link module:engine/view/upcastwriter~UpcastWriter#createDocumentFragment `UpcastWriter#createDocumentFragment()`}
- * method.
- */
- class DocumentFragment {
- /**
- * Creates new DocumentFragment instance.
- *
- * @protected
- * @param {module:engine/view/document~Document} document The document to which this document fragment belongs.
- * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
- * A list of nodes to be inserted into the created document fragment.
- */
- constructor( document, children ) {
- /**
- * The document to which this document fragment belongs.
- *
- * @readonly
- * @member {module:engine/view/document~Document}
- */
- this.document = document;
- /**
- * Array of child nodes.
- *
- * @protected
- * @member {Array.<module:engine/view/element~Element>} module:engine/view/documentfragment~DocumentFragment#_children
- */
- this._children = [];
- if ( children ) {
- this._insertChild( 0, children );
- }
- }
- /**
- * Iterable interface.
- *
- * Iterates over nodes added to this document fragment.
- *
- * @returns {Iterable.<module:engine/view/node~Node>}
- */
- [ Symbol.iterator ]() {
- return this._children[ Symbol.iterator ]();
- }
- /**
- * Number of child nodes in this document fragment.
- *
- * @readonly
- * @type {Number}
- */
- get childCount() {
- return this._children.length;
- }
- /**
- * Is `true` if there are no nodes inside this document fragment, `false` otherwise.
- *
- * @readonly
- * @type {Boolean}
- */
- get isEmpty() {
- return this.childCount === 0;
- }
- /**
- * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.
- *
- * @readonly
- * @type {module:engine/model/documentfragment~DocumentFragment}
- */
- get root() {
- return this;
- }
- /**
- * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
- *
- * @readonly
- * @type {null}
- */
- get parent() {
- return null;
- }
- /**
- * Checks whether this object is of the given type.
- *
- * docFrag.is( 'documentFragment' ); // -> true
- * docFrag.is( 'view:documentFragment' ); // -> true
- *
- * docFrag.is( 'model:documentFragment' ); // -> false
- * docFrag.is( 'element' ); // -> false
- * docFrag.is( 'node' ); // -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'documentFragment' || type === 'view:documentFragment';
- }
- /**
- * {@link module:engine/view/documentfragment~DocumentFragment#_insertChild Insert} a child node or a list of child nodes at the end
- * and sets the parent of these nodes to this fragment.
- *
- * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
- * @returns {Number} Number of appended nodes.
- */
- _appendChild( items ) {
- return this._insertChild( this.childCount, items );
- }
- /**
- * Gets child at the given index.
- *
- * @param {Number} index Index of child.
- * @returns {module:engine/view/node~Node} Child node.
- */
- getChild( index ) {
- return this._children[ index ];
- }
- /**
- * Gets index of the given child node. Returns `-1` if child node is not found.
- *
- * @param {module:engine/view/node~Node} node Child node.
- * @returns {Number} Index of the child node.
- */
- getChildIndex( node ) {
- return this._children.indexOf( node );
- }
- /**
- * Gets child nodes iterator.
- *
- * @returns {Iterable.<module:engine/view/node~Node>} Child nodes iterator.
- */
- getChildren() {
- return this._children[ Symbol.iterator ]();
- }
- /**
- * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
- * this fragment.
- *
- * @param {Number} index Position where nodes should be inserted.
- * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
- * @returns {Number} Number of inserted nodes.
- */
- _insertChild( index, items ) {
- this._fireChange( 'children', this );
- let count = 0;
- const nodes = normalize( this.document, items );
- for ( const node of nodes ) {
- // If node that is being added to this element is already inside another element, first remove it from the old parent.
- if ( node.parent !== null ) {
- node._remove();
- }
- node.parent = this;
- this._children.splice( index, 0, node );
- index++;
- count++;
- }
- return count;
- }
- /**
- * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.
- *
- * @param {Number} index Number of the first node to remove.
- * @param {Number} [howMany=1] Number of nodes to remove.
- * @returns {Array.<module:engine/view/node~Node>} The array of removed nodes.
- */
- _removeChildren( index, howMany = 1 ) {
- this._fireChange( 'children', this );
- for ( let i = index; i < index + howMany; i++ ) {
- this._children[ i ].parent = null;
- }
- return this._children.splice( index, howMany );
- }
- /**
- * Fires `change` event with given type of the change.
- *
- * @private
- * @param {module:engine/view/document~ChangeType} type Type of the change.
- * @param {module:engine/view/node~Node} node Changed node.
- * @fires module:engine/view/node~Node#change
- */
- _fireChange( type, node ) {
- this.fire( 'change:' + type, node );
- }
- // @if CK_DEBUG_ENGINE // printTree() {
- // @if CK_DEBUG_ENGINE // let string = 'ViewDocumentFragment: [';
- // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
- // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
- // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( 1 ) + child.data;
- // @if CK_DEBUG_ENGINE // } else {
- // @if CK_DEBUG_ENGINE // string += '\n' + child.printTree( 1 );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // string += '\n]';
- // @if CK_DEBUG_ENGINE // return string;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // logTree() {
- // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
- // @if CK_DEBUG_ENGINE // }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( DocumentFragment, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
- // Converts strings to Text and non-iterables to arrays.
- //
- // @param {String|module:engine/view/item~Item|Iterable.<String|module:engine/view/item~Item>}
- // @returns {Iterable.<module:engine/view/node~Node>}
- function normalize( document, nodes ) {
- // Separate condition because string is iterable.
- if ( typeof nodes == 'string' ) {
- return [ new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( document, nodes ) ];
- }
- if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_3__["default"])( nodes ) ) {
- nodes = [ nodes ];
- }
- // Array.from to enable .map() on non-arrays.
- return Array.from( nodes )
- .map( node => {
- if ( typeof node == 'string' ) {
- return new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( document, node );
- }
- if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
- return new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( document, node.data );
- }
- return node;
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentSelection; });
- /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/documentselection
- */
- /**
- * Class representing the document selection in the view.
- *
- * Its instance is available in {@link module:engine/view/document~Document#selection `Document#selection`}.
- *
- * It is similar to {@link module:engine/view/selection~Selection} but
- * it has a read-only API and can be modified only by the writer available in
- * the {@link module:engine/view/view~View#change `View#change()`} block
- * (so via {@link module:engine/view/downcastwriter~DowncastWriter#setSelection `DowncastWriter#setSelection()`}).
- */
- class DocumentSelection {
- /**
- * Creates new DocumentSelection instance.
- *
- * // Creates empty selection without ranges.
- * const selection = new DocumentSelection();
- *
- * // Creates selection at the given range.
- * const range = writer.createRange( start, end );
- * const selection = new DocumentSelection( range );
- *
- * // Creates selection at the given ranges
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
- * const selection = new DocumentSelection( ranges );
- *
- * // Creates selection from the other selection.
- * const otherSelection = writer.createSelection();
- * const selection = new DocumentSelection( otherSelection );
- *
- * // Creates selection at the given position.
- * const position = writer.createPositionAt( root, offset );
- * const selection = new DocumentSelection( position );
- *
- * // Creates collapsed selection at the position of given item and offset.
- * const paragraph = writer.createContainerElement( 'paragraph' );
- * const selection = new DocumentSelection( paragraph, offset );
- *
- * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
- * // first child of that element and ends after the last child of that element.
- * const selection = new DocumentSelection( paragraph, 'in' );
- *
- * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
- * // just after the item.
- * const selection = new DocumentSelection( paragraph, 'on' );
- *
- * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
- *
- * // Creates backward selection.
- * const selection = new DocumentSelection( range, { backward: true } );
- *
- * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
- * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
- * represented in other way, for example by applying proper CSS class.
- *
- * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
- * (and be properly handled by screen readers).
- *
- * // Creates fake selection with label.
- * const selection = new DocumentSelection( range, { fake: true, label: 'foo' } );
- *
- * @param {module:engine/view/selection~Selectable} [selectable=null]
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
- * @param {String} [options.label] Label for the fake selection.
- */
- constructor( selectable = null, placeOrOffset, options ) {
- /**
- * Selection is used internally (`DocumentSelection` is a proxy to that selection).
- *
- * @private
- * @member {module:engine/view/selection~Selection}
- */
- this._selection = new _selection__WEBPACK_IMPORTED_MODULE_0__["default"]();
- // Delegate change event to be fired on DocumentSelection instance.
- this._selection.delegate( 'change' ).to( this );
- // Set selection data.
- this._selection.setTo( selectable, placeOrOffset, options );
- }
- /**
- * Returns true if selection instance is marked as `fake`.
- *
- * @see #_setTo
- * @type {Boolean}
- */
- get isFake() {
- return this._selection.isFake;
- }
- /**
- * Returns fake selection label.
- *
- * @see #_setTo
- * @type {String}
- */
- get fakeSelectionLabel() {
- return this._selection.fakeSelectionLabel;
- }
- /**
- * Selection anchor. Anchor may be described as a position where the selection starts. Together with
- * {@link #focus focus} they define the direction of selection, which is important
- * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.
- * It may be a bit unintuitive when there are multiple ranges in selection.
- *
- * @see #focus
- * @type {module:engine/view/position~Position}
- */
- get anchor() {
- return this._selection.anchor;
- }
- /**
- * Selection focus. Focus is a position where the selection ends.
- *
- * @see #anchor
- * @type {module:engine/view/position~Position}
- */
- get focus() {
- return this._selection.focus;
- }
- /**
- * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
- * collapsed.
- *
- * @type {Boolean}
- */
- get isCollapsed() {
- return this._selection.isCollapsed;
- }
- /**
- * Returns number of ranges in selection.
- *
- * @type {Number}
- */
- get rangeCount() {
- return this._selection.rangeCount;
- }
- /**
- * Specifies whether the {@link #focus} precedes {@link #anchor}.
- *
- * @type {Boolean}
- */
- get isBackward() {
- return this._selection.isBackward;
- }
- /**
- * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`
- * if the selection is not inside an editable element.
- *
- * @type {module:engine/view/editableelement~EditableElement|null}
- */
- get editableElement() {
- return this._selection.editableElement;
- }
- /**
- * Used for the compatibility with the {@link module:engine/view/selection~Selection#isEqual} method.
- *
- * @protected
- */
- get _ranges() {
- return this._selection._ranges;
- }
- /**
- * Returns an iterable that contains copies of all ranges added to the selection.
- *
- * @returns {Iterable.<module:engine/view/range~Range>}
- */
- * getRanges() {
- yield* this._selection.getRanges();
- }
- /**
- * Returns copy of the first range in the selection. First range is the one which
- * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start
- * position of all other ranges (not to confuse with the first range added to the selection).
- * Returns `null` if no ranges are added to selection.
- *
- * @returns {module:engine/view/range~Range|null}
- */
- getFirstRange() {
- return this._selection.getFirstRange();
- }
- /**
- * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}
- * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse
- * with the last range added to the selection). Returns `null` if no ranges are added to selection.
- *
- * @returns {module:engine/view/range~Range|null}
- */
- getLastRange() {
- return this._selection.getLastRange();
- }
- /**
- * Returns copy of the first position in the selection. First position is the position that
- * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.
- * Returns `null` if no ranges are added to selection.
- *
- * @returns {module:engine/view/position~Position|null}
- */
- getFirstPosition() {
- return this._selection.getFirstPosition();
- }
- /**
- * Returns copy of the last position in the selection. Last position is the position that
- * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.
- * Returns `null` if no ranges are added to selection.
- *
- * @returns {module:engine/view/position~Position|null}
- */
- getLastPosition() {
- return this._selection.getLastPosition();
- }
- /**
- * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only
- * one range in the selection, and that range contains exactly one element.
- * Returns `null` if there is no selected element.
- *
- * @returns {module:engine/view/element~Element|null}
- */
- getSelectedElement() {
- return this._selection.getSelectedElement();
- }
- /**
- * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,
- * same number of ranges and all ranges from one selection equal to a range from other selection.
- *
- * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
- * Selection to compare with.
- * @returns {Boolean} `true` if selections are equal, `false` otherwise.
- */
- isEqual( otherSelection ) {
- return this._selection.isEqual( otherSelection );
- }
- /**
- * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same
- * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are
- * equal to any trimmed range from other selection.
- *
- * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
- * Selection to compare with.
- * @returns {Boolean} `true` if selections are similar, `false` otherwise.
- */
- isSimilar( otherSelection ) {
- return this._selection.isSimilar( otherSelection );
- }
- /**
- * Checks whether this object is of the given type.
- *
- * docSelection.is( 'selection' ); // -> true
- * docSelection.is( 'documentSelection' ); // -> true
- * docSelection.is( 'view:selection' ); // -> true
- * docSelection.is( 'view:documentSelection' ); // -> true
- *
- * docSelection.is( 'model:documentSelection' ); // -> false
- * docSelection.is( 'element' ); // -> false
- * docSelection.is( 'node' ); // -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'selection' ||
- type == 'documentSelection' ||
- type == 'view:selection' ||
- type == 'view:documentSelection';
- }
- /**
- * Sets this selection's ranges and direction to the specified location based on the given
- * {@link module:engine/view/selection~Selectable selectable}.
- *
- * // Sets selection to the given range.
- * const range = writer.createRange( start, end );
- * documentSelection._setTo( range );
- *
- * // Sets selection to given ranges.
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
- * documentSelection._setTo( range );
- *
- * // Sets selection to the other selection.
- * const otherSelection = writer.createSelection();
- * documentSelection._setTo( otherSelection );
- *
- * // Sets collapsed selection at the given position.
- * const position = writer.createPositionAt( root, offset );
- * documentSelection._setTo( position );
- *
- * // Sets collapsed selection at the position of given item and offset.
- * documentSelection._setTo( paragraph, offset );
- *
- * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
- * that element and ends after the last child of that element.
- *
- * documentSelection._setTo( paragraph, 'in' );
- *
- * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
- *
- * documentSelection._setTo( paragraph, 'on' );
- *
- * // Clears selection. Removes all ranges.
- * documentSelection._setTo( null );
- *
- * `Selection#_setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
- *
- * // Sets selection as backward.
- * documentSelection._setTo( range, { backward: true } );
- *
- * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
- * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
- * represented in other way, for example by applying proper CSS class.
- *
- * Additionally fake's selection label can be provided. It will be used to des cribe fake selection in DOM
- * (and be properly handled by screen readers).
- *
- * // Creates fake selection with label.
- * documentSelection._setTo( range, { fake: true, label: 'foo' } );
- *
- * @protected
- * @fires change
- * @param {module:engine/view/selection~Selectable} selectable
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
- * @param {String} [options.label] Label for the fake selection.
- */
- _setTo( selectable, placeOrOffset, options ) {
- this._selection.setTo( selectable, placeOrOffset, options );
- }
- /**
- * Moves {@link #focus} to the specified location.
- *
- * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
- * parameters.
- *
- * @protected
- * @fires change
- * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * first parameter is a {@link module:engine/view/item~Item view item}.
- */
- _setFocus( itemOrPosition, offset ) {
- this._selection.setFocus( itemOrPosition, offset );
- }
- /**
- * Fired whenever selection ranges are changed through {@link ~DocumentSelection Selection API}.
- *
- * @event change
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( DocumentSelection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DomConverter; });
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
- /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
- /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
- /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js");
- /* harmony import */ var _matcher__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
- /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/indexof */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/getancestors */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_getcommonancestor__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/getcommonancestor */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getcommonancestor.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/domconverter
- */
- /* globals document, Node, NodeFilter, Text */
- const BR_FILLER_REF = Object(_filler__WEBPACK_IMPORTED_MODULE_8__["BR_FILLER"])( document ); // eslint-disable-line new-cap
- const NBSP_FILLER_REF = Object(_filler__WEBPACK_IMPORTED_MODULE_8__["NBSP_FILLER"])( document ); // eslint-disable-line new-cap
- const MARKED_NBSP_FILLER_REF = Object(_filler__WEBPACK_IMPORTED_MODULE_8__["MARKED_NBSP_FILLER"])( document ); // eslint-disable-line new-cap
- /**
- * `DomConverter` is a set of tools to do transformations between DOM nodes and view nodes. It also handles
- * {@link module:engine/view/domconverter~DomConverter#bindElements bindings} between these nodes.
- *
- * An instance of the DOM converter is available under
- * {@link module:engine/view/view~View#domConverter `editor.editing.view.domConverter`}.
- *
- * The DOM converter does not check which nodes should be rendered (use {@link module:engine/view/renderer~Renderer}), does not keep the
- * state of a tree nor keeps the synchronization between the tree view and the DOM tree (use {@link module:engine/view/document~Document}).
- *
- * The DOM converter keeps DOM elements to view element bindings, so when the converter gets destroyed, the bindings are lost.
- * Two converters will keep separate binding maps, so one tree view can be bound with two DOM trees.
- */
- class DomConverter {
- /**
- * Creates a DOM converter.
- *
- * @param {module:engine/view/document~Document} document The view document instance.
- * @param {Object} options An object with configuration options.
- * @param {module:engine/view/filler~BlockFillerMode} [options.blockFillerMode='br'] The type of the block filler to use.
- */
- constructor( document, options = {} ) {
- /**
- * @readonly
- * @type {module:engine/view/document~Document}
- */
- this.document = document;
- /**
- * The mode of a block filler used by the DOM converter.
- *
- * @member {'br'|'nbsp'|'markedNbsp'} module:engine/view/domconverter~DomConverter#blockFillerMode
- */
- this.blockFillerMode = options.blockFillerMode || 'br';
- /**
- * Elements which are considered pre-formatted elements.
- *
- * @readonly
- * @member {Array.<String>} module:engine/view/domconverter~DomConverter#preElements
- */
- this.preElements = [ 'pre' ];
- /**
- * Elements which are considered block elements (and hence should be filled with a
- * {@link #isBlockFiller block filler}).
- *
- * Whether an element is considered a block element also affects handling of trailing whitespaces.
- *
- * You can extend this array if you introduce support for block elements which are not yet recognized here.
- *
- * @readonly
- * @member {Array.<String>} module:engine/view/domconverter~DomConverter#blockElements
- */
- this.blockElements = [ 'p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li', 'dd', 'dt', 'figcaption', 'td', 'th' ];
- /**
- * The DOM-to-view mapping.
- *
- * @private
- * @member {WeakMap} module:engine/view/domconverter~DomConverter#_domToViewMapping
- */
- this._domToViewMapping = new WeakMap();
- /**
- * The view-to-DOM mapping.
- *
- * @private
- * @member {WeakMap} module:engine/view/domconverter~DomConverter#_viewToDomMapping
- */
- this._viewToDomMapping = new WeakMap();
- /**
- * Holds the mapping between fake selection containers and corresponding view selections.
- *
- * @private
- * @member {WeakMap} module:engine/view/domconverter~DomConverter#_fakeSelectionMapping
- */
- this._fakeSelectionMapping = new WeakMap();
- /**
- * Matcher for view elements whose content should be treated as raw data
- * and not processed during the conversion from DOM nodes to view elements.
- *
- * @private
- * @type {module:engine/view/matcher~Matcher}
- */
- this._rawContentElementMatcher = new _matcher__WEBPACK_IMPORTED_MODULE_7__["default"]();
- /**
- * A set of encountered raw content DOM nodes. It is used for preventing left trimming of the following text node.
- *
- * @private
- * @type {WeakSet.<Node>}
- */
- this._encounteredRawContentDomNodes = new WeakSet();
- }
- /**
- * Binds a given DOM element that represents fake selection to a **position** of a
- * {@link module:engine/view/documentselection~DocumentSelection document selection}.
- * Document selection copy is stored and can be retrieved by the
- * {@link module:engine/view/domconverter~DomConverter#fakeSelectionToView} method.
- *
- * @param {HTMLElement} domElement
- * @param {module:engine/view/documentselection~DocumentSelection} viewDocumentSelection
- */
- bindFakeSelection( domElement, viewDocumentSelection ) {
- this._fakeSelectionMapping.set( domElement, new _selection__WEBPACK_IMPORTED_MODULE_4__["default"]( viewDocumentSelection ) );
- }
- /**
- * Returns a {@link module:engine/view/selection~Selection view selection} instance corresponding to a given
- * DOM element that represents fake selection. Returns `undefined` if binding to the given DOM element does not exist.
- *
- * @param {HTMLElement} domElement
- * @returns {module:engine/view/selection~Selection|undefined}
- */
- fakeSelectionToView( domElement ) {
- return this._fakeSelectionMapping.get( domElement );
- }
- /**
- * Binds DOM and view elements, so it will be possible to get corresponding elements using
- * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and
- * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.
- *
- * @param {HTMLElement} domElement The DOM element to bind.
- * @param {module:engine/view/element~Element} viewElement The view element to bind.
- */
- bindElements( domElement, viewElement ) {
- this._domToViewMapping.set( domElement, viewElement );
- this._viewToDomMapping.set( viewElement, domElement );
- }
- /**
- * Unbinds a given DOM element from the view element it was bound to. Unbinding is deep, meaning that all children of
- * the DOM element will be unbound too.
- *
- * @param {HTMLElement} domElement The DOM element to unbind.
- */
- unbindDomElement( domElement ) {
- const viewElement = this._domToViewMapping.get( domElement );
- if ( viewElement ) {
- this._domToViewMapping.delete( domElement );
- this._viewToDomMapping.delete( viewElement );
- for ( const child of domElement.childNodes ) {
- this.unbindDomElement( child );
- }
- }
- }
- /**
- * Binds DOM and view document fragments, so it will be possible to get corresponding document fragments using
- * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and
- * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.
- *
- * @param {DocumentFragment} domFragment The DOM document fragment to bind.
- * @param {module:engine/view/documentfragment~DocumentFragment} viewFragment The view document fragment to bind.
- */
- bindDocumentFragments( domFragment, viewFragment ) {
- this._domToViewMapping.set( domFragment, viewFragment );
- this._viewToDomMapping.set( viewFragment, domFragment );
- }
- /**
- * Converts the view to the DOM. For all text nodes, not bound elements and document fragments new items will
- * be created. For bound elements and document fragments the method will return corresponding items.
- *
- * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} viewNode
- * View node or document fragment to transform.
- * @param {Document} domDocument Document which will be used to create DOM nodes.
- * @param {Object} [options] Conversion options.
- * @param {Boolean} [options.bind=false] Determines whether new elements will be bound.
- * @param {Boolean} [options.withChildren=true] If `true`, node's and document fragment's children will be converted too.
- * @returns {Node|DocumentFragment} Converted node or DocumentFragment.
- */
- viewToDom( viewNode, domDocument, options = {} ) {
- if ( viewNode.is( '$text' ) ) {
- const textData = this._processDataFromViewText( viewNode );
- return domDocument.createTextNode( textData );
- } else {
- if ( this.mapViewToDom( viewNode ) ) {
- return this.mapViewToDom( viewNode );
- }
- let domElement;
- if ( viewNode.is( 'documentFragment' ) ) {
- // Create DOM document fragment.
- domElement = domDocument.createDocumentFragment();
- if ( options.bind ) {
- this.bindDocumentFragments( domElement, viewNode );
- }
- } else if ( viewNode.is( 'uiElement' ) ) {
- // UIElement has its own render() method (see #799).
- domElement = viewNode.render( domDocument );
- if ( options.bind ) {
- this.bindElements( domElement, viewNode );
- }
- return domElement;
- } else {
- // Create DOM element.
- if ( viewNode.hasAttribute( 'xmlns' ) ) {
- domElement = domDocument.createElementNS( viewNode.getAttribute( 'xmlns' ), viewNode.name );
- } else {
- domElement = domDocument.createElement( viewNode.name );
- }
- // RawElement take care of their children in RawElement#render() method which can be customized
- // (see https://github.com/ckeditor/ckeditor5/issues/4469).
- if ( viewNode.is( 'rawElement' ) ) {
- viewNode.render( domElement );
- }
- if ( options.bind ) {
- this.bindElements( domElement, viewNode );
- }
- // Copy element's attributes.
- for ( const key of viewNode.getAttributeKeys() ) {
- domElement.setAttribute( key, viewNode.getAttribute( key ) );
- }
- }
- if ( options.withChildren !== false ) {
- for ( const child of this.viewChildrenToDom( viewNode, domDocument, options ) ) {
- domElement.appendChild( child );
- }
- }
- return domElement;
- }
- }
- /**
- * Converts children of the view element to DOM using the
- * {@link module:engine/view/domconverter~DomConverter#viewToDom} method.
- * Additionally, this method adds block {@link module:engine/view/filler filler} to the list of children, if needed.
- *
- * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewElement Parent view element.
- * @param {Document} domDocument Document which will be used to create DOM nodes.
- * @param {Object} options See {@link module:engine/view/domconverter~DomConverter#viewToDom} options parameter.
- * @returns {Iterable.<Node>} DOM nodes.
- */
- * viewChildrenToDom( viewElement, domDocument, options = {} ) {
- const fillerPositionOffset = viewElement.getFillerOffset && viewElement.getFillerOffset();
- let offset = 0;
- for ( const childView of viewElement.getChildren() ) {
- if ( fillerPositionOffset === offset ) {
- yield this._getBlockFiller( domDocument );
- }
- yield this.viewToDom( childView, domDocument, options );
- offset++;
- }
- if ( fillerPositionOffset === offset ) {
- yield this._getBlockFiller( domDocument );
- }
- }
- /**
- * Converts view {@link module:engine/view/range~Range} to DOM range.
- * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.
- *
- * @param {module:engine/view/range~Range} viewRange View range.
- * @returns {Range} DOM range.
- */
- viewRangeToDom( viewRange ) {
- const domStart = this.viewPositionToDom( viewRange.start );
- const domEnd = this.viewPositionToDom( viewRange.end );
- const domRange = document.createRange();
- domRange.setStart( domStart.parent, domStart.offset );
- domRange.setEnd( domEnd.parent, domEnd.offset );
- return domRange;
- }
- /**
- * Converts view {@link module:engine/view/position~Position} to DOM parent and offset.
- *
- * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.
- * If the converted position is directly before inline filler it is moved inside the filler.
- *
- * @param {module:engine/view/position~Position} viewPosition View position.
- * @returns {Object|null} position DOM position or `null` if view position could not be converted to DOM.
- * @returns {Node} position.parent DOM position parent.
- * @returns {Number} position.offset DOM position offset.
- */
- viewPositionToDom( viewPosition ) {
- const viewParent = viewPosition.parent;
- if ( viewParent.is( '$text' ) ) {
- const domParent = this.findCorrespondingDomText( viewParent );
- if ( !domParent ) {
- // Position is in a view text node that has not been rendered to DOM yet.
- return null;
- }
- let offset = viewPosition.offset;
- if ( Object(_filler__WEBPACK_IMPORTED_MODULE_8__["startsWithFiller"])( domParent ) ) {
- offset += _filler__WEBPACK_IMPORTED_MODULE_8__["INLINE_FILLER_LENGTH"];
- }
- return { parent: domParent, offset };
- } else {
- // viewParent is instance of ViewElement.
- let domParent, domBefore, domAfter;
- if ( viewPosition.offset === 0 ) {
- domParent = this.mapViewToDom( viewParent );
- if ( !domParent ) {
- // Position is in a view element that has not been rendered to DOM yet.
- return null;
- }
- domAfter = domParent.childNodes[ 0 ];
- } else {
- const nodeBefore = viewPosition.nodeBefore;
- domBefore = nodeBefore.is( '$text' ) ?
- this.findCorrespondingDomText( nodeBefore ) :
- this.mapViewToDom( viewPosition.nodeBefore );
- if ( !domBefore ) {
- // Position is after a view element that has not been rendered to DOM yet.
- return null;
- }
- domParent = domBefore.parentNode;
- domAfter = domBefore.nextSibling;
- }
- // If there is an inline filler at position return position inside the filler. We should never return
- // the position before the inline filler.
- if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( domAfter ) && Object(_filler__WEBPACK_IMPORTED_MODULE_8__["startsWithFiller"])( domAfter ) ) {
- return { parent: domAfter, offset: _filler__WEBPACK_IMPORTED_MODULE_8__["INLINE_FILLER_LENGTH"] };
- }
- const offset = domBefore ? Object(_ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_10__["default"])( domBefore ) + 1 : 0;
- return { parent: domParent, offset };
- }
- }
- /**
- * Converts DOM to view. For all text nodes, not bound elements and document fragments new items will
- * be created. For bound elements and document fragments function will return corresponding items. For
- * {@link module:engine/view/filler fillers} `null` will be returned.
- * For all DOM elements rendered by {@link module:engine/view/uielement~UIElement} that UIElement will be returned.
- *
- * @param {Node|DocumentFragment} domNode DOM node or document fragment to transform.
- * @param {Object} [options] Conversion options.
- * @param {Boolean} [options.bind=false] Determines whether new elements will be bound.
- * @param {Boolean} [options.withChildren=true] If `true`, node's and document fragment's children will be converted too.
- * @param {Boolean} [options.keepOriginalCase=false] If `false`, node's tag name will be converter to lower case.
- * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null} Converted node or document fragment
- * or `null` if DOM node is a {@link module:engine/view/filler filler} or the given node is an empty text node.
- */
- domToView( domNode, options = {} ) {
- if ( this.isBlockFiller( domNode ) ) {
- return null;
- }
- // When node is inside a UIElement or a RawElement return that parent as it's view representation.
- const hostElement = this.getHostViewElement( domNode );
- if ( hostElement ) {
- return hostElement;
- }
- if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( domNode ) ) {
- if ( Object(_filler__WEBPACK_IMPORTED_MODULE_8__["isInlineFiller"])( domNode ) ) {
- return null;
- } else {
- const textData = this._processDataFromDomText( domNode );
- return textData === '' ? null : new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( this.document, textData );
- }
- } else if ( this.isComment( domNode ) ) {
- return null;
- } else {
- if ( this.mapDomToView( domNode ) ) {
- return this.mapDomToView( domNode );
- }
- let viewElement;
- if ( this.isDocumentFragment( domNode ) ) {
- // Create view document fragment.
- viewElement = new _documentfragment__WEBPACK_IMPORTED_MODULE_5__["default"]( this.document );
- if ( options.bind ) {
- this.bindDocumentFragments( domNode, viewElement );
- }
- } else {
- // Create view element.
- const viewName = options.keepOriginalCase ? domNode.tagName : domNode.tagName.toLowerCase();
- viewElement = new _element__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, viewName );
- if ( options.bind ) {
- this.bindElements( domNode, viewElement );
- }
- // Copy element's attributes.
- const attrs = domNode.attributes;
- for ( let i = attrs.length - 1; i >= 0; i-- ) {
- viewElement._setAttribute( attrs[ i ].name, attrs[ i ].value );
- }
- // Treat this element's content as a raw data if it was registered as such.
- if ( options.withChildren !== false && this._rawContentElementMatcher.match( viewElement ) ) {
- viewElement._setCustomProperty( '$rawContent', domNode.innerHTML );
- // Store a DOM node to prevent left trimming of the following text node.
- this._encounteredRawContentDomNodes.add( domNode );
- return viewElement;
- }
- }
- if ( options.withChildren !== false ) {
- for ( const child of this.domChildrenToView( domNode, options ) ) {
- viewElement._appendChild( child );
- }
- }
- return viewElement;
- }
- }
- /**
- * Converts children of the DOM element to view nodes using
- * the {@link module:engine/view/domconverter~DomConverter#domToView} method.
- * Additionally this method omits block {@link module:engine/view/filler filler}, if it exists in the DOM parent.
- *
- * @param {HTMLElement} domElement Parent DOM element.
- * @param {Object} options See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.
- * @returns {Iterable.<module:engine/view/node~Node>} View nodes.
- */
- * domChildrenToView( domElement, options = {} ) {
- for ( let i = 0; i < domElement.childNodes.length; i++ ) {
- const domChild = domElement.childNodes[ i ];
- const viewChild = this.domToView( domChild, options );
- if ( viewChild !== null ) {
- yield viewChild;
- }
- }
- }
- /**
- * Converts DOM selection to view {@link module:engine/view/selection~Selection}.
- * Ranges which cannot be converted will be omitted.
- *
- * @param {Selection} domSelection DOM selection.
- * @returns {module:engine/view/selection~Selection} View selection.
- */
- domSelectionToView( domSelection ) {
- // DOM selection might be placed in fake selection container.
- // If container contains fake selection - return corresponding view selection.
- if ( domSelection.rangeCount === 1 ) {
- let container = domSelection.getRangeAt( 0 ).startContainer;
- // The DOM selection might be moved to the text node inside the fake selection container.
- if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( container ) ) {
- container = container.parentNode;
- }
- const viewSelection = this.fakeSelectionToView( container );
- if ( viewSelection ) {
- return viewSelection;
- }
- }
- const isBackward = this.isDomSelectionBackward( domSelection );
- const viewRanges = [];
- for ( let i = 0; i < domSelection.rangeCount; i++ ) {
- // DOM Range have correct start and end, no matter what is the DOM Selection direction. So we don't have to fix anything.
- const domRange = domSelection.getRangeAt( i );
- const viewRange = this.domRangeToView( domRange );
- if ( viewRange ) {
- viewRanges.push( viewRange );
- }
- }
- return new _selection__WEBPACK_IMPORTED_MODULE_4__["default"]( viewRanges, { backward: isBackward } );
- }
- /**
- * Converts DOM Range to view {@link module:engine/view/range~Range}.
- * If the start or end position can not be converted `null` is returned.
- *
- * @param {Range} domRange DOM range.
- * @returns {module:engine/view/range~Range|null} View range.
- */
- domRangeToView( domRange ) {
- const viewStart = this.domPositionToView( domRange.startContainer, domRange.startOffset );
- const viewEnd = this.domPositionToView( domRange.endContainer, domRange.endOffset );
- if ( viewStart && viewEnd ) {
- return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( viewStart, viewEnd );
- }
- return null;
- }
- /**
- * Converts DOM parent and offset to view {@link module:engine/view/position~Position}.
- *
- * If the position is inside a {@link module:engine/view/filler filler} which has no corresponding view node,
- * position of the filler will be converted and returned.
- *
- * If the position is inside DOM element rendered by {@link module:engine/view/uielement~UIElement}
- * that position will be converted to view position before that UIElement.
- *
- * If structures are too different and it is not possible to find corresponding position then `null` will be returned.
- *
- * @param {Node} domParent DOM position parent.
- * @param {Number} domOffset DOM position offset.
- * @returns {module:engine/view/position~Position} viewPosition View position.
- */
- domPositionToView( domParent, domOffset ) {
- if ( this.isBlockFiller( domParent ) ) {
- return this.domPositionToView( domParent.parentNode, Object(_ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_10__["default"])( domParent ) );
- }
- // If position is somewhere inside UIElement or a RawElement - return position before that element.
- const viewElement = this.mapDomToView( domParent );
- if ( viewElement && ( viewElement.is( 'uiElement' ) || viewElement.is( 'rawElement' ) ) ) {
- return _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( viewElement );
- }
- if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( domParent ) ) {
- if ( Object(_filler__WEBPACK_IMPORTED_MODULE_8__["isInlineFiller"])( domParent ) ) {
- return this.domPositionToView( domParent.parentNode, Object(_ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_10__["default"])( domParent ) );
- }
- const viewParent = this.findCorrespondingViewText( domParent );
- let offset = domOffset;
- if ( !viewParent ) {
- return null;
- }
- if ( Object(_filler__WEBPACK_IMPORTED_MODULE_8__["startsWithFiller"])( domParent ) ) {
- offset -= _filler__WEBPACK_IMPORTED_MODULE_8__["INLINE_FILLER_LENGTH"];
- offset = offset < 0 ? 0 : offset;
- }
- return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, offset );
- }
- // domParent instanceof HTMLElement.
- else {
- if ( domOffset === 0 ) {
- const viewParent = this.mapDomToView( domParent );
- if ( viewParent ) {
- return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, 0 );
- }
- } else {
- const domBefore = domParent.childNodes[ domOffset - 1 ];
- const viewBefore = Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( domBefore ) ?
- this.findCorrespondingViewText( domBefore ) :
- this.mapDomToView( domBefore );
- // TODO #663
- if ( viewBefore && viewBefore.parent ) {
- return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewBefore.parent, viewBefore.index + 1 );
- }
- }
- return null;
- }
- }
- /**
- * Returns corresponding view {@link module:engine/view/element~Element Element} or
- * {@link module:engine/view/documentfragment~DocumentFragment} for provided DOM element or
- * document fragment. If there is no view item {@link module:engine/view/domconverter~DomConverter#bindElements bound}
- * to the given DOM - `undefined` is returned.
- *
- * For all DOM elements rendered by a {@link module:engine/view/uielement~UIElement} or
- * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.
- *
- * @param {DocumentFragment|Element} domElementOrDocumentFragment DOM element or document fragment.
- * @returns {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|undefined}
- * Corresponding view element, document fragment or `undefined` if no element was bound.
- */
- mapDomToView( domElementOrDocumentFragment ) {
- const hostElement = this.getHostViewElement( domElementOrDocumentFragment );
- return hostElement || this._domToViewMapping.get( domElementOrDocumentFragment );
- }
- /**
- * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},
- * corresponding text node is returned based on the sibling or parent.
- *
- * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used
- * to find the corresponding text node.
- *
- * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}
- * element, it is used to find the corresponding text node.
- *
- * For all text nodes rendered by a {@link module:engine/view/uielement~UIElement} or
- * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.
- *
- * Otherwise `null` is returned.
- *
- * Note that for the block or inline {@link module:engine/view/filler filler} this method returns `null`.
- *
- * @param {Text} domText DOM text node.
- * @returns {module:engine/view/text~Text|null} Corresponding view text node or `null`, if it was not possible to find a
- * corresponding node.
- */
- findCorrespondingViewText( domText ) {
- if ( Object(_filler__WEBPACK_IMPORTED_MODULE_8__["isInlineFiller"])( domText ) ) {
- return null;
- }
- // If DOM text was rendered by a UIElement or a RawElement - return this parent element.
- const hostElement = this.getHostViewElement( domText );
- if ( hostElement ) {
- return hostElement;
- }
- const previousSibling = domText.previousSibling;
- // Try to use previous sibling to find the corresponding text node.
- if ( previousSibling ) {
- if ( !( this.isElement( previousSibling ) ) ) {
- // The previous is text or comment.
- return null;
- }
- const viewElement = this.mapDomToView( previousSibling );
- if ( viewElement ) {
- const nextSibling = viewElement.nextSibling;
- // It might be filler which has no corresponding view node.
- if ( nextSibling instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- return viewElement.nextSibling;
- } else {
- return null;
- }
- }
- }
- // Try to use parent to find the corresponding text node.
- else {
- const viewElement = this.mapDomToView( domText.parentNode );
- if ( viewElement ) {
- const firstChild = viewElement.getChild( 0 );
- // It might be filler which has no corresponding view node.
- if ( firstChild instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- return firstChild;
- } else {
- return null;
- }
- }
- }
- return null;
- }
- /**
- * Returns corresponding DOM item for provided {@link module:engine/view/element~Element Element} or
- * {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment}.
- * To find a corresponding text for {@link module:engine/view/text~Text view Text instance}
- * use {@link #findCorrespondingDomText}.
- *
- * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewNode
- * View element or document fragment.
- * @returns {Node|DocumentFragment|undefined} Corresponding DOM node or document fragment.
- */
- mapViewToDom( documentFragmentOrElement ) {
- return this._viewToDomMapping.get( documentFragmentOrElement );
- }
- /**
- * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},
- * corresponding text node is returned based on the sibling or parent.
- *
- * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used
- * to find the corresponding text node.
- *
- * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}
- * element, it is used to find the corresponding text node.
- *
- * Otherwise `null` is returned.
- *
- * @param {module:engine/view/text~Text} viewText View text node.
- * @returns {Text|null} Corresponding DOM text node or `null`, if it was not possible to find a corresponding node.
- */
- findCorrespondingDomText( viewText ) {
- const previousSibling = viewText.previousSibling;
- // Try to use previous sibling to find the corresponding text node.
- if ( previousSibling && this.mapViewToDom( previousSibling ) ) {
- return this.mapViewToDom( previousSibling ).nextSibling;
- }
- // If this is a first node, try to use parent to find the corresponding text node.
- if ( !previousSibling && viewText.parent && this.mapViewToDom( viewText.parent ) ) {
- return this.mapViewToDom( viewText.parent ).childNodes[ 0 ];
- }
- return null;
- }
- /**
- * Focuses DOM editable that is corresponding to provided {@link module:engine/view/editableelement~EditableElement}.
- *
- * @param {module:engine/view/editableelement~EditableElement} viewEditable
- */
- focus( viewEditable ) {
- const domEditable = this.mapViewToDom( viewEditable );
- if ( domEditable && domEditable.ownerDocument.activeElement !== domEditable ) {
- // Save the scrollX and scrollY positions before the focus.
- const { scrollX, scrollY } = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__["default"].window;
- const scrollPositions = [];
- // Save all scrollLeft and scrollTop values starting from domEditable up to
- // document#documentElement.
- forEachDomNodeAncestor( domEditable, node => {
- const { scrollLeft, scrollTop } = node;
- scrollPositions.push( [ scrollLeft, scrollTop ] );
- } );
- domEditable.focus();
- // Restore scrollLeft and scrollTop values starting from domEditable up to
- // document#documentElement.
- // https://github.com/ckeditor/ckeditor5-engine/issues/951
- // https://github.com/ckeditor/ckeditor5-engine/issues/957
- forEachDomNodeAncestor( domEditable, node => {
- const [ scrollLeft, scrollTop ] = scrollPositions.shift();
- node.scrollLeft = scrollLeft;
- node.scrollTop = scrollTop;
- } );
- // Restore the scrollX and scrollY positions after the focus.
- // https://github.com/ckeditor/ckeditor5-engine/issues/951
- _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__["default"].window.scrollTo( scrollX, scrollY );
- }
- }
- /**
- * Returns `true` when `node.nodeType` equals `Node.ELEMENT_NODE`.
- *
- * @param {Node} node Node to check.
- * @returns {Boolean}
- */
- isElement( node ) {
- return node && node.nodeType == Node.ELEMENT_NODE;
- }
- /**
- * Returns `true` when `node.nodeType` equals `Node.DOCUMENT_FRAGMENT_NODE`.
- *
- * @param {Node} node Node to check.
- * @returns {Boolean}
- */
- isDocumentFragment( node ) {
- return node && node.nodeType == Node.DOCUMENT_FRAGMENT_NODE;
- }
- /**
- * Returns `true` when `node.nodeType` equals `Node.COMMENT_NODE`.
- *
- * @param {Node} node Node to check.
- * @returns {Boolean}
- */
- isComment( node ) {
- return node && node.nodeType == Node.COMMENT_NODE;
- }
- /**
- * Checks if the node is an instance of the block filler for this DOM converter.
- *
- * const converter = new DomConverter( viewDocument, { blockFillerMode: 'br' } );
- *
- * converter.isBlockFiller( BR_FILLER( document ) ); // true
- * converter.isBlockFiller( NBSP_FILLER( document ) ); // false
- *
- * **Note:**: For the `'nbsp'` mode the method also checks context of a node so it cannot be a detached node.
- *
- * **Note:** A special case in the `'nbsp'` mode exists where the `<br>` in `<p><br></p>` is treated as a block filler.
- *
- * @param {Node} domNode DOM node to check.
- * @returns {Boolean} True if a node is considered a block filler for given mode.
- */
- isBlockFiller( domNode ) {
- if ( this.blockFillerMode == 'br' ) {
- return domNode.isEqualNode( BR_FILLER_REF );
- }
- // Special case for <p><br></p> in which <br> should be treated as filler even when we are not in the 'br' mode. See ckeditor5#5564.
- if ( domNode.tagName === 'BR' && hasBlockParent( domNode, this.blockElements ) && domNode.parentNode.childNodes.length === 1 ) {
- return true;
- }
- // If not in 'br' mode, try recognizing both marked and regular nbsp block fillers.
- return domNode.isEqualNode( MARKED_NBSP_FILLER_REF ) || isNbspBlockFiller( domNode, this.blockElements );
- }
- /**
- * Returns `true` if given selection is a backward selection, that is, if it's `focus` is before `anchor`.
- *
- * @param {Selection} DOM Selection instance to check.
- * @returns {Boolean}
- */
- isDomSelectionBackward( selection ) {
- if ( selection.isCollapsed ) {
- return false;
- }
- // Since it takes multiple lines of code to check whether a "DOM Position" is before/after another "DOM Position",
- // we will use the fact that range will collapse if it's end is before it's start.
- const range = document.createRange();
- range.setStart( selection.anchorNode, selection.anchorOffset );
- range.setEnd( selection.focusNode, selection.focusOffset );
- const backward = range.collapsed;
- range.detach();
- return backward;
- }
- /**
- * Returns a parent {@link module:engine/view/uielement~UIElement} or {@link module:engine/view/rawelement~RawElement}
- * that hosts the provided DOM node. Returns `null` if there is no such parent.
- *
- * @param {Node} domNode
- * @returns {module:engine/view/uielement~UIElement|module:engine/view/rawelement~RawElement|null}
- */
- getHostViewElement( domNode ) {
- const ancestors = Object(_ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_11__["default"])( domNode );
- // Remove domNode from the list.
- ancestors.pop();
- while ( ancestors.length ) {
- const domNode = ancestors.pop();
- const viewNode = this._domToViewMapping.get( domNode );
- if ( viewNode && ( viewNode.is( 'uiElement' ) || viewNode.is( 'rawElement' ) ) ) {
- return viewNode;
- }
- }
- return null;
- }
- /**
- * Checks if the given selection's boundaries are at correct places.
- *
- * The following places are considered as incorrect for selection boundaries:
- *
- * * before or in the middle of an inline filler sequence,
- * * inside a DOM element which represents {@link module:engine/view/uielement~UIElement a view UI element},
- * * inside a DOM element which represents {@link module:engine/view/rawelement~RawElement a view raw element}.
- *
- * @param {Selection} domSelection The DOM selection object to be checked.
- * @returns {Boolean} `true` if the given selection is at a correct place, `false` otherwise.
- */
- isDomSelectionCorrect( domSelection ) {
- return this._isDomSelectionPositionCorrect( domSelection.anchorNode, domSelection.anchorOffset ) &&
- this._isDomSelectionPositionCorrect( domSelection.focusNode, domSelection.focusOffset );
- }
- /**
- * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data
- * and not processed during the conversion from DOM nodes to view elements.
- *
- * This is affecting how {@link module:engine/view/domconverter~DomConverter#domToView} and
- * {@link module:engine/view/domconverter~DomConverter#domChildrenToView} process DOM nodes.
- *
- * The raw data can be later accessed by a
- * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `"$rawContent"`.
- *
- * @param {module:engine/view/matcher~MatcherPattern} pattern Pattern matching a view element whose content should
- * be treated as raw data.
- */
- registerRawContentMatcher( pattern ) {
- this._rawContentElementMatcher.add( pattern );
- }
- /**
- * Returns the block {@link module:engine/view/filler filler} node based on the current {@link #blockFillerMode} setting.
- *
- * @private
- * @params {Document} domDocument
- * @returns {Node} filler
- */
- _getBlockFiller( domDocument ) {
- switch ( this.blockFillerMode ) {
- case 'nbsp':
- return Object(_filler__WEBPACK_IMPORTED_MODULE_8__["NBSP_FILLER"])( domDocument ); // eslint-disable-line new-cap
- case 'markedNbsp':
- return Object(_filler__WEBPACK_IMPORTED_MODULE_8__["MARKED_NBSP_FILLER"])( domDocument ); // eslint-disable-line new-cap
- case 'br':
- return Object(_filler__WEBPACK_IMPORTED_MODULE_8__["BR_FILLER"])( domDocument ); // eslint-disable-line new-cap
- }
- }
- /**
- * Checks if the given DOM position is a correct place for selection boundary. See {@link #isDomSelectionCorrect}.
- *
- * @private
- * @param {Element} domParent Position parent.
- * @param {Number} offset Position offset.
- * @returns {Boolean} `true` if given position is at a correct place for selection boundary, `false` otherwise.
- */
- _isDomSelectionPositionCorrect( domParent, offset ) {
- // If selection is before or in the middle of inline filler string, it is incorrect.
- if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( domParent ) && Object(_filler__WEBPACK_IMPORTED_MODULE_8__["startsWithFiller"])( domParent ) && offset < _filler__WEBPACK_IMPORTED_MODULE_8__["INLINE_FILLER_LENGTH"] ) {
- // Selection in a text node, at wrong position (before or in the middle of filler).
- return false;
- }
- if ( this.isElement( domParent ) && Object(_filler__WEBPACK_IMPORTED_MODULE_8__["startsWithFiller"])( domParent.childNodes[ offset ] ) ) {
- // Selection in an element node, before filler text node.
- return false;
- }
- const viewParent = this.mapDomToView( domParent );
- // The position is incorrect when anchored inside a UIElement or a RawElement.
- // Note: In case of UIElement and RawElement, mapDomToView() returns a parent element for any DOM child
- // so there's no need to perform any additional checks.
- if ( viewParent && ( viewParent.is( 'uiElement' ) || viewParent.is( 'rawElement' ) ) ) {
- return false;
- }
- return true;
- }
- /**
- * Takes text data from a given {@link module:engine/view/text~Text#data} and processes it so
- * it is correctly displayed in the DOM.
- *
- * Following changes are done:
- *
- * * a space at the beginning is changed to ` ` if this is the first text node in its container
- * element or if a previous text node ends with a space character,
- * * space at the end of the text node is changed to ` ` if there are two spaces at the end of a node or if next node
- * starts with a space or if it is the last text node in its container,
- * * remaining spaces are replaced to a chain of spaces and ` ` (e.g. `'x x'` becomes `'x x'`).
- *
- * Content of {@link #preElements} is not processed.
- *
- * @private
- * @param {module:engine/view/text~Text} node View text node to process.
- * @returns {String} Processed text data.
- */
- _processDataFromViewText( node ) {
- let data = node.data;
- // If any of node ancestors has a name which is in `preElements` array, then currently processed
- // view text node is (will be) in preformatted element. We should not change whitespaces then.
- if ( node.getAncestors().some( parent => this.preElements.includes( parent.name ) ) ) {
- return data;
- }
- // 1. Replace the first space with a nbsp if the previous node ends with a space or there is no previous node
- // (container element boundary).
- if ( data.charAt( 0 ) == ' ' ) {
- const prevNode = this._getTouchingViewTextNode( node, false );
- const prevEndsWithSpace = prevNode && this._nodeEndsWithSpace( prevNode );
- if ( prevEndsWithSpace || !prevNode ) {
- data = '\u00A0' + data.substr( 1 );
- }
- }
- // 2. Replace the last space with nbsp if there are two spaces at the end or if the next node starts with space or there is no
- // next node (container element boundary).
- //
- // Keep in mind that Firefox prefers $nbsp; before tag, not inside it:
- //
- // Foo <span> bar</span> <-- bad.
- // Foo <span> bar</span> <-- good.
- //
- // More here: https://github.com/ckeditor/ckeditor5-engine/issues/1747.
- if ( data.charAt( data.length - 1 ) == ' ' ) {
- const nextNode = this._getTouchingViewTextNode( node, true );
- if ( data.charAt( data.length - 2 ) == ' ' || !nextNode || nextNode.data.charAt( 0 ) == ' ' ) {
- data = data.substr( 0, data.length - 1 ) + '\u00A0';
- }
- }
- // 3. Create space+nbsp pairs.
- return data.replace( / {2}/g, ' \u00A0' );
- }
- /**
- * Checks whether given node ends with a space character after changing appropriate space characters to ` `s.
- *
- * @private
- * @param {module:engine/view/text~Text} node Node to check.
- * @returns {Boolean} `true` if given `node` ends with space, `false` otherwise.
- */
- _nodeEndsWithSpace( node ) {
- if ( node.getAncestors().some( parent => this.preElements.includes( parent.name ) ) ) {
- return false;
- }
- const data = this._processDataFromViewText( node );
- return data.charAt( data.length - 1 ) == ' ';
- }
- /**
- * Takes text data from native `Text` node and processes it to a correct {@link module:engine/view/text~Text view text node} data.
- *
- * Following changes are done:
- *
- * * multiple whitespaces are replaced to a single space,
- * * space at the beginning of a text node is removed if it is the first text node in its container
- * element or if the previous text node ends with a space character,
- * * space at the end of the text node is removed if there are two spaces at the end of a node or if next node
- * starts with a space or if it is the last text node in its container
- * * nbsps are converted to spaces.
- *
- * @param {Node} node DOM text node to process.
- * @returns {String} Processed data.
- * @private
- */
- _processDataFromDomText( node ) {
- let data = node.data;
- if ( _hasDomParentOfType( node, this.preElements ) ) {
- return Object(_filler__WEBPACK_IMPORTED_MODULE_8__["getDataWithoutFiller"])( node );
- }
- // Change all consecutive whitespace characters (from the [ \n\t\r] set –
- // see https://github.com/ckeditor/ckeditor5-engine/issues/822#issuecomment-311670249) to a single space character.
- // That's how multiple whitespaces are treated when rendered, so we normalize those whitespaces.
- // We're replacing 1+ (and not 2+) to also normalize singular \n\t\r characters (#822).
- data = data.replace( /[ \n\t\r]{1,}/g, ' ' );
- const prevNode = this._getTouchingInlineDomNode( node, false );
- const nextNode = this._getTouchingInlineDomNode( node, true );
- const shouldLeftTrim = this._checkShouldLeftTrimDomText( node, prevNode );
- const shouldRightTrim = this._checkShouldRightTrimDomText( node, nextNode );
- // If the previous dom text node does not exist or it ends by whitespace character, remove space character from the beginning
- // of this text node. Such space character is treated as a whitespace.
- if ( shouldLeftTrim ) {
- data = data.replace( /^ /, '' );
- }
- // If the next text node does not exist remove space character from the end of this text node.
- if ( shouldRightTrim ) {
- data = data.replace( / $/, '' );
- }
- // At the beginning and end of a block element, Firefox inserts normal space + <br> instead of non-breaking space.
- // This means that the text node starts/end with normal space instead of non-breaking space.
- // This causes a problem because the normal space would be removed in `.replace` calls above. To prevent that,
- // the inline filler is removed only after the data is initially processed (by the `.replace` above). See ckeditor5#692.
- data = Object(_filler__WEBPACK_IMPORTED_MODULE_8__["getDataWithoutFiller"])( new Text( data ) );
- // At this point we should have removed all whitespaces from DOM text data.
- //
- // Now, We will reverse the process that happens in `_processDataFromViewText`.
- //
- // We have to change chars, that were in DOM text data because of rendering reasons, to spaces.
- // First, change all ` \u00A0` pairs (space + ) to two spaces. DOM converter changes two spaces from model/view to
- // ` \u00A0` to ensure proper rendering. Since here we convert back, we recognize those pairs and change them back to ` `.
- data = data.replace( / \u00A0/g, ' ' );
- // Then, let's change the last nbsp to a space.
- if ( /( |\u00A0)\u00A0$/.test( data ) || !nextNode || ( nextNode.data && nextNode.data.charAt( 0 ) == ' ' ) ) {
- data = data.replace( /\u00A0$/, ' ' );
- }
- // Then, change character that is at the beginning of the text node to space character.
- // We do that replacement only if this is the first node or the previous node ends on whitespace character.
- if ( shouldLeftTrim ) {
- data = data.replace( /^\u00A0/, ' ' );
- }
- // At this point, all whitespaces should be removed and all created for rendering reasons should be
- // changed to normal space. All left are inserted intentionally.
- return data;
- }
- /**
- * Helper function which checks if a DOM text node, preceded by the given `prevNode` should
- * be trimmed from the left side.
- *
- * @private
- * @param {Node} node
- * @param {Node} prevNode
- */
- _checkShouldLeftTrimDomText( node, prevNode ) {
- if ( !prevNode ) {
- return true;
- }
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_14__["isElement"])( prevNode ) ) {
- return true;
- }
- // Shouldn't left trim if previous node is a node that was encountered as a raw content node.
- if ( this._encounteredRawContentDomNodes.has( node.previousSibling ) ) {
- return false;
- }
- return /[^\S\u00A0]/.test( prevNode.data.charAt( prevNode.data.length - 1 ) );
- }
- /**
- * Helper function which checks if a DOM text node, succeeded by the given `nextNode` should
- * be trimmed from the right side.
- *
- * @private
- * @param {Node} node
- * @param {Node} nextNode
- */
- _checkShouldRightTrimDomText( node, nextNode ) {
- if ( nextNode ) {
- return false;
- }
- return !Object(_filler__WEBPACK_IMPORTED_MODULE_8__["startsWithFiller"])( node );
- }
- /**
- * Helper function. For given {@link module:engine/view/text~Text view text node}, it finds previous or next sibling
- * that is contained in the same container element. If there is no such sibling, `null` is returned.
- *
- * @private
- * @param {module:engine/view/text~Text} node Reference node.
- * @param {Boolean} getNext
- * @returns {module:engine/view/text~Text|null} Touching text node or `null` if there is no next or previous touching text node.
- */
- _getTouchingViewTextNode( node, getNext ) {
- const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_6__["default"]( {
- startPosition: getNext ? _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAfter( node ) : _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( node ),
- direction: getNext ? 'forward' : 'backward'
- } );
- for ( const value of treeWalker ) {
- // ViewContainerElement is found on a way to next ViewText node, so given `node` was first/last
- // text node in its container element.
- if ( value.item.is( 'containerElement' ) ) {
- return null;
- }
- // <br> found – it works like a block boundary, so do not scan further.
- else if ( value.item.is( 'element', 'br' ) ) {
- return null;
- }
- // Found a text node in the same container element.
- else if ( value.item.is( '$textProxy' ) ) {
- return value.item;
- }
- }
- return null;
- }
- /**
- * Helper function. For the given text node, it finds the closest touching node which is either
- * a text node or a `<br>`. The search is terminated at block element boundaries and if a matching node
- * wasn't found so far, `null` is returned.
- *
- * In the following DOM structure:
- *
- * <p>foo<b>bar</b><br>bom</p>
- *
- * * `foo` doesn't have its previous touching inline node (`null` is returned),
- * * `foo`'s next touching inline node is `bar`
- * * `bar`'s next touching inline node is `<br>`
- *
- * This method returns text nodes and `<br>` elements because these types of nodes affect how
- * spaces in the given text node need to be converted.
- *
- * @private
- * @param {Text} node
- * @param {Boolean} getNext
- * @returns {Text|Element|null}
- */
- _getTouchingInlineDomNode( node, getNext ) {
- if ( !node.parentNode ) {
- return null;
- }
- const direction = getNext ? 'nextNode' : 'previousNode';
- const document = node.ownerDocument;
- const topmostParent = Object(_ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_11__["default"])( node )[ 0 ];
- const treeWalker = document.createTreeWalker( topmostParent, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT, {
- acceptNode( node ) {
- if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_13__["default"])( node ) ) {
- return NodeFilter.FILTER_ACCEPT;
- }
- if ( node.tagName == 'BR' ) {
- return NodeFilter.FILTER_ACCEPT;
- }
- return NodeFilter.FILTER_SKIP;
- }
- } );
- treeWalker.currentNode = node;
- const touchingNode = treeWalker[ direction ]();
- if ( touchingNode !== null ) {
- const lca = Object(_ckeditor_ckeditor5_utils_src_dom_getcommonancestor__WEBPACK_IMPORTED_MODULE_12__["default"])( node, touchingNode );
- // If there is common ancestor between the text node and next/prev text node,
- // and there are no block elements on a way from the text node to that ancestor,
- // and there are no block elements on a way from next/prev text node to that ancestor...
- if (
- lca &&
- !_hasDomParentOfType( node, this.blockElements, lca ) &&
- !_hasDomParentOfType( touchingNode, this.blockElements, lca )
- ) {
- // Then they are in the same container element.
- return touchingNode;
- }
- }
- return null;
- }
- }
- // Helper function.
- // Used to check if given native `Element` or `Text` node has parent with tag name from `types` array.
- //
- // @param {Node} node
- // @param {Array.<String>} types
- // @param {Boolean} [boundaryParent] Can be given if parents should be checked up to a given element (excluding that element).
- // @returns {Boolean} `true` if such parent exists or `false` if it does not.
- function _hasDomParentOfType( node, types, boundaryParent ) {
- let parents = Object(_ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_11__["default"])( node );
- if ( boundaryParent ) {
- parents = parents.slice( parents.indexOf( boundaryParent ) + 1 );
- }
- return parents.some( parent => parent.tagName && types.includes( parent.tagName.toLowerCase() ) );
- }
- // A helper that executes given callback for each DOM node's ancestor, starting from the given node
- // and ending in document#documentElement.
- //
- // @param {Node} node
- // @param {Function} callback A callback to be executed for each ancestor.
- function forEachDomNodeAncestor( node, callback ) {
- while ( node && node != _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__["default"].document ) {
- callback( node );
- node = node.parentNode;
- }
- }
- // Checks if given node is a nbsp block filler.
- //
- // A is a block filler only if it is a single child of a block element.
- //
- // @param {Node} domNode DOM node.
- // @returns {Boolean}
- function isNbspBlockFiller( domNode, blockElements ) {
- const isNBSP = domNode.isEqualNode( NBSP_FILLER_REF );
- return isNBSP && hasBlockParent( domNode, blockElements ) && domNode.parentNode.childNodes.length === 1;
- }
- // Checks if domNode has block parent.
- //
- // @param {Node} domNode DOM node.
- // @returns {Boolean}
- function hasBlockParent( domNode, blockElements ) {
- const parent = domNode.parentNode;
- return parent && parent.tagName && blockElements.includes( parent.tagName.toLowerCase() );
- }
- /**
- * Enum representing the type of the block filler.
- *
- * Possible values:
- *
- * * `br` – For the `<br data-cke-filler="true">` block filler used in the editing view.
- * * `nbsp` – For the ` ` block fillers used in the data.
- * * `markedNbsp` – For the ` ` block fillers wrapped in a `<span>` element: `<span data-cke-filler="true"> </span>`
- * used in the data.
- *
- * @typedef {String} module:engine/view/filler~BlockFillerMode
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DowncastWriter; });
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
- /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
- /* harmony import */ var _containerelement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./containerelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js");
- /* harmony import */ var _attributeelement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./attributeelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js");
- /* harmony import */ var _emptyelement__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./emptyelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js");
- /* harmony import */ var _uielement__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./uielement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js");
- /* harmony import */ var _rawelement__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./rawelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
- /* harmony import */ var _editableelement__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./editableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module module:engine/view/downcastwriter
- */
- /**
- * View downcast writer.
- *
- * It provides a set of methods used to manipulate view nodes.
- *
- * Do not create an instance of this writer manually. To modify a view structure, use
- * the {@link module:engine/view/view~View#change `View#change()`} block.
- *
- * The `DowncastWriter` is designed to work with semantic views which are the views that were/are being downcasted from the model.
- * To work with ordinary views (e.g. parsed from a pasted content) use the
- * {@link module:engine/view/upcastwriter~UpcastWriter upcast writer}.
- *
- * Read more about changing the view in the {@glink framework/guides/architecture/editing-engine#changing-the-view Changing the view}
- * section of the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide.
- */
- class DowncastWriter {
- /**
- * @param {module:engine/view/document~Document} document The view document instance.
- */
- constructor( document ) {
- /**
- * The view document instance in which this writer operates.
- *
- * @readonly
- * @type {module:engine/view/document~Document}
- */
- this.document = document;
- /**
- * Holds references to the attribute groups that share the same {@link module:engine/view/attributeelement~AttributeElement#id id}.
- * The keys are `id`s, the values are `Set`s holding {@link module:engine/view/attributeelement~AttributeElement}s.
- *
- * @private
- * @type {Map.<String,Set>}
- */
- this._cloneGroups = new Map();
- }
- /**
- * Sets {@link module:engine/view/documentselection~DocumentSelection selection's} ranges and direction to the
- * specified location based on the given {@link module:engine/view/selection~Selectable selectable}.
- *
- * Usage:
- *
- * // Sets selection to the given range.
- * const range = writer.createRange( start, end );
- * writer.setSelection( range );
- *
- * // Sets backward selection to the given range.
- * const range = writer.createRange( start, end );
- * writer.setSelection( range );
- *
- * // Sets selection to given ranges.
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
- * writer.setSelection( range );
- *
- * // Sets selection to the other selection.
- * const otherSelection = writer.createSelection();
- * writer.setSelection( otherSelection );
- *
- * // Sets collapsed selection at the given position.
- * const position = writer.createPositionFromPath( root, path );
- * writer.setSelection( position );
- *
- * // Sets collapsed selection at the position of given item and offset.
- * const paragraph = writer.createContainerElement( 'p' );
- * writer.setSelection( paragraph, offset );
- *
- * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
- * that element and ends after the last child of that element.
- *
- * writer.setSelection( paragraph, 'in' );
- *
- * Creates a range on the {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
- *
- * writer.setSelection( paragraph, 'on' );
- *
- * // Removes all ranges.
- * writer.setSelection( null );
- *
- * `DowncastWriter#setSelection()` allow passing additional options (`backward`, `fake` and `label`) as the last argument.
- *
- * // Sets selection as backward.
- * writer.setSelection( range, { backward: true } );
- *
- * // Sets selection as fake.
- * // Fake selection does not render as browser native selection over selected elements and is hidden to the user.
- * // This way, no native selection UI artifacts are displayed to the user and selection over elements can be
- * // represented in other way, for example by applying proper CSS class.
- * writer.setSelection( range, { fake: true } );
- *
- * // Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
- * // (and be properly handled by screen readers).
- * writer.setSelection( range, { fake: true, label: 'foo' } );
- *
- * @param {module:engine/view/selection~Selectable} selectable
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
- * @param {String} [options.label] Label for the fake selection.
- */
- setSelection( selectable, placeOrOffset, options ) {
- this.document.selection._setTo( selectable, placeOrOffset, options );
- }
- /**
- * Moves {@link module:engine/view/documentselection~DocumentSelection#focus selection's focus} to the specified location.
- *
- * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
- * parameters.
- *
- * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * first parameter is a {@link module:engine/view/item~Item view item}.
- */
- setSelectionFocus( itemOrPosition, offset ) {
- this.document.selection._setFocus( itemOrPosition, offset );
- }
- /**
- * Creates a new {@link module:engine/view/documentfragment~DocumentFragment} instance.
- *
- * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
- * A list of nodes to be inserted into the created document fragment.
- * @returns {module:engine/view/documentfragment~DocumentFragment} The created document fragment.
- */
- createDocumentFragment( children ) {
- return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]( this.document, children );
- }
- /**
- * Creates a new {@link module:engine/view/text~Text text node}.
- *
- * writer.createText( 'foo' );
- *
- * @param {String} data The text's data.
- * @returns {module:engine/view/text~Text} The created text node.
- */
- createText( data ) {
- return new _text__WEBPACK_IMPORTED_MODULE_11__["default"]( this.document, data );
- }
- /**
- * Creates a new {@link module:engine/view/attributeelement~AttributeElement}.
- *
- * writer.createAttributeElement( 'strong' );
- * writer.createAttributeElement( 'a', { href: 'foo.bar' } );
- *
- * // Make `<a>` element contain other attributes element so the `<a>` element is not broken.
- * writer.createAttributeElement( 'a', { href: 'foo.bar' }, { priority: 5 } );
- *
- * // Set `id` of a marker element so it is not joined or merged with "normal" elements.
- * writer.createAttributeElement( 'span', { class: 'my-marker' }, { id: 'marker:my' } );
- *
- * **Note:** By default an `AttributeElement` is split by a
- * {@link module:engine/view/containerelement~ContainerElement `ContainerElement`} but this behavior can be modified
- * with `isAllowedInsideAttributeElement` option set while {@link #createContainerElement creating the element}.
- *
- * @param {String} name Name of the element.
- * @param {Object} [attributes] Element's attributes.
- * @param {Object} [options] Element's options.
- * @param {Number} [options.priority] Element's {@link module:engine/view/attributeelement~AttributeElement#priority priority}.
- * @param {Number|String} [options.id] Element's {@link module:engine/view/attributeelement~AttributeElement#id id}.
- * @returns {module:engine/view/attributeelement~AttributeElement} Created element.
- */
- createAttributeElement( name, attributes, options = {} ) {
- const attributeElement = new _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"]( this.document, name, attributes );
- if ( typeof options.priority === 'number' ) {
- attributeElement._priority = options.priority;
- }
- if ( options.id ) {
- attributeElement._id = options.id;
- }
- return attributeElement;
- }
- /**
- * Creates a new {@link module:engine/view/containerelement~ContainerElement}.
- *
- * writer.createContainerElement( 'p' );
- *
- * // Create element with custom attributes.
- * writer.createContainerElement( 'div', { id: 'foo-bar', 'data-baz': '123' } );
- *
- * // Create element with custom styles.
- * writer.createContainerElement( 'p', { style: 'font-weight: bold; padding-bottom: 10px' } );
- *
- * // Create element with custom classes.
- * writer.createContainerElement( 'p', { class: 'foo bar baz' } );
- *
- * @param {String} name Name of the element.
- * @param {Object} [attributes] Elements attributes.
- * @param {Object} [options] Element's options.
- * @param {Boolean} [options.isAllowedInsideAttributeElement=false] Whether an element is
- * {@link module:engine/view/element~Element#isAllowedInsideAttributeElement allowed inside an AttributeElement} and can be wrapped
- * with {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
- * @returns {module:engine/view/containerelement~ContainerElement} Created element.
- */
- createContainerElement( name, attributes, options = {} ) {
- const containerElement = new _containerelement__WEBPACK_IMPORTED_MODULE_3__["default"]( this.document, name, attributes );
- if ( options.isAllowedInsideAttributeElement !== undefined ) {
- containerElement._isAllowedInsideAttributeElement = options.isAllowedInsideAttributeElement;
- }
- return containerElement;
- }
- /**
- * Creates a new {@link module:engine/view/editableelement~EditableElement}.
- *
- * writer.createEditableElement( 'div' );
- * writer.createEditableElement( 'div', { id: 'foo-1234' } );
- *
- * Note: The editable element is to be used in the editing pipeline. Usually, together with
- * {@link module:widget/utils~toWidgetEditable `toWidgetEditable()`}.
- *
- * @param {String} name Name of the element.
- * @param {Object} [attributes] Elements attributes.
- * @returns {module:engine/view/editableelement~EditableElement} Created element.
- */
- createEditableElement( name, attributes ) {
- const editableElement = new _editableelement__WEBPACK_IMPORTED_MODULE_12__["default"]( this.document, name, attributes );
- editableElement._document = this.document;
- return editableElement;
- }
- /**
- * Creates a new {@link module:engine/view/emptyelement~EmptyElement}.
- *
- * writer.createEmptyElement( 'img' );
- * writer.createEmptyElement( 'img', { id: 'foo-1234' } );
- *
- * @param {String} name Name of the element.
- * @param {Object} [attributes] Elements attributes.
- * @param {Object} [options] Element's options.
- * @param {Boolean} [options.isAllowedInsideAttributeElement=true] Whether an element is
- * {@link module:engine/view/element~Element#isAllowedInsideAttributeElement allowed inside an AttributeElement} and can be wrapped
- * with {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
- * @returns {module:engine/view/emptyelement~EmptyElement} Created element.
- */
- createEmptyElement( name, attributes, options = {} ) {
- const emptyElement = new _emptyelement__WEBPACK_IMPORTED_MODULE_5__["default"]( this.document, name, attributes );
- if ( options.isAllowedInsideAttributeElement !== undefined ) {
- emptyElement._isAllowedInsideAttributeElement = options.isAllowedInsideAttributeElement;
- }
- return emptyElement;
- }
- /**
- * Creates a new {@link module:engine/view/uielement~UIElement}.
- *
- * writer.createUIElement( 'span' );
- * writer.createUIElement( 'span', { id: 'foo-1234' } );
- *
- * A custom render function can be provided as the third parameter:
- *
- * writer.createUIElement( 'span', null, function( domDocument ) {
- * const domElement = this.toDomElement( domDocument );
- * domElement.innerHTML = '<b>this is ui element</b>';
- *
- * return domElement;
- * } );
- *
- * Unlike {@link #createRawElement raw elements}, UI elements are by no means editor content, for instance,
- * they are ignored by the editor selection system.
- *
- * You should not use UI elements as data containers. Check out {@link #createRawElement} instead.
- *
- * @param {String} name The name of the element.
- * @param {Object} [attributes] Element attributes.
- * @param {Function} [renderFunction] A custom render function.
- * @param {Object} [options] Element's options.
- * @param {Boolean} [options.isAllowedInsideAttributeElement=true] Whether an element is
- * {@link module:engine/view/element~Element#isAllowedInsideAttributeElement allowed inside an AttributeElement} and can be wrapped
- * with {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
- * @returns {module:engine/view/uielement~UIElement} The created element.
- */
- createUIElement( name, attributes, renderFunction, options = {} ) {
- const uiElement = new _uielement__WEBPACK_IMPORTED_MODULE_6__["default"]( this.document, name, attributes );
- if ( renderFunction ) {
- uiElement.render = renderFunction;
- }
- if ( options.isAllowedInsideAttributeElement !== undefined ) {
- uiElement._isAllowedInsideAttributeElement = options.isAllowedInsideAttributeElement;
- }
- return uiElement;
- }
- /**
- * Creates a new {@link module:engine/view/rawelement~RawElement}.
- *
- * writer.createRawElement( 'span', { id: 'foo-1234' }, function( domElement ) {
- * domElement.innerHTML = '<b>This is the raw content of the raw element.</b>';
- * } );
- *
- * Raw elements work as data containers ("wrappers", "sandboxes") but their children are not managed or
- * even recognized by the editor. This encapsulation allows integrations to maintain custom DOM structures
- * in the editor content without, for instance, worrying about compatibility with other editor features.
- * Raw elements are a perfect tool for integration with external frameworks and data sources.
- *
- * Unlike {@link #createUIElement UI elements}, raw elements act like "real" editor content (similar to
- * {@link module:engine/view/containerelement~ContainerElement} or {@link module:engine/view/emptyelement~EmptyElement}),
- * and they are considered by the editor selection.
- *
- * You should not use raw elements to render the UI in the editor content. Check out {@link #createUIElement `#createUIElement()`}
- * instead.
- *
- * @param {String} name The name of the element.
- * @param {Object} [attributes] Element attributes.
- * @param {Function} [renderFunction] A custom render function.
- * @param {Object} [options] Element's options.
- * @param {Boolean} [options.isAllowedInsideAttributeElement=true] Whether an element is
- * {@link module:engine/view/element~Element#isAllowedInsideAttributeElement allowed inside an AttributeElement} and can be wrapped
- * with {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
- * @returns {module:engine/view/rawelement~RawElement} The created element.
- */
- createRawElement( name, attributes, renderFunction, options = {} ) {
- const rawElement = new _rawelement__WEBPACK_IMPORTED_MODULE_7__["default"]( this.document, name, attributes );
- rawElement.render = renderFunction || ( () => {} );
- if ( options.isAllowedInsideAttributeElement !== undefined ) {
- rawElement._isAllowedInsideAttributeElement = options.isAllowedInsideAttributeElement;
- }
- return rawElement;
- }
- /**
- * Adds or overwrites the element's attribute with a specified key and value.
- *
- * writer.setAttribute( 'href', 'http://ckeditor.com', linkElement );
- *
- * @param {String} key The attribute key.
- * @param {String} value The attribute value.
- * @param {module:engine/view/element~Element} element
- */
- setAttribute( key, value, element ) {
- element._setAttribute( key, value );
- }
- /**
- * Removes attribute from the element.
- *
- * writer.removeAttribute( 'href', linkElement );
- *
- * @param {String} key Attribute key.
- * @param {module:engine/view/element~Element} element
- */
- removeAttribute( key, element ) {
- element._removeAttribute( key );
- }
- /**
- * Adds specified class to the element.
- *
- * writer.addClass( 'foo', linkElement );
- * writer.addClass( [ 'foo', 'bar' ], linkElement );
- *
- * @param {Array.<String>|String} className
- * @param {module:engine/view/element~Element} element
- */
- addClass( className, element ) {
- element._addClass( className );
- }
- /**
- * Removes specified class from the element.
- *
- * writer.removeClass( 'foo', linkElement );
- * writer.removeClass( [ 'foo', 'bar' ], linkElement );
- *
- * @param {Array.<String>|String} className
- * @param {module:engine/view/element~Element} element
- */
- removeClass( className, element ) {
- element._removeClass( className );
- }
- /**
- * Adds style to the element.
- *
- * writer.setStyle( 'color', 'red', element );
- * writer.setStyle( {
- * color: 'red',
- * position: 'fixed'
- * }, element );
- *
- * **Note**: The passed style can be normalized if
- * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
- * See {@link module:engine/view/stylesmap~StylesMap#set `StylesMap#set()`} for details.
- *
- * @param {String|Object} property Property name or object with key - value pairs.
- * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.
- * @param {module:engine/view/element~Element} element Element to set styles on.
- */
- setStyle( property, value, element ) {
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_13__["isPlainObject"])( property ) && element === undefined ) {
- element = value;
- }
- element._setStyle( property, value );
- }
- /**
- * Removes specified style from the element.
- *
- * writer.removeStyle( 'color', element ); // Removes 'color' style.
- * writer.removeStyle( [ 'color', 'border-top' ], element ); // Removes both 'color' and 'border-top' styles.
- *
- * **Note**: This method can work with normalized style names if
- * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
- * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.
- *
- * @param {Array.<String>|String} property
- * @param {module:engine/view/element~Element} element
- */
- removeStyle( property, element ) {
- element._removeStyle( property );
- }
- /**
- * Sets a custom property on element. Unlike attributes, custom properties are not rendered to the DOM,
- * so they can be used to add special data to elements.
- *
- * @param {String|Symbol} key
- * @param {*} value
- * @param {module:engine/view/element~Element} element
- */
- setCustomProperty( key, value, element ) {
- element._setCustomProperty( key, value );
- }
- /**
- * Removes a custom property stored under the given key.
- *
- * @param {String|Symbol} key
- * @param {module:engine/view/element~Element} element
- * @returns {Boolean} Returns true if property was removed.
- */
- removeCustomProperty( key, element ) {
- return element._removeCustomProperty( key );
- }
- /**
- * Breaks attribute elements at the provided position or at the boundaries of a provided range. It breaks attribute elements
- * up to their first ancestor that is a container element.
- *
- * In following examples `<p>` is a container, `<b>` and `<u>` are attribute elements:
- *
- * <p>foo<b><u>bar{}</u></b></p> -> <p>foo<b><u>bar</u></b>[]</p>
- * <p>foo<b><u>{}bar</u></b></p> -> <p>foo{}<b><u>bar</u></b></p>
- * <p>foo<b><u>b{}ar</u></b></p> -> <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>
- * <p><b>fo{o</b><u>ba}r</u></p> -> <p><b>fo</b><b>o</b><u>ba</u><u>r</u></b></p>
- *
- * **Note:** {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.
- *
- * **Note:** The difference between {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes breakAttributes()} and
- * {@link module:engine/view/downcastwriter~DowncastWriter#breakContainer breakContainer()} is that `breakAttributes()` breaks all
- * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of a given `position`,
- * up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.
- * `breakContainer()` assumes that a given `position` is directly in the container element and breaks that container element.
- *
- * Throws the `view-writer-invalid-range-container` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
- * when the {@link module:engine/view/range~Range#start start}
- * and {@link module:engine/view/range~Range#end end} positions of a passed range are not placed inside same parent container.
- *
- * Throws the `view-writer-cannot-break-empty-element` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
- * when trying to break attributes inside an {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.
- *
- * Throws the `view-writer-cannot-break-ui-element` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
- * when trying to break attributes inside a {@link module:engine/view/uielement~UIElement UIElement}.
- *
- * @see module:engine/view/attributeelement~AttributeElement
- * @see module:engine/view/containerelement~ContainerElement
- * @see module:engine/view/downcastwriter~DowncastWriter#breakContainer
- * @param {module:engine/view/position~Position|module:engine/view/range~Range} positionOrRange The position where
- * to break attribute elements.
- * @returns {module:engine/view/position~Position|module:engine/view/range~Range} The new position or range, after breaking the
- * attribute elements.
- */
- breakAttributes( positionOrRange ) {
- if ( positionOrRange instanceof _position__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- return this._breakAttributes( positionOrRange );
- } else {
- return this._breakAttributesRange( positionOrRange );
- }
- }
- /**
- * Breaks a {@link module:engine/view/containerelement~ContainerElement container view element} into two, at the given position.
- * The position has to be directly inside the container element and cannot be in the root. It does not break the conrainer view element
- * if the position is at the beginning or at the end of its parent element.
- *
- * <p>foo^bar</p> -> <p>foo</p><p>bar</p>
- * <div><p>foo</p>^<p>bar</p></div> -> <div><p>foo</p></div><div><p>bar</p></div>
- * <p>^foobar</p> -> ^<p>foobar</p>
- * <p>foobar^</p> -> <p>foobar</p>^
- *
- * **Note:** The difference between {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes breakAttributes()} and
- * {@link module:engine/view/downcastwriter~DowncastWriter#breakContainer breakContainer()} is that `breakAttributes()` breaks all
- * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of a given `position`,
- * up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.
- * `breakContainer()` assumes that the given `position` is directly in the container element and breaks that container element.
- *
- * @see module:engine/view/attributeelement~AttributeElement
- * @see module:engine/view/containerelement~ContainerElement
- * @see module:engine/view/downcastwriter~DowncastWriter#breakAttributes
- * @param {module:engine/view/position~Position} position The position where to break the element.
- * @returns {module:engine/view/position~Position} The position between broken elements. If an element has not been broken,
- * the returned position is placed either before or after it.
- */
- breakContainer( position ) {
- const element = position.parent;
- if ( !( element.is( 'containerElement' ) ) ) {
- /**
- * Trying to break an element which is not a container element.
- *
- * @error view-writer-break-non-container-element
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-break-non-container-element', this.document );
- }
- if ( !element.parent ) {
- /**
- * Trying to break root element.
- *
- * @error view-writer-break-root
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-break-root', this.document );
- }
- if ( position.isAtStart ) {
- return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( element );
- } else if ( !position.isAtEnd ) {
- const newElement = element._clone( false );
- this.insert( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( element ), newElement );
- const sourceRange = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position, _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 'end' ) );
- const targetPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( newElement, 0 );
- this.move( sourceRange, targetPosition );
- }
- return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( element );
- }
- /**
- * Merges {@link module:engine/view/attributeelement~AttributeElement attribute elements}. It also merges text nodes if needed.
- * Only {@link module:engine/view/attributeelement~AttributeElement#isSimilar similar} attribute elements can be merged.
- *
- * In following examples `<p>` is a container and `<b>` is an attribute element:
- *
- * <p>foo[]bar</p> -> <p>foo{}bar</p>
- * <p><b>foo</b>[]<b>bar</b></p> -> <p><b>foo{}bar</b></p>
- * <p><b foo="bar">a</b>[]<b foo="baz">b</b></p> -> <p><b foo="bar">a</b>[]<b foo="baz">b</b></p>
- *
- * It will also take care about empty attributes when merging:
- *
- * <p><b>[]</b></p> -> <p>[]</p>
- * <p><b>foo</b><i>[]</i><b>bar</b></p> -> <p><b>foo{}bar</b></p>
- *
- * **Note:** Difference between {@link module:engine/view/downcastwriter~DowncastWriter#mergeAttributes mergeAttributes} and
- * {@link module:engine/view/downcastwriter~DowncastWriter#mergeContainers mergeContainers} is that `mergeAttributes` merges two
- * {@link module:engine/view/attributeelement~AttributeElement attribute elements} or {@link module:engine/view/text~Text text nodes}
- * while `mergeContainer` merges two {@link module:engine/view/containerelement~ContainerElement container elements}.
- *
- * @see module:engine/view/attributeelement~AttributeElement
- * @see module:engine/view/containerelement~ContainerElement
- * @see module:engine/view/downcastwriter~DowncastWriter#mergeContainers
- * @param {module:engine/view/position~Position} position Merge position.
- * @returns {module:engine/view/position~Position} Position after merge.
- */
- mergeAttributes( position ) {
- const positionOffset = position.offset;
- const positionParent = position.parent;
- // When inside text node - nothing to merge.
- if ( positionParent.is( '$text' ) ) {
- return position;
- }
- // When inside empty attribute - remove it.
- if ( positionParent.is( 'attributeElement' ) && positionParent.childCount === 0 ) {
- const parent = positionParent.parent;
- const offset = positionParent.index;
- positionParent._remove();
- this._removeFromClonedElementsGroup( positionParent );
- return this.mergeAttributes( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, offset ) );
- }
- const nodeBefore = positionParent.getChild( positionOffset - 1 );
- const nodeAfter = positionParent.getChild( positionOffset );
- // Position should be placed between two nodes.
- if ( !nodeBefore || !nodeAfter ) {
- return position;
- }
- // When position is between two text nodes.
- if ( nodeBefore.is( '$text' ) && nodeAfter.is( '$text' ) ) {
- return mergeTextNodes( nodeBefore, nodeAfter );
- }
- // When position is between two same attribute elements.
- else if ( nodeBefore.is( 'attributeElement' ) && nodeAfter.is( 'attributeElement' ) && nodeBefore.isSimilar( nodeAfter ) ) {
- // Move all children nodes from node placed after selection and remove that node.
- const count = nodeBefore.childCount;
- nodeBefore._appendChild( nodeAfter.getChildren() );
- nodeAfter._remove();
- this._removeFromClonedElementsGroup( nodeAfter );
- // New position is located inside the first node, before new nodes.
- // Call this method recursively to merge again if needed.
- return this.mergeAttributes( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeBefore, count ) );
- }
- return position;
- }
- /**
- * Merges two {@link module:engine/view/containerelement~ContainerElement container elements} that are before and after given position.
- * Precisely, the element after the position is removed and it's contents are moved to element before the position.
- *
- * <p>foo</p>^<p>bar</p> -> <p>foo^bar</p>
- * <div>foo</div>^<p>bar</p> -> <div>foo^bar</div>
- *
- * **Note:** Difference between {@link module:engine/view/downcastwriter~DowncastWriter#mergeAttributes mergeAttributes} and
- * {@link module:engine/view/downcastwriter~DowncastWriter#mergeContainers mergeContainers} is that `mergeAttributes` merges two
- * {@link module:engine/view/attributeelement~AttributeElement attribute elements} or {@link module:engine/view/text~Text text nodes}
- * while `mergeContainer` merges two {@link module:engine/view/containerelement~ContainerElement container elements}.
- *
- * @see module:engine/view/attributeelement~AttributeElement
- * @see module:engine/view/containerelement~ContainerElement
- * @see module:engine/view/downcastwriter~DowncastWriter#mergeAttributes
- * @param {module:engine/view/position~Position} position Merge position.
- * @returns {module:engine/view/position~Position} Position after merge.
- */
- mergeContainers( position ) {
- const prev = position.nodeBefore;
- const next = position.nodeAfter;
- if ( !prev || !next || !prev.is( 'containerElement' ) || !next.is( 'containerElement' ) ) {
- /**
- * Element before and after given position cannot be merged.
- *
- * @error view-writer-merge-containers-invalid-position
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-merge-containers-invalid-position', this.document );
- }
- const lastChild = prev.getChild( prev.childCount - 1 );
- const newPosition = lastChild instanceof _text__WEBPACK_IMPORTED_MODULE_11__["default"] ? _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( lastChild, 'end' ) : _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( prev, 'end' );
- this.move( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( next ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( prev, 'end' ) );
- this.remove( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( next ) );
- return newPosition;
- }
- /**
- * Inserts a node or nodes at specified position. Takes care about breaking attributes before insertion
- * and merging them afterwards.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert
- * contains instances that are not {@link module:engine/view/text~Text Texts},
- * {@link module:engine/view/attributeelement~AttributeElement AttributeElements},
- * {@link module:engine/view/containerelement~ContainerElement ContainerElements},
- * {@link module:engine/view/emptyelement~EmptyElement EmptyElements},
- * {@link module:engine/view/rawelement~RawElement RawElements} or
- * {@link module:engine/view/uielement~UIElement UIElements}.
- *
- * @param {module:engine/view/position~Position} position Insertion position.
- * @param {module:engine/view/text~Text|module:engine/view/attributeelement~AttributeElement|
- * module:engine/view/containerelement~ContainerElement|module:engine/view/emptyelement~EmptyElement|
- * module:engine/view/rawelement~RawElement|module:engine/view/uielement~UIElement|
- * Iterable.<module:engine/view/text~Text|
- * module:engine/view/attributeelement~AttributeElement|module:engine/view/containerelement~ContainerElement|
- * module:engine/view/emptyelement~EmptyElement|module:engine/view/rawelement~RawElement|
- * module:engine/view/uielement~UIElement>} nodes Node or nodes to insert.
- * @returns {module:engine/view/range~Range} Range around inserted nodes.
- */
- insert( position, nodes ) {
- nodes = Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_10__["default"])( nodes ) ? [ ...nodes ] : [ nodes ];
- // Check if nodes to insert are instances of AttributeElements, ContainerElements, EmptyElements, UIElements or Text.
- validateNodesToInsert( nodes, this.document );
- // Group nodes in batches of nodes that require or do not require breaking an AttributeElements.
- const nodeGroups = nodes.reduce( ( groups, node ) => {
- const lastGroup = groups[ groups.length - 1 ];
- // Break attributes on nodes that do exist in the model tree so they can have attributes, other elements
- // can't have an attribute in model and won't get wrapped with an AttributeElement while down-casted.
- const breakAttributes = !( node.is( 'uiElement' ) && node.isAllowedInsideAttributeElement );
- if ( !lastGroup || lastGroup.breakAttributes != breakAttributes ) {
- groups.push( {
- breakAttributes,
- nodes: [ node ]
- } );
- } else {
- lastGroup.nodes.push( node );
- }
- return groups;
- }, [] );
- // Insert nodes in batches.
- let start = null;
- let end = position;
- for ( const { nodes, breakAttributes } of nodeGroups ) {
- const range = this._insertNodes( end, nodes, breakAttributes );
- if ( !start ) {
- start = range.start;
- }
- end = range.end;
- }
- // When no nodes were inserted - return collapsed range.
- if ( !start ) {
- return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position );
- }
- return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
- }
- /**
- * Removes provided range from the container.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
- * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
- * same parent container.
- *
- * @param {module:engine/view/range~Range|module:engine/view/item~Item} rangeOrItem Range to remove from container
- * or an {@link module:engine/view/item~Item item} to remove. If range is provided, after removing, it will be updated
- * to a collapsed range showing the new position.
- * @returns {module:engine/view/documentfragment~DocumentFragment} Document fragment containing removed nodes.
- */
- remove( rangeOrItem ) {
- const range = rangeOrItem instanceof _range__WEBPACK_IMPORTED_MODULE_1__["default"] ? rangeOrItem : _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( rangeOrItem );
- validateRangeContainer( range, this.document );
- // If range is collapsed - nothing to remove.
- if ( range.isCollapsed ) {
- return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]( this.document );
- }
- // Break attributes at range start and end.
- const { start: breakStart, end: breakEnd } = this._breakAttributesRange( range, true );
- const parentContainer = breakStart.parent;
- const count = breakEnd.offset - breakStart.offset;
- // Remove nodes in range.
- const removed = parentContainer._removeChildren( breakStart.offset, count );
- for ( const node of removed ) {
- this._removeFromClonedElementsGroup( node );
- }
- // Merge after removing.
- const mergePosition = this.mergeAttributes( breakStart );
- range.start = mergePosition;
- range.end = mergePosition.clone();
- // Return removed nodes.
- return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]( this.document, removed );
- }
- /**
- * Removes matching elements from given range.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
- * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
- * same parent container.
- *
- * @param {module:engine/view/range~Range} range Range to clear.
- * @param {module:engine/view/element~Element} element Element to remove.
- */
- clear( range, element ) {
- validateRangeContainer( range, this.document );
- // Create walker on given range.
- // We walk backward because when we remove element during walk it modifies range end position.
- const walker = range.getWalker( {
- direction: 'backward',
- ignoreElementEnd: true
- } );
- // Let's walk.
- for ( const current of walker ) {
- const item = current.item;
- let rangeToRemove;
- // When current item matches to the given element.
- if ( item.is( 'element' ) && element.isSimilar( item ) ) {
- // Create range on this element.
- rangeToRemove = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item );
- // When range starts inside Text or TextProxy element.
- } else if ( !current.nextPosition.isAfter( range.start ) && item.is( '$textProxy' ) ) {
- // We need to check if parent of this text matches to given element.
- const parentElement = item.getAncestors().find( ancestor => {
- return ancestor.is( 'element' ) && element.isSimilar( ancestor );
- } );
- // If it is then create range inside this element.
- if ( parentElement ) {
- rangeToRemove = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( parentElement );
- }
- }
- // If we have found element to remove.
- if ( rangeToRemove ) {
- // We need to check if element range stick out of the given range and truncate if it is.
- if ( rangeToRemove.end.isAfter( range.end ) ) {
- rangeToRemove.end = range.end;
- }
- if ( rangeToRemove.start.isBefore( range.start ) ) {
- rangeToRemove.start = range.start;
- }
- // At the end we remove range with found element.
- this.remove( rangeToRemove );
- }
- }
- }
- /**
- * Moves nodes from provided range to target position.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
- * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
- * same parent container.
- *
- * @param {module:engine/view/range~Range} sourceRange Range containing nodes to move.
- * @param {module:engine/view/position~Position} targetPosition Position to insert.
- * @returns {module:engine/view/range~Range} Range in target container. Inserted nodes are placed between
- * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions.
- */
- move( sourceRange, targetPosition ) {
- let nodes;
- if ( targetPosition.isAfter( sourceRange.end ) ) {
- targetPosition = this._breakAttributes( targetPosition, true );
- const parent = targetPosition.parent;
- const countBefore = parent.childCount;
- sourceRange = this._breakAttributesRange( sourceRange, true );
- nodes = this.remove( sourceRange );
- targetPosition.offset += ( parent.childCount - countBefore );
- } else {
- nodes = this.remove( sourceRange );
- }
- return this.insert( targetPosition, nodes );
- }
- /**
- * Wraps elements within range with provided {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
- * If a collapsed range is provided, it will be wrapped only if it is equal to view selection.
- *
- * If a collapsed range was passed and is same as selection, the selection
- * will be moved to the inside of the wrapped attribute element.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-invalid-range-container`
- * when {@link module:engine/view/range~Range#start}
- * and {@link module:engine/view/range~Range#end} positions are not placed inside same parent container.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
- * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-nonselection-collapsed-range` when passed range
- * is collapsed and different than view selection.
- *
- * **Note:** Attribute elements by default can wrap {@link module:engine/view/text~Text},
- * {@link module:engine/view/emptyelement~EmptyElement}, {@link module:engine/view/uielement~UIElement},
- * {@link module:engine/view/rawelement~RawElement} and other attribute elements with higher priority. Other elements while placed
- * inside an attribute element will split it (or nest it in case of an `AttributeElement`). This behavior can be modified by changing
- * the `isAllowedInsideAttributeElement` option while using
- * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement},
- * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement},
- * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement} or
- * {@link module:engine/view/downcastwriter~DowncastWriter#createRawElement}.
- *
- * @param {module:engine/view/range~Range} range Range to wrap.
- * @param {module:engine/view/attributeelement~AttributeElement} attribute Attribute element to use as wrapper.
- * @returns {module:engine/view/range~Range} range Range after wrapping, spanning over wrapping attribute element.
- */
- wrap( range, attribute ) {
- if ( !( attribute instanceof _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"] ) ) {
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
- 'view-writer-wrap-invalid-attribute',
- this.document
- );
- }
- validateRangeContainer( range, this.document );
- if ( !range.isCollapsed ) {
- // Non-collapsed range. Wrap it with the attribute element.
- return this._wrapRange( range, attribute );
- } else {
- // Collapsed range. Wrap position.
- let position = range.start;
- if ( position.parent.is( 'element' ) && !_hasNonUiChildren( position.parent ) ) {
- position = position.getLastMatchingPosition( value => value.item.is( 'uiElement' ) );
- }
- position = this._wrapPosition( position, attribute );
- const viewSelection = this.document.selection;
- // If wrapping position is equal to view selection, move view selection inside wrapping attribute element.
- if ( viewSelection.isCollapsed && viewSelection.getFirstPosition().isEqual( range.start ) ) {
- this.setSelection( position );
- }
- return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position );
- }
- }
- /**
- * Unwraps nodes within provided range from attribute element.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
- * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
- * same parent container.
- *
- * @param {module:engine/view/range~Range} range
- * @param {module:engine/view/attributeelement~AttributeElement} attribute
- */
- unwrap( range, attribute ) {
- if ( !( attribute instanceof _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"] ) ) {
- /**
- * The `attribute` passed to {@link module:engine/view/downcastwriter~DowncastWriter#unwrap `DowncastWriter#unwrap()`}
- * must be an instance of {@link module:engine/view/attributeelement~AttributeElement `AttributeElement`}.
- *
- * @error view-writer-unwrap-invalid-attribute
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
- 'view-writer-unwrap-invalid-attribute',
- this.document
- );
- }
- validateRangeContainer( range, this.document );
- // If range is collapsed - nothing to unwrap.
- if ( range.isCollapsed ) {
- return range;
- }
- // Break attributes at range start and end.
- const { start: breakStart, end: breakEnd } = this._breakAttributesRange( range, true );
- const parentContainer = breakStart.parent;
- // Unwrap children located between break points.
- const newRange = this._unwrapChildren( parentContainer, breakStart.offset, breakEnd.offset, attribute );
- // Merge attributes at the both ends and return a new range.
- const start = this.mergeAttributes( newRange.start );
- // If start position was merged - move end position back.
- if ( !start.isEqual( newRange.start ) ) {
- newRange.end.offset--;
- }
- const end = this.mergeAttributes( newRange.end );
- return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
- }
- /**
- * Renames element by creating a copy of renamed element but with changed name and then moving contents of the
- * old element to the new one. Keep in mind that this will invalidate all {@link module:engine/view/position~Position positions} which
- * has renamed element as {@link module:engine/view/position~Position#parent a parent}.
- *
- * New element has to be created because `Element#tagName` property in DOM is readonly.
- *
- * Since this function creates a new element and removes the given one, the new element is returned to keep reference.
- *
- * @param {String} newName New name for element.
- * @param {module:engine/view/containerelement~ContainerElement} viewElement Element to be renamed.
- * @returns {module:engine/view/containerelement~ContainerElement} Element created due to rename.
- */
- rename( newName, viewElement ) {
- const newElement = new _containerelement__WEBPACK_IMPORTED_MODULE_3__["default"]( this.document, newName, viewElement.getAttributes() );
- this.insert( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( viewElement ), newElement );
- this.move( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( viewElement ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( newElement, 0 ) );
- this.remove( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( viewElement ) );
- return newElement;
- }
- /**
- * Cleans up memory by removing obsolete cloned elements group from the writer.
- *
- * Should be used whenever all {@link module:engine/view/attributeelement~AttributeElement attribute elements}
- * with the same {@link module:engine/view/attributeelement~AttributeElement#id id} are going to be removed from the view and
- * the group will no longer be needed.
- *
- * Cloned elements group are not removed automatically in case if the group is still needed after all its elements
- * were removed from the view.
- *
- * Keep in mind that group names are equal to the `id` property of the attribute element.
- *
- * @param {String} groupName Name of the group to clear.
- */
- clearClonedElementsGroup( groupName ) {
- this._cloneGroups.delete( groupName );
- }
- /**
- * Creates position at the given location. The location can be specified as:
- *
- * * a {@link module:engine/view/position~Position position},
- * * parent element and offset (offset defaults to `0`),
- * * parent element and `'end'` (sets position at the end of that element),
- * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
- *
- * This method is a shortcut to other constructors such as:
- *
- * * {@link #createPositionBefore},
- * * {@link #createPositionAfter},
- *
- * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * first parameter is a {@link module:engine/view/item~Item view item}.
- * @returns {module:engine/view/position~Position}
- */
- createPositionAt( itemOrPosition, offset ) {
- return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( itemOrPosition, offset );
- }
- /**
- * Creates a new position after given view item.
- *
- * @param {module:engine/view/item~Item} item View item after which the position should be located.
- * @returns {module:engine/view/position~Position}
- */
- createPositionAfter( item ) {
- return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( item );
- }
- /**
- * Creates a new position before given view item.
- *
- * @param {module:engine/view/item~Item} item View item before which the position should be located.
- * @returns {module:engine/view/position~Position}
- */
- createPositionBefore( item ) {
- return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item );
- }
- /**
- * Creates a range spanning from `start` position to `end` position.
- *
- * **Note:** This factory method creates its own {@link module:engine/view/position~Position} instances basing on passed values.
- *
- * @param {module:engine/view/position~Position} start Start position.
- * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
- * @returns {module:engine/view/range~Range}
- */
- createRange( start, end ) {
- return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
- }
- /**
- * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
- *
- * @param {module:engine/view/item~Item} item
- * @returns {module:engine/view/range~Range}
- */
- createRangeOn( item ) {
- return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item );
- }
- /**
- * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
- * that element and ends after the last child of that element.
- *
- * @param {module:engine/view/element~Element} element Element which is a parent for the range.
- * @returns {module:engine/view/range~Range}
- */
- createRangeIn( element ) {
- return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( element );
- }
- /**
- Creates new {@link module:engine/view/selection~Selection} instance.
- *
- * // Creates empty selection without ranges.
- * const selection = writer.createSelection();
- *
- * // Creates selection at the given range.
- * const range = writer.createRange( start, end );
- * const selection = writer.createSelection( range );
- *
- * // Creates selection at the given ranges
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
- * const selection = writer.createSelection( ranges );
- *
- * // Creates selection from the other selection.
- * const otherSelection = writer.createSelection();
- * const selection = writer.createSelection( otherSelection );
- *
- * // Creates selection from the document selection.
- * const selection = writer.createSelection( editor.editing.view.document.selection );
- *
- * // Creates selection at the given position.
- * const position = writer.createPositionFromPath( root, path );
- * const selection = writer.createSelection( position );
- *
- * // Creates collapsed selection at the position of given item and offset.
- * const paragraph = writer.createContainerElement( 'p' );
- * const selection = writer.createSelection( paragraph, offset );
- *
- * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
- * // first child of that element and ends after the last child of that element.
- * const selection = writer.createSelection( paragraph, 'in' );
- *
- * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
- * // just after the item.
- * const selection = writer.createSelection( paragraph, 'on' );
- *
- * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
- *
- * // Creates backward selection.
- * const selection = writer.createSelection( range, { backward: true } );
- *
- * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
- * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
- * represented in other way, for example by applying proper CSS class.
- *
- * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
- * (and be properly handled by screen readers).
- *
- * // Creates fake selection with label.
- * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
- *
- * @param {module:engine/view/selection~Selectable} [selectable=null]
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
- * @param {String} [options.label] Label for the fake selection.
- * @returns {module:engine/view/selection~Selection}
- */
- createSelection( selectable, placeOrOffset, options ) {
- return new _selection__WEBPACK_IMPORTED_MODULE_2__["default"]( selectable, placeOrOffset, options );
- }
- /**
- * Inserts a node or nodes at the specified position. Takes care of breaking attributes before insertion
- * and merging them afterwards if requested by the breakAttributes param.
- *
- * @private
- * @param {module:engine/view/position~Position} position Insertion position.
- * @param {module:engine/view/text~Text|module:engine/view/attributeelement~AttributeElement|
- * module:engine/view/containerelement~ContainerElement|module:engine/view/emptyelement~EmptyElement|
- * module:engine/view/rawelement~RawElement|module:engine/view/uielement~UIElement|
- * Iterable.<module:engine/view/text~Text|
- * module:engine/view/attributeelement~AttributeElement|module:engine/view/containerelement~ContainerElement|
- * module:engine/view/emptyelement~EmptyElement|module:engine/view/rawelement~RawElement|
- * module:engine/view/uielement~UIElement>} nodes Node or nodes to insert.
- * @param {Boolean} breakAttributes Whether attributes should be broken.
- * @returns {module:engine/view/range~Range} Range around inserted nodes.
- */
- _insertNodes( position, nodes, breakAttributes ) {
- let parentElement;
- // Break attributes on nodes that do exist in the model tree so they can have attributes, other elements
- // can't have an attribute in model and won't get wrapped with an AttributeElement while down-casted.
- if ( breakAttributes ) {
- parentElement = getParentContainer( position );
- } else {
- parentElement = position.parent.is( '$text' ) ? position.parent.parent : position.parent;
- }
- if ( !parentElement ) {
- /**
- * Position's parent container cannot be found.
- *
- * @error view-writer-invalid-position-container
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
- 'view-writer-invalid-position-container',
- this.document
- );
- }
- let insertionPosition;
- if ( breakAttributes ) {
- insertionPosition = this._breakAttributes( position, true );
- } else {
- insertionPosition = position.parent.is( '$text' ) ? breakTextNode( position ) : position;
- }
- const length = parentElement._insertChild( insertionPosition.offset, nodes );
- for ( const node of nodes ) {
- this._addToClonedElementsGroup( node );
- }
- const endPosition = insertionPosition.getShiftedBy( length );
- const start = this.mergeAttributes( insertionPosition );
- // If start position was merged - move end position.
- if ( !start.isEqual( insertionPosition ) ) {
- endPosition.offset--;
- }
- const end = this.mergeAttributes( endPosition );
- return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
- }
- /**
- * Wraps children with provided `wrapElement`. Only children contained in `parent` element between
- * `startOffset` and `endOffset` will be wrapped.
- *
- * @private
- * @param {module:engine/view/element~Element} parent
- * @param {Number} startOffset
- * @param {Number} endOffset
- * @param {module:engine/view/element~Element} wrapElement
- */
- _wrapChildren( parent, startOffset, endOffset, wrapElement ) {
- let i = startOffset;
- const wrapPositions = [];
- while ( i < endOffset ) {
- const child = parent.getChild( i );
- const isText = child.is( '$text' );
- const isAttribute = child.is( 'attributeElement' );
- const isAllowedInsideAttributeElement = child.isAllowedInsideAttributeElement;
- //
- // (In all examples, assume that `wrapElement` is `<span class="foo">` element.)
- //
- // Check if `wrapElement` can be joined with the wrapped element. One of requirements is having same name.
- // If possible, join elements.
- //
- // <p><span class="bar">abc</span></p> --> <p><span class="foo bar">abc</span></p>
- //
- if ( isAttribute && this._wrapAttributeElement( wrapElement, child ) ) {
- wrapPositions.push( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ) );
- }
- //
- // Wrap the child if it is not an attribute element or if it is an attribute element that should be inside
- // `wrapElement` (due to priority).
- //
- // <p>abc</p> --> <p><span class="foo">abc</span></p>
- // <p><strong>abc</strong></p> --> <p><span class="foo"><strong>abc</strong></span></p>
- else if ( isText || isAllowedInsideAttributeElement || ( isAttribute && shouldABeOutsideB( wrapElement, child ) ) ) {
- // Clone attribute.
- const newAttribute = wrapElement._clone();
- // Wrap current node with new attribute.
- child._remove();
- newAttribute._appendChild( child );
- parent._insertChild( i, newAttribute );
- this._addToClonedElementsGroup( newAttribute );
- wrapPositions.push( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ) );
- }
- //
- // If other nested attribute is found and it wasn't wrapped (see above), continue wrapping inside it.
- //
- // <p><a href="foo.html">abc</a></p> --> <p><a href="foo.html"><span class="foo">abc</span></a></p>
- //
- else if ( isAttribute ) {
- this._wrapChildren( child, 0, child.childCount, wrapElement );
- }
- i++;
- }
- // Merge at each wrap.
- let offsetChange = 0;
- for ( const position of wrapPositions ) {
- position.offset -= offsetChange;
- // Do not merge with elements outside selected children.
- if ( position.offset == startOffset ) {
- continue;
- }
- const newPosition = this.mergeAttributes( position );
- // If nodes were merged - other merge offsets will change.
- if ( !newPosition.isEqual( position ) ) {
- offsetChange++;
- endOffset--;
- }
- }
- return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromParentsAndOffsets( parent, startOffset, parent, endOffset );
- }
- /**
- * Unwraps children from provided `unwrapElement`. Only children contained in `parent` element between
- * `startOffset` and `endOffset` will be unwrapped.
- *
- * @private
- * @param {module:engine/view/element~Element} parent
- * @param {Number} startOffset
- * @param {Number} endOffset
- * @param {module:engine/view/element~Element} unwrapElement
- */
- _unwrapChildren( parent, startOffset, endOffset, unwrapElement ) {
- let i = startOffset;
- const unwrapPositions = [];
- // Iterate over each element between provided offsets inside parent.
- // We don't use tree walker or range iterator because we will be removing and merging potentially multiple nodes,
- // so it could get messy. It is safer to it manually in this case.
- while ( i < endOffset ) {
- const child = parent.getChild( i );
- // Skip all text nodes. There should be no container element's here either.
- if ( !child.is( 'attributeElement' ) ) {
- i++;
- continue;
- }
- //
- // (In all examples, assume that `unwrapElement` is `<span class="foo">` element.)
- //
- // If the child is similar to the given attribute element, unwrap it - it will be completely removed.
- //
- // <p><span class="foo">abc</span>xyz</p> --> <p>abcxyz</p>
- //
- if ( child.isSimilar( unwrapElement ) ) {
- const unwrapped = child.getChildren();
- const count = child.childCount;
- // Replace wrapper element with its children
- child._remove();
- parent._insertChild( i, unwrapped );
- this._removeFromClonedElementsGroup( child );
- // Save start and end position of moved items.
- unwrapPositions.push(
- new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ),
- new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i + count )
- );
- // Skip elements that were unwrapped. Assuming there won't be another element to unwrap in child elements.
- i += count;
- endOffset += count - 1;
- continue;
- }
- //
- // If the child is not similar but is an attribute element, try partial unwrapping - remove the same attributes/styles/classes.
- // Partial unwrapping will happen only if the elements have the same name.
- //
- // <p><span class="foo bar">abc</span>xyz</p> --> <p><span class="bar">abc</span>xyz</p>
- // <p><i class="foo">abc</i>xyz</p> --> <p><i class="foo">abc</i>xyz</p>
- //
- if ( this._unwrapAttributeElement( unwrapElement, child ) ) {
- unwrapPositions.push(
- new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ),
- new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i + 1 )
- );
- i++;
- continue;
- }
- //
- // If other nested attribute is found, look through it's children for elements to unwrap.
- //
- // <p><i><span class="foo">abc</span></i><p> --> <p><i>abc</i><p>
- //
- this._unwrapChildren( child, 0, child.childCount, unwrapElement );
- i++;
- }
- // Merge at each unwrap.
- let offsetChange = 0;
- for ( const position of unwrapPositions ) {
- position.offset -= offsetChange;
- // Do not merge with elements outside selected children.
- if ( position.offset == startOffset || position.offset == endOffset ) {
- continue;
- }
- const newPosition = this.mergeAttributes( position );
- // If nodes were merged - other merge offsets will change.
- if ( !newPosition.isEqual( position ) ) {
- offsetChange++;
- endOffset--;
- }
- }
- return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromParentsAndOffsets( parent, startOffset, parent, endOffset );
- }
- /**
- * Helper function for `view.writer.wrap`. Wraps range with provided attribute element.
- * This method will also merge newly added attribute element with its siblings whenever possible.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
- * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
- *
- * @private
- * @param {module:engine/view/range~Range} range
- * @param {module:engine/view/attributeelement~AttributeElement} attribute
- * @returns {module:engine/view/range~Range} New range after wrapping, spanning over wrapping attribute element.
- */
- _wrapRange( range, attribute ) {
- // Break attributes at range start and end.
- const { start: breakStart, end: breakEnd } = this._breakAttributesRange( range, true );
- const parentContainer = breakStart.parent;
- // Wrap all children with attribute.
- const newRange = this._wrapChildren( parentContainer, breakStart.offset, breakEnd.offset, attribute );
- // Merge attributes at the both ends and return a new range.
- const start = this.mergeAttributes( newRange.start );
- // If start position was merged - move end position back.
- if ( !start.isEqual( newRange.start ) ) {
- newRange.end.offset--;
- }
- const end = this.mergeAttributes( newRange.end );
- return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
- }
- /**
- * Helper function for {@link #wrap}. Wraps position with provided attribute element.
- * This method will also merge newly added attribute element with its siblings whenever possible.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
- * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
- *
- * @private
- * @param {module:engine/view/position~Position} position
- * @param {module:engine/view/attributeelement~AttributeElement} attribute
- * @returns {module:engine/view/position~Position} New position after wrapping.
- */
- _wrapPosition( position, attribute ) {
- // Return same position when trying to wrap with attribute similar to position parent.
- if ( attribute.isSimilar( position.parent ) ) {
- return movePositionToTextNode( position.clone() );
- }
- // When position is inside text node - break it and place new position between two text nodes.
- if ( position.parent.is( '$text' ) ) {
- position = breakTextNode( position );
- }
- // Create fake element that will represent position, and will not be merged with other attributes.
- const fakePosition = this.createAttributeElement();
- fakePosition._priority = Number.POSITIVE_INFINITY;
- fakePosition.isSimilar = () => false;
- // Insert fake element in position location.
- position.parent._insertChild( position.offset, fakePosition );
- // Range around inserted fake attribute element.
- const wrapRange = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position, position.getShiftedBy( 1 ) );
- // Wrap fake element with attribute (it will also merge if possible).
- this.wrap( wrapRange, attribute );
- // Remove fake element and place new position there.
- const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( fakePosition.parent, fakePosition.index );
- fakePosition._remove();
- // If position is placed between text nodes - merge them and return position inside.
- const nodeBefore = newPosition.nodeBefore;
- const nodeAfter = newPosition.nodeAfter;
- if ( nodeBefore instanceof _text__WEBPACK_IMPORTED_MODULE_11__["default"] && nodeAfter instanceof _text__WEBPACK_IMPORTED_MODULE_11__["default"] ) {
- return mergeTextNodes( nodeBefore, nodeAfter );
- }
- // If position is next to text node - move position inside.
- return movePositionToTextNode( newPosition );
- }
- /**
- * Wraps one {@link module:engine/view/attributeelement~AttributeElement AttributeElement} into another by
- * merging them if possible. When merging is possible - all attributes, styles and classes are moved from wrapper
- * element to element being wrapped.
- *
- * @private
- * @param {module:engine/view/attributeelement~AttributeElement} wrapper Wrapper AttributeElement.
- * @param {module:engine/view/attributeelement~AttributeElement} toWrap AttributeElement to wrap using wrapper element.
- * @returns {Boolean} Returns `true` if elements are merged.
- */
- _wrapAttributeElement( wrapper, toWrap ) {
- if ( !canBeJoined( wrapper, toWrap ) ) {
- return false;
- }
- // Can't merge if name or priority differs.
- if ( wrapper.name !== toWrap.name || wrapper.priority !== toWrap.priority ) {
- return false;
- }
- // Check if attributes can be merged.
- for ( const key of wrapper.getAttributeKeys() ) {
- // Classes and styles should be checked separately.
- if ( key === 'class' || key === 'style' ) {
- continue;
- }
- // If some attributes are different we cannot wrap.
- if ( toWrap.hasAttribute( key ) && toWrap.getAttribute( key ) !== wrapper.getAttribute( key ) ) {
- return false;
- }
- }
- // Check if styles can be merged.
- for ( const key of wrapper.getStyleNames() ) {
- if ( toWrap.hasStyle( key ) && toWrap.getStyle( key ) !== wrapper.getStyle( key ) ) {
- return false;
- }
- }
- // Move all attributes/classes/styles from wrapper to wrapped AttributeElement.
- for ( const key of wrapper.getAttributeKeys() ) {
- // Classes and styles should be checked separately.
- if ( key === 'class' || key === 'style' ) {
- continue;
- }
- // Move only these attributes that are not present - other are similar.
- if ( !toWrap.hasAttribute( key ) ) {
- this.setAttribute( key, wrapper.getAttribute( key ), toWrap );
- }
- }
- for ( const key of wrapper.getStyleNames() ) {
- if ( !toWrap.hasStyle( key ) ) {
- this.setStyle( key, wrapper.getStyle( key ), toWrap );
- }
- }
- for ( const key of wrapper.getClassNames() ) {
- if ( !toWrap.hasClass( key ) ) {
- this.addClass( key, toWrap );
- }
- }
- return true;
- }
- /**
- * Unwraps {@link module:engine/view/attributeelement~AttributeElement AttributeElement} from another by removing
- * corresponding attributes, classes and styles. All attributes, classes and styles from wrapper should be present
- * inside element being unwrapped.
- *
- * @private
- * @param {module:engine/view/attributeelement~AttributeElement} wrapper Wrapper AttributeElement.
- * @param {module:engine/view/attributeelement~AttributeElement} toUnwrap AttributeElement to unwrap using wrapper element.
- * @returns {Boolean} Returns `true` if elements are unwrapped.
- **/
- _unwrapAttributeElement( wrapper, toUnwrap ) {
- if ( !canBeJoined( wrapper, toUnwrap ) ) {
- return false;
- }
- // Can't unwrap if name or priority differs.
- if ( wrapper.name !== toUnwrap.name || wrapper.priority !== toUnwrap.priority ) {
- return false;
- }
- // Check if AttributeElement has all wrapper attributes.
- for ( const key of wrapper.getAttributeKeys() ) {
- // Classes and styles should be checked separately.
- if ( key === 'class' || key === 'style' ) {
- continue;
- }
- // If some attributes are missing or different we cannot unwrap.
- if ( !toUnwrap.hasAttribute( key ) || toUnwrap.getAttribute( key ) !== wrapper.getAttribute( key ) ) {
- return false;
- }
- }
- // Check if AttributeElement has all wrapper classes.
- if ( !toUnwrap.hasClass( ...wrapper.getClassNames() ) ) {
- return false;
- }
- // Check if AttributeElement has all wrapper styles.
- for ( const key of wrapper.getStyleNames() ) {
- // If some styles are missing or different we cannot unwrap.
- if ( !toUnwrap.hasStyle( key ) || toUnwrap.getStyle( key ) !== wrapper.getStyle( key ) ) {
- return false;
- }
- }
- // Remove all wrapper's attributes from unwrapped element.
- for ( const key of wrapper.getAttributeKeys() ) {
- // Classes and styles should be checked separately.
- if ( key === 'class' || key === 'style' ) {
- continue;
- }
- this.removeAttribute( key, toUnwrap );
- }
- // Remove all wrapper's classes from unwrapped element.
- this.removeClass( Array.from( wrapper.getClassNames() ), toUnwrap );
- // Remove all wrapper's styles from unwrapped element.
- this.removeStyle( Array.from( wrapper.getStyleNames() ), toUnwrap );
- return true;
- }
- /**
- * Helper function used by other `DowncastWriter` methods. Breaks attribute elements at the boundaries of given range.
- *
- * @private
- * @param {module:engine/view/range~Range} range Range which `start` and `end` positions will be used to break attributes.
- * @param {Boolean} [forceSplitText=false] If set to `true`, will break text nodes even if they are directly in container element.
- * This behavior will result in incorrect view state, but is needed by other view writing methods which then fixes view state.
- * @returns {module:engine/view/range~Range} New range with located at break positions.
- */
- _breakAttributesRange( range, forceSplitText = false ) {
- const rangeStart = range.start;
- const rangeEnd = range.end;
- validateRangeContainer( range, this.document );
- // Break at the collapsed position. Return new collapsed range.
- if ( range.isCollapsed ) {
- const position = this._breakAttributes( range.start, forceSplitText );
- return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position, position );
- }
- const breakEnd = this._breakAttributes( rangeEnd, forceSplitText );
- const count = breakEnd.parent.childCount;
- const breakStart = this._breakAttributes( rangeStart, forceSplitText );
- // Calculate new break end offset.
- breakEnd.offset += breakEnd.parent.childCount - count;
- return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( breakStart, breakEnd );
- }
- /**
- * Helper function used by other `DowncastWriter` methods. Breaks attribute elements at given position.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-empty-element` when break position
- * is placed inside {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-ui-element` when break position
- * is placed inside {@link module:engine/view/uielement~UIElement UIElement}.
- *
- * @private
- * @param {module:engine/view/position~Position} position Position where to break attributes.
- * @param {Boolean} [forceSplitText=false] If set to `true`, will break text nodes even if they are directly in container element.
- * This behavior will result in incorrect view state, but is needed by other view writing methods which then fixes view state.
- * @returns {module:engine/view/position~Position} New position after breaking the attributes.
- */
- _breakAttributes( position, forceSplitText = false ) {
- const positionOffset = position.offset;
- const positionParent = position.parent;
- // If position is placed inside EmptyElement - throw an exception as we cannot break inside.
- if ( position.parent.is( 'emptyElement' ) ) {
- /**
- * Cannot break an `EmptyElement` instance.
- *
- * This error is thrown if
- * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}
- * was executed in an incorrect position.
- *
- * @error view-writer-cannot-break-empty-element
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-cannot-break-empty-element', this.document );
- }
- // If position is placed inside UIElement - throw an exception as we cannot break inside.
- if ( position.parent.is( 'uiElement' ) ) {
- /**
- * Cannot break a `UIElement` instance.
- *
- * This error is thrown if
- * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}
- * was executed in an incorrect position.
- *
- * @error view-writer-cannot-break-ui-element
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-cannot-break-ui-element', this.document );
- }
- // If position is placed inside RawElement - throw an exception as we cannot break inside.
- if ( position.parent.is( 'rawElement' ) ) {
- /**
- * Cannot break a `RawElement` instance.
- *
- * This error is thrown if
- * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}
- * was executed in an incorrect position.
- *
- * @error view-writer-cannot-break-raw-element
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-cannot-break-raw-element', this.document );
- }
- // There are no attributes to break and text nodes breaking is not forced.
- if ( !forceSplitText && positionParent.is( '$text' ) && isContainerOrFragment( positionParent.parent ) ) {
- return position.clone();
- }
- // Position's parent is container, so no attributes to break.
- if ( isContainerOrFragment( positionParent ) ) {
- return position.clone();
- }
- // Break text and start again in new position.
- if ( positionParent.is( '$text' ) ) {
- return this._breakAttributes( breakTextNode( position ), forceSplitText );
- }
- const length = positionParent.childCount;
- // <p>foo<b><u>bar{}</u></b></p>
- // <p>foo<b><u>bar</u>[]</b></p>
- // <p>foo<b><u>bar</u></b>[]</p>
- if ( positionOffset == length ) {
- const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( positionParent.parent, positionParent.index + 1 );
- return this._breakAttributes( newPosition, forceSplitText );
- } else {
- // <p>foo<b><u>{}bar</u></b></p>
- // <p>foo<b>[]<u>bar</u></b></p>
- // <p>foo{}<b><u>bar</u></b></p>
- if ( positionOffset === 0 ) {
- const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( positionParent.parent, positionParent.index );
- return this._breakAttributes( newPosition, forceSplitText );
- }
- // <p>foo<b><u>b{}ar</u></b></p>
- // <p>foo<b><u>b[]ar</u></b></p>
- // <p>foo<b><u>b</u>[]<u>ar</u></b></p>
- // <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>
- else {
- const offsetAfter = positionParent.index + 1;
- // Break element.
- const clonedNode = positionParent._clone();
- // Insert cloned node to position's parent node.
- positionParent.parent._insertChild( offsetAfter, clonedNode );
- this._addToClonedElementsGroup( clonedNode );
- // Get nodes to move.
- const count = positionParent.childCount - positionOffset;
- const nodesToMove = positionParent._removeChildren( positionOffset, count );
- // Move nodes to cloned node.
- clonedNode._appendChild( nodesToMove );
- // Create new position to work on.
- const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( positionParent.parent, offsetAfter );
- return this._breakAttributes( newPosition, forceSplitText );
- }
- }
- }
- /**
- * Stores the information that an {@link module:engine/view/attributeelement~AttributeElement attribute element} was
- * added to the tree. Saves the reference to the group in the given element and updates the group, so other elements
- * from the group now keep a reference to the given attribute element.
- *
- * The clones group can be obtained using {@link module:engine/view/attributeelement~AttributeElement#getElementsWithSameId}.
- *
- * Does nothing if added element has no {@link module:engine/view/attributeelement~AttributeElement#id id}.
- *
- * @private
- * @param {module:engine/view/attributeelement~AttributeElement} element Attribute element to save.
- */
- _addToClonedElementsGroup( element ) {
- // Add only if the element is in document tree.
- if ( !element.root.is( 'rootElement' ) ) {
- return;
- }
- // Traverse the element's children recursively to find other attribute elements that also might got inserted.
- // The loop is at the beginning so we can make fast returns later in the code.
- if ( element.is( 'element' ) ) {
- for ( const child of element.getChildren() ) {
- this._addToClonedElementsGroup( child );
- }
- }
- const id = element.id;
- if ( !id ) {
- return;
- }
- let group = this._cloneGroups.get( id );
- if ( !group ) {
- group = new Set();
- this._cloneGroups.set( id, group );
- }
- group.add( element );
- element._clonesGroup = group;
- }
- /**
- * Removes all the information about the given {@link module:engine/view/attributeelement~AttributeElement attribute element}
- * from its clones group.
- *
- * Keep in mind, that the element will still keep a reference to the group (but the group will not keep a reference to it).
- * This allows to reference the whole group even if the element was already removed from the tree.
- *
- * Does nothing if the element has no {@link module:engine/view/attributeelement~AttributeElement#id id}.
- *
- * @private
- * @param {module:engine/view/attributeelement~AttributeElement} element Attribute element to remove.
- */
- _removeFromClonedElementsGroup( element ) {
- // Traverse the element's children recursively to find other attribute elements that also got removed.
- // The loop is at the beginning so we can make fast returns later in the code.
- if ( element.is( 'element' ) ) {
- for ( const child of element.getChildren() ) {
- this._removeFromClonedElementsGroup( child );
- }
- }
- const id = element.id;
- if ( !id ) {
- return;
- }
- const group = this._cloneGroups.get( id );
- if ( !group ) {
- return;
- }
- group.delete( element );
- // Not removing group from element on purpose!
- // If other parts of code have reference to this element, they will be able to get references to other elements from the group.
- }
- }
- // Helper function for `view.writer.wrap`. Checks if given element has any children that are not ui elements.
- function _hasNonUiChildren( parent ) {
- return Array.from( parent.getChildren() ).some( child => !child.is( 'uiElement' ) );
- }
- /**
- * The `attribute` passed to {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#wrap()`}
- * must be an instance of {@link module:engine/view/attributeelement~AttributeElement `AttributeElement`}.
- *
- * @error view-writer-wrap-invalid-attribute
- */
- // Returns first parent container of specified {@link module:engine/view/position~Position Position}.
- // Position's parent node is checked as first, then next parents are checked.
- // Note that {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.
- //
- // @param {module:engine/view/position~Position} position Position used as a start point to locate parent container.
- // @returns {module:engine/view/containerelement~ContainerElement|module:engine/view/documentfragment~DocumentFragment|undefined}
- // Parent container element or `undefined` if container is not found.
- function getParentContainer( position ) {
- let parent = position.parent;
- while ( !isContainerOrFragment( parent ) ) {
- if ( !parent ) {
- return undefined;
- }
- parent = parent.parent;
- }
- return parent;
- }
- // Checks if first {@link module:engine/view/attributeelement~AttributeElement AttributeElement} provided to the function
- // can be wrapped outside second element. It is done by comparing elements'
- // {@link module:engine/view/attributeelement~AttributeElement#priority priorities}, if both have same priority
- // {@link module:engine/view/element~Element#getIdentity identities} are compared.
- //
- // @param {module:engine/view/attributeelement~AttributeElement} a
- // @param {module:engine/view/attributeelement~AttributeElement} b
- // @returns {Boolean}
- function shouldABeOutsideB( a, b ) {
- if ( a.priority < b.priority ) {
- return true;
- } else if ( a.priority > b.priority ) {
- return false;
- }
- // When priorities are equal and names are different - use identities.
- return a.getIdentity() < b.getIdentity();
- }
- // Returns new position that is moved to near text node. Returns same position if there is no text node before of after
- // specified position.
- //
- // <p>foo[]</p> -> <p>foo{}</p>
- // <p>[]foo</p> -> <p>{}foo</p>
- //
- // @param {module:engine/view/position~Position} position
- // @returns {module:engine/view/position~Position} Position located inside text node or same position if there is no text nodes
- // before or after position location.
- function movePositionToTextNode( position ) {
- const nodeBefore = position.nodeBefore;
- if ( nodeBefore && nodeBefore.is( '$text' ) ) {
- return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeBefore, nodeBefore.data.length );
- }
- const nodeAfter = position.nodeAfter;
- if ( nodeAfter && nodeAfter.is( '$text' ) ) {
- return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeAfter, 0 );
- }
- return position;
- }
- // Breaks text node into two text nodes when possible.
- //
- // <p>foo{}bar</p> -> <p>foo[]bar</p>
- // <p>{}foobar</p> -> <p>[]foobar</p>
- // <p>foobar{}</p> -> <p>foobar[]</p>
- //
- // @param {module:engine/view/position~Position} position Position that need to be placed inside text node.
- // @returns {module:engine/view/position~Position} New position after breaking text node.
- function breakTextNode( position ) {
- if ( position.offset == position.parent.data.length ) {
- return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( position.parent.parent, position.parent.index + 1 );
- }
- if ( position.offset === 0 ) {
- return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( position.parent.parent, position.parent.index );
- }
- // Get part of the text that need to be moved.
- const textToMove = position.parent.data.slice( position.offset );
- // Leave rest of the text in position's parent.
- position.parent._data = position.parent.data.slice( 0, position.offset );
- // Insert new text node after position's parent text node.
- position.parent.parent._insertChild( position.parent.index + 1, new _text__WEBPACK_IMPORTED_MODULE_11__["default"]( position.root.document, textToMove ) );
- // Return new position between two newly created text nodes.
- return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( position.parent.parent, position.parent.index + 1 );
- }
- // Merges two text nodes into first node. Removes second node and returns merge position.
- //
- // @param {module:engine/view/text~Text} t1 First text node to merge. Data from second text node will be moved at the end of
- // this text node.
- // @param {module:engine/view/text~Text} t2 Second text node to merge. This node will be removed after merging.
- // @returns {module:engine/view/position~Position} Position after merging text nodes.
- function mergeTextNodes( t1, t2 ) {
- // Merge text data into first text node and remove second one.
- const nodeBeforeLength = t1.data.length;
- t1._data += t2.data;
- t2._remove();
- return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( t1, nodeBeforeLength );
- }
- // Checks if provided nodes are valid to insert.
- //
- // Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert
- // contains instances that are not supported ones (see error description for valid ones.
- //
- // @param Iterable.<module:engine/view/text~Text|module:engine/view/element~Element> nodes
- // @param {Object} errorContext
- function validateNodesToInsert( nodes, errorContext ) {
- for ( const node of nodes ) {
- if ( !validNodesToInsert.some( ( validNode => node instanceof validNode ) ) ) { // eslint-disable-line no-use-before-define
- /**
- * One of the nodes to be inserted is of an invalid type.
- *
- * Nodes to be inserted with {@link module:engine/view/downcastwriter~DowncastWriter#insert `DowncastWriter#insert()`} should be
- * of the following types:
- *
- * * {@link module:engine/view/attributeelement~AttributeElement AttributeElement},
- * * {@link module:engine/view/containerelement~ContainerElement ContainerElement},
- * * {@link module:engine/view/emptyelement~EmptyElement EmptyElement},
- * * {@link module:engine/view/uielement~UIElement UIElement},
- * * {@link module:engine/view/rawelement~RawElement RawElement},
- * * {@link module:engine/view/text~Text Text}.
- *
- * @error view-writer-insert-invalid-node-type
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-insert-invalid-node-type', errorContext );
- }
- if ( !node.is( '$text' ) ) {
- validateNodesToInsert( node.getChildren(), errorContext );
- }
- }
- }
- const validNodesToInsert = [ _text__WEBPACK_IMPORTED_MODULE_11__["default"], _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"], _containerelement__WEBPACK_IMPORTED_MODULE_3__["default"], _emptyelement__WEBPACK_IMPORTED_MODULE_5__["default"], _rawelement__WEBPACK_IMPORTED_MODULE_7__["default"], _uielement__WEBPACK_IMPORTED_MODULE_6__["default"] ];
- // Checks if node is ContainerElement or DocumentFragment, because in most cases they should be treated the same way.
- //
- // @param {module:engine/view/node~Node} node
- // @returns {Boolean} Returns `true` if node is instance of ContainerElement or DocumentFragment.
- function isContainerOrFragment( node ) {
- return node && ( node.is( 'containerElement' ) || node.is( 'documentFragment' ) );
- }
- // Checks if {@link module:engine/view/range~Range#start range start} and {@link module:engine/view/range~Range#end range end} are placed
- // inside same {@link module:engine/view/containerelement~ContainerElement container element}.
- // Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when validation fails.
- //
- // @param {module:engine/view/range~Range} range
- // @param {Object} errorContext
- function validateRangeContainer( range, errorContext ) {
- const startContainer = getParentContainer( range.start );
- const endContainer = getParentContainer( range.end );
- if ( !startContainer || !endContainer || startContainer !== endContainer ) {
- /**
- * The container of the given range is invalid.
- *
- * This may happen if {@link module:engine/view/range~Range#start range start} and
- * {@link module:engine/view/range~Range#end range end} positions are not placed inside the same container element or
- * a parent container for these positions cannot be found.
- *
- * Methods like {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#remove()`},
- * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#clean()`},
- * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#wrap()`},
- * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#unwrap()`} need to be called
- * on a range that has its start and end positions located in the same container element. Both positions can be
- * nested within other elements (e.g. an attribute element) but the closest container ancestor must be the same.
- *
- * @error view-writer-invalid-range-container
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-invalid-range-container', errorContext );
- }
- }
- // Checks if two attribute elements can be joined together. Elements can be joined together if, and only if
- // they do not have ids specified.
- //
- // @private
- // @param {module:engine/view/element~Element} a
- // @param {module:engine/view/element~Element} b
- // @returns {Boolean}
- function canBeJoined( a, b ) {
- return a.id === null && b.id === null;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditableElement; });
- /* harmony import */ var _containerelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./containerelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/editableelement
- */
- /**
- * Editable element which can be a {@link module:engine/view/rooteditableelement~RootEditableElement root}
- * or nested editable area in the editor.
- *
- * Editable is automatically read-only when its {@link module:engine/view/document~Document Document} is read-only.
- *
- * The constructor of this class shouldn't be used directly. To create new `EditableElement` use the
- * {@link module:engine/view/downcastwriter~DowncastWriter#createEditableElement `downcastWriter#createEditableElement()`} method.
- *
- * @extends module:engine/view/containerelement~ContainerElement
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class EditableElement extends _containerelement__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an editable element.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#createEditableElement
- * @protected
- */
- constructor( document, name, attrs, children ) {
- super( document, name, attrs, children );
- /**
- * Whether the editable is in read-write or read-only mode.
- *
- * @observable
- * @member {Boolean} module:engine/view/editableelement~EditableElement#isReadOnly
- */
- this.set( 'isReadOnly', false );
- /**
- * Whether the editable is focused.
- *
- * This property updates when {@link module:engine/view/document~Document#isFocused document.isFocused} or view
- * selection is changed.
- *
- * @readonly
- * @observable
- * @member {Boolean} module:engine/view/editableelement~EditableElement#isFocused
- */
- this.set( 'isFocused', false );
- this.bind( 'isReadOnly' ).to( document );
- this.bind( 'isFocused' ).to(
- document,
- 'isFocused',
- isFocused => isFocused && document.selection.editableElement == this
- );
- // Update focus state based on selection changes.
- this.listenTo( document.selection, 'change', () => {
- this.isFocused = document.isFocused && document.selection.editableElement == this;
- } );
- }
- /**
- * Checks whether this object is of the given.
- *
- * editableElement.is( 'editableElement' ); // -> true
- * editableElement.is( 'element' ); // -> true
- * editableElement.is( 'node' ); // -> true
- * editableElement.is( 'view:editableElement' ); // -> true
- * editableElement.is( 'view:element' ); // -> true
- * editableElement.is( 'view:node' ); // -> true
- *
- * editableElement.is( 'model:element' ); // -> false
- * editableElement.is( 'documentFragment' ); // -> false
- *
- * Assuming that the object being checked is an editbale element, you can also check its
- * {@link module:engine/view/editableelement~EditableElement#name name}:
- *
- * editableElement.is( 'element', 'div' ); // -> true if this is a div element
- * editableElement.is( 'editableElement', 'div' ); // -> same as above
- * text.is( 'element', 'div' ); -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type Type to check.
- * @param {String} [name] Element name.
- * @returns {Boolean}
- */
- is( type, name = null ) {
- if ( !name ) {
- return type === 'editableElement' || type === 'view:editableElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'containerElement' || type === 'view:containerElement' ||
- type === 'element' || type === 'view:element' ||
- type === 'node' || type === 'view:node';
- } else {
- return name === this.name && (
- type === 'editableElement' || type === 'view:editableElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'containerElement' || type === 'view:containerElement' ||
- type === 'element' || type === 'view:element'
- );
- }
- }
- destroy() {
- this.stopListening();
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( EditableElement, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Element; });
- /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
- /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
- /* harmony import */ var _matcher__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
- /* harmony import */ var _stylesmap__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./stylesmap */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/element
- */
- // @if CK_DEBUG_ENGINE // const { convertMapToTags } = require( '../dev-utils/utils' );
- /**
- * View element.
- *
- * The editing engine does not define a fixed semantics of its elements (it is "DTD-free").
- * This is why the type of the {@link module:engine/view/element~Element} need to
- * be defined by the feature developer. When creating an element you should use one of the following methods:
- *
- * * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `downcastWriter#createContainerElement()`}
- * in order to create a {@link module:engine/view/containerelement~ContainerElement},
- * * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `downcastWriter#createAttributeElement()`}
- * in order to create a {@link module:engine/view/attributeelement~AttributeElement},
- * * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`}
- * in order to create a {@link module:engine/view/emptyelement~EmptyElement}.
- * * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`}
- * in order to create a {@link module:engine/view/uielement~UIElement}.
- * * {@link module:engine/view/downcastwriter~DowncastWriter#createEditableElement `downcastWriter#createEditableElement()`}
- * in order to create a {@link module:engine/view/editableelement~EditableElement}.
- *
- * Note that for view elements which are not created from the model, like elements from mutations, paste or
- * {@link module:engine/controller/datacontroller~DataController#set data.set} it is not possible to define the type of the element.
- * In such cases the {@link module:engine/view/upcastwriter~UpcastWriter#createElement `UpcastWriter#createElement()`} method
- * should be used to create generic view elements.
- *
- * @extends module:engine/view/node~Node
- */
- class Element extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates a view element.
- *
- * Attributes can be passed in various formats:
- *
- * new Element( viewDocument, 'div', { class: 'editor', contentEditable: 'true' } ); // object
- * new Element( viewDocument, 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator
- * new Element( viewDocument, 'div', mapOfAttributes ); // map
- *
- * @protected
- * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
- * @param {String} name Node name.
- * @param {Object|Iterable} [attrs] Collection of attributes.
- * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
- * A list of nodes to be inserted into created element.
- */
- constructor( document, name, attrs, children ) {
- super( document );
- /**
- * Name of the element.
- *
- * @readonly
- * @member {String}
- */
- this.name = name;
- /**
- * Map of attributes, where attributes names are keys and attributes values are values.
- *
- * @protected
- * @member {Map} #_attrs
- */
- this._attrs = parseAttributes( attrs );
- /**
- * Array of child nodes.
- *
- * @protected
- * @member {Array.<module:engine/view/node~Node>}
- */
- this._children = [];
- if ( children ) {
- this._insertChild( 0, children );
- }
- /**
- * Set of classes associated with element instance.
- *
- * @protected
- * @member {Set}
- */
- this._classes = new Set();
- if ( this._attrs.has( 'class' ) ) {
- // Remove class attribute and handle it by class set.
- const classString = this._attrs.get( 'class' );
- parseClasses( this._classes, classString );
- this._attrs.delete( 'class' );
- }
- /**
- * Normalized styles.
- *
- * @protected
- * @member {module:engine/view/stylesmap~StylesMap} module:engine/view/element~Element#_styles
- */
- this._styles = new _stylesmap__WEBPACK_IMPORTED_MODULE_7__["default"]( this.document.stylesProcessor );
- if ( this._attrs.has( 'style' ) ) {
- // Remove style attribute and handle it by styles map.
- this._styles.setTo( this._attrs.get( 'style' ) );
- this._attrs.delete( 'style' );
- }
- /**
- * Map of custom properties.
- * Custom properties can be added to element instance, will be cloned but not rendered into DOM.
- *
- * @protected
- * @member {Map}
- */
- this._customProperties = new Map();
- /**
- * Whether an element is allowed inside an AttributeElement and can be wrapped with
- * {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
- *
- * @protected
- * @member {Boolean}
- */
- this._isAllowedInsideAttributeElement = false;
- }
- /**
- * Number of element's children.
- *
- * @readonly
- * @type {Number}
- */
- get childCount() {
- return this._children.length;
- }
- /**
- * Is `true` if there are no nodes inside this element, `false` otherwise.
- *
- * @readonly
- * @type {Boolean}
- */
- get isEmpty() {
- return this._children.length === 0;
- }
- /**
- * Whether the element is allowed inside an AttributeElement and can be wrapped with
- * {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
- *
- * @readonly
- * @type {Boolean}
- */
- get isAllowedInsideAttributeElement() {
- return this._isAllowedInsideAttributeElement;
- }
- /**
- * Checks whether this object is of the given.
- *
- * element.is( 'element' ); // -> true
- * element.is( 'node' ); // -> true
- * element.is( 'view:element' ); // -> true
- * element.is( 'view:node' ); // -> true
- *
- * element.is( 'model:element' ); // -> false
- * element.is( 'documentSelection' ); // -> false
- *
- * Assuming that the object being checked is an element, you can also check its
- * {@link module:engine/view/element~Element#name name}:
- *
- * element.is( 'element', 'img' ); // -> true if this is an <img> element
- * text.is( 'element', 'img' ); -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type Type to check.
- * @param {String} [name] Element name.
- * @returns {Boolean}
- */
- is( type, name = null ) {
- if ( !name ) {
- return type === 'element' || type === 'view:element' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'node' || type === 'view:node';
- } else {
- return name === this.name && ( type === 'element' || type === 'view:element' );
- }
- }
- /**
- * Gets child at the given index.
- *
- * @param {Number} index Index of child.
- * @returns {module:engine/view/node~Node} Child node.
- */
- getChild( index ) {
- return this._children[ index ];
- }
- /**
- * Gets index of the given child node. Returns `-1` if child node is not found.
- *
- * @param {module:engine/view/node~Node} node Child node.
- * @returns {Number} Index of the child node.
- */
- getChildIndex( node ) {
- return this._children.indexOf( node );
- }
- /**
- * Gets child nodes iterator.
- *
- * @returns {Iterable.<module:engine/view/node~Node>} Child nodes iterator.
- */
- getChildren() {
- return this._children[ Symbol.iterator ]();
- }
- /**
- * Returns an iterator that contains the keys for attributes. Order of inserting attributes is not preserved.
- *
- * @returns {Iterable.<String>} Keys for attributes.
- */
- * getAttributeKeys() {
- if ( this._classes.size > 0 ) {
- yield 'class';
- }
- if ( !this._styles.isEmpty ) {
- yield 'style';
- }
- yield* this._attrs.keys();
- }
- /**
- * Returns iterator that iterates over this element's attributes.
- *
- * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
- * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
- *
- * @returns {Iterable.<*>}
- */
- * getAttributes() {
- yield* this._attrs.entries();
- if ( this._classes.size > 0 ) {
- yield [ 'class', this.getAttribute( 'class' ) ];
- }
- if ( !this._styles.isEmpty ) {
- yield [ 'style', this.getAttribute( 'style' ) ];
- }
- }
- /**
- * Gets attribute by key. If attribute is not present - returns undefined.
- *
- * @param {String} key Attribute key.
- * @returns {String|undefined} Attribute value.
- */
- getAttribute( key ) {
- if ( key == 'class' ) {
- if ( this._classes.size > 0 ) {
- return [ ...this._classes ].join( ' ' );
- }
- return undefined;
- }
- if ( key == 'style' ) {
- const inlineStyle = this._styles.toString();
- return inlineStyle == '' ? undefined : inlineStyle;
- }
- return this._attrs.get( key );
- }
- /**
- * Returns a boolean indicating whether an attribute with the specified key exists in the element.
- *
- * @param {String} key Attribute key.
- * @returns {Boolean} `true` if attribute with the specified key exists in the element, false otherwise.
- */
- hasAttribute( key ) {
- if ( key == 'class' ) {
- return this._classes.size > 0;
- }
- if ( key == 'style' ) {
- return !this._styles.isEmpty;
- }
- return this._attrs.has( key );
- }
- /**
- * Checks if this element is similar to other element.
- * Both elements should have the same name and attributes to be considered as similar. Two similar elements
- * can contain different set of children nodes.
- *
- * @param {module:engine/view/element~Element} otherElement
- * @returns {Boolean}
- */
- isSimilar( otherElement ) {
- if ( !( otherElement instanceof Element ) ) {
- return false;
- }
- // If exactly the same Element is provided - return true immediately.
- if ( this === otherElement ) {
- return true;
- }
- // Check element name.
- if ( this.name != otherElement.name ) {
- return false;
- }
- // Check isAllowedInsideAttributeElement property.
- if ( this.isAllowedInsideAttributeElement != otherElement.isAllowedInsideAttributeElement ) {
- return false;
- }
- // Check number of attributes, classes and styles.
- if ( this._attrs.size !== otherElement._attrs.size || this._classes.size !== otherElement._classes.size ||
- this._styles.size !== otherElement._styles.size ) {
- return false;
- }
- // Check if attributes are the same.
- for ( const [ key, value ] of this._attrs ) {
- if ( !otherElement._attrs.has( key ) || otherElement._attrs.get( key ) !== value ) {
- return false;
- }
- }
- // Check if classes are the same.
- for ( const className of this._classes ) {
- if ( !otherElement._classes.has( className ) ) {
- return false;
- }
- }
- // Check if styles are the same.
- for ( const property of this._styles.getStyleNames() ) {
- if (
- !otherElement._styles.has( property ) ||
- otherElement._styles.getAsString( property ) !== this._styles.getAsString( property )
- ) {
- return false;
- }
- }
- return true;
- }
- /**
- * Returns true if class is present.
- * If more then one class is provided - returns true only when all classes are present.
- *
- * element.hasClass( 'foo' ); // Returns true if 'foo' class is present.
- * element.hasClass( 'foo', 'bar' ); // Returns true if 'foo' and 'bar' classes are both present.
- *
- * @param {...String} className
- */
- hasClass( ...className ) {
- for ( const name of className ) {
- if ( !this._classes.has( name ) ) {
- return false;
- }
- }
- return true;
- }
- /**
- * Returns iterator that contains all class names.
- *
- * @returns {Iterable.<String>}
- */
- getClassNames() {
- return this._classes.keys();
- }
- /**
- * Returns style value for the given property mae.
- * If the style does not exist `undefined` is returned.
- *
- * **Note**: This method can work with normalized style names if
- * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
- * See {@link module:engine/view/stylesmap~StylesMap#getAsString `StylesMap#getAsString()`} for details.
- *
- * For an element with style set to `'margin:1px'`:
- *
- * // Enable 'margin' shorthand processing:
- * editor.data.addStyleProcessorRules( addMarginRules );
- *
- * const element = view.change( writer => {
- * const element = writer.createElement();
- * writer.setStyle( 'margin', '1px' );
- * writer.setStyle( 'margin-bottom', '3em' );
- *
- * return element;
- * } );
- *
- * element.getStyle( 'margin' ); // -> 'margin: 1px 1px 3em;'
- *
- * @param {String} property
- * @returns {String|undefined}
- */
- getStyle( property ) {
- return this._styles.getAsString( property );
- }
- /**
- * Returns a normalized style object or single style value.
- *
- * For an element with style set to: margin:1px 2px 3em;
- *
- * element.getNormalizedStyle( 'margin' ) );
- *
- * will return:
- *
- * {
- * top: '1px',
- * right: '2px',
- * bottom: '3em',
- * left: '2px' // a normalized value from margin shorthand
- * }
- *
- * and reading for single style value:
- *
- * styles.getNormalizedStyle( 'margin-left' );
- *
- * Will return a `2px` string.
- *
- * **Note**: This method will return normalized values only if
- * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
- * See {@link module:engine/view/stylesmap~StylesMap#getNormalized `StylesMap#getNormalized()`} for details.
- *
- *
- * @param {String} property Name of CSS property
- * @returns {Object|String|undefined}
- */
- getNormalizedStyle( property ) {
- return this._styles.getNormalized( property );
- }
- /**
- * Returns iterator that contains all style names.
- *
- * @returns {Iterable.<String>}
- */
- getStyleNames() {
- return this._styles.getStyleNames();
- }
- /**
- * Returns true if style keys are present.
- * If more then one style property is provided - returns true only when all properties are present.
- *
- * element.hasStyle( 'color' ); // Returns true if 'border-top' style is present.
- * element.hasStyle( 'color', 'border-top' ); // Returns true if 'color' and 'border-top' styles are both present.
- *
- * @param {...String} property
- */
- hasStyle( ...property ) {
- for ( const name of property ) {
- if ( !this._styles.has( name ) ) {
- return false;
- }
- }
- return true;
- }
- /**
- * Returns ancestor element that match specified pattern.
- * Provided patterns should be compatible with {@link module:engine/view/matcher~Matcher Matcher} as it is used internally.
- *
- * @see module:engine/view/matcher~Matcher
- * @param {Object|String|RegExp|Function} patterns Patterns used to match correct ancestor.
- * See {@link module:engine/view/matcher~Matcher}.
- * @returns {module:engine/view/element~Element|null} Found element or `null` if no matching ancestor was found.
- */
- findAncestor( ...patterns ) {
- const matcher = new _matcher__WEBPACK_IMPORTED_MODULE_6__["default"]( ...patterns );
- let parent = this.parent;
- while ( parent ) {
- if ( matcher.match( parent ) ) {
- return parent;
- }
- parent = parent.parent;
- }
- return null;
- }
- /**
- * Returns the custom property value for the given key.
- *
- * @param {String|Symbol} key
- * @returns {*}
- */
- getCustomProperty( key ) {
- return this._customProperties.get( key );
- }
- /**
- * Returns an iterator which iterates over this element's custom properties.
- * Iterator provides `[ key, value ]` pairs for each stored property.
- *
- * @returns {Iterable.<*>}
- */
- * getCustomProperties() {
- yield* this._customProperties.entries();
- }
- /**
- * Returns identity string based on element's name, styles, classes and other attributes.
- * Two elements that {@link #isSimilar are similar} will have same identity string.
- * It has the following format:
- *
- * 'name class="class1,class2" style="style1:value1;style2:value2" attr1="val1" attr2="val2"'
- *
- * For example:
- *
- * const element = writer.createContainerElement( 'foo', {
- * banana: '10',
- * apple: '20',
- * style: 'color: red; border-color: white;',
- * class: 'baz'
- * } );
- *
- * // returns 'foo class="baz" style="border-color:white;color:red" apple="20" banana="10"'
- * element.getIdentity();
- *
- * **Note**: Classes, styles and other attributes are sorted alphabetically.
- *
- * @returns {String}
- */
- getIdentity() {
- const classes = Array.from( this._classes ).sort().join( ',' );
- const styles = this._styles.toString();
- const attributes = Array.from( this._attrs ).map( i => `${ i[ 0 ] }="${ i[ 1 ] }"` ).sort().join( ' ' );
- return this.name +
- ( classes == '' ? '' : ` class="${ classes }"` ) +
- ( !styles ? '' : ` style="${ styles }"` ) +
- ( attributes == '' ? '' : ` ${ attributes }` );
- }
- /**
- * Clones provided element.
- *
- * @protected
- * @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
- * element will be cloned without any children.
- * @returns {module:engine/view/element~Element} Clone of this element.
- */
- _clone( deep = false ) {
- const childrenClone = [];
- if ( deep ) {
- for ( const child of this.getChildren() ) {
- childrenClone.push( child._clone( deep ) );
- }
- }
- // ContainerElement and AttributeElement should be also cloned properly.
- const cloned = new this.constructor( this.document, this.name, this._attrs, childrenClone );
- // Classes and styles are cloned separately - this solution is faster than adding them back to attributes and
- // parse once again in constructor.
- cloned._classes = new Set( this._classes );
- cloned._styles.set( this._styles.getNormalized() );
- // Clone custom properties.
- cloned._customProperties = new Map( this._customProperties );
- // Clone filler offset method.
- // We can't define this method in a prototype because it's behavior which
- // is changed by e.g. toWidget() function from ckeditor5-widget. Perhaps this should be one of custom props.
- cloned.getFillerOffset = this.getFillerOffset;
- cloned._isAllowedInsideAttributeElement = this.isAllowedInsideAttributeElement;
- return cloned;
- }
- /**
- * {@link module:engine/view/element~Element#_insertChild Insert} a child node or a list of child nodes at the end of this node
- * and sets the parent of these nodes to this element.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#insert
- * @protected
- * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
- * @fires module:engine/view/node~Node#change
- * @returns {Number} Number of appended nodes.
- */
- _appendChild( items ) {
- return this._insertChild( this.childCount, items );
- }
- /**
- * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
- * this element.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#insert
- * @protected
- * @param {Number} index Position where nodes should be inserted.
- * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
- * @fires module:engine/view/node~Node#change
- * @returns {Number} Number of inserted nodes.
- */
- _insertChild( index, items ) {
- this._fireChange( 'children', this );
- let count = 0;
- const nodes = normalize( this.document, items );
- for ( const node of nodes ) {
- // If node that is being added to this element is already inside another element, first remove it from the old parent.
- if ( node.parent !== null ) {
- node._remove();
- }
- node.parent = this;
- node.document = this.document;
- this._children.splice( index, 0, node );
- index++;
- count++;
- }
- return count;
- }
- /**
- * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#remove
- * @protected
- * @param {Number} index Number of the first node to remove.
- * @param {Number} [howMany=1] Number of nodes to remove.
- * @fires module:engine/view/node~Node#change
- * @returns {Array.<module:engine/view/node~Node>} The array of removed nodes.
- */
- _removeChildren( index, howMany = 1 ) {
- this._fireChange( 'children', this );
- for ( let i = index; i < index + howMany; i++ ) {
- this._children[ i ].parent = null;
- }
- return this._children.splice( index, howMany );
- }
- /**
- * Adds or overwrite attribute with a specified key and value.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#setAttribute
- * @protected
- * @param {String} key Attribute key.
- * @param {String} value Attribute value.
- * @fires module:engine/view/node~Node#change
- */
- _setAttribute( key, value ) {
- value = String( value );
- this._fireChange( 'attributes', this );
- if ( key == 'class' ) {
- parseClasses( this._classes, value );
- } else if ( key == 'style' ) {
- this._styles.setTo( value );
- } else {
- this._attrs.set( key, value );
- }
- }
- /**
- * Removes attribute from the element.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#removeAttribute
- * @protected
- * @param {String} key Attribute key.
- * @returns {Boolean} Returns true if an attribute existed and has been removed.
- * @fires module:engine/view/node~Node#change
- */
- _removeAttribute( key ) {
- this._fireChange( 'attributes', this );
- // Remove class attribute.
- if ( key == 'class' ) {
- if ( this._classes.size > 0 ) {
- this._classes.clear();
- return true;
- }
- return false;
- }
- // Remove style attribute.
- if ( key == 'style' ) {
- if ( !this._styles.isEmpty ) {
- this._styles.clear();
- return true;
- }
- return false;
- }
- // Remove other attributes.
- return this._attrs.delete( key );
- }
- /**
- * Adds specified class.
- *
- * element._addClass( 'foo' ); // Adds 'foo' class.
- * element._addClass( [ 'foo', 'bar' ] ); // Adds 'foo' and 'bar' classes.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#addClass
- * @protected
- * @param {Array.<String>|String} className
- * @fires module:engine/view/node~Node#change
- */
- _addClass( className ) {
- this._fireChange( 'attributes', this );
- for ( const name of Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( className ) ) {
- this._classes.add( name );
- }
- }
- /**
- * Removes specified class.
- *
- * element._removeClass( 'foo' ); // Removes 'foo' class.
- * element._removeClass( [ 'foo', 'bar' ] ); // Removes both 'foo' and 'bar' classes.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#removeClass
- * @protected
- * @param {Array.<String>|String} className
- * @fires module:engine/view/node~Node#change
- */
- _removeClass( className ) {
- this._fireChange( 'attributes', this );
- for ( const name of Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( className ) ) {
- this._classes.delete( name );
- }
- }
- /**
- * Adds style to the element.
- *
- * element._setStyle( 'color', 'red' );
- * element._setStyle( {
- * color: 'red',
- * position: 'fixed'
- * } );
- *
- * **Note**: This method can work with normalized style names if
- * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
- * See {@link module:engine/view/stylesmap~StylesMap#set `StylesMap#set()`} for details.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#setStyle
- * @protected
- * @param {String|Object} property Property name or object with key - value pairs.
- * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.
- * @fires module:engine/view/node~Node#change
- */
- _setStyle( property, value ) {
- this._fireChange( 'attributes', this );
- this._styles.set( property, value );
- }
- /**
- * Removes specified style.
- *
- * element._removeStyle( 'color' ); // Removes 'color' style.
- * element._removeStyle( [ 'color', 'border-top' ] ); // Removes both 'color' and 'border-top' styles.
- *
- * **Note**: This method can work with normalized style names if
- * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
- * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#removeStyle
- * @protected
- * @param {Array.<String>|String} property
- * @fires module:engine/view/node~Node#change
- */
- _removeStyle( property ) {
- this._fireChange( 'attributes', this );
- for ( const name of Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( property ) ) {
- this._styles.remove( name );
- }
- }
- /**
- * Sets a custom property. Unlike attributes, custom properties are not rendered to the DOM,
- * so they can be used to add special data to elements.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#setCustomProperty
- * @protected
- * @param {String|Symbol} key
- * @param {*} value
- */
- _setCustomProperty( key, value ) {
- this._customProperties.set( key, value );
- }
- /**
- * Removes the custom property stored under the given key.
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#removeCustomProperty
- * @protected
- * @param {String|Symbol} key
- * @returns {Boolean} Returns true if property was removed.
- */
- _removeCustomProperty( key ) {
- return this._customProperties.delete( key );
- }
- /**
- * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
- *
- * @abstract
- * @method module:engine/view/element~Element#getFillerOffset
- */
- // @if CK_DEBUG_ENGINE // printTree( level = 0) {
- // @if CK_DEBUG_ENGINE // let string = '';
- // @if CK_DEBUG_ENGINE // string += '\t'.repeat( level ) + `<${ this.name }${ convertMapToTags( this.getAttributes() ) }>`;
- // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
- // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
- // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( level + 1 ) + child.data;
- // @if CK_DEBUG_ENGINE // } else {
- // @if CK_DEBUG_ENGINE // string += '\n' + child.printTree( level + 1 );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // if ( this.childCount ) {
- // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( level );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // string += `</${ this.name }>`;
- // @if CK_DEBUG_ENGINE // return string;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // logTree() {
- // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
- // @if CK_DEBUG_ENGINE // }
- }
- // Parses attributes provided to the element constructor before they are applied to an element. If attributes are passed
- // as an object (instead of `Iterable`), the object is transformed to the map. Attributes with `null` value are removed.
- // Attributes with non-`String` value are converted to `String`.
- //
- // @param {Object|Iterable} attrs Attributes to parse.
- // @returns {Map} Parsed attributes.
- function parseAttributes( attrs ) {
- attrs = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_3__["default"])( attrs );
- for ( const [ key, value ] of attrs ) {
- if ( value === null ) {
- attrs.delete( key );
- } else if ( typeof value != 'string' ) {
- attrs.set( key, String( value ) );
- }
- }
- return attrs;
- }
- // Parses class attribute and puts all classes into classes set.
- // Classes set s cleared before insertion.
- //
- // @param {Set.<String>} classesSet Set to insert parsed classes.
- // @param {String} classesString String with classes to parse.
- function parseClasses( classesSet, classesString ) {
- const classArray = classesString.split( /\s+/ );
- classesSet.clear();
- classArray.forEach( name => classesSet.add( name ) );
- }
- // Converts strings to Text and non-iterables to arrays.
- //
- // @param {String|module:engine/view/item~Item|Iterable.<String|module:engine/view/item~Item>}
- // @returns {Iterable.<module:engine/view/node~Node>}
- function normalize( document, nodes ) {
- // Separate condition because string is iterable.
- if ( typeof nodes == 'string' ) {
- return [ new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( document, nodes ) ];
- }
- if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_5__["default"])( nodes ) ) {
- nodes = [ nodes ];
- }
- // Array.from to enable .map() on non-arrays.
- return Array.from( nodes )
- .map( node => {
- if ( typeof node == 'string' ) {
- return new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( document, node );
- }
- if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
- return new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( document, node.data );
- }
- return node;
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EmptyElement; });
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/emptyelement
- */
- /**
- * Empty element class. It is used to represent elements that cannot contain any child nodes (for example `<img>` elements).
- *
- * To create a new empty element use the
- * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`} method.
- *
- * @extends module:engine/view/element~Element
- */
- class EmptyElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates new instance of EmptyElement.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` when third parameter is passed,
- * to inform that usage of EmptyElement is incorrect (adding child nodes to EmptyElement is forbidden).
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#createEmptyElement
- * @protected
- * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
- * @param {String} name Node name.
- * @param {Object|Iterable} [attrs] Collection of attributes.
- * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
- * A list of nodes to be inserted into created element.
- */
- constructor( document, name, attrs, children ) {
- super( document, name, attrs, children );
- // Override the default of the base class.
- this._isAllowedInsideAttributeElement = true;
- /**
- * Returns `null` because filler is not needed for EmptyElements.
- *
- * @method #getFillerOffset
- * @returns {null} Always returns null.
- */
- this.getFillerOffset = getFillerOffset;
- }
- /**
- * Checks whether this object is of the given.
- *
- * emptyElement.is( 'emptyElement' ); // -> true
- * emptyElement.is( 'element' ); // -> true
- * emptyElement.is( 'node' ); // -> true
- * emptyElement.is( 'view:emptyElement' ); // -> true
- * emptyElement.is( 'view:element' ); // -> true
- * emptyElement.is( 'view:node' ); // -> true
- *
- * emptyElement.is( 'model:element' ); // -> false
- * emptyElement.is( 'documentFragment' ); // -> false
- *
- * Assuming that the object being checked is an empty element, you can also check its
- * {@link module:engine/view/emptyelement~EmptyElement#name name}:
- *
- * emptyElement.is( 'element', 'img' ); // -> true if this is a img element
- * emptyElement.is( 'emptyElement', 'img' ); // -> same as above
- * text.is( 'element', 'img' ); -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type Type to check.
- * @param {String} [name] Element name.
- * @returns {Boolean}
- */
- is( type, name = null ) {
- if ( !name ) {
- return type === 'emptyElement' || type === 'view:emptyElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'element' || type === 'view:element' ||
- type === 'node' || type === 'view:node';
- } else {
- return name === this.name && (
- type === 'emptyElement' || type === 'view:emptyElement' ||
- type === 'element' || type === 'view:element'
- );
- }
- }
- /**
- * Overrides {@link module:engine/view/element~Element#_insertChild} method.
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` to prevent
- * adding any child nodes to EmptyElement.
- *
- * @protected
- */
- _insertChild( index, nodes ) {
- if ( nodes && ( nodes instanceof _node__WEBPACK_IMPORTED_MODULE_2__["default"] || Array.from( nodes ).length > 0 ) ) {
- /**
- * Cannot add children to {@link module:engine/view/emptyelement~EmptyElement}.
- *
- * @error view-emptyelement-cannot-add
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
- 'view-emptyelement-cannot-add',
- [ this, nodes ]
- );
- }
- }
- }
- // Returns `null` because block filler is not needed for EmptyElements.
- //
- // @returns {null}
- function getFillerOffset() {
- return null;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js ***!
- \********************************************************************/
- /*! exports provided: NBSP_FILLER, MARKED_NBSP_FILLER, BR_FILLER, INLINE_FILLER_LENGTH, INLINE_FILLER, startsWithFiller, isInlineFiller, getDataWithoutFiller, injectQuirksHandling */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NBSP_FILLER", function() { return NBSP_FILLER; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MARKED_NBSP_FILLER", function() { return MARKED_NBSP_FILLER; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BR_FILLER", function() { return BR_FILLER; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INLINE_FILLER_LENGTH", function() { return INLINE_FILLER_LENGTH; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INLINE_FILLER", function() { return INLINE_FILLER; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithFiller", function() { return startsWithFiller; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInlineFiller", function() { return isInlineFiller; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDataWithoutFiller", function() { return getDataWithoutFiller; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectQuirksHandling", function() { return injectQuirksHandling; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * Set of utilities related to handling block and inline fillers.
- *
- * Browsers do not allow to put caret in elements which does not have height. Because of it, we need to fill all
- * empty elements which should be selectable with elements or characters called "fillers". Unfortunately there is no one
- * universal filler, this is why two types are uses:
- *
- * * Block filler is an element which fill block elements, like `<p>`. CKEditor uses `<br>` as a block filler during the editing,
- * as browsers do natively. So instead of an empty `<p>` there will be `<p><br></p>`. The advantage of block filler is that
- * it is transparent for the selection, so when the caret is before the `<br>` and user presses right arrow he will be
- * moved to the next paragraph, not after the `<br>`. The disadvantage is that it breaks a block, so it can not be used
- * in the middle of a line of text. The {@link module:engine/view/filler~BR_FILLER `<br>` filler} can be replaced with any other
- * character in the data output, for instance {@link module:engine/view/filler~NBSP_FILLER non-breaking space} or
- * {@link module:engine/view/filler~MARKED_NBSP_FILLER marked non-breaking space}.
- *
- * * Inline filler is a filler which does not break a line of text, so it can be used inside the text, for instance in the empty
- * `<b>` surrendered by text: `foo<b></b>bar`, if we want to put the caret there. CKEditor uses a sequence of the zero-width
- * spaces as an {@link module:engine/view/filler~INLINE_FILLER inline filler} having the predetermined
- * {@link module:engine/view/filler~INLINE_FILLER_LENGTH length}. A sequence is used, instead of a single character to
- * avoid treating random zero-width spaces as the inline filler. Disadvantage of the inline filler is that it is not
- * transparent for the selection. The arrow key moves the caret between zero-width spaces characters, so the additional
- * code is needed to handle the caret.
- *
- * Both inline and block fillers are handled by the {@link module:engine/view/renderer~Renderer renderer} and are not present in the
- * view.
- *
- * @module engine/view/filler
- */
- /**
- * Non-breaking space filler creator. This function creates the ` ` text node.
- * It defines how the filler is created.
- *
- * @see module:engine/view/filler~MARKED_NBSP_FILLER
- * @see module:engine/view/filler~BR_FILLER
- * @function
- */
- const NBSP_FILLER = domDocument => domDocument.createTextNode( '\u00A0' );
- /**
- * Marked non-breaking space filler creator. This function creates the `<span data-cke-filler="true"> </span>` element.
- * It defines how the filler is created.
- *
- * @see module:engine/view/filler~NBSP_FILLER
- * @see module:engine/view/filler~BR_FILLER
- * @function
- */
- const MARKED_NBSP_FILLER = domDocument => {
- const span = domDocument.createElement( 'span' );
- span.dataset.ckeFiller = true;
- span.innerHTML = '\u00A0';
- return span;
- };
- /**
- * `<br>` filler creator. This function creates the `<br data-cke-filler="true">` element.
- * It defines how the filler is created.
- *
- * @see module:engine/view/filler~NBSP_FILLER
- * @see module:engine/view/filler~MARKED_NBSP_FILLER
- * @function
- */
- const BR_FILLER = domDocument => {
- const fillerBr = domDocument.createElement( 'br' );
- fillerBr.dataset.ckeFiller = true;
- return fillerBr;
- };
- /**
- * Length of the {@link module:engine/view/filler~INLINE_FILLER INLINE_FILLER}.
- */
- const INLINE_FILLER_LENGTH = 7;
- /**
- * Inline filler which is a sequence of the word joiners.
- *
- * @type {String}
- */
- const INLINE_FILLER = '\u2060'.repeat( INLINE_FILLER_LENGTH );
- /**
- * Checks if the node is a text node which starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
- *
- * startsWithFiller( document.createTextNode( INLINE_FILLER ) ); // true
- * startsWithFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // true
- * startsWithFiller( document.createTextNode( 'foo' ) ); // false
- * startsWithFiller( document.createElement( 'p' ) ); // false
- *
- * @param {Node} domNode DOM node.
- * @returns {Boolean} True if the text node starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
- */
- function startsWithFiller( domNode ) {
- return Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_1__["default"])( domNode ) && ( domNode.data.substr( 0, INLINE_FILLER_LENGTH ) === INLINE_FILLER );
- }
- /**
- * Checks if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
- *
- * isInlineFiller( document.createTextNode( INLINE_FILLER ) ); // true
- * isInlineFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // false
- *
- * @param {Text} domText DOM text node.
- * @returns {Boolean} True if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
- */
- function isInlineFiller( domText ) {
- return domText.data.length == INLINE_FILLER_LENGTH && startsWithFiller( domText );
- }
- /**
- * Get string data from the text node, removing an {@link module:engine/view/filler~INLINE_FILLER inline filler} from it,
- * if text node contains it.
- *
- * getDataWithoutFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ) == 'foo' // true
- * getDataWithoutFiller( document.createTextNode( 'foo' ) ) == 'foo' // true
- *
- * @param {Text} domText DOM text node, possible with inline filler.
- * @returns {String} Data without filler.
- */
- function getDataWithoutFiller( domText ) {
- if ( startsWithFiller( domText ) ) {
- return domText.data.slice( INLINE_FILLER_LENGTH );
- } else {
- return domText.data;
- }
- }
- /**
- * Assign key observer which move cursor from the end of the inline filler to the beginning of it when
- * the left arrow is pressed, so the filler does not break navigation.
- *
- * @param {module:engine/view/view~View} view View controller instance we should inject quirks handling on.
- */
- function injectQuirksHandling( view ) {
- view.document.on( 'arrowKey', jumpOverInlineFiller, { priority: 'low' } );
- }
- // Move cursor from the end of the inline filler to the beginning of it when, so the filler does not break navigation.
- function jumpOverInlineFiller( evt, data ) {
- if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].arrowleft ) {
- const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
- if ( domSelection.rangeCount == 1 && domSelection.getRangeAt( 0 ).collapsed ) {
- const domParent = domSelection.getRangeAt( 0 ).startContainer;
- const domOffset = domSelection.getRangeAt( 0 ).startOffset;
- if ( startsWithFiller( domParent ) && domOffset <= INLINE_FILLER_LENGTH ) {
- domSelection.collapse( domParent, 0 );
- }
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Matcher; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/matcher
- */
- /**
- * View matcher class.
- * Instance of this class can be used to find {@link module:engine/view/element~Element elements} that match given pattern.
- */
- class Matcher {
- /**
- * Creates new instance of Matcher.
- *
- * @param {String|RegExp|Object} [pattern] Match patterns. See {@link module:engine/view/matcher~Matcher#add add method} for
- * more information.
- */
- constructor( ...pattern ) {
- /**
- * @private
- * @type {Array<String|RegExp|Object>}
- */
- this._patterns = [];
- this.add( ...pattern );
- }
- /**
- * Adds pattern or patterns to matcher instance.
- *
- * // String.
- * matcher.add( 'div' );
- *
- * // Regular expression.
- * matcher.add( /^\w/ );
- *
- * // Single class.
- * matcher.add( {
- * classes: 'foobar'
- * } );
- *
- * See {@link module:engine/view/matcher~MatcherPattern} for more examples.
- *
- * Multiple patterns can be added in one call:
- *
- * matcher.add( 'div', { classes: 'foobar' } );
- *
- * @param {Object|String|RegExp|Function} pattern Object describing pattern details. If string or regular expression
- * is provided it will be used to match element's name. Pattern can be also provided in a form
- * of a function - then this function will be called with each {@link module:engine/view/element~Element element} as a parameter.
- * Function's return value will be stored under `match` key of the object returned from
- * {@link module:engine/view/matcher~Matcher#match match} or {@link module:engine/view/matcher~Matcher#matchAll matchAll} methods.
- * @param {String|RegExp} [pattern.name] Name or regular expression to match element's name.
- * @param {Object} [pattern.attributes] Object with key-value pairs representing attributes to match. Each object key
- * represents attribute name. Value under that key can be either:
- * * `true` - then attribute is just required (can be empty),
- * * a string - then attribute has to be equal, or
- * * a regular expression - then attribute has to match the expression.
- * @param {String|RegExp|Array} [pattern.classes] Class name or array of class names to match. Each name can be
- * provided in a form of string or regular expression.
- * @param {Object} [pattern.styles] Object with key-value pairs representing styles to match. Each object key
- * represents style name. Value under that key can be either a string or a regular expression and it will be used
- * to match style value.
- */
- add( ...pattern ) {
- for ( let item of pattern ) {
- // String or RegExp pattern is used as element's name.
- if ( typeof item == 'string' || item instanceof RegExp ) {
- item = { name: item };
- }
- // Single class name/RegExp can be provided.
- if ( item.classes && ( typeof item.classes == 'string' || item.classes instanceof RegExp ) ) {
- item.classes = [ item.classes ];
- }
- this._patterns.push( item );
- }
- }
- /**
- * Matches elements for currently stored patterns. Returns match information about first found
- * {@link module:engine/view/element~Element element}, otherwise returns `null`.
- *
- * Example of returned object:
- *
- * {
- * element: <instance of found element>,
- * pattern: <pattern used to match found element>,
- * match: {
- * name: true,
- * attributes: [ 'title', 'href' ],
- * classes: [ 'foo' ],
- * styles: [ 'color', 'position' ]
- * }
- * }
- *
- * @see module:engine/view/matcher~Matcher#add
- * @see module:engine/view/matcher~Matcher#matchAll
- * @param {...module:engine/view/element~Element} element View element to match against stored patterns.
- * @returns {Object|null} result
- * @returns {module:engine/view/element~Element} result.element Matched view element.
- * @returns {Object|String|RegExp|Function} result.pattern Pattern that was used to find matched element.
- * @returns {Object} result.match Object representing matched element parts.
- * @returns {Boolean} [result.match.name] True if name of the element was matched.
- * @returns {Array} [result.match.attributes] Array with matched attribute names.
- * @returns {Array} [result.match.classes] Array with matched class names.
- * @returns {Array} [result.match.styles] Array with matched style names.
- */
- match( ...element ) {
- for ( const singleElement of element ) {
- for ( const pattern of this._patterns ) {
- const match = isElementMatching( singleElement, pattern );
- if ( match ) {
- return {
- element: singleElement,
- pattern,
- match
- };
- }
- }
- }
- return null;
- }
- /**
- * Matches elements for currently stored patterns. Returns array of match information with all found
- * {@link module:engine/view/element~Element elements}. If no element is found - returns `null`.
- *
- * @see module:engine/view/matcher~Matcher#add
- * @see module:engine/view/matcher~Matcher#match
- * @param {...module:engine/view/element~Element} element View element to match against stored patterns.
- * @returns {Array.<Object>|null} Array with match information about found elements or `null`. For more information
- * see {@link module:engine/view/matcher~Matcher#match match method} description.
- */
- matchAll( ...element ) {
- const results = [];
- for ( const singleElement of element ) {
- for ( const pattern of this._patterns ) {
- const match = isElementMatching( singleElement, pattern );
- if ( match ) {
- results.push( {
- element: singleElement,
- pattern,
- match
- } );
- }
- }
- }
- return results.length > 0 ? results : null;
- }
- /**
- * Returns the name of the element to match if there is exactly one pattern added to the matcher instance
- * and it matches element name defined by `string` (not `RegExp`). Otherwise, returns `null`.
- *
- * @returns {String|null} Element name trying to match.
- */
- getElementName() {
- if ( this._patterns.length !== 1 ) {
- return null;
- }
- const pattern = this._patterns[ 0 ];
- const name = pattern.name;
- return ( typeof pattern != 'function' && name && !( name instanceof RegExp ) ) ? name : null;
- }
- }
- // Returns match information if {@link module:engine/view/element~Element element} is matching provided pattern.
- // If element cannot be matched to provided pattern - returns `null`.
- //
- // @param {module:engine/view/element~Element} element
- // @param {Object|String|RegExp|Function} pattern
- // @returns {Object|null} Returns object with match information or null if element is not matching.
- function isElementMatching( element, pattern ) {
- // If pattern is provided as function - return result of that function;
- if ( typeof pattern == 'function' ) {
- return pattern( element );
- }
- const match = {};
- // Check element's name.
- if ( pattern.name ) {
- match.name = matchName( pattern.name, element.name );
- if ( !match.name ) {
- return null;
- }
- }
- // Check element's attributes.
- if ( pattern.attributes ) {
- match.attributes = matchAttributes( pattern.attributes, element );
- if ( !match.attributes ) {
- return null;
- }
- }
- // Check element's classes.
- if ( pattern.classes ) {
- match.classes = matchClasses( pattern.classes, element );
- if ( !match.classes ) {
- return false;
- }
- }
- // Check element's styles.
- if ( pattern.styles ) {
- match.styles = matchStyles( pattern.styles, element );
- if ( !match.styles ) {
- return false;
- }
- }
- return match;
- }
- // Checks if name can be matched by provided pattern.
- //
- // @param {String|RegExp} pattern
- // @param {String} name
- // @returns {Boolean} Returns `true` if name can be matched, `false` otherwise.
- function matchName( pattern, name ) {
- // If pattern is provided as RegExp - test against this regexp.
- if ( pattern instanceof RegExp ) {
- return pattern.test( name );
- }
- return pattern === name;
- }
- // Checks if attributes of provided element can be matched against provided patterns.
- //
- // @param {Object} patterns Object with information about attributes to match. Each key of the object will be
- // used as attribute name. Value of each key can be a string or regular expression to match against attribute value.
- // @param {module:engine/view/element~Element} element Element which attributes will be tested.
- // @returns {Array|null} Returns array with matched attribute names or `null` if no attributes were matched.
- function matchAttributes( patterns, element ) {
- const match = [];
- for ( const name in patterns ) {
- const pattern = patterns[ name ];
- if ( element.hasAttribute( name ) ) {
- const attribute = element.getAttribute( name );
- if ( pattern === true ) {
- match.push( name );
- } else if ( pattern instanceof RegExp ) {
- if ( pattern.test( attribute ) ) {
- match.push( name );
- } else {
- return null;
- }
- } else if ( attribute === pattern ) {
- match.push( name );
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
- return match;
- }
- // Checks if classes of provided element can be matched against provided patterns.
- //
- // @param {Array.<String|RegExp>} patterns Array of strings or regular expressions to match against element's classes.
- // @param {module:engine/view/element~Element} element Element which classes will be tested.
- // @returns {Array|null} Returns array with matched class names or `null` if no classes were matched.
- function matchClasses( patterns, element ) {
- const match = [];
- for ( const pattern of patterns ) {
- if ( pattern instanceof RegExp ) {
- const classes = element.getClassNames();
- for ( const name of classes ) {
- if ( pattern.test( name ) ) {
- match.push( name );
- }
- }
- if ( match.length === 0 ) {
- return null;
- }
- } else if ( element.hasClass( pattern ) ) {
- match.push( pattern );
- } else {
- return null;
- }
- }
- return match;
- }
- // Checks if styles of provided element can be matched against provided patterns.
- //
- // @param {Object} patterns Object with information about styles to match. Each key of the object will be
- // used as style name. Value of each key can be a string or regular expression to match against style value.
- // @param {module:engine/view/element~Element} element Element which styles will be tested.
- // @returns {Array|null} Returns array with matched style names or `null` if no styles were matched.
- function matchStyles( patterns, element ) {
- const match = [];
- for ( const name in patterns ) {
- const pattern = patterns[ name ];
- if ( element.hasStyle( name ) ) {
- const style = element.getStyle( name );
- if ( pattern instanceof RegExp ) {
- if ( pattern.test( style ) ) {
- match.push( name );
- } else {
- return null;
- }
- } else if ( style === pattern ) {
- match.push( name );
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
- return match;
- }
- /**
- * An entity that is a valid pattern recognized by a matcher. `MatcherPattern` is used by {@link ~Matcher} to recognize
- * if a view element fits in a group of view elements described by the pattern.
- *
- * `MatcherPattern` can be given as a `String`, a `RegExp`, an `Object` or a `Function`.
- *
- * If `MatcherPattern` is given as a `String` or `RegExp`, it will match any view element that has a matching name:
- *
- * // Match any element with name equal to 'div'.
- * const pattern = 'div';
- *
- * // Match any element which name starts on 'p'.
- * const pattern = /^p/;
- *
- * If `MatcherPattern` is given as an `Object`, all the object's properties will be matched with view element properties.
- *
- * // Match view element's name.
- * const pattern = { name: /^p/ };
- *
- * // Match view element which has matching attributes.
- * const pattern = {
- * attributes: {
- * title: 'foobar', // Attribute title should equal 'foobar'.
- * foo: /^\w+/, // Attribute foo should match /^\w+/ regexp.
- * bar: true // Attribute bar should be set (can be empty).
- * }
- * };
- *
- * // Match view element which has given class.
- * const pattern = {
- * classes: 'foobar'
- * };
- *
- * // Match view element class using regular expression.
- * const pattern = {
- * classes: /foo.../
- * };
- *
- * // Multiple classes to match.
- * const pattern = {
- * classes: [ 'baz', 'bar', /foo.../ ]
- * };
- *
- * // Match view element which has given styles.
- * const pattern = {
- * styles: {
- * position: 'absolute',
- * color: /^\w*blue$/
- * }
- * };
- *
- * // Pattern with multiple properties.
- * const pattern = {
- * name: 'span',
- * styles: {
- * 'font-weight': 'bold'
- * },
- * classes: 'highlighted'
- * };
- *
- * If `MatcherPattern` is given as a `Function`, the function takes a view element as a first and only parameter and
- * the function should decide whether that element matches. If so, it should return what part of the view element has been matched.
- * Otherwise, the function should return `null`. The returned result will be included in `match` property of the object
- * returned by {@link ~Matcher#match} call.
- *
- * // Match an empty <div> element.
- * const pattern = element => {
- * if ( element.name == 'div' && element.childCount > 0 ) {
- * // Return which part of the element was matched.
- * return { name: true };
- * }
- *
- * return null;
- * };
- *
- * // Match a <p> element with big font ("heading-like" element).
- * const pattern = element => {
- * if ( element.name == 'p' ) {
- * const fontSize = element.getStyle( 'font-size' );
- * const size = fontSize.match( /(\d+)/px );
- *
- * if ( size && Number( size[ 1 ] ) > 26 ) {
- * return { name: true, attribute: [ 'font-size' ] };
- * }
- * }
- *
- * return null;
- * };
- *
- * `MatcherPattern` is defined in a way that it is a superset of {@link module:engine/view/elementdefinition~ElementDefinition},
- * that is, every `ElementDefinition` also can be used as a `MatcherPattern`.
- *
- * @typedef {String|RegExp|Object|Function} module:engine/view/matcher~MatcherPattern
- *
- * @property {String|RegExp} [name] View element name to match.
- * @property {String|RegExp|Array.<String|RegExp>} [classes] View element's class name(s) to match.
- * @property {Object} [styles] Object with key-value pairs representing styles to match.
- * Each object key represents style name. Value can be given as `String` or `RegExp`.
- * @property {Object} [attributes] Object with key-value pairs representing attributes to match.
- * Each object key represents attribute name. Value can be given as `String` or `RegExp`.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Node; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_version__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/node
- */
- // To check if component is loaded more than once.
- /**
- * Abstract view node class.
- *
- * This is an abstract class. Its constructor should not be used directly.
- * Use the {@link module:engine/view/downcastwriter~DowncastWriter} or {@link module:engine/view/upcastwriter~UpcastWriter}
- * to create new instances of view nodes.
- *
- * @abstract
- */
- class Node {
- /**
- * Creates a tree view node.
- *
- * @protected
- * @param {module:engine/view/document~Document} document The document instance to which this node belongs.
- */
- constructor( document ) {
- /**
- * The document instance to which this node belongs.
- *
- * @readonly
- * @member {module:engine/view/document~Document}
- */
- this.document = document;
- /**
- * Parent element. Null by default. Set by {@link module:engine/view/element~Element#_insertChild}.
- *
- * @readonly
- * @member {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}
- */
- this.parent = null;
- }
- /**
- * Index of the node in the parent element or null if the node has no parent.
- *
- * Accessing this property throws an error if this node's parent element does not contain it.
- * This means that view tree got broken.
- *
- * @readonly
- * @type {Number|null}
- */
- get index() {
- let pos;
- if ( !this.parent ) {
- return null;
- }
- // No parent or child doesn't exist in parent's children.
- if ( ( pos = this.parent.getChildIndex( this ) ) == -1 ) {
- /**
- * The node's parent does not contain this node. It means that the document tree is corrupted.
- *
- * @error view-node-not-found-in-parent
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-node-not-found-in-parent', this );
- }
- return pos;
- }
- /**
- * Node's next sibling, or `null` if it is the last child.
- *
- * @readonly
- * @type {module:engine/view/node~Node|null}
- */
- get nextSibling() {
- const index = this.index;
- return ( index !== null && this.parent.getChild( index + 1 ) ) || null;
- }
- /**
- * Node's previous sibling, or `null` if it is the first child.
- *
- * @readonly
- * @type {module:engine/view/node~Node|null}
- */
- get previousSibling() {
- const index = this.index;
- return ( index !== null && this.parent.getChild( index - 1 ) ) || null;
- }
- /**
- * Top-most ancestor of the node. If the node has no parent it is the root itself.
- *
- * @readonly
- * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
- */
- get root() {
- let root = this; // eslint-disable-line consistent-this
- while ( root.parent ) {
- root = root.parent;
- }
- return root;
- }
- /**
- * Returns true if the node is in a tree rooted in the document (is a descendant of one of its roots).
- *
- * @returns {Boolean}
- */
- isAttached() {
- return this.root.is( 'rootElement' );
- }
- /**
- * Gets a path to the node. The path is an array containing indices of consecutive ancestors of this node,
- * beginning from {@link module:engine/view/node~Node#root root}, down to this node's index.
- *
- * const abc = downcastWriter.createText( 'abc' );
- * const foo = downcastWriter.createText( 'foo' );
- * const h1 = downcastWriter.createElement( 'h1', null, downcastWriter.createText( 'header' ) );
- * const p = downcastWriter.createElement( 'p', null, [ abc, foo ] );
- * const div = downcastWriter.createElement( 'div', null, [ h1, p ] );
- * foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.
- * h1.getPath(); // Returns [ 0 ].
- * div.getPath(); // Returns [].
- *
- * @returns {Array.<Number>} The path.
- */
- getPath() {
- const path = [];
- let node = this; // eslint-disable-line consistent-this
- while ( node.parent ) {
- path.unshift( node.index );
- node = node.parent;
- }
- return path;
- }
- /**
- * Returns ancestors array of this node.
- *
- * @param {Object} options Options object.
- * @param {Boolean} [options.includeSelf=false] When set to `true` this node will be also included in parent's array.
- * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from node's parent to root element,
- * otherwise root element will be the first item in the array.
- * @returns {Array} Array with ancestors.
- */
- getAncestors( options = { includeSelf: false, parentFirst: false } ) {
- const ancestors = [];
- let parent = options.includeSelf ? this : this.parent;
- while ( parent ) {
- ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
- parent = parent.parent;
- }
- return ancestors;
- }
- /**
- * Returns a {@link module:engine/view/element~Element} or {@link module:engine/view/documentfragment~DocumentFragment}
- * which is a common ancestor of both nodes.
- *
- * @param {module:engine/view/node~Node} node The second node.
- * @param {Object} options Options object.
- * @param {Boolean} [options.includeSelf=false] When set to `true` both nodes will be considered "ancestors" too.
- * Which means that if e.g. node A is inside B, then their common ancestor will be B.
- * @returns {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}
- */
- getCommonAncestor( node, options = {} ) {
- const ancestorsA = this.getAncestors( options );
- const ancestorsB = node.getAncestors( options );
- let i = 0;
- while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
- i++;
- }
- return i === 0 ? null : ancestorsA[ i - 1 ];
- }
- /**
- * Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,
- * in different {@link module:engine/view/documentfragment~DocumentFragment}s).
- *
- * @param {module:engine/view/node~Node} node Node to compare with.
- * @returns {Boolean}
- */
- isBefore( node ) {
- // Given node is not before this node if they are same.
- if ( this == node ) {
- return false;
- }
- // Return `false` if it is impossible to compare nodes.
- if ( this.root !== node.root ) {
- return false;
- }
- const thisPath = this.getPath();
- const nodePath = node.getPath();
- const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__["default"])( thisPath, nodePath );
- switch ( result ) {
- case 'prefix':
- return true;
- case 'extension':
- return false;
- default:
- return thisPath[ result ] < nodePath[ result ];
- }
- }
- /**
- * Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,
- * in different {@link module:engine/view/documentfragment~DocumentFragment}s).
- *
- * @param {module:engine/view/node~Node} node Node to compare with.
- * @returns {Boolean}
- */
- isAfter( node ) {
- // Given node is not before this node if they are same.
- if ( this == node ) {
- return false;
- }
- // Return `false` if it is impossible to compare nodes.
- if ( this.root !== node.root ) {
- return false;
- }
- // In other cases, just check if the `node` is before, and return the opposite.
- return !this.isBefore( node );
- }
- /**
- * Removes node from parent.
- *
- * @protected
- */
- _remove() {
- this.parent._removeChildren( this.index );
- }
- /**
- * @protected
- * @param {module:engine/view/document~ChangeType} type Type of the change.
- * @param {module:engine/view/node~Node} node Changed node.
- * @fires change
- */
- _fireChange( type, node ) {
- this.fire( 'change:' + type, node );
- if ( this.parent ) {
- this.parent._fireChange( type, node );
- }
- }
- /**
- * Custom toJSON method to solve child-parent circular dependencies.
- *
- * @returns {Object} Clone of this object with the parent property removed.
- */
- toJSON() {
- const json = Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["clone"])( this );
- // Due to circular references we need to remove parent reference.
- delete json.parent;
- return json;
- }
- /**
- * Checks whether this object is of the given type.
- *
- * This method is useful when processing view objects that are of unknown type. For example, a function
- * may return a {@link module:engine/view/documentfragment~DocumentFragment} or a {@link module:engine/view/node~Node}
- * that can be either a text node or an element. This method can be used to check what kind of object is returned.
- *
- * someObject.is( 'element' ); // -> true if this is an element
- * someObject.is( 'node' ); // -> true if this is a node (a text node or an element)
- * someObject.is( 'documentFragment' ); // -> true if this is a document fragment
- *
- * Since this method is also available on a range of model objects, you can prefix the type of the object with
- * `model:` or `view:` to check, for example, if this is the model's or view's element:
- *
- * viewElement.is( 'view:element' ); // -> true
- * viewElement.is( 'model:element' ); // -> false
- *
- * By using this method it is also possible to check a name of an element:
- *
- * imgElement.is( 'element', 'img' ); // -> true
- * imgElement.is( 'view:element', 'img' ); // -> same as above, but more precise
- *
- * The list of view objects which implement the `is()` method:
- *
- * * {@link module:engine/view/attributeelement~AttributeElement#is `AttributeElement#is()`}
- * * {@link module:engine/view/containerelement~ContainerElement#is `ContainerElement#is()`}
- * * {@link module:engine/view/documentfragment~DocumentFragment#is `DocumentFragment#is()`}
- * * {@link module:engine/view/documentselection~DocumentSelection#is `DocumentSelection#is()`}
- * * {@link module:engine/view/editableelement~EditableElement#is `EditableElement#is()`}
- * * {@link module:engine/view/element~Element#is `Element#is()`}
- * * {@link module:engine/view/emptyelement~EmptyElement#is `EmptyElement#is()`}
- * * {@link module:engine/view/node~Node#is `Node#is()`}
- * * {@link module:engine/view/position~Position#is `Position#is()`}
- * * {@link module:engine/view/range~Range#is `Range#is()`}
- * * {@link module:engine/view/rooteditableelement~RootEditableElement#is `RootEditableElement#is()`}
- * * {@link module:engine/view/selection~Selection#is `Selection#is()`}
- * * {@link module:engine/view/text~Text#is `Text#is()`}
- * * {@link module:engine/view/textproxy~TextProxy#is `TextProxy#is()`}
- * * {@link module:engine/view/uielement~UIElement#is `UIElement#is()`}
- *
- * @method #is
- * @param {String} type Type to check.
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'node' || type === 'view:node';
- }
- /**
- * Clones this node.
- *
- * @protected
- * @method #_clone
- * @returns {module:engine/view/node~Node} Clone of this node.
- */
- /**
- * Checks if provided node is similar to this node.
- *
- * @method #isSimilar
- * @returns {Boolean} True if nodes are similar.
- */
- }
- /**
- * Fired when list of {@link module:engine/view/element~Element elements} children changes.
- *
- * Change event is bubbled – it is fired on all ancestors.
- *
- * @event change:children
- * @param {module:engine/view/node~Node} changedNode
- */
- /**
- * Fired when list of {@link module:engine/view/element~Element elements} attributes changes.
- *
- * Change event is bubbled – it is fired on all ancestors.
- *
- * @event change:attributes
- * @param {module:engine/view/node~Node} changedNode
- */
- /**
- * Fired when {@link module:engine/view/text~Text text nodes} data changes.
- *
- * Change event is bubbled – it is fired on all ancestors.
- *
- * @event change:text
- * @param {module:engine/view/node~Node} changedNode
- */
- /**
- * @event change
- */
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Node, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js ***!
- \****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ArrowKeysObserver; });
- /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
- /* harmony import */ var _bubblingeventinfo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bubblingeventinfo */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ "./node_modules/@ckeditor/ckeditor5-utils/src/index.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/arrowkeysobserver
- */
- /**
- * Arrow keys observer introduces the {@link module:engine/view/document~Document#event:arrowKey `Document#arrowKey`} event.
- *
- * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
- *
- * @extends module:engine/view/observer/observer~Observer
- */
- class ArrowKeysObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( view ) {
- super( view );
- this.document.on( 'keydown', ( event, data ) => {
- if ( this.isEnabled && Object(_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_2__["isArrowKeyCode"])( data.keyCode ) ) {
- const eventInfo = new _bubblingeventinfo__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, 'arrowKey', this.document.selection.getFirstRange() );
- this.document.fire( eventInfo, data );
- if ( eventInfo.stop.called ) {
- event.stop();
- }
- }
- } );
- }
- /**
- * @inheritDoc
- */
- observe() {}
- }
- /**
- * Event fired when the user presses an arrow keys.
- *
- * Introduced by {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver}.
- *
- * Note that because {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver} is attached by the
- * {@link module:engine/view/view~View} this event is available by default.
- *
- * @event module:engine/view/document~Document#event:arrowKey
- * @param {module:engine/view/observer/domeventdata~DomEventData} data
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js":
- /*!*******************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js ***!
- \*******************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
- /* harmony import */ var _bubblingeventinfo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bubblingeventinfo */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/bubblingemittermixin
- */
- const contextsSymbol = Symbol( 'bubbling contexts' );
- /**
- * Bubbling emitter mixin for the view document as described in the
- * {@link ~BubblingEmitter} interface.
- *
- * @mixin BubblingEmitterMixin
- * @implements module:engine/view/observer/bubblingemittermixin~BubblingEmitter
- */
- const BubblingEmitterMixin = {
- /**
- * @inheritDoc
- */
- fire( eventOrInfo, ...eventArgs ) {
- try {
- const eventInfo = eventOrInfo instanceof _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"] ? eventOrInfo : new _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"]( this, eventOrInfo );
- const eventContexts = getBubblingContexts( this );
- if ( !eventContexts.size ) {
- return;
- }
- updateEventInfo( eventInfo, 'capturing', this );
- // The capture phase of the event.
- if ( fireListenerFor( eventContexts, '$capture', eventInfo, ...eventArgs ) ) {
- return eventInfo.return;
- }
- const startRange = eventInfo.startRange || this.selection.getFirstRange();
- const selectedElement = startRange ? startRange.getContainedElement() : null;
- const isCustomContext = selectedElement ? Boolean( getCustomContext( eventContexts, selectedElement ) ) : false;
- let node = selectedElement || getDeeperRangeParent( startRange );
- updateEventInfo( eventInfo, 'atTarget', node );
- // For the not yet bubbling event trigger for $text node if selection can be there and it's not a custom context selected.
- if ( !isCustomContext ) {
- if ( fireListenerFor( eventContexts, '$text', eventInfo, ...eventArgs ) ) {
- return eventInfo.return;
- }
- updateEventInfo( eventInfo, 'bubbling', node );
- }
- while ( node ) {
- // Root node handling.
- if ( node.is( 'rootElement' ) ) {
- if ( fireListenerFor( eventContexts, '$root', eventInfo, ...eventArgs ) ) {
- return eventInfo.return;
- }
- }
- // Element node handling.
- else if ( node.is( 'element' ) ) {
- if ( fireListenerFor( eventContexts, node.name, eventInfo, ...eventArgs ) ) {
- return eventInfo.return;
- }
- }
- // Check custom contexts (i.e., a widget).
- if ( fireListenerFor( eventContexts, node, eventInfo, ...eventArgs ) ) {
- return eventInfo.return;
- }
- node = node.parent;
- updateEventInfo( eventInfo, 'bubbling', node );
- }
- updateEventInfo( eventInfo, 'bubbling', this );
- // Document context.
- fireListenerFor( eventContexts, '$document', eventInfo, ...eventArgs );
- return eventInfo.return;
- } catch ( err ) {
- // @if CK_DEBUG // throw err;
- /* istanbul ignore next */
- _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"].rethrowUnexpectedError( err, this );
- }
- },
- /**
- * @inheritDoc
- */
- _addEventListener( event, callback, options ) {
- const contexts = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__["default"])( options.context || '$document' );
- const eventContexts = getBubblingContexts( this );
- for ( const context of contexts ) {
- let emitter = eventContexts.get( context );
- if ( !emitter ) {
- emitter = Object.create( _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
- eventContexts.set( context, emitter );
- }
- this.listenTo( emitter, event, callback, options );
- }
- },
- /**
- * @inheritDoc
- */
- _removeEventListener( event, callback ) {
- const eventContexts = getBubblingContexts( this );
- for ( const emitter of eventContexts.values() ) {
- this.stopListening( emitter, event, callback );
- }
- }
- };
- /* harmony default export */ __webpack_exports__["default"] = (BubblingEmitterMixin);
- // Update the event info bubbling fields.
- //
- // @param {module:utils/eventinfo~EventInfo} eventInfo The event info object to update.
- // @param {'none'|'capturing'|'atTarget'|'bubbling'} eventPhase The current event phase.
- // @param {module:engine/view/document~Document|module:engine/view/node~Node} currentTarget The current bubbling target.
- function updateEventInfo( eventInfo, eventPhase, currentTarget ) {
- if ( eventInfo instanceof _bubblingeventinfo__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
- eventInfo._eventPhase = eventPhase;
- eventInfo._currentTarget = currentTarget;
- }
- }
- // Fires the listener for the specified context. Returns `true` if event was stopped.
- //
- // @private
- // @param {Map.<String|Function, module:utils/emittermixin~Emitter>} eventContexts
- // @param {String|module:engine/view/node~Node} context
- // @param {module:utils/eventinfo~EventInfo} eventInfo The `EventInfo` object.
- // @param {...*} [eventArgs] Additional arguments to be passed to the callbacks.
- // @returns {Boolean} True if event stop was called.
- function fireListenerFor( eventContexts, context, eventInfo, ...eventArgs ) {
- const emitter = typeof context == 'string' ? eventContexts.get( context ) : getCustomContext( eventContexts, context );
- if ( !emitter ) {
- return false;
- }
- emitter.fire( eventInfo, ...eventArgs );
- return eventInfo.stop.called;
- }
- // Returns an emitter for a specified view node.
- //
- // @private
- // @param {Map.<String|Function, module:utils/emittermixin~Emitter>} eventContexts
- // @param {module:engine/view/node~Node} node
- // @returns {module:utils/emittermixin~Emitter|null}
- function getCustomContext( eventContexts, node ) {
- for ( const [ context, emitter ] of eventContexts ) {
- if ( typeof context == 'function' && context( node ) ) {
- return emitter;
- }
- }
- return null;
- }
- // Returns bubbling contexts map for the source (emitter).
- function getBubblingContexts( source ) {
- if ( !source[ contextsSymbol ] ) {
- source[ contextsSymbol ] = new Map();
- }
- return source[ contextsSymbol ];
- }
- // Returns the deeper parent element for the range.
- function getDeeperRangeParent( range ) {
- if ( !range ) {
- return null;
- }
- const startParent = range.start.parent;
- const endParent = range.end.parent;
- const startPath = startParent.getPath();
- const endPath = endParent.getPath();
- return startPath.length > endPath.length ? startParent : endParent;
- }
- /**
- * Bubbling emitter for the view document.
- *
- * Bubbling emitter is triggering events in the context of specified {@link module:engine/view/element~Element view element} name,
- * predefined `'$text'`, `'$root'`, `'$document'` and `'$capture'` contexts, and context matchers provided as a function.
- *
- * Before bubbling starts, listeners for `'$capture'` context are triggered. Then the bubbling starts from the deeper selection
- * position (by firing event on the `'$text'` context) and propagates the view document tree up to the `'$root'` and finally
- * the listeners at `'$document'` context are fired (this is the default context).
- *
- * Examples:
- *
- * // Listeners registered in the context of the view element names:
- * this.listenTo( viewDocument, 'enter', ( evt, data ) => {
- * // ...
- * }, { context: 'blockquote' } );
- *
- * this.listenTo( viewDocument, 'enter', ( evt, data ) => {
- * // ...
- * }, { context: 'li' } );
- *
- * // Listeners registered in the context of the '$text' and '$root' nodes.
- * this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
- * // ...
- * }, { context: '$text', priority: 'high' } );
- *
- * this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
- * // ...
- * }, { context: '$root' } );
- *
- * // Listeners registered in the context of custom callback function.
- * this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
- * // ...
- * }, { context: isWidget } );
- *
- * this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
- * // ...
- * }, { context: isWidget, priority: 'high' } );
- *
- * Example flow for selection in text:
- *
- * <blockquote><p>Foo[]bar</p></blockquote>
- *
- * Fired events on contexts:
- * 1. `'$capture'`
- * 2. `'$text'`
- * 3. `'p'`
- * 4. `'blockquote'`
- * 5. `'$root'`
- * 6. `'$document'`
- *
- * Example flow for selection on element (i.e., Widget):
- *
- * <blockquote><p>Foo[<widget/>]bar</p></blockquote>
- *
- * Fired events on contexts:
- * 1. `'$capture'`
- * 2. *widget* (custom matcher)
- * 3. `'p'`
- * 4. `'blockquote'`
- * 5. `'$root'`
- * 6. `'$document'`
- *
- * There could be multiple listeners registered for the same context and at different priority levels:
- *
- * <p>Foo[]bar</p>
- *
- * 1. `'$capture'` at priorities:
- * 1. `'highest'`
- * 2. `'high'`
- * 3. `'normal'`
- * 4. `'low'`
- * 5. `'lowest'`
- * 2. `'$text'` at priorities:
- * 1. `'highest'`
- * 2. `'high'`
- * 3. `'normal'`
- * 4. `'low'`
- * 5. `'lowest'`
- * 3. `'p'` at priorities:
- * 1. `'highest'`
- * 2. `'high'`
- * 3. `'normal'`
- * 4. `'low'`
- * 5. `'lowest'`
- * 4. `'$root'` at priorities:
- * 1. `'highest'`
- * 2. `'high'`
- * 3. `'normal'`
- * 4. `'low'`
- * 5. `'lowest'`
- * 5. `'$document'` at priorities:
- * 1. `'highest'`
- * 2. `'high'`
- * 3. `'normal'`
- * 4. `'low'`
- * 5. `'lowest'`
- *
- * @interface BubblingEmitter
- * @extends module:utils/emittermixin~Emitter
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js ***!
- \****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BubblingEventInfo; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/bubblingeventinfo
- */
- /**
- * The event object passed to bubbling event callbacks. It is used to provide information about the event as well as a tool to
- * manipulate it.
- *
- * @extends module:utils/eventinfo~EventInfo
- */
- class BubblingEventInfo extends _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @param {Object} source The emitter.
- * @param {String} name The event name.
- * @param {module:engine/view/range~Range} startRange The view range that the bubbling should start from.
- */
- constructor( source, name, startRange ) {
- super( source, name );
- /**
- * The view range that the bubbling should start from.
- *
- * @readonly
- * @member {module:engine/view/range~Range}
- */
- this.startRange = startRange;
- /**
- * The current event phase.
- *
- * @protected
- * @member {'none'|'capturing'|'atTarget'|'bubbling'}
- */
- this._eventPhase = 'none';
- /**
- * The current bubbling target.
- *
- * @protected
- * @member {module:engine/view/document~Document|module:engine/view/node~Node|null}
- */
- this._currentTarget = null;
- }
- /**
- * The current event phase.
- *
- * @readonly
- * @member {'none'|'capturing'|'atTarget'|'bubbling'}
- */
- get eventPhase() {
- return this._eventPhase;
- }
- /**
- * The current bubbling target.
- *
- * @readonly
- * @member {module:engine/view/document~Document|module:engine/view/node~Node|null}
- */
- get currentTarget() {
- return this._currentTarget;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClickObserver; });
- /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/clickobserver
- */
- /**
- * {@link module:engine/view/document~Document#event:click Click} event observer.
- *
- * Note that this observer is not available by default. To make it available it needs to be added to
- * {@link module:engine/view/view~View view controller}
- * by a {@link module:engine/view/view~View#addObserver} method.
- *
- * @extends module:engine/view/observer/domeventobserver~DomEventObserver
- */
- class ClickObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
- constructor( view ) {
- super( view );
- this.domEventType = 'click';
- }
- onDomEvent( domEvent ) {
- this.fire( domEvent.type, domEvent );
- }
- }
- /**
- * Fired when one of the editables has been clicked.
- *
- * Introduced by {@link module:engine/view/observer/clickobserver~ClickObserver}.
- *
- * Note that this event is not available by default. To make it available
- * {@link module:engine/view/observer/clickobserver~ClickObserver} needs to be added
- * to {@link module:engine/view/view~View} by a {@link module:engine/view/view~View#addObserver} method.
- *
- * @see module:engine/view/observer/clickobserver~ClickObserver
- * @event module:engine/view/document~Document#event:click
- * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js":
- /*!******************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js ***!
- \******************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CompositionObserver; });
- /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/compositionobserver
- */
- /**
- * {@link module:engine/view/document~Document#event:compositionstart Compositionstart},
- * {@link module:engine/view/document~Document#event:compositionupdate compositionupdate} and
- * {@link module:engine/view/document~Document#event:compositionend compositionend} events observer.
- *
- * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
- *
- * @extends module:engine/view/observer/domeventobserver~DomEventObserver
- */
- class CompositionObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
- constructor( view ) {
- super( view );
- this.domEventType = [ 'compositionstart', 'compositionupdate', 'compositionend' ];
- const document = this.document;
- document.on( 'compositionstart', () => {
- document.isComposing = true;
- } );
- document.on( 'compositionend', () => {
- document.isComposing = false;
- } );
- }
- onDomEvent( domEvent ) {
- this.fire( domEvent.type, domEvent );
- }
- }
- /**
- * Fired when composition starts inside one of the editables.
- *
- * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
- *
- * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
- * {@link module:engine/view/view~View} this event is available by default.
- *
- * @see module:engine/view/observer/compositionobserver~CompositionObserver
- * @event module:engine/view/document~Document#event:compositionstart
- * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
- */
- /**
- * Fired when composition is updated inside one of the editables.
- *
- * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
- *
- * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
- * {@link module:engine/view/view~View} this event is available by default.
- *
- * @see module:engine/view/observer/compositionobserver~CompositionObserver
- * @event module:engine/view/document~Document#event:compositionupdate
- * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
- */
- /**
- * Fired when composition ends inside one of the editables.
- *
- * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
- *
- * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
- * {@link module:engine/view/view~View} this event is available by default.
- *
- * @see module:engine/view/observer/compositionobserver~CompositionObserver
- * @event module:engine/view/document~Document#event:compositionend
- * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DomEventData; });
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/domeventdata
- */
- /**
- * Information about a DOM event in context of the {@link module:engine/view/document~Document}.
- * It wraps the native event, which usually should not be used as the wrapper contains
- * additional data (like key code for keyboard events).
- */
- class DomEventData {
- /**
- * @param {module:engine/view/view~View} view The instance of the view controller.
- * @param {Event} domEvent The DOM event.
- * @param {Object} [additionalData] Additional properties that the instance should contain.
- */
- constructor( view, domEvent, additionalData ) {
- /**
- * Instance of the view controller.
- *
- * @readonly
- * @member {module:engine/view/view~View} module:engine/view/observer/observer~Observer.DomEvent#view
- */
- this.view = view;
- /**
- * The instance of the document.
- *
- * @readonly
- * @member {module:engine/view/document~Document} module:engine/view/observer/observer~Observer.DomEvent#document
- */
- this.document = view.document;
- /**
- * The DOM event.
- *
- * @readonly
- * @member {Event} module:engine/view/observer/observer~Observer.DomEvent#domEvent
- */
- this.domEvent = domEvent;
- /**
- * The DOM target.
- *
- * @readonly
- * @member {HTMLElement} module:engine/view/observer/observer~Observer.DomEvent#target
- */
- this.domTarget = domEvent.target;
- Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["extend"])( this, additionalData );
- }
- /**
- * The tree view element representing the target.
- *
- * @readonly
- * @type module:engine/view/element~Element
- */
- get target() {
- return this.view.domConverter.mapDomToView( this.domTarget );
- }
- /**
- * Prevents the native's event default action.
- */
- preventDefault() {
- this.domEvent.preventDefault();
- }
- /**
- * Stops native event propagation.
- */
- stopPropagation() {
- this.domEvent.stopPropagation();
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js ***!
- \***************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DomEventObserver; });
- /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
- /* harmony import */ var _domeventdata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/domeventobserver
- */
- /**
- * Base class for DOM event observers. This class handles
- * {@link module:engine/view/observer/observer~Observer#observe adding} listeners to DOM elements,
- * {@link module:engine/view/observer/observer~Observer#disable disabling} and
- * {@link module:engine/view/observer/observer~Observer#enable re-enabling} events.
- * Child class needs to define
- * {@link module:engine/view/observer/domeventobserver~DomEventObserver#domEventType DOM event type} and
- * {@link module:engine/view/observer/domeventobserver~DomEventObserver#onDomEvent callback}.
- *
- * For instance:
- *
- * class ClickObserver extends DomEventObserver {
- * // It can also be defined as a normal property in the constructor.
- * get domEventType() {
- * return 'click';
- * }
- *
- * onDomEvent( domEvent ) {
- * this.fire( 'click', domEvent );
- * }
- * }
- *
- * @extends module:engine/view/observer/observer~Observer
- */
- class DomEventObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Type of the DOM event the observer should listen to. Array of types can be defined
- * if the observer should listen to multiple DOM events.
- *
- * @readonly
- * @member {String|Array.<String>} #domEventType
- */
- /**
- * Callback which should be called when the DOM event occurred. Note that the callback will not be called if
- * observer {@link #isEnabled is not enabled}.
- *
- * @see #domEventType
- * @abstract
- * @method #onDomEvent
- */
- /**
- * @inheritDoc
- */
- constructor( view ) {
- super( view );
- /**
- * If set to `true` DOM events will be listened on the capturing phase.
- * Default value is `false`.
- *
- * @member {Boolean}
- */
- this.useCapture = false;
- }
- /**
- * @inheritDoc
- */
- observe( domElement ) {
- const types = typeof this.domEventType == 'string' ? [ this.domEventType ] : this.domEventType;
- types.forEach( type => {
- this.listenTo( domElement, type, ( eventInfo, domEvent ) => {
- if ( this.isEnabled && !this.checkShouldIgnoreEventFromTarget( domEvent.target ) ) {
- this.onDomEvent( domEvent );
- }
- }, { useCapture: this.useCapture } );
- } );
- }
- /**
- * Calls `Document#fire()` if observer {@link #isEnabled is enabled}.
- *
- * @see module:utils/emittermixin~EmitterMixin#fire
- * @param {String} eventType The event type (name).
- * @param {Event} domEvent The DOM event.
- * @param {Object} [additionalData] The additional data which should extend the
- * {@link module:engine/view/observer/domeventdata~DomEventData event data} object.
- */
- fire( eventType, domEvent, additionalData ) {
- if ( this.isEnabled ) {
- this.document.fire( eventType, new _domeventdata__WEBPACK_IMPORTED_MODULE_1__["default"]( this.view, domEvent, additionalData ) );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js":
- /*!********************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js ***!
- \********************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FakeSelectionObserver; });
- /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
- /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/fakeselectionobserver
- */
- /**
- * Fake selection observer class. If view selection is fake it is placed in dummy DOM container. This observer listens
- * on {@link module:engine/view/document~Document#event:keydown keydown} events and handles moving fake view selection to the correct place
- * if arrow keys are pressed.
- * Fires {@link module:engine/view/document~Document#event:selectionChange selectionChange event} simulating natural behaviour of
- * {@link module:engine/view/observer/selectionobserver~SelectionObserver SelectionObserver}.
- *
- * @extends module:engine/view/observer/observer~Observer
- */
- class FakeSelectionObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates new FakeSelectionObserver instance.
- *
- * @param {module:engine/view/view~View} view
- */
- constructor( view ) {
- super( view );
- /**
- * Fires debounced event `selectionChangeDone`. It uses `lodash#debounce` method to delay function call.
- *
- * @private
- * @param {Object} data Selection change data.
- * @method #_fireSelectionChangeDoneDebounced
- */
- this._fireSelectionChangeDoneDebounced = Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["debounce"])( data => this.document.fire( 'selectionChangeDone', data ), 200 );
- }
- /**
- * @inheritDoc
- */
- observe() {
- const document = this.document;
- document.on( 'arrowKey', ( eventInfo, data ) => {
- const selection = document.selection;
- if ( selection.isFake && this.isEnabled ) {
- // Prevents default key down handling - no selection change will occur.
- data.preventDefault();
- }
- }, { context: '$capture' } );
- document.on( 'arrowKey', ( eventInfo, data ) => {
- const selection = document.selection;
- if ( selection.isFake && this.isEnabled ) {
- this._handleSelectionMove( data.keyCode );
- }
- }, { priority: 'lowest' } );
- }
- /**
- * @inheritDoc
- */
- destroy() {
- super.destroy();
- this._fireSelectionChangeDoneDebounced.cancel();
- }
- /**
- * Handles collapsing view selection according to given key code. If left or up key is provided - new selection will be
- * collapsed to left. If right or down key is pressed - new selection will be collapsed to right.
- *
- * This method fires {@link module:engine/view/document~Document#event:selectionChange} and
- * {@link module:engine/view/document~Document#event:selectionChangeDone} events imitating behaviour of
- * {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
- *
- * @private
- * @param {Number} keyCode
- * @fires module:engine/view/document~Document#event:selectionChange
- * @fires module:engine/view/document~Document#event:selectionChangeDone
- */
- _handleSelectionMove( keyCode ) {
- const selection = this.document.selection;
- const newSelection = new _selection__WEBPACK_IMPORTED_MODULE_1__["default"]( selection.getRanges(), { backward: selection.isBackward, fake: false } );
- // Left or up arrow pressed - move selection to start.
- if ( keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].arrowleft || keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].arrowup ) {
- newSelection.setTo( newSelection.getFirstPosition() );
- }
- // Right or down arrow pressed - move selection to end.
- if ( keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].arrowright || keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].arrowdown ) {
- newSelection.setTo( newSelection.getLastPosition() );
- }
- const data = {
- oldSelection: selection,
- newSelection,
- domSelection: null
- };
- // Fire dummy selection change event.
- this.document.fire( 'selectionChange', data );
- // Call` #_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.
- // This function is debounced what means that `selectionChangeDone` event will be fired only when
- // defined int the function time will elapse since the last time the function was called.
- // So `selectionChangeDone` will be fired when selection will stop changing.
- this._fireSelectionChangeDoneDebounced( data );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FocusObserver; });
- /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/focusobserver
- */
- /* globals setTimeout, clearTimeout */
- /**
- * {@link module:engine/view/document~Document#event:focus Focus}
- * and {@link module:engine/view/document~Document#event:blur blur} events observer.
- * Focus observer handle also {@link module:engine/view/rooteditableelement~RootEditableElement#isFocused isFocused} property of the
- * {@link module:engine/view/rooteditableelement~RootEditableElement root elements}.
- *
- * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
- *
- * @extends module:engine/view/observer/domeventobserver~DomEventObserver
- */
- class FocusObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
- constructor( view ) {
- super( view );
- this.domEventType = [ 'focus', 'blur' ];
- this.useCapture = true;
- const document = this.document;
- document.on( 'focus', () => {
- document.isFocused = true;
- // Unfortunately native `selectionchange` event is fired asynchronously.
- // We need to wait until `SelectionObserver` handle the event and then render. Otherwise rendering will
- // overwrite new DOM selection with selection from the view.
- // See https://github.com/ckeditor/ckeditor5-engine/issues/795 for more details.
- // Long timeout is needed to solve #676 and https://github.com/ckeditor/ckeditor5-engine/issues/1157 issues.
- this._renderTimeoutId = setTimeout( () => view.forceRender(), 50 );
- } );
- document.on( 'blur', ( evt, data ) => {
- const selectedEditable = document.selection.editableElement;
- if ( selectedEditable === null || selectedEditable === data.target ) {
- document.isFocused = false;
- // Re-render the document to update view elements.
- view.forceRender();
- }
- } );
- /**
- * Identifier of the timeout currently used by focus listener to delay rendering execution.
- *
- * @private
- * @member {Number} #_renderTimeoutId
- */
- }
- onDomEvent( domEvent ) {
- this.fire( domEvent.type, domEvent );
- }
- /**
- * @inheritDoc
- */
- destroy() {
- if ( this._renderTimeoutId ) {
- clearTimeout( this._renderTimeoutId );
- }
- super.destroy();
- }
- }
- /**
- * Fired when one of the editables gets focus.
- *
- * Introduced by {@link module:engine/view/observer/focusobserver~FocusObserver}.
- *
- * Note that because {@link module:engine/view/observer/focusobserver~FocusObserver} is attached by the
- * {@link module:engine/view/view~View} this event is available by default.
- *
- * @see module:engine/view/observer/focusobserver~FocusObserver
- * @event module:engine/view/document~Document#event:focus
- * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
- */
- /**
- * Fired when one of the editables loses focus.
- *
- * Introduced by {@link module:engine/view/observer/focusobserver~FocusObserver}.
- *
- * Note that because {@link module:engine/view/observer/focusobserver~FocusObserver} is attached by the
- * {@link module:engine/view/view~View} this event is available by default.
- *
- * @see module:engine/view/observer/focusobserver~FocusObserver
- * @event module:engine/view/document~Document#event:blur
- * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InputObserver; });
- /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
- /**
- * @module engine/view/observer/inputobserver
- */
- /**
- * Observer for events connected with data input.
- *
- * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
- *
- * @extends module:engine/view/observer/domeventobserver~DomEventObserver
- */
- class InputObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
- constructor( view ) {
- super( view );
- this.domEventType = [ 'beforeinput' ];
- }
- onDomEvent( domEvent ) {
- this.fire( domEvent.type, domEvent );
- }
- }
- /**
- * Fired before browser inputs (or deletes) some data.
- *
- * This event is available only on browsers which support DOM `beforeinput` event.
- *
- * Introduced by {@link module:engine/view/observer/inputobserver~InputObserver}.
- *
- * Note that because {@link module:engine/view/observer/inputobserver~InputObserver} is attached by the
- * {@link module:engine/view/view~View} this event is available by default.
- *
- * @see module:engine/view/observer/inputobserver~InputObserver
- * @event module:engine/view/document~Document#event:beforeinput
- * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return KeyObserver; });
- /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/keyobserver
- */
- /**
- * Observer for events connected with pressing keyboard keys.
- *
- * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
- *
- * @extends module:engine/view/observer/domeventobserver~DomEventObserver
- */
- class KeyObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
- constructor( view ) {
- super( view );
- this.domEventType = [ 'keydown', 'keyup' ];
- }
- onDomEvent( domEvt ) {
- this.fire( domEvt.type, domEvt, {
- keyCode: domEvt.keyCode,
- altKey: domEvt.altKey,
- ctrlKey: domEvt.ctrlKey,
- shiftKey: domEvt.shiftKey,
- metaKey: domEvt.metaKey,
- get keystroke() {
- return Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( this );
- }
- } );
- }
- }
- /**
- * Fired when a key has been pressed.
- *
- * Introduced by {@link module:engine/view/observer/keyobserver~KeyObserver}.
- *
- * Note that because {@link module:engine/view/observer/keyobserver~KeyObserver} is attached by the
- * {@link module:engine/view/view~View} this event is available by default.
- *
- * @see module:engine/view/observer/keyobserver~KeyObserver
- * @event module:engine/view/document~Document#event:keydown
- * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEventData
- */
- /**
- * Fired when a key has been released.
- *
- * Introduced by {@link module:engine/view/observer/keyobserver~KeyObserver}.
- *
- * Note that because {@link module:engine/view/observer/keyobserver~KeyObserver} is attached by the
- * {@link module:engine/view/view~View} this event is available by default.
- *
- * @see module:engine/view/observer/keyobserver~KeyObserver
- * @event module:engine/view/document~Document#event:keyup
- * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEventData
- */
- /**
- * The value of both events - {@link module:engine/view/document~Document#event:keydown} and
- * {@link module:engine/view/document~Document#event:keyup}.
- *
- * @class module:engine/view/observer/keyobserver~KeyEventData
- * @extends module:engine/view/observer/domeventdata~DomEventData
- * @implements module:utils/keyboard~KeystrokeInfo
- */
- /**
- * Code of the whole keystroke. See {@link module:utils/keyboard~getCode}.
- *
- * @readonly
- * @member {Number} module:engine/view/observer/keyobserver~KeyEventData#keystroke
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MouseObserver; });
- /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/mouseobserver
- */
- /**
- * Mouse events observer.
- *
- * Note that this observer is not available by default. To make it available it needs to be added to
- * {@link module:engine/view/view~View} by {@link module:engine/view/view~View#addObserver} method.
- *
- * @extends module:engine/view/observer/domeventobserver~DomEventObserver
- */
- class MouseObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
- constructor( view ) {
- super( view );
- this.domEventType = [ 'mousedown', 'mouseup', 'mouseover', 'mouseout' ];
- }
- onDomEvent( domEvent ) {
- this.fire( domEvent.type, domEvent );
- }
- }
- /**
- * Fired when the mouse button is pressed down on one of the editing roots of the editor.
- *
- * Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
- *
- * Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
- * needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
- *
- * @see module:engine/view/observer/mouseobserver~MouseObserver
- * @event module:engine/view/document~Document#event:mousedown
- * @param {module:engine/view/observer/domeventdata~DomEventData} data The event data.
- */
- /**
- * Fired when the mouse button is released over one of the editing roots of the editor.
- *
- * Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
- *
- * Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
- * needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
- *
- * @see module:engine/view/observer/mouseobserver~MouseObserver
- * @event module:engine/view/document~Document#event:mouseup
- * @param {module:engine/view/observer/domeventdata~DomEventData} data The event data.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js ***!
- \***************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MutationObserver; });
- /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
- /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
- /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/mutationobserver
- */
- /* globals window */
- /**
- * Mutation observer class observes changes in the DOM, fires {@link module:engine/view/document~Document#event:mutations} event, mark view
- * elements as changed and call {@link module:engine/view/renderer~Renderer#render}.
- * Because all mutated nodes are marked as "to be rendered" and the
- * {@link module:engine/view/renderer~Renderer#render} is called, all changes will be reverted, unless the mutation will be handled by the
- * {@link module:engine/view/document~Document#event:mutations} event listener. It means user will see only handled changes, and the editor
- * will block all changes which are not handled.
- *
- * Mutation Observer also take care of reducing number of mutations which are fired. It removes duplicates and
- * mutations on elements which do not have corresponding view elements. Also
- * {@link module:engine/view/observer/mutationobserver~MutatedText text mutation} is fired only if parent element do not change child list.
- *
- * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
- *
- * @extends module:engine/view/observer/observer~Observer
- */
- class MutationObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
- constructor( view ) {
- super( view );
- /**
- * Native mutation observer config.
- *
- * @private
- * @member {Object}
- */
- this._config = {
- childList: true,
- characterData: true,
- characterDataOldValue: true,
- subtree: true
- };
- /**
- * Reference to the {@link module:engine/view/view~View#domConverter}.
- *
- * @member {module:engine/view/domconverter~DomConverter}
- */
- this.domConverter = view.domConverter;
- /**
- * Reference to the {@link module:engine/view/view~View#_renderer}.
- *
- * @member {module:engine/view/renderer~Renderer}
- */
- this.renderer = view._renderer;
- /**
- * Observed DOM elements.
- *
- * @private
- * @member {Array.<HTMLElement>}
- */
- this._domElements = [];
- /**
- * Native mutation observer.
- *
- * @private
- * @member {MutationObserver}
- */
- this._mutationObserver = new window.MutationObserver( this._onMutations.bind( this ) );
- }
- /**
- * Synchronously fires {@link module:engine/view/document~Document#event:mutations} event with all mutations in record queue.
- * At the same time empties the queue so mutations will not be fired twice.
- */
- flush() {
- this._onMutations( this._mutationObserver.takeRecords() );
- }
- /**
- * @inheritDoc
- */
- observe( domElement ) {
- this._domElements.push( domElement );
- if ( this.isEnabled ) {
- this._mutationObserver.observe( domElement, this._config );
- }
- }
- /**
- * @inheritDoc
- */
- enable() {
- super.enable();
- for ( const domElement of this._domElements ) {
- this._mutationObserver.observe( domElement, this._config );
- }
- }
- /**
- * @inheritDoc
- */
- disable() {
- super.disable();
- this._mutationObserver.disconnect();
- }
- /**
- * @inheritDoc
- */
- destroy() {
- super.destroy();
- this._mutationObserver.disconnect();
- }
- /**
- * Handles mutations. Deduplicates, mark view elements to sync, fire event and call render.
- *
- * @private
- * @param {Array.<Object>} domMutations Array of native mutations.
- */
- _onMutations( domMutations ) {
- // As a result of this.flush() we can have an empty collection.
- if ( domMutations.length === 0 ) {
- return;
- }
- const domConverter = this.domConverter;
- // Use map and set for deduplication.
- const mutatedTexts = new Map();
- const mutatedElements = new Set();
- // Handle `childList` mutations first, so we will be able to check if the `characterData` mutation is in the
- // element with changed structure anyway.
- for ( const mutation of domMutations ) {
- if ( mutation.type === 'childList' ) {
- const element = domConverter.mapDomToView( mutation.target );
- // Do not collect mutations from UIElements and RawElements.
- if ( element && ( element.is( 'uiElement' ) || element.is( 'rawElement' ) ) ) {
- continue;
- }
- if ( element && !this._isBogusBrMutation( mutation ) ) {
- mutatedElements.add( element );
- }
- }
- }
- // Handle `characterData` mutations later, when we have the full list of nodes which changed structure.
- for ( const mutation of domMutations ) {
- const element = domConverter.mapDomToView( mutation.target );
- // Do not collect mutations from UIElements and RawElements.
- if ( element && ( element.is( 'uiElement' ) || element.is( 'rawElement' ) ) ) {
- continue;
- }
- if ( mutation.type === 'characterData' ) {
- const text = domConverter.findCorrespondingViewText( mutation.target );
- if ( text && !mutatedElements.has( text.parent ) ) {
- // Use text as a key, for deduplication. If there will be another mutation on the same text element
- // we will have only one in the map.
- mutatedTexts.set( text, {
- type: 'text',
- oldText: text.data,
- newText: Object(_filler__WEBPACK_IMPORTED_MODULE_2__["getDataWithoutFiller"])( mutation.target ),
- node: text
- } );
- }
- // When we added first letter to the text node which had only inline filler, for the DOM it is mutation
- // on text, but for the view, where filler text node did not existed, new text node was created, so we
- // need to fire 'children' mutation instead of 'text'.
- else if ( !text && Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( mutation.target ) ) {
- mutatedElements.add( domConverter.mapDomToView( mutation.target.parentNode ) );
- }
- }
- }
- // Now we build the list of mutations to fire and mark elements. We did not do it earlier to avoid marking the
- // same node multiple times in case of duplication.
- // List of mutations we will fire.
- const viewMutations = [];
- for ( const mutatedText of mutatedTexts.values() ) {
- this.renderer.markToSync( 'text', mutatedText.node );
- viewMutations.push( mutatedText );
- }
- for ( const viewElement of mutatedElements ) {
- const domElement = domConverter.mapViewToDom( viewElement );
- const viewChildren = Array.from( viewElement.getChildren() );
- const newViewChildren = Array.from( domConverter.domChildrenToView( domElement, { withChildren: false } ) );
- // It may happen that as a result of many changes (sth was inserted and then removed),
- // both elements haven't really changed. #1031
- if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["isEqualWith"])( viewChildren, newViewChildren, sameNodes ) ) {
- this.renderer.markToSync( 'children', viewElement );
- viewMutations.push( {
- type: 'children',
- oldChildren: viewChildren,
- newChildren: newViewChildren,
- node: viewElement
- } );
- }
- }
- // Retrieve `domSelection` using `ownerDocument` of one of mutated nodes.
- // There should not be simultaneous mutation in multiple documents, so it's fine.
- const domSelection = domMutations[ 0 ].target.ownerDocument.getSelection();
- let viewSelection = null;
- if ( domSelection && domSelection.anchorNode ) {
- // If `domSelection` is inside a dom node that is already bound to a view node from view tree, get
- // corresponding selection in the view and pass it together with `viewMutations`. The `viewSelection` may
- // be used by features handling mutations.
- // Only one range is supported.
- const viewSelectionAnchor = domConverter.domPositionToView( domSelection.anchorNode, domSelection.anchorOffset );
- const viewSelectionFocus = domConverter.domPositionToView( domSelection.focusNode, domSelection.focusOffset );
- // Anchor and focus has to be properly mapped to view.
- if ( viewSelectionAnchor && viewSelectionFocus ) {
- viewSelection = new _selection__WEBPACK_IMPORTED_MODULE_1__["default"]( viewSelectionAnchor );
- viewSelection.setFocus( viewSelectionFocus );
- }
- }
- // In case only non-relevant mutations were recorded it skips the event and force render (#5600).
- if ( viewMutations.length ) {
- this.document.fire( 'mutations', viewMutations, viewSelection );
- // If nothing changes on `mutations` event, at this point we have "dirty DOM" (changed) and de-synched
- // view (which has not been changed). In order to "reset DOM" we render the view again.
- this.view.forceRender();
- }
- function sameNodes( child1, child2 ) {
- // First level of comparison (array of children vs array of children) – use the Lodash's default behavior.
- if ( Array.isArray( child1 ) ) {
- return;
- }
- // Elements.
- if ( child1 === child2 ) {
- return true;
- }
- // Texts.
- else if ( child1.is( '$text' ) && child2.is( '$text' ) ) {
- return child1.data === child2.data;
- }
- // Not matching types.
- return false;
- }
- }
- /**
- * Checks if mutation was generated by the browser inserting bogus br on the end of the block element.
- * Such mutations are generated while pressing space or performing native spellchecker correction
- * on the end of the block element in Firefox browser.
- *
- * @private
- * @param {Object} mutation Native mutation object.
- * @returns {Boolean}
- */
- _isBogusBrMutation( mutation ) {
- let addedNode = null;
- // Check if mutation added only one node on the end of its parent.
- if ( mutation.nextSibling === null && mutation.removedNodes.length === 0 && mutation.addedNodes.length == 1 ) {
- addedNode = this.domConverter.domToView( mutation.addedNodes[ 0 ], {
- withChildren: false
- } );
- }
- return addedNode && addedNode.is( 'element', 'br' );
- }
- }
- /**
- * Fired when mutation occurred. If tree view is not changed on this event, DOM will be reverted to the state before
- * mutation, so all changes which should be applied, should be handled on this event.
- *
- * Introduced by {@link module:engine/view/observer/mutationobserver~MutationObserver}.
- *
- * Note that because {@link module:engine/view/observer/mutationobserver~MutationObserver} is attached by the
- * {@link module:engine/view/view~View} this event is available by default.
- *
- * @see module:engine/view/observer/mutationobserver~MutationObserver
- * @event module:engine/view/document~Document#event:mutations
- * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|module:engine/view/observer/mutationobserver~MutatedChildren>}
- * viewMutations Array of mutations.
- * For mutated texts it will be {@link module:engine/view/observer/mutationobserver~MutatedText} and for mutated elements it will be
- * {@link module:engine/view/observer/mutationobserver~MutatedChildren}. You can recognize the type based on the `type` property.
- * @param {module:engine/view/selection~Selection|null} viewSelection View selection that is a result of converting DOM selection to view.
- * Keep in
- * mind that the DOM selection is already "updated", meaning that it already acknowledges changes done in mutation.
- */
- /**
- * Mutation item for text.
- *
- * @see module:engine/view/document~Document#event:mutations
- * @see module:engine/view/observer/mutationobserver~MutatedChildren
- *
- * @typedef {Object} module:engine/view/observer/mutationobserver~MutatedText
- *
- * @property {String} type For text mutations it is always 'text'.
- * @property {module:engine/view/text~Text} node Mutated text node.
- * @property {String} oldText Old text.
- * @property {String} newText New text.
- */
- /**
- * Mutation item for child nodes.
- *
- * @see module:engine/view/document~Document#event:mutations
- * @see module:engine/view/observer/mutationobserver~MutatedText
- *
- * @typedef {Object} module:engine/view/observer/mutationobserver~MutatedChildren
- *
- * @property {String} type For child nodes mutations it is always 'children'.
- * @property {module:engine/view/element~Element} node Parent of the mutated children.
- * @property {Array.<module:engine/view/node~Node>} oldChildren Old child nodes.
- * @property {Array.<module:engine/view/node~Node>} newChildren New child nodes.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Observer; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/observer
- */
- /**
- * Abstract base observer class. Observers are classes which listen to DOM events, do the preliminary
- * processing and fire events on the {@link module:engine/view/document~Document} objects.
- * Observers can also add features to the view, for instance by updating its status or marking elements
- * which need a refresh on DOM events.
- *
- * @abstract
- */
- class Observer {
- /**
- * Creates an instance of the observer.
- *
- * @param {module:engine/view/view~View} view
- */
- constructor( view ) {
- /**
- * An instance of the view controller.
- *
- * @readonly
- * @member {module:engine/view/view~View}
- */
- this.view = view;
- /**
- * A reference to the {@link module:engine/view/document~Document} object.
- *
- * @readonly
- * @member {module:engine/view/document~Document}
- */
- this.document = view.document;
- /**
- * The state of the observer. If it is disabled, no events will be fired.
- *
- * @readonly
- * @member {Boolean}
- */
- this.isEnabled = false;
- }
- /**
- * Enables the observer. This method is called when the observer is registered to the
- * {@link module:engine/view/view~View} and after {@link module:engine/view/view~View#forceRender rendering}
- * (all observers are {@link #disable disabled} before rendering).
- *
- * A typical use case for disabling observers is that mutation observers need to be disabled for the rendering.
- * However, a child class may not need to be disabled, so it can implement an empty method.
- *
- * @see module:engine/view/observer/observer~Observer#disable
- */
- enable() {
- this.isEnabled = true;
- }
- /**
- * Disables the observer. This method is called before
- * {@link module:engine/view/view~View#forceRender rendering} to prevent firing events during rendering.
- *
- * @see module:engine/view/observer/observer~Observer#enable
- */
- disable() {
- this.isEnabled = false;
- }
- /**
- * Disables and destroys the observer, among others removes event listeners created by the observer.
- */
- destroy() {
- this.disable();
- this.stopListening();
- }
- /**
- * Checks whether a given DOM event should be ignored (should not be turned into a synthetic view document event).
- *
- * Currently, an event will be ignored only if its target or any of its ancestors has the `data-cke-ignore-events` attribute.
- * This attribute can be used inside the structures generated by
- * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `DowncastWriter#createUIElement()`} to ignore events
- * fired within a UI that should be excluded from CKEditor 5's realms.
- *
- * @param {Node} domTarget The DOM event target to check (usually an element, sometimes a text node and
- * potentially sometimes a document, too).
- * @returns {Boolean} Whether this event should be ignored by the observer.
- */
- checkShouldIgnoreEventFromTarget( domTarget ) {
- if ( domTarget && domTarget.nodeType === 3 ) {
- domTarget = domTarget.parentNode;
- }
- if ( !domTarget || domTarget.nodeType !== 1 ) {
- return false;
- }
- return domTarget.matches( '[data-cke-ignore-events], [data-cke-ignore-events] *' );
- }
- /**
- * Starts observing the given root element.
- *
- * @method #observe
- * @param {HTMLElement} domElement
- * @param {String} name The name of the root element.
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Observer, _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js ***!
- \****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectionObserver; });
- /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
- /* harmony import */ var _mutationobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mutationobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/observer/selectionobserver
- */
- /* global setInterval, clearInterval */
- /**
- * Selection observer class observes selection changes in the document. If a selection changes on the document this
- * observer checks if there are any mutations and if the DOM selection is different from the
- * {@link module:engine/view/document~Document#selection view selection}. The selection observer fires
- * {@link module:engine/view/document~Document#event:selectionChange} event only if a selection change was the only change in the document
- * and the DOM selection is different then the view selection.
- *
- * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
- *
- * @see module:engine/view/observer/mutationobserver~MutationObserver
- * @extends module:engine/view/observer/observer~Observer
- */
- class SelectionObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
- constructor( view ) {
- super( view );
- /**
- * Instance of the mutation observer. Selection observer calls
- * {@link module:engine/view/observer/mutationobserver~MutationObserver#flush} to ensure that the mutations will be handled
- * before the {@link module:engine/view/document~Document#event:selectionChange} event is fired.
- *
- * @readonly
- * @member {module:engine/view/observer/mutationobserver~MutationObserver}
- * module:engine/view/observer/selectionobserver~SelectionObserver#mutationObserver
- */
- this.mutationObserver = view.getObserver( _mutationobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /**
- * Reference to the view {@link module:engine/view/documentselection~DocumentSelection} object used to compare
- * new selection with it.
- *
- * @readonly
- * @member {module:engine/view/documentselection~DocumentSelection}
- * module:engine/view/observer/selectionobserver~SelectionObserver#selection
- */
- this.selection = this.document.selection;
- /* eslint-disable max-len */
- /**
- * Reference to the {@link module:engine/view/view~View#domConverter}.
- *
- * @readonly
- * @member {module:engine/view/domconverter~DomConverter} module:engine/view/observer/selectionobserver~SelectionObserver#domConverter
- */
- /* eslint-enable max-len */
- this.domConverter = view.domConverter;
- /**
- * A set of documents which have added `selectionchange` listener to avoid adding a listener twice to the same
- * document.
- *
- * @private
- * @member {WeakSet.<Document>} module:engine/view/observer/selectionobserver~SelectionObserver#_documents
- */
- this._documents = new WeakSet();
- /**
- * Fires debounced event `selectionChangeDone`. It uses `lodash#debounce` method to delay function call.
- *
- * @private
- * @param {Object} data Selection change data.
- * @method #_fireSelectionChangeDoneDebounced
- */
- this._fireSelectionChangeDoneDebounced = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["debounce"])( data => this.document.fire( 'selectionChangeDone', data ), 200 );
- this._clearInfiniteLoopInterval = setInterval( () => this._clearInfiniteLoop(), 1000 );
- /**
- * Private property to check if the code does not enter infinite loop.
- *
- * @private
- * @member {Number} module:engine/view/observer/selectionobserver~SelectionObserver#_loopbackCounter
- */
- this._loopbackCounter = 0;
- }
- /**
- * @inheritDoc
- */
- observe( domElement ) {
- const domDocument = domElement.ownerDocument;
- // Add listener once per each document.
- if ( this._documents.has( domDocument ) ) {
- return;
- }
- this.listenTo( domDocument, 'selectionchange', ( evt, domEvent ) => {
- this._handleSelectionChange( domEvent, domDocument );
- } );
- this._documents.add( domDocument );
- }
- /**
- * @inheritDoc
- */
- destroy() {
- super.destroy();
- clearInterval( this._clearInfiniteLoopInterval );
- this._fireSelectionChangeDoneDebounced.cancel();
- }
- /**
- * Selection change listener. {@link module:engine/view/observer/mutationobserver~MutationObserver#flush Flush} mutations, check if
- * a selection changes and fires {@link module:engine/view/document~Document#event:selectionChange} event on every change
- * and {@link module:engine/view/document~Document#event:selectionChangeDone} when a selection stop changing.
- *
- * @private
- * @param {Event} domEvent DOM event.
- * @param {Document} domDocument DOM document.
- */
- _handleSelectionChange( domEvent, domDocument ) {
- if ( !this.isEnabled ) {
- return;
- }
- const domSelection = domDocument.defaultView.getSelection();
- if ( this.checkShouldIgnoreEventFromTarget( domSelection.anchorNode ) ) {
- return;
- }
- // Ensure the mutation event will be before selection event on all browsers.
- this.mutationObserver.flush();
- // If there were mutations then the view will be re-rendered by the mutation observer and the selection
- // will be updated, so the selections will equal and the event will not be fired, as expected.
- const newViewSelection = this.domConverter.domSelectionToView( domSelection );
- // Do not convert selection change if the new view selection has no ranges in it.
- //
- // It means that the DOM selection is in some way incorrect. Ranges that were in the DOM selection could not be
- // converted to the view. This happens when the DOM selection was moved outside of the editable element.
- if ( newViewSelection.rangeCount == 0 ) {
- this.view.hasDomSelection = false;
- return;
- }
- this.view.hasDomSelection = true;
- if ( this.selection.isEqual( newViewSelection ) && this.domConverter.isDomSelectionCorrect( domSelection ) ) {
- return;
- }
- // Ensure we are not in the infinite loop (#400).
- // This counter is reset each second. 60 selection changes in 1 second is enough high number
- // to be very difficult (impossible) to achieve using just keyboard keys (during normal editor use).
- if ( ++this._loopbackCounter > 60 ) {
- // Selection change observer detected an infinite rendering loop.
- // Most probably you try to put the selection in the position which is not allowed
- // by the browser and browser fixes it automatically what causes `selectionchange` event on
- // which a loopback through a model tries to re-render the wrong selection and again.
- //
- // @if CK_DEBUG // console.warn( 'Selection change observer detected an infinite rendering loop.' );
- return;
- }
- if ( this.selection.isSimilar( newViewSelection ) ) {
- // If selection was equal and we are at this point of algorithm, it means that it was incorrect.
- // Just re-render it, no need to fire any events, etc.
- this.view.forceRender();
- } else {
- const data = {
- oldSelection: this.selection,
- newSelection: newViewSelection,
- domSelection
- };
- // Prepare data for new selection and fire appropriate events.
- this.document.fire( 'selectionChange', data );
- // Call `#_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.
- // This function is debounced what means that `selectionChangeDone` event will be fired only when
- // defined int the function time will elapse since the last time the function was called.
- // So `selectionChangeDone` will be fired when selection will stop changing.
- this._fireSelectionChangeDoneDebounced( data );
- }
- }
- /**
- * Clears `SelectionObserver` internal properties connected with preventing infinite loop.
- *
- * @protected
- */
- _clearInfiniteLoop() {
- this._loopbackCounter = 0;
- }
- }
- /**
- * Fired when a selection has changed. This event is fired only when the selection change was the only change that happened
- * in the document, and the old selection is different then the new selection.
- *
- * Introduced by {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
- *
- * Note that because {@link module:engine/view/observer/selectionobserver~SelectionObserver} is attached by the
- * {@link module:engine/view/view~View} this event is available by default.
- *
- * @see module:engine/view/observer/selectionobserver~SelectionObserver
- * @event module:engine/view/document~Document#event:selectionChange
- * @param {Object} data
- * @param {module:engine/view/documentselection~DocumentSelection} data.oldSelection Old View selection which is
- * {@link module:engine/view/document~Document#selection}.
- * @param {module:engine/view/selection~Selection} data.newSelection New View selection which is converted DOM selection.
- * @param {Selection} data.domSelection Native DOM selection.
- */
- /**
- * Fired when selection stops changing.
- *
- * Introduced by {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
- *
- * Note that because {@link module:engine/view/observer/selectionobserver~SelectionObserver} is attached by the
- * {@link module:engine/view/view~View} this event is available by default.
- *
- * @see module:engine/view/observer/selectionobserver~SelectionObserver
- * @event module:engine/view/document~Document#event:selectionChangeDone
- * @param {Object} data
- * @param {module:engine/view/documentselection~DocumentSelection} data.oldSelection Old View selection which is
- * {@link module:engine/view/document~Document#selection}.
- * @param {module:engine/view/selection~Selection} data.newSelection New View selection which is converted DOM selection.
- * @param {Selection} data.domSelection Native DOM selection.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js ***!
- \*************************************************************************/
- /*! exports provided: enablePlaceholder, disablePlaceholder, showPlaceholder, hidePlaceholder, needsPlaceholder */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enablePlaceholder", function() { return enablePlaceholder; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disablePlaceholder", function() { return disablePlaceholder; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showPlaceholder", function() { return showPlaceholder; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hidePlaceholder", function() { return hidePlaceholder; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "needsPlaceholder", function() { return needsPlaceholder; });
- /* harmony import */ var _theme_placeholder_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../theme/placeholder.css */ "./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css");
- /* harmony import */ var _theme_placeholder_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_theme_placeholder_css__WEBPACK_IMPORTED_MODULE_0__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/placeholder
- */
- // Each document stores information about its placeholder elements and check functions.
- const documentPlaceholders = new WeakMap();
- /**
- * A helper that enables a placeholder on the provided view element (also updates its visibility).
- * The placeholder is a CSS pseudo–element (with a text content) attached to the element.
- *
- * To change the placeholder text, simply call this method again with new options.
- *
- * To disable the placeholder, use {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} helper.
- *
- * @param {Object} [options] Configuration options of the placeholder.
- * @param {module:engine/view/view~View} options.view Editing view instance.
- * @param {module:engine/view/element~Element} options.element Element that will gain a placeholder.
- * See `options.isDirectHost` to learn more.
- * @param {String} options.text Placeholder text.
- * @param {Boolean} [options.isDirectHost=true] If set `false`, the placeholder will not be enabled directly
- * in the passed `element` but in one of its children (selected automatically, i.e. a first empty child element).
- * Useful when attaching placeholders to elements that can host other elements (not just text), for instance,
- * editable root elements.
- * @param {Boolean} [options.keepOnFocus=false] If set `true`, the placeholder stay visible when the host element is focused.
- */
- function enablePlaceholder( options ) {
- const { view, element, text, isDirectHost = true, keepOnFocus = false } = options;
- const doc = view.document;
- // Use a single a single post fixer per—document to update all placeholders.
- if ( !documentPlaceholders.has( doc ) ) {
- documentPlaceholders.set( doc, new Map() );
- // If a post-fixer callback makes a change, it should return `true` so other post–fixers
- // can re–evaluate the document again.
- doc.registerPostFixer( writer => updateDocumentPlaceholders( doc, writer ) );
- }
- // Store information about the element placeholder under its document.
- documentPlaceholders.get( doc ).set( element, {
- text,
- isDirectHost,
- keepOnFocus,
- hostElement: isDirectHost ? element : null
- } );
- // Update the placeholders right away.
- view.change( writer => updateDocumentPlaceholders( doc, writer ) );
- }
- /**
- * Disables the placeholder functionality from a given element.
- *
- * See {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} to learn more.
- *
- * @param {module:engine/view/view~View} view
- * @param {module:engine/view/element~Element} element
- */
- function disablePlaceholder( view, element ) {
- const doc = element.document;
- view.change( writer => {
- if ( !documentPlaceholders.has( doc ) ) {
- return;
- }
- const placeholders = documentPlaceholders.get( doc );
- const config = placeholders.get( element );
- writer.removeAttribute( 'data-placeholder', config.hostElement );
- hidePlaceholder( writer, config.hostElement );
- placeholders.delete( element );
- } );
- }
- /**
- * Shows a placeholder in the provided element by changing related attributes and CSS classes.
- *
- * **Note**: This helper will not update the placeholder visibility nor manage the
- * it in any way in the future. What it does is a one–time state change of an element. Use
- * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and
- * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full
- * placeholder functionality.
- *
- * **Note**: This helper will blindly show the placeholder directly in the root editable element if
- * one is passed, which could result in a visual clash if the editable element has some children
- * (for instance, an empty paragraph). Use {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`}
- * in that case or make sure the correct element is passed to the helper.
- *
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer
- * @param {module:engine/view/element~Element} element
- * @returns {Boolean} `true`, if any changes were made to the `element`.
- */
- function showPlaceholder( writer, element ) {
- if ( !element.hasClass( 'ck-placeholder' ) ) {
- writer.addClass( 'ck-placeholder', element );
- return true;
- }
- return false;
- }
- /**
- * Hides a placeholder in the element by changing related attributes and CSS classes.
- *
- * **Note**: This helper will not update the placeholder visibility nor manage the
- * it in any way in the future. What it does is a one–time state change of an element. Use
- * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and
- * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full
- * placeholder functionality.
- *
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer
- * @param {module:engine/view/element~Element} element
- * @returns {Boolean} `true`, if any changes were made to the `element`.
- */
- function hidePlaceholder( writer, element ) {
- if ( element.hasClass( 'ck-placeholder' ) ) {
- writer.removeClass( 'ck-placeholder', element );
- return true;
- }
- return false;
- }
- /**
- * Checks if a placeholder should be displayed in the element.
- *
- * **Note**: This helper will blindly check the possibility of showing a placeholder directly in the
- * root editable element if one is passed, which may not be the expected result. If an element can
- * host other elements (not just text), most likely one of its children should be checked instead
- * because it will be the final host for the placeholder. Use
- * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} in that case or make
- * sure the correct element is passed to the helper.
- *
- * @param {module:engine/view/element~Element} element Element that holds the placeholder.
- * @param {Boolean} keepOnFocus Focusing the element will keep the placeholder visible.
- * @returns {Boolean}
- */
- function needsPlaceholder( element, keepOnFocus ) {
- if ( !element.isAttached() ) {
- return false;
- }
- // Anything but uiElement(s) counts as content.
- const hasContent = Array.from( element.getChildren() )
- .some( element => !element.is( 'uiElement' ) );
- if ( hasContent ) {
- return false;
- }
- // Skip the focus check and make the placeholder visible already regardless of document focus state.
- if ( keepOnFocus ) {
- return true;
- }
- const doc = element.document;
- // If the document is blurred.
- if ( !doc.isFocused ) {
- return true;
- }
- const viewSelection = doc.selection;
- const selectionAnchor = viewSelection.anchor;
- // If document is focused and the element is empty but the selection is not anchored inside it.
- return selectionAnchor && selectionAnchor.parent !== element;
- }
- // Updates all placeholders associated with a document in a post–fixer callback.
- //
- // @private
- // @param { module:engine/view/document~Document} doc
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- // @returns {Boolean} True if any changes were made to the view document.
- function updateDocumentPlaceholders( doc, writer ) {
- const placeholders = documentPlaceholders.get( doc );
- const directHostElements = [];
- let wasViewModified = false;
- // First set placeholders on the direct hosts.
- for ( const [ element, config ] of placeholders ) {
- if ( config.isDirectHost ) {
- directHostElements.push( element );
- if ( updatePlaceholder( writer, element, config ) ) {
- wasViewModified = true;
- }
- }
- }
- // Then set placeholders on the indirect hosts but only on those that does not already have an direct host placeholder.
- for ( const [ element, config ] of placeholders ) {
- if ( config.isDirectHost ) {
- continue;
- }
- const hostElement = getChildPlaceholderHostSubstitute( element );
- // When not a direct host, it could happen that there is no child element
- // capable of displaying a placeholder.
- if ( !hostElement ) {
- continue;
- }
- // Don't override placeholder if the host element already has some direct placeholder.
- if ( directHostElements.includes( hostElement ) ) {
- continue;
- }
- // Update the host element (used for setting and removing the placeholder).
- config.hostElement = hostElement;
- if ( updatePlaceholder( writer, element, config ) ) {
- wasViewModified = true;
- }
- }
- return wasViewModified;
- }
- // Updates a single placeholder in a post–fixer callback.
- //
- // @private
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- // @param {module:engine/view/element~Element} element
- // @param {Object} config Configuration of the placeholder
- // @param {String} config.text
- // @param {Boolean} config.isDirectHost
- // @returns {Boolean} True if any changes were made to the view document.
- function updatePlaceholder( writer, element, config ) {
- const { text, isDirectHost, hostElement } = config;
- let wasViewModified = false;
- // This may be necessary when updating the placeholder text to something else.
- if ( hostElement.getAttribute( 'data-placeholder' ) !== text ) {
- writer.setAttribute( 'data-placeholder', text, hostElement );
- wasViewModified = true;
- }
- // If the host element is not a direct host then placeholder is needed only when there is only one element.
- const isOnlyChild = isDirectHost || element.childCount == 1;
- if ( isOnlyChild && needsPlaceholder( hostElement, config.keepOnFocus ) ) {
- if ( showPlaceholder( writer, hostElement ) ) {
- wasViewModified = true;
- }
- } else if ( hidePlaceholder( writer, hostElement ) ) {
- wasViewModified = true;
- }
- return wasViewModified;
- }
- // Gets a child element capable of displaying a placeholder if a parent element can host more
- // than just text (for instance, when it is a root editable element). The child element
- // can then be used in other placeholder helpers as a substitute of its parent.
- //
- // @private
- // @param {module:engine/view/element~Element} parent
- // @returns {module:engine/view/element~Element|null}
- function getChildPlaceholderHostSubstitute( parent ) {
- if ( parent.childCount ) {
- const firstChild = parent.getChild( 0 );
- if ( firstChild.is( 'element' ) && !firstChild.is( 'uiElement' ) ) {
- return firstChild;
- }
- }
- return null;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Position; });
- /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _editableelement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_version__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/position
- */
- // To check if component is loaded more than once.
- /**
- * Position in the view tree. Position is represented by its parent node and an offset in this parent.
- *
- * In order to create a new position instance use the `createPosition*()` factory methods available in:
- *
- * * {@link module:engine/view/view~View}
- * * {@link module:engine/view/downcastwriter~DowncastWriter}
- * * {@link module:engine/view/upcastwriter~UpcastWriter}
- */
- class Position {
- /**
- * Creates a position.
- *
- * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} parent Position parent.
- * @param {Number} offset Position offset.
- */
- constructor( parent, offset ) {
- /**
- * Position parent.
- *
- * @readonly
- * @member {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
- * module:engine/view/position~Position#parent
- */
- this.parent = parent;
- /**
- * Position offset.
- *
- * @readonly
- * @member {Number} module:engine/view/position~Position#offset
- */
- this.offset = offset;
- }
- /**
- * Node directly after the position. Equals `null` when there is no node after position or position is located
- * inside text node.
- *
- * @readonly
- * @type {module:engine/view/node~Node|null}
- */
- get nodeAfter() {
- if ( this.parent.is( '$text' ) ) {
- return null;
- }
- return this.parent.getChild( this.offset ) || null;
- }
- /**
- * Node directly before the position. Equals `null` when there is no node before position or position is located
- * inside text node.
- *
- * @readonly
- * @type {module:engine/view/node~Node|null}
- */
- get nodeBefore() {
- if ( this.parent.is( '$text' ) ) {
- return null;
- }
- return this.parent.getChild( this.offset - 1 ) || null;
- }
- /**
- * Is `true` if position is at the beginning of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.
- *
- * @readonly
- * @type {Boolean}
- */
- get isAtStart() {
- return this.offset === 0;
- }
- /**
- * Is `true` if position is at the end of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.
- *
- * @readonly
- * @type {Boolean}
- */
- get isAtEnd() {
- const endOffset = this.parent.is( '$text' ) ? this.parent.data.length : this.parent.childCount;
- return this.offset === endOffset;
- }
- /**
- * Position's root, that is the root of the position's parent element.
- *
- * @readonly
- * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
- */
- get root() {
- return this.parent.root;
- }
- /**
- * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this position, or `null` if
- * position is not inside an editable element.
- *
- * @type {module:engine/view/editableelement~EditableElement|null}
- */
- get editableElement() {
- let editable = this.parent;
- while ( !( editable instanceof _editableelement__WEBPACK_IMPORTED_MODULE_3__["default"] ) ) {
- if ( editable.parent ) {
- editable = editable.parent;
- } else {
- return null;
- }
- }
- return editable;
- }
- /**
- * Returns a new instance of Position with offset incremented by `shift` value.
- *
- * @param {Number} shift How position offset should get changed. Accepts negative values.
- * @returns {module:engine/view/position~Position} Shifted position.
- */
- getShiftedBy( shift ) {
- const shifted = Position._createAt( this );
- const offset = shifted.offset + shift;
- shifted.offset = offset < 0 ? 0 : offset;
- return shifted;
- }
- /**
- * Gets the farthest position which matches the callback using
- * {@link module:engine/view/treewalker~TreeWalker TreeWalker}.
- *
- * For example:
- *
- * getLastMatchingPosition( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>
- * getLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } ); // <p>foo[]</p> -> <p>{}foo</p>
- * getLastMatchingPosition( value => false ); // Do not move the position.
- *
- * @param {Function} skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should
- * return `true` if the value should be skipped or `false` if not.
- * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
- *
- * @returns {module:engine/view/position~Position} The position after the last item which matches the `skip` callback test.
- */
- getLastMatchingPosition( skip, options = {} ) {
- options.startPosition = this;
- const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( options );
- treeWalker.skip( skip );
- return treeWalker.position;
- }
- /**
- * Returns ancestors array of this position, that is this position's parent and it's ancestors.
- *
- * @returns {Array} Array with ancestors.
- */
- getAncestors() {
- if ( this.parent.is( 'documentFragment' ) ) {
- return [ this.parent ];
- } else {
- return this.parent.getAncestors( { includeSelf: true } );
- }
- }
- /**
- * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}
- * which is a common ancestor of both positions.
- *
- * @param {module:engine/view/position~Position} position
- * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null}
- */
- getCommonAncestor( position ) {
- const ancestorsA = this.getAncestors();
- const ancestorsB = position.getAncestors();
- let i = 0;
- while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
- i++;
- }
- return i === 0 ? null : ancestorsA[ i - 1 ];
- }
- /**
- * Checks whether this object is of the given type.
- *
- * position.is( 'position' ); // -> true
- * position.is( 'view:position' ); // -> true
- *
- * position.is( 'model:position' ); // -> false
- * position.is( 'element' ); // -> false
- * position.is( 'range' ); // -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'position' || type === 'view:position';
- }
- /**
- * Checks whether this position equals given position.
- *
- * @param {module:engine/view/position~Position} otherPosition Position to compare with.
- * @returns {Boolean} True if positions are same.
- */
- isEqual( otherPosition ) {
- return ( this.parent == otherPosition.parent && this.offset == otherPosition.offset );
- }
- /**
- * Checks whether this position is located before given position. When method returns `false` it does not mean that
- * this position is after give one. Two positions may be located inside separate roots and in that situation this
- * method will still return `false`.
- *
- * @see module:engine/view/position~Position#isAfter
- * @see module:engine/view/position~Position#compareWith
- * @param {module:engine/view/position~Position} otherPosition Position to compare with.
- * @returns {Boolean} Returns `true` if this position is before given position.
- */
- isBefore( otherPosition ) {
- return this.compareWith( otherPosition ) == 'before';
- }
- /**
- * Checks whether this position is located after given position. When method returns `false` it does not mean that
- * this position is before give one. Two positions may be located inside separate roots and in that situation this
- * method will still return `false`.
- *
- * @see module:engine/view/position~Position#isBefore
- * @see module:engine/view/position~Position#compareWith
- * @param {module:engine/view/position~Position} otherPosition Position to compare with.
- * @returns {Boolean} Returns `true` if this position is after given position.
- */
- isAfter( otherPosition ) {
- return this.compareWith( otherPosition ) == 'after';
- }
- /**
- * Checks whether this position is before, after or in same position that other position. Two positions may be also
- * different when they are located in separate roots.
- *
- * @param {module:engine/view/position~Position} otherPosition Position to compare with.
- * @returns {module:engine/view/position~PositionRelation}
- */
- compareWith( otherPosition ) {
- if ( this.root !== otherPosition.root ) {
- return 'different';
- }
- if ( this.isEqual( otherPosition ) ) {
- return 'same';
- }
- // Get path from root to position's parent element.
- const thisPath = this.parent.is( 'node' ) ? this.parent.getPath() : [];
- const otherPath = otherPosition.parent.is( 'node' ) ? otherPosition.parent.getPath() : [];
- // Add the positions' offsets to the parents offsets.
- thisPath.push( this.offset );
- otherPath.push( otherPosition.offset );
- // Compare both path arrays to find common ancestor.
- const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( thisPath, otherPath );
- switch ( result ) {
- case 'prefix':
- return 'before';
- case 'extension':
- return 'after';
- default:
- return thisPath[ result ] < otherPath[ result ] ? 'before' : 'after';
- }
- }
- /**
- * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this positions as a start position.
- *
- * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}
- * @param {module:engine/view/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.
- * @param {Boolean} [options.singleCharacters=false]
- * @param {Boolean} [options.shallow=false]
- * @param {Boolean} [options.ignoreElementEnd=false]
- */
- getWalker( options = {} ) {
- options.startPosition = this;
- return new _treewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( options );
- }
- clone() {
- return new Position( this.parent, this.offset );
- }
- /**
- * Creates position at the given location. The location can be specified as:
- *
- * * a {@link module:engine/view/position~Position position},
- * * parent element and offset (offset defaults to `0`),
- * * parent element and `'end'` (sets position at the end of that element),
- * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
- *
- * This method is a shortcut to other constructors such as:
- *
- * * {@link module:engine/view/position~Position._createBefore},
- * * {@link module:engine/view/position~Position._createAfter}.
- *
- * @protected
- * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * first parameter is a {@link module:engine/view/item~Item view item}.
- */
- static _createAt( itemOrPosition, offset ) {
- if ( itemOrPosition instanceof Position ) {
- return new this( itemOrPosition.parent, itemOrPosition.offset );
- } else {
- const node = itemOrPosition;
- if ( offset == 'end' ) {
- offset = node.is( '$text' ) ? node.data.length : node.childCount;
- } else if ( offset == 'before' ) {
- return this._createBefore( node );
- } else if ( offset == 'after' ) {
- return this._createAfter( node );
- } else if ( offset !== 0 && !offset ) {
- /**
- * {@link module:engine/view/view~View#createPositionAt `View#createPositionAt()`}
- * requires the offset to be specified when the first parameter is a view item.
- *
- * @error view-createpositionat-offset-required
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'view-createpositionat-offset-required', node );
- }
- return new Position( node, offset );
- }
- }
- /**
- * Creates a new position after given view item.
- *
- * @protected
- * @param {module:engine/view/item~Item} item View item after which the position should be located.
- * @returns {module:engine/view/position~Position}
- */
- static _createAfter( item ) {
- // TextProxy is not a instance of Node so we need do handle it in specific way.
- if ( item.is( '$textProxy' ) ) {
- return new Position( item.textNode, item.offsetInText + item.data.length );
- }
- if ( !item.parent ) {
- /**
- * You can not make a position after a root.
- *
- * @error view-position-after-root
- * @param {module:engine/view/node~Node} root
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'view-position-after-root', item, { root: item } );
- }
- return new Position( item.parent, item.index + 1 );
- }
- /**
- * Creates a new position before given view item.
- *
- * @protected
- * @param {module:engine/view/item~Item} item View item before which the position should be located.
- * @returns {module:engine/view/position~Position}
- */
- static _createBefore( item ) {
- // TextProxy is not a instance of Node so we need do handle it in specific way.
- if ( item.is( '$textProxy' ) ) {
- return new Position( item.textNode, item.offsetInText );
- }
- if ( !item.parent ) {
- /**
- * You cannot make a position before a root.
- *
- * @error view-position-before-root
- * @param {module:engine/view/node~Node} root
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'view-position-before-root', item, { root: item } );
- }
- return new Position( item.parent, item.index );
- }
- }
- /**
- * A flag indicating whether this position is `'before'` or `'after'` or `'same'` as given position.
- * If positions are in different roots `'different'` flag is returned.
- *
- * @typedef {String} module:engine/view/position~PositionRelation
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Range; });
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
- /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/range
- */
- /**
- * Range in the view tree. A range is represented by its start and end {@link module:engine/view/position~Position positions}.
- *
- * In order to create a new position instance use the `createPosition*()` factory methods available in:
- *
- * * {@link module:engine/view/view~View}
- * * {@link module:engine/view/downcastwriter~DowncastWriter}
- * * {@link module:engine/view/upcastwriter~UpcastWriter}
- */
- class Range {
- /**
- * Creates a range spanning from `start` position to `end` position.
- *
- * **Note:** Constructor creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
- *
- * @param {module:engine/view/position~Position} start Start position.
- * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at the `start` position.
- */
- constructor( start, end = null ) {
- /**
- * Start position.
- *
- * @readonly
- * @member {module:engine/view/position~Position}
- */
- this.start = start.clone();
- /**
- * End position.
- *
- * @readonly
- * @member {module:engine/view/position~Position}
- */
- this.end = end ? end.clone() : start.clone();
- }
- /**
- * Iterable interface.
- *
- * Iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns
- * them together with additional information like length or {@link module:engine/view/position~Position positions},
- * grouped as {@link module:engine/view/treewalker~TreeWalkerValue}.
- *
- * This iterator uses {@link module:engine/view/treewalker~TreeWalker TreeWalker} with `boundaries` set to this range and
- * `ignoreElementEnd` option
- * set to `true`.
- *
- * @returns {Iterable.<module:engine/view/treewalker~TreeWalkerValue>}
- */
- * [ Symbol.iterator ]() {
- yield* new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( { boundaries: this, ignoreElementEnd: true } );
- }
- /**
- * Returns whether the range is collapsed, that is it start and end positions are equal.
- *
- * @type {Boolean}
- */
- get isCollapsed() {
- return this.start.isEqual( this.end );
- }
- /**
- * Returns whether this range is flat, that is if {@link module:engine/view/range~Range#start start} position and
- * {@link module:engine/view/range~Range#end end} position are in the same {@link module:engine/view/position~Position#parent parent}.
- *
- * @type {Boolean}
- */
- get isFlat() {
- return this.start.parent === this.end.parent;
- }
- /**
- * Range root element.
- *
- * @type {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment}
- */
- get root() {
- return this.start.root;
- }
- /**
- * Creates a maximal range that has the same content as this range but is expanded in both ways (at the beginning
- * and at the end).
- *
- * For example:
- *
- * <p>Foo</p><p><b>{Bar}</b></p> -> <p>Foo</p>[<p><b>Bar</b>]</p>
- * <p><b>foo</b>{bar}<span></span></p> -> <p><b>foo[</b>bar<span></span>]</p>
- *
- * Note that in the sample above:
- *
- * - `<p>` have type of {@link module:engine/view/containerelement~ContainerElement},
- * - `<b>` have type of {@link module:engine/view/attributeelement~AttributeElement},
- * - `<span>` have type of {@link module:engine/view/uielement~UIElement}.
- *
- * @returns {module:engine/view/range~Range} Enlarged range.
- */
- getEnlarged() {
- let start = this.start.getLastMatchingPosition( enlargeTrimSkip, { direction: 'backward' } );
- let end = this.end.getLastMatchingPosition( enlargeTrimSkip );
- // Fix positions, in case if they are in Text node.
- if ( start.parent.is( '$text' ) && start.isAtStart ) {
- start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( start.parent );
- }
- if ( end.parent.is( '$text' ) && end.isAtEnd ) {
- end = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( end.parent );
- }
- return new Range( start, end );
- }
- /**
- * Creates a minimum range that has the same content as this range but is trimmed in both ways (at the beginning
- * and at the end).
- *
- * For example:
- *
- * <p>Foo</p>[<p><b>Bar</b>]</p> -> <p>Foo</p><p><b>{Bar}</b></p>
- * <p><b>foo[</b>bar<span></span>]</p> -> <p><b>foo</b>{bar}<span></span></p>
- *
- * Note that in the sample above:
- *
- * - `<p>` have type of {@link module:engine/view/containerelement~ContainerElement},
- * - `<b>` have type of {@link module:engine/view/attributeelement~AttributeElement},
- * - `<span>` have type of {@link module:engine/view/uielement~UIElement}.
- *
- * @returns {module:engine/view/range~Range} Shrink range.
- */
- getTrimmed() {
- let start = this.start.getLastMatchingPosition( enlargeTrimSkip );
- if ( start.isAfter( this.end ) || start.isEqual( this.end ) ) {
- return new Range( start, start );
- }
- let end = this.end.getLastMatchingPosition( enlargeTrimSkip, { direction: 'backward' } );
- const nodeAfterStart = start.nodeAfter;
- const nodeBeforeEnd = end.nodeBefore;
- // Because TreeWalker prefers positions next to text node, we need to move them manually into these text nodes.
- if ( nodeAfterStart && nodeAfterStart.is( '$text' ) ) {
- start = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeAfterStart, 0 );
- }
- if ( nodeBeforeEnd && nodeBeforeEnd.is( '$text' ) ) {
- end = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeBeforeEnd, nodeBeforeEnd.data.length );
- }
- return new Range( start, end );
- }
- /**
- * Two ranges are equal if their start and end positions are equal.
- *
- * @param {module:engine/view/range~Range} otherRange Range to compare with.
- * @returns {Boolean} `true` if ranges are equal, `false` otherwise
- */
- isEqual( otherRange ) {
- return this == otherRange || ( this.start.isEqual( otherRange.start ) && this.end.isEqual( otherRange.end ) );
- }
- /**
- * Checks whether this range contains given {@link module:engine/view/position~Position position}.
- *
- * @param {module:engine/view/position~Position} position Position to check.
- * @returns {Boolean} `true` if given {@link module:engine/view/position~Position position} is contained in this range,
- * `false` otherwise.
- */
- containsPosition( position ) {
- return position.isAfter( this.start ) && position.isBefore( this.end );
- }
- /**
- * Checks whether this range contains given {@link module:engine/view/range~Range range}.
- *
- * @param {module:engine/view/range~Range} otherRange Range to check.
- * @param {Boolean} [loose=false] Whether the check is loose or strict. If the check is strict (`false`), compared range cannot
- * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or
- * even be equal to this range. Note that collapsed ranges are always compared in strict mode.
- * @returns {Boolean} `true` if given {@link module:engine/view/range~Range range} boundaries are contained by this range, `false`
- * otherwise.
- */
- containsRange( otherRange, loose = false ) {
- if ( otherRange.isCollapsed ) {
- loose = false;
- }
- const containsStart = this.containsPosition( otherRange.start ) || ( loose && this.start.isEqual( otherRange.start ) );
- const containsEnd = this.containsPosition( otherRange.end ) || ( loose && this.end.isEqual( otherRange.end ) );
- return containsStart && containsEnd;
- }
- /**
- * Computes which part(s) of this {@link module:engine/view/range~Range range} is not a part of given
- * {@link module:engine/view/range~Range range}.
- * Returned array contains zero, one or two {@link module:engine/view/range~Range ranges}.
- *
- * Examples:
- *
- * let foo = downcastWriter.createText( 'foo' );
- * let img = downcastWriter.createContainerElement( 'img' );
- * let bar = downcastWriter.createText( 'bar' );
- * let p = downcastWriter.createContainerElement( 'p', null, [ foo, img, bar ] );
- *
- * let range = view.createRange( view.createPositionAt( foo, 2 ), view.createPositionAt( bar, 1 ); // "o", img, "b" are in range.
- * let otherRange = view.createRange( // "oo", img, "ba" are in range.
- * view.createPositionAt( foo, 1 ),
- * view.createPositionAt( bar, 2 )
- * );
- * let transformed = range.getDifference( otherRange );
- * // transformed array has no ranges because `otherRange` contains `range`
- *
- * otherRange = view.createRange( view.createPositionAt( foo, 1 ), view.createPositionAt( p, 2 ); // "oo", img are in range.
- * transformed = range.getDifference( otherRange );
- * // transformed array has one range: from ( p, 2 ) to ( bar, 1 )
- *
- * otherRange = view.createRange( view.createPositionAt( p, 1 ), view.createPositionAt( p, 2 ) ); // img is in range.
- * transformed = range.getDifference( otherRange );
- * // transformed array has two ranges: from ( foo, 1 ) to ( p, 1 ) and from ( p, 2 ) to ( bar, 1 )
- *
- * @param {module:engine/view/range~Range} otherRange Range to differentiate against.
- * @returns {Array.<module:engine/view/range~Range>} The difference between ranges.
- */
- getDifference( otherRange ) {
- const ranges = [];
- if ( this.isIntersecting( otherRange ) ) {
- // Ranges intersect.
- if ( this.containsPosition( otherRange.start ) ) {
- // Given range start is inside this range. This means that we have to
- // add shrunken range - from the start to the middle of this range.
- ranges.push( new Range( this.start, otherRange.start ) );
- }
- if ( this.containsPosition( otherRange.end ) ) {
- // Given range end is inside this range. This means that we have to
- // add shrunken range - from the middle of this range to the end.
- ranges.push( new Range( otherRange.end, this.end ) );
- }
- } else {
- // Ranges do not intersect, return the original range.
- ranges.push( this.clone() );
- }
- return ranges;
- }
- /**
- * Returns an intersection of this {@link module:engine/view/range~Range range} and given {@link module:engine/view/range~Range range}.
- * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.
- *
- * Examples:
- *
- * let foo = downcastWriter.createText( 'foo' );
- * let img = downcastWriter.createContainerElement( 'img' );
- * let bar = downcastWriter.createText( 'bar' );
- * let p = downcastWriter.createContainerElement( 'p', null, [ foo, img, bar ] );
- *
- * let range = view.createRange( view.createPositionAt( foo, 2 ), view.createPositionAt( bar, 1 ); // "o", img, "b" are in range.
- * let otherRange = view.createRange( view.createPositionAt( foo, 1 ), view.createPositionAt( p, 2 ); // "oo", img are in range.
- * let transformed = range.getIntersection( otherRange ); // range from ( foo, 1 ) to ( p, 2 ).
- *
- * otherRange = view.createRange( view.createPositionAt( bar, 1 ), view.createPositionAt( bar, 3 ); "ar" is in range.
- * transformed = range.getIntersection( otherRange ); // null - no common part.
- *
- * @param {module:engine/view/range~Range} otherRange Range to check for intersection.
- * @returns {module:engine/view/range~Range|null} A common part of given ranges or `null` if ranges have no common part.
- */
- getIntersection( otherRange ) {
- if ( this.isIntersecting( otherRange ) ) {
- // Ranges intersect, so a common range will be returned.
- // At most, it will be same as this range.
- let commonRangeStart = this.start;
- let commonRangeEnd = this.end;
- if ( this.containsPosition( otherRange.start ) ) {
- // Given range start is inside this range. This means thaNt we have to
- // shrink common range to the given range start.
- commonRangeStart = otherRange.start;
- }
- if ( this.containsPosition( otherRange.end ) ) {
- // Given range end is inside this range. This means that we have to
- // shrink common range to the given range end.
- commonRangeEnd = otherRange.end;
- }
- return new Range( commonRangeStart, commonRangeEnd );
- }
- // Ranges do not intersect, so they do not have common part.
- return null;
- }
- /**
- * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.
- *
- * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
- * @param {module:engine/view/position~Position} [options.startPosition]
- * @param {Boolean} [options.singleCharacters=false]
- * @param {Boolean} [options.shallow=false]
- * @param {Boolean} [options.ignoreElementEnd=false]
- * @returns {module:engine/view/treewalker~TreeWalker}
- */
- getWalker( options = {} ) {
- options.boundaries = this;
- return new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
- }
- /**
- * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}
- * which is a common ancestor of range's both ends (in which the entire range is contained).
- *
- * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null}
- */
- getCommonAncestor() {
- return this.start.getCommonAncestor( this.end );
- }
- /**
- * Returns an {@link module:engine/view/element~Element Element} contained by the range.
- * The element will be returned when it is the **only** node within the range and **fully–contained**
- * at the same time.
- *
- * @returns {module:engine/view/element~Element|null}
- */
- getContainedElement() {
- if ( this.isCollapsed ) {
- return null;
- }
- let nodeAfterStart = this.start.nodeAfter;
- let nodeBeforeEnd = this.end.nodeBefore;
- // Handle the situation when the range position is at the beginning / at the end of a text node.
- // In such situation `.nodeAfter` and `.nodeBefore` are `null` but the range still might be spanning
- // over one element.
- //
- // <p>Foo{<span class="widget"></span>}bar</p> vs <p>Foo[<span class="widget"></span>]bar</p>
- //
- // These are basically the same range, only the difference is if the range position is at
- // at the end/at the beginning of a text node or just before/just after the text node.
- //
- if ( this.start.parent.is( '$text' ) && this.start.isAtEnd && this.start.parent.nextSibling ) {
- nodeAfterStart = this.start.parent.nextSibling;
- }
- if ( this.end.parent.is( '$text' ) && this.end.isAtStart && this.end.parent.previousSibling ) {
- nodeBeforeEnd = this.end.parent.previousSibling;
- }
- if ( nodeAfterStart && nodeAfterStart.is( 'element' ) && nodeAfterStart === nodeBeforeEnd ) {
- return nodeAfterStart;
- }
- return null;
- }
- /**
- * Clones this range.
- *
- * @returns {module:engine/view/range~Range}
- */
- clone() {
- return new Range( this.start, this.end );
- }
- /**
- * Returns an iterator that iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns
- * them.
- *
- * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option
- * set to `true`. However it returns only {@link module:engine/view/item~Item items},
- * not {@link module:engine/view/treewalker~TreeWalkerValue}.
- *
- * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for
- * a full list of available options.
- *
- * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
- * @returns {Iterable.<module:engine/view/item~Item>}
- */
- * getItems( options = {} ) {
- options.boundaries = this;
- options.ignoreElementEnd = true;
- const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
- for ( const value of treeWalker ) {
- yield value.item;
- }
- }
- /**
- * Returns an iterator that iterates over all {@link module:engine/view/position~Position positions} that are boundaries or
- * contained in this range.
- *
- * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only
- * {@link module:engine/view/position~Position positions}, not {@link module:engine/view/treewalker~TreeWalkerValue}.
- *
- * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for
- * a full list of available options.
- *
- * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
- * @returns {Iterable.<module:engine/view/position~Position>}
- */
- * getPositions( options = {} ) {
- options.boundaries = this;
- const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
- yield treeWalker.position;
- for ( const value of treeWalker ) {
- yield value.nextPosition;
- }
- }
- /**
- * Checks whether this object is of the given type.
- *
- * range.is( 'range' ); // -> true
- * range.is( 'view:range' ); // -> true
- *
- * range.is( 'model:range' ); // -> false
- * range.is( 'element' ); // -> false
- * range.is( 'selection' ); // -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'range' || type === 'view:range';
- }
- /**
- * Checks and returns whether this range intersects with the given range.
- *
- * @param {module:engine/view/range~Range} otherRange Range to compare with.
- * @returns {Boolean} True if ranges intersect.
- */
- isIntersecting( otherRange ) {
- return this.start.isBefore( otherRange.end ) && this.end.isAfter( otherRange.start );
- }
- /**
- * Creates a range from the given parents and offsets.
- *
- * @protected
- * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} startElement Start position
- * parent element.
- * @param {Number} startOffset Start position offset.
- * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} endElement End position
- * parent element.
- * @param {Number} endOffset End position offset.
- * @returns {module:engine/view/range~Range} Created range.
- */
- static _createFromParentsAndOffsets( startElement, startOffset, endElement, endOffset ) {
- return new this(
- new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( startElement, startOffset ),
- new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( endElement, endOffset )
- );
- }
- /**
- * Creates a new range, spreading from specified {@link module:engine/view/position~Position position} to a position moved by
- * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.
- *
- * @protected
- * @param {module:engine/view/position~Position} position Beginning of the range.
- * @param {Number} shift How long the range should be.
- * @returns {module:engine/view/range~Range}
- */
- static _createFromPositionAndShift( position, shift ) {
- const start = position;
- const end = position.getShiftedBy( shift );
- return shift > 0 ? new this( start, end ) : new this( end, start );
- }
- /**
- * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
- * that element and ends after the last child of that element.
- *
- * @protected
- * @param {module:engine/view/element~Element} element Element which is a parent for the range.
- * @returns {module:engine/view/range~Range}
- */
- static _createIn( element ) {
- return this._createFromParentsAndOffsets( element, 0, element, element.childCount );
- }
- /**
- * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
- *
- * @protected
- * @param {module:engine/view/item~Item} item
- * @returns {module:engine/view/range~Range}
- */
- static _createOn( item ) {
- const size = item.is( '$textProxy' ) ? item.offsetSize : 1;
- return this._createFromPositionAndShift( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item ), size );
- }
- }
- // Function used by getEnlarged and getTrimmed methods.
- function enlargeTrimSkip( value ) {
- if ( value.item.is( 'attributeElement' ) || value.item.is( 'uiElement' ) ) {
- return true;
- }
- return false;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RawElement; });
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/rawelement
- */
- /**
- * The raw element class.
- *
- * The raw elements work as data containers ("wrappers", "sandboxes") but their children are not managed or
- * even recognized by the editor. This encapsulation allows integrations to maintain custom DOM structures
- * in the editor content without, for instance, worrying about compatibility with other editor features.
- * Raw elements are a perfect tool for integration with external frameworks and data sources.
- *
- * Unlike {@link module:engine/view/uielement~UIElement UI elements}, raw elements act like real editor
- * content (similar to {@link module:engine/view/containerelement~ContainerElement} or
- * {@link module:engine/view/emptyelement~EmptyElement}), they are considered by the editor selection and
- * {@link module:widget/utils~toWidget they can work as widgets}.
- *
- * To create a new raw element, use the
- * {@link module:engine/view/downcastwriter~DowncastWriter#createRawElement `downcastWriter#createRawElement()`} method.
- *
- * @extends module:engine/view/element~Element
- */
- class RawElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates a new instance of a raw element.
- *
- * Throws the `view-rawelement-cannot-add` {@link module:utils/ckeditorerror~CKEditorError CKEditorError} when the `children`
- * parameter is passed to inform that the usage of `RawElement` is incorrect (adding child nodes to `RawElement` is forbidden).
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#createRawElement
- * @protected
- * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
- * @param {String} name A node name.
- * @param {Object|Iterable} [attrs] The collection of attributes.
- * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
- * A list of nodes to be inserted into the created element.
- */
- constructor( document, name, attrs, children ) {
- super( document, name, attrs, children );
- // Override the default of the base class.
- this._isAllowedInsideAttributeElement = true;
- /**
- * Returns `null` because filler is not needed for raw elements.
- *
- * @method #getFillerOffset
- * @returns {null} Always returns null.
- */
- this.getFillerOffset = getFillerOffset;
- }
- /**
- * Checks whether this object is of the given type or name.
- *
- * rawElement.is( 'rawElement' ); // -> true
- * rawElement.is( 'element' ); // -> true
- * rawElement.is( 'node' ); // -> true
- * rawElement.is( 'view:rawElement' ); // -> true
- * rawElement.is( 'view:element' ); // -> true
- * rawElement.is( 'view:node' ); // -> true
- *
- * rawElement.is( 'model:element' ); // -> false
- * rawElement.is( 'documentFragment' ); // -> false
- *
- * Assuming that the object being checked is a raw element, you can also check its
- * {@link module:engine/view/rawelement~RawElement#name name}:
- *
- * rawElement.is( 'img' ); // -> true if this is an img element
- * rawElement.is( 'rawElement', 'img' ); // -> same as above
- * text.is( 'img' ); -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type The type to check when the `name` parameter is present.
- * Otherwise, it acts like the `name` parameter.
- * @param {String} [name] The element name.
- * @returns {Boolean}
- */
- is( type, name = null ) {
- if ( !name ) {
- return type === 'rawElement' || type === 'view:rawElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === this.name || type === 'view:' + this.name ||
- type === 'element' || type === 'view:element' ||
- type === 'node' || type === 'view:node';
- } else {
- return name === this.name && (
- type === 'rawElement' || type === 'view:rawElement' ||
- type === 'element' || type === 'view:element'
- );
- }
- }
- /**
- * Overrides the {@link module:engine/view/element~Element#_insertChild} method.
- * Throws the `view-rawelement-cannot-add` {@link module:utils/ckeditorerror~CKEditorError CKEditorError} to prevent
- * adding any child nodes to a raw element.
- *
- * @protected
- */
- _insertChild( index, nodes ) {
- if ( nodes && ( nodes instanceof _node__WEBPACK_IMPORTED_MODULE_2__["default"] || Array.from( nodes ).length > 0 ) ) {
- /**
- * Cannot add children to a {@link module:engine/view/rawelement~RawElement} instance.
- *
- * @error view-rawelement-cannot-add
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
- 'view-rawelement-cannot-add',
- [ this, nodes ]
- );
- }
- }
- /**
- * This allows rendering the children of a {@link module:engine/view/rawelement~RawElement} on the DOM level.
- * This method is called by the {@link module:engine/view/domconverter~DomConverter} with the raw DOM element
- * passed as an argument, leaving the number and shape of the children up to the integrator.
- *
- * This method **must be defined** for the raw element to work:
- *
- * const myRawElement = downcastWriter.createRawElement( 'div' );
- *
- * myRawElement.render = function( domElement ) {
- * domElement.innerHTML = '<b>This is the raw content of myRawElement.</b>';
- * };
- *
- * @method #render
- * @param {HTMLElement} domElement The native DOM element representing the raw view element.
- */
- }
- // Returns `null` because block filler is not needed for raw elements.
- //
- // @returns {null}
- function getFillerOffset() {
- return null;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Renderer; });
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
- /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/diff */ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_insertat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/insertat */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_remove__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/remove */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/isnode */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_fastdiff__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/fastdiff */ "./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /* globals Node */
- /**
- * @module engine/view/renderer
- */
- /**
- * Renderer is responsible for updating the DOM structure and the DOM selection based on
- * the {@link module:engine/view/renderer~Renderer#markToSync information about updated view nodes}.
- * In other words, it renders the view to the DOM.
- *
- * Its main responsibility is to make only the necessary, minimal changes to the DOM. However, unlike in many
- * virtual DOM implementations, the primary reason for doing minimal changes is not the performance but ensuring
- * that native editing features such as text composition, autocompletion, spell checking, selection's x-index are
- * affected as little as possible.
- *
- * Renderer uses {@link module:engine/view/domconverter~DomConverter} to transform view nodes and positions
- * to and from the DOM.
- */
- class Renderer {
- /**
- * Creates a renderer instance.
- *
- * @param {module:engine/view/domconverter~DomConverter} domConverter Converter instance.
- * @param {module:engine/view/documentselection~DocumentSelection} selection View selection.
- */
- constructor( domConverter, selection ) {
- /**
- * Set of DOM Documents instances.
- *
- * @readonly
- * @member {Set.<Document>}
- */
- this.domDocuments = new Set();
- /**
- * Converter instance.
- *
- * @readonly
- * @member {module:engine/view/domconverter~DomConverter}
- */
- this.domConverter = domConverter;
- /**
- * Set of nodes which attributes changed and may need to be rendered.
- *
- * @readonly
- * @member {Set.<module:engine/view/node~Node>}
- */
- this.markedAttributes = new Set();
- /**
- * Set of elements which child lists changed and may need to be rendered.
- *
- * @readonly
- * @member {Set.<module:engine/view/node~Node>}
- */
- this.markedChildren = new Set();
- /**
- * Set of text nodes which text data changed and may need to be rendered.
- *
- * @readonly
- * @member {Set.<module:engine/view/node~Node>}
- */
- this.markedTexts = new Set();
- /**
- * View selection. Renderer updates DOM selection based on the view selection.
- *
- * @readonly
- * @member {module:engine/view/documentselection~DocumentSelection}
- */
- this.selection = selection;
- /**
- * Indicates if the view document is focused and selection can be rendered. Selection will not be rendered if
- * this is set to `false`.
- *
- * @member {Boolean}
- */
- this.isFocused = false;
- /**
- * The text node in which the inline filler was rendered.
- *
- * @private
- * @member {Text}
- */
- this._inlineFiller = null;
- /**
- * DOM element containing fake selection.
- *
- * @private
- * @type {null|HTMLElement}
- */
- this._fakeSelectionContainer = null;
- }
- /**
- * Marks a view node to be updated in the DOM by {@link #render `render()`}.
- *
- * Note that only view nodes whose parents have corresponding DOM elements need to be marked to be synchronized.
- *
- * @see #markedAttributes
- * @see #markedChildren
- * @see #markedTexts
- *
- * @param {module:engine/view/document~ChangeType} type Type of the change.
- * @param {module:engine/view/node~Node} node Node to be marked.
- */
- markToSync( type, node ) {
- if ( type === 'text' ) {
- if ( this.domConverter.mapViewToDom( node.parent ) ) {
- this.markedTexts.add( node );
- }
- } else {
- // If the node has no DOM element it is not rendered yet,
- // its children/attributes do not need to be marked to be sync.
- if ( !this.domConverter.mapViewToDom( node ) ) {
- return;
- }
- if ( type === 'attributes' ) {
- this.markedAttributes.add( node );
- } else if ( type === 'children' ) {
- this.markedChildren.add( node );
- } else {
- /**
- * Unknown type passed to Renderer.markToSync.
- *
- * @error view-renderer-unknown-type
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-renderer-unknown-type', this );
- }
- }
- }
- /**
- * Renders all buffered changes ({@link #markedAttributes}, {@link #markedChildren} and {@link #markedTexts}) and
- * the current view selection (if needed) to the DOM by applying a minimal set of changes to it.
- *
- * Renderer tries not to break the text composition (e.g. IME) and x-index of the selection,
- * so it does as little as it is needed to update the DOM.
- *
- * Renderer also handles {@link module:engine/view/filler fillers}. Especially, it checks if the inline filler is needed
- * at the selection position and adds or removes it. To prevent breaking text composition inline filler will not be
- * removed as long as the selection is in the text node which needed it at first.
- */
- render() {
- let inlineFillerPosition;
- // Refresh mappings.
- for ( const element of this.markedChildren ) {
- this._updateChildrenMappings( element );
- }
- // There was inline filler rendered in the DOM but it's not
- // at the selection position any more, so we can remove it
- // (cause even if it's needed, it must be placed in another location).
- if ( this._inlineFiller && !this._isSelectionInInlineFiller() ) {
- this._removeInlineFiller();
- }
- // If we've got the filler, let's try to guess its position in the view.
- if ( this._inlineFiller ) {
- inlineFillerPosition = this._getInlineFillerPosition();
- }
- // Otherwise, if it's needed, create it at the selection position.
- else if ( this._needsInlineFillerAtSelection() ) {
- inlineFillerPosition = this.selection.getFirstPosition();
- // Do not use `markToSync` so it will be added even if the parent is already added.
- this.markedChildren.add( inlineFillerPosition.parent );
- }
- for ( const element of this.markedAttributes ) {
- this._updateAttrs( element );
- }
- for ( const element of this.markedChildren ) {
- this._updateChildren( element, { inlineFillerPosition } );
- }
- for ( const node of this.markedTexts ) {
- if ( !this.markedChildren.has( node.parent ) && this.domConverter.mapViewToDom( node.parent ) ) {
- this._updateText( node, { inlineFillerPosition } );
- }
- }
- // Check whether the inline filler is required and where it really is in the DOM.
- // At this point in most cases it will be in the DOM, but there are exceptions.
- // For example, if the inline filler was deep in the created DOM structure, it will not be created.
- // Similarly, if it was removed at the beginning of this function and then neither text nor children were updated,
- // it will not be present.
- // Fix those and similar scenarios.
- if ( inlineFillerPosition ) {
- const fillerDomPosition = this.domConverter.viewPositionToDom( inlineFillerPosition );
- const domDocument = fillerDomPosition.parent.ownerDocument;
- if ( !Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( fillerDomPosition.parent ) ) {
- // Filler has not been created at filler position. Create it now.
- this._inlineFiller = addInlineFiller( domDocument, fillerDomPosition.parent, fillerDomPosition.offset );
- } else {
- // Filler has been found, save it.
- this._inlineFiller = fillerDomPosition.parent;
- }
- } else {
- // There is no filler needed.
- this._inlineFiller = null;
- }
- // First focus the new editing host, then update the selection.
- // Otherwise, FF may throw an error (https://github.com/ckeditor/ckeditor5/issues/721).
- this._updateFocus();
- this._updateSelection();
- this.markedTexts.clear();
- this.markedAttributes.clear();
- this.markedChildren.clear();
- }
- /**
- * Updates mappings of view element's children.
- *
- * Children that were replaced in the view structure by similar elements (same tag name) are treated as 'replaced'.
- * This means that their mappings can be updated so the new view elements are mapped to the existing DOM elements.
- * Thanks to that these elements do not need to be re-rendered completely.
- *
- * @private
- * @param {module:engine/view/node~Node} viewElement The view element whose children mappings will be updated.
- */
- _updateChildrenMappings( viewElement ) {
- const domElement = this.domConverter.mapViewToDom( viewElement );
- if ( !domElement ) {
- // If there is no `domElement` it means that it was already removed from DOM and there is no need to process it.
- return;
- }
- // Removing nodes from the DOM as we iterate can cause `actualDomChildren`
- // (which is a live-updating `NodeList`) to get out of sync with the
- // indices that we compute as we iterate over `actions`, producing
- // incorrect element mappings.
- //
- // Converting live list to an array to make the list static.
- const actualDomChildren = Array.from(
- this.domConverter.mapViewToDom( viewElement ).childNodes
- );
- const expectedDomChildren = Array.from(
- this.domConverter.viewChildrenToDom( viewElement, domElement.ownerDocument, { withChildren: false } )
- );
- const diff = this._diffNodeLists( actualDomChildren, expectedDomChildren );
- const actions = this._findReplaceActions( diff, actualDomChildren, expectedDomChildren );
- if ( actions.indexOf( 'replace' ) !== -1 ) {
- const counter = { equal: 0, insert: 0, delete: 0 };
- for ( const action of actions ) {
- if ( action === 'replace' ) {
- const insertIndex = counter.equal + counter.insert;
- const deleteIndex = counter.equal + counter.delete;
- const viewChild = viewElement.getChild( insertIndex );
- // UIElement and RawElement are special cases. Their children are not stored in a view (#799)
- // so we cannot use them with replacing flow (since they use view children during rendering
- // which will always result in rendering empty elements).
- if ( viewChild && !( viewChild.is( 'uiElement' ) || viewChild.is( 'rawElement' ) ) ) {
- this._updateElementMappings( viewChild, actualDomChildren[ deleteIndex ] );
- }
- Object(_ckeditor_ckeditor5_utils_src_dom_remove__WEBPACK_IMPORTED_MODULE_6__["default"])( expectedDomChildren[ insertIndex ] );
- counter.equal++;
- } else {
- counter[ action ]++;
- }
- }
- }
- }
- /**
- * Updates mappings of a given view element.
- *
- * @private
- * @param {module:engine/view/node~Node} viewElement The view element whose mappings will be updated.
- * @param {Node} domElement The DOM element representing the given view element.
- */
- _updateElementMappings( viewElement, domElement ) {
- // Remap 'DomConverter' bindings.
- this.domConverter.unbindDomElement( domElement );
- this.domConverter.bindElements( domElement, viewElement );
- // View element may have children which needs to be updated, but are not marked, mark them to update.
- this.markedChildren.add( viewElement );
- // Because we replace new view element mapping with the existing one, the corresponding DOM element
- // will not be rerendered. The new view element may have different attributes than the previous one.
- // Since its corresponding DOM element will not be rerendered, new attributes will not be added
- // to the DOM, so we need to mark it here to make sure its attributes gets updated. See #1427 for more
- // detailed case study.
- // Also there are cases where replaced element is removed from the view structure and then has
- // its attributes changed or removed. In such cases the element will not be present in `markedAttributes`
- // and also may be the same (`element.isSimilar()`) as the reused element not having its attributes updated.
- // To prevent such situations we always mark reused element to have its attributes rerenderd (#1560).
- this.markedAttributes.add( viewElement );
- }
- /**
- * Gets the position of the inline filler based on the current selection.
- * Here, we assume that we know that the filler is needed and
- * {@link #_isSelectionInInlineFiller is at the selection position}, and, since it is needed,
- * it is somewhere at the selection position.
- *
- * Note: The filler position cannot be restored based on the filler's DOM text node, because
- * when this method is called (before rendering), the bindings will often be broken. View-to-DOM
- * bindings are only dependable after rendering.
- *
- * @private
- * @returns {module:engine/view/position~Position}
- */
- _getInlineFillerPosition() {
- const firstPos = this.selection.getFirstPosition();
- if ( firstPos.parent.is( '$text' ) ) {
- return _position__WEBPACK_IMPORTED_MODULE_1__["default"]._createBefore( this.selection.getFirstPosition().parent );
- } else {
- return firstPos;
- }
- }
- /**
- * Returns `true` if the selection has not left the inline filler's text node.
- * If it is `true`, it means that the filler had been added for a reason and the selection did not
- * leave the filler's text node. For example, the user can be in the middle of a composition so it should not be touched.
- *
- * @private
- * @returns {Boolean} `true` if the inline filler and selection are in the same place.
- */
- _isSelectionInInlineFiller() {
- if ( this.selection.rangeCount != 1 || !this.selection.isCollapsed ) {
- return false;
- }
- // Note, we can't check if selection's position equals position of the
- // this._inlineFiller node, because of #663. We may not be able to calculate
- // the filler's position in the view at this stage.
- // Instead, we check it the other way – whether selection is anchored in
- // that text node or next to it.
- // Possible options are:
- // "FILLER{}"
- // "FILLERadded-text{}"
- const selectionPosition = this.selection.getFirstPosition();
- const position = this.domConverter.viewPositionToDom( selectionPosition );
- if ( position && Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( position.parent ) && Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( position.parent ) ) {
- return true;
- }
- return false;
- }
- /**
- * Removes the inline filler.
- *
- * @private
- */
- _removeInlineFiller() {
- const domFillerNode = this._inlineFiller;
- // Something weird happened and the stored node doesn't contain the filler's text.
- if ( !Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( domFillerNode ) ) {
- /**
- * The inline filler node was lost. Most likely, something overwrote the filler text node
- * in the DOM.
- *
- * @error view-renderer-filler-was-lost
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-renderer-filler-was-lost', this );
- }
- if ( Object(_filler__WEBPACK_IMPORTED_MODULE_2__["isInlineFiller"])( domFillerNode ) ) {
- domFillerNode.parentNode.removeChild( domFillerNode );
- } else {
- domFillerNode.data = domFillerNode.data.substr( _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER_LENGTH"] );
- }
- this._inlineFiller = null;
- }
- /**
- * Checks if the inline {@link module:engine/view/filler filler} should be added.
- *
- * @private
- * @returns {Boolean} `true` if the inline filler should be added.
- */
- _needsInlineFillerAtSelection() {
- if ( this.selection.rangeCount != 1 || !this.selection.isCollapsed ) {
- return false;
- }
- const selectionPosition = this.selection.getFirstPosition();
- const selectionParent = selectionPosition.parent;
- const selectionOffset = selectionPosition.offset;
- // If there is no DOM root we do not care about fillers.
- if ( !this.domConverter.mapViewToDom( selectionParent.root ) ) {
- return false;
- }
- if ( !( selectionParent.is( 'element' ) ) ) {
- return false;
- }
- // Prevent adding inline filler inside elements with contenteditable=false.
- // https://github.com/ckeditor/ckeditor5-engine/issues/1170
- if ( !isEditable( selectionParent ) ) {
- return false;
- }
- // We have block filler, we do not need inline one.
- if ( selectionOffset === selectionParent.getFillerOffset() ) {
- return false;
- }
- const nodeBefore = selectionPosition.nodeBefore;
- const nodeAfter = selectionPosition.nodeAfter;
- if ( nodeBefore instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] || nodeAfter instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- return false;
- }
- return true;
- }
- /**
- * Checks if text needs to be updated and possibly updates it.
- *
- * @private
- * @param {module:engine/view/text~Text} viewText View text to update.
- * @param {Object} options
- * @param {module:engine/view/position~Position} options.inlineFillerPosition The position where the inline
- * filler should be rendered.
- */
- _updateText( viewText, options ) {
- const domText = this.domConverter.findCorrespondingDomText( viewText );
- const newDomText = this.domConverter.viewToDom( viewText, domText.ownerDocument );
- const actualText = domText.data;
- let expectedText = newDomText.data;
- const filler = options.inlineFillerPosition;
- if ( filler && filler.parent == viewText.parent && filler.offset == viewText.index ) {
- expectedText = _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER"] + expectedText;
- }
- if ( actualText != expectedText ) {
- const actions = Object(_ckeditor_ckeditor5_utils_src_fastdiff__WEBPACK_IMPORTED_MODULE_11__["default"])( actualText, expectedText );
- for ( const action of actions ) {
- if ( action.type === 'insert' ) {
- domText.insertData( action.index, action.values.join( '' ) );
- } else { // 'delete'
- domText.deleteData( action.index, action.howMany );
- }
- }
- }
- }
- /**
- * Checks if attribute list needs to be updated and possibly updates it.
- *
- * @private
- * @param {module:engine/view/element~Element} viewElement The view element to update.
- */
- _updateAttrs( viewElement ) {
- const domElement = this.domConverter.mapViewToDom( viewElement );
- if ( !domElement ) {
- // If there is no `domElement` it means that 'viewElement' is outdated as its mapping was updated
- // in 'this._updateChildrenMappings()'. There is no need to process it as new view element which
- // replaced old 'viewElement' mapping was also added to 'this.markedAttributes'
- // in 'this._updateChildrenMappings()' so it will be processed separately.
- return;
- }
- const domAttrKeys = Array.from( domElement.attributes ).map( attr => attr.name );
- const viewAttrKeys = viewElement.getAttributeKeys();
- // Add or overwrite attributes.
- for ( const key of viewAttrKeys ) {
- domElement.setAttribute( key, viewElement.getAttribute( key ) );
- }
- // Remove from DOM attributes which do not exists in the view.
- for ( const key of domAttrKeys ) {
- if ( !viewElement.hasAttribute( key ) ) {
- domElement.removeAttribute( key );
- }
- }
- }
- /**
- * Checks if elements child list needs to be updated and possibly updates it.
- *
- * @private
- * @param {module:engine/view/element~Element} viewElement View element to update.
- * @param {Object} options
- * @param {module:engine/view/position~Position} options.inlineFillerPosition The position where the inline
- * filler should be rendered.
- */
- _updateChildren( viewElement, options ) {
- const domElement = this.domConverter.mapViewToDom( viewElement );
- if ( !domElement ) {
- // If there is no `domElement` it means that it was already removed from DOM.
- // There is no need to process it. It will be processed when re-inserted.
- return;
- }
- const inlineFillerPosition = options.inlineFillerPosition;
- const actualDomChildren = this.domConverter.mapViewToDom( viewElement ).childNodes;
- const expectedDomChildren = Array.from(
- this.domConverter.viewChildrenToDom( viewElement, domElement.ownerDocument, { bind: true, inlineFillerPosition } )
- );
- // Inline filler element has to be created as it is present in the DOM, but not in the view. It is required
- // during diffing so text nodes could be compared correctly and also during rendering to maintain
- // proper order and indexes while updating the DOM.
- if ( inlineFillerPosition && inlineFillerPosition.parent === viewElement ) {
- addInlineFiller( domElement.ownerDocument, expectedDomChildren, inlineFillerPosition.offset );
- }
- const diff = this._diffNodeLists( actualDomChildren, expectedDomChildren );
- let i = 0;
- const nodesToUnbind = new Set();
- // Handle deletions first.
- // This is to prevent a situation where an element that already exists in `actualDomChildren` is inserted at a different
- // index in `actualDomChildren`. Since `actualDomChildren` is a `NodeList`, this works like move, not like an insert,
- // and it disrupts the whole algorithm. See https://github.com/ckeditor/ckeditor5/issues/6367.
- //
- // It doesn't matter in what order we remove or add nodes, as long as we remove and add correct nodes at correct indexes.
- for ( const action of diff ) {
- if ( action === 'delete' ) {
- nodesToUnbind.add( actualDomChildren[ i ] );
- Object(_ckeditor_ckeditor5_utils_src_dom_remove__WEBPACK_IMPORTED_MODULE_6__["default"])( actualDomChildren[ i ] );
- } else if ( action === 'equal' ) {
- i++;
- }
- }
- i = 0;
- for ( const action of diff ) {
- if ( action === 'insert' ) {
- Object(_ckeditor_ckeditor5_utils_src_dom_insertat__WEBPACK_IMPORTED_MODULE_5__["default"])( domElement, i, expectedDomChildren[ i ] );
- i++;
- } else if ( action === 'equal' ) {
- // Force updating text nodes inside elements which did not change and do not need to be re-rendered (#1125).
- // Do it here (not in the loop above) because only after insertions the `i` index is correct.
- this._markDescendantTextToSync( this.domConverter.domToView( expectedDomChildren[ i ] ) );
- i++;
- }
- }
- // Unbind removed nodes. When node does not have a parent it means that it was removed from DOM tree during
- // comparison with the expected DOM. We don't need to check child nodes, because if child node was reinserted,
- // it was moved to DOM tree out of the removed node.
- for ( const node of nodesToUnbind ) {
- if ( !node.parentNode ) {
- this.domConverter.unbindDomElement( node );
- }
- }
- }
- /**
- * Shorthand for diffing two arrays or node lists of DOM nodes.
- *
- * @private
- * @param {Array.<Node>|NodeList} actualDomChildren Actual DOM children
- * @param {Array.<Node>|NodeList} expectedDomChildren Expected DOM children.
- * @returns {Array.<String>} The list of actions based on the {@link module:utils/diff~diff} function.
- */
- _diffNodeLists( actualDomChildren, expectedDomChildren ) {
- actualDomChildren = filterOutFakeSelectionContainer( actualDomChildren, this._fakeSelectionContainer );
- return Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__["default"])( actualDomChildren, expectedDomChildren, sameNodes.bind( null, this.domConverter ) );
- }
- /**
- * Finds DOM nodes that were replaced with the similar nodes (same tag name) in the view. All nodes are compared
- * within one `insert`/`delete` action group, for example:
- *
- * Actual DOM: <p><b>Foo</b>Bar<i>Baz</i><b>Bax</b></p>
- * Expected DOM: <p>Bar<b>123</b><i>Baz</i><b>456</b></p>
- * Input actions: [ insert, insert, delete, delete, equal, insert, delete ]
- * Output actions: [ insert, replace, delete, equal, replace ]
- *
- * @private
- * @param {Array.<String>} actions Actions array which is a result of the {@link module:utils/diff~diff} function.
- * @param {Array.<Node>|NodeList} actualDom Actual DOM children
- * @param {Array.<Node>} expectedDom Expected DOM children.
- * @returns {Array.<String>} Actions array modified with the `replace` actions.
- */
- _findReplaceActions( actions, actualDom, expectedDom ) {
- // If there is no both 'insert' and 'delete' actions, no need to check for replaced elements.
- if ( actions.indexOf( 'insert' ) === -1 || actions.indexOf( 'delete' ) === -1 ) {
- return actions;
- }
- let newActions = [];
- let actualSlice = [];
- let expectedSlice = [];
- const counter = { equal: 0, insert: 0, delete: 0 };
- for ( const action of actions ) {
- if ( action === 'insert' ) {
- expectedSlice.push( expectedDom[ counter.equal + counter.insert ] );
- } else if ( action === 'delete' ) {
- actualSlice.push( actualDom[ counter.equal + counter.delete ] );
- } else { // equal
- newActions = newActions.concat( Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__["default"])( actualSlice, expectedSlice, areSimilar ).map( x => x === 'equal' ? 'replace' : x ) );
- newActions.push( 'equal' );
- // Reset stored elements on 'equal'.
- actualSlice = [];
- expectedSlice = [];
- }
- counter[ action ]++;
- }
- return newActions.concat( Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__["default"])( actualSlice, expectedSlice, areSimilar ).map( x => x === 'equal' ? 'replace' : x ) );
- }
- /**
- * Marks text nodes to be synchronized.
- *
- * If a text node is passed, it will be marked. If an element is passed, all descendant text nodes inside it will be marked.
- *
- * @private
- * @param {module:engine/view/node~Node} viewNode View node to sync.
- */
- _markDescendantTextToSync( viewNode ) {
- if ( !viewNode ) {
- return;
- }
- if ( viewNode.is( '$text' ) ) {
- this.markedTexts.add( viewNode );
- } else if ( viewNode.is( 'element' ) ) {
- for ( const child of viewNode.getChildren() ) {
- this._markDescendantTextToSync( child );
- }
- }
- }
- /**
- * Checks if the selection needs to be updated and possibly updates it.
- *
- * @private
- */
- _updateSelection() {
- // If there is no selection - remove DOM and fake selections.
- if ( this.selection.rangeCount === 0 ) {
- this._removeDomSelection();
- this._removeFakeSelection();
- return;
- }
- const domRoot = this.domConverter.mapViewToDom( this.selection.editableElement );
- // Do nothing if there is no focus, or there is no DOM element corresponding to selection's editable element.
- if ( !this.isFocused || !domRoot ) {
- return;
- }
- // Render selection.
- if ( this.selection.isFake ) {
- this._updateFakeSelection( domRoot );
- } else {
- this._removeFakeSelection();
- this._updateDomSelection( domRoot );
- }
- }
- /**
- * Updates the fake selection.
- *
- * @private
- * @param {HTMLElement} domRoot A valid DOM root where the fake selection container should be added.
- */
- _updateFakeSelection( domRoot ) {
- const domDocument = domRoot.ownerDocument;
- if ( !this._fakeSelectionContainer ) {
- this._fakeSelectionContainer = createFakeSelectionContainer( domDocument );
- }
- const container = this._fakeSelectionContainer;
- // Bind fake selection container with the current selection *position*.
- this.domConverter.bindFakeSelection( container, this.selection );
- if ( !this._fakeSelectionNeedsUpdate( domRoot ) ) {
- return;
- }
- if ( !container.parentElement || container.parentElement != domRoot ) {
- domRoot.appendChild( container );
- }
- container.textContent = this.selection.fakeSelectionLabel || '\u00A0';
- const domSelection = domDocument.getSelection();
- const domRange = domDocument.createRange();
- domSelection.removeAllRanges();
- domRange.selectNodeContents( container );
- domSelection.addRange( domRange );
- }
- /**
- * Updates the DOM selection.
- *
- * @private
- * @param {HTMLElement} domRoot A valid DOM root where the DOM selection should be rendered.
- */
- _updateDomSelection( domRoot ) {
- const domSelection = domRoot.ownerDocument.defaultView.getSelection();
- // Let's check whether DOM selection needs updating at all.
- if ( !this._domSelectionNeedsUpdate( domSelection ) ) {
- return;
- }
- // Multi-range selection is not available in most browsers, and, at least in Chrome, trying to
- // set such selection, that is not continuous, throws an error. Because of that, we will just use anchor
- // and focus of view selection.
- // Since we are not supporting multi-range selection, we also do not need to check if proper editable is
- // selected. If there is any editable selected, it is okay (editable is taken from selection anchor).
- const anchor = this.domConverter.viewPositionToDom( this.selection.anchor );
- const focus = this.domConverter.viewPositionToDom( this.selection.focus );
- domSelection.collapse( anchor.parent, anchor.offset );
- domSelection.extend( focus.parent, focus.offset );
- // Firefox–specific hack (https://github.com/ckeditor/ckeditor5-engine/issues/1439).
- if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__["default"].isGecko ) {
- fixGeckoSelectionAfterBr( focus, domSelection );
- }
- }
- /**
- * Checks whether a given DOM selection needs to be updated.
- *
- * @private
- * @param {Selection} domSelection The DOM selection to check.
- * @returns {Boolean}
- */
- _domSelectionNeedsUpdate( domSelection ) {
- if ( !this.domConverter.isDomSelectionCorrect( domSelection ) ) {
- // Current DOM selection is in incorrect position. We need to update it.
- return true;
- }
- const oldViewSelection = domSelection && this.domConverter.domSelectionToView( domSelection );
- if ( oldViewSelection && this.selection.isEqual( oldViewSelection ) ) {
- return false;
- }
- // If selection is not collapsed, it does not need to be updated if it is similar.
- if ( !this.selection.isCollapsed && this.selection.isSimilar( oldViewSelection ) ) {
- // Selection did not changed and is correct, do not update.
- return false;
- }
- // Selections are not similar.
- return true;
- }
- /**
- * Checks whether the fake selection needs to be updated.
- *
- * @private
- * @param {HTMLElement} domRoot A valid DOM root where a new fake selection container should be added.
- * @returns {Boolean}
- */
- _fakeSelectionNeedsUpdate( domRoot ) {
- const container = this._fakeSelectionContainer;
- const domSelection = domRoot.ownerDocument.getSelection();
- // Fake selection needs to be updated if there's no fake selection container, or the container currently sits
- // in a different root.
- if ( !container || container.parentElement !== domRoot ) {
- return true;
- }
- // Make sure that the selection actually is within the fake selection.
- if ( domSelection.anchorNode !== container && !container.contains( domSelection.anchorNode ) ) {
- return true;
- }
- return container.textContent !== this.selection.fakeSelectionLabel;
- }
- /**
- * Removes the DOM selection.
- *
- * @private
- */
- _removeDomSelection() {
- for ( const doc of this.domDocuments ) {
- const domSelection = doc.getSelection();
- if ( domSelection.rangeCount ) {
- const activeDomElement = doc.activeElement;
- const viewElement = this.domConverter.mapDomToView( activeDomElement );
- if ( activeDomElement && viewElement ) {
- doc.getSelection().removeAllRanges();
- }
- }
- }
- }
- /**
- * Removes the fake selection.
- *
- * @private
- */
- _removeFakeSelection() {
- const container = this._fakeSelectionContainer;
- if ( container ) {
- container.remove();
- }
- }
- /**
- * Checks if focus needs to be updated and possibly updates it.
- *
- * @private
- */
- _updateFocus() {
- if ( this.isFocused ) {
- const editable = this.selection.editableElement;
- if ( editable ) {
- this.domConverter.focus( editable );
- }
- }
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( Renderer, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_7__["default"] );
- // Checks if provided element is editable.
- //
- // @private
- // @param {module:engine/view/element~Element} element
- // @returns {Boolean}
- function isEditable( element ) {
- if ( element.getAttribute( 'contenteditable' ) == 'false' ) {
- return false;
- }
- const parent = element.findAncestor( element => element.hasAttribute( 'contenteditable' ) );
- return !parent || parent.getAttribute( 'contenteditable' ) == 'true';
- }
- // Adds inline filler at a given position.
- //
- // The position can be given as an array of DOM nodes and an offset in that array,
- // or a DOM parent element and an offset in that element.
- //
- // @private
- // @param {Document} domDocument
- // @param {Element|Array.<Node>} domParentOrArray
- // @param {Number} offset
- // @returns {Text} The DOM text node that contains an inline filler.
- function addInlineFiller( domDocument, domParentOrArray, offset ) {
- const childNodes = domParentOrArray instanceof Array ? domParentOrArray : domParentOrArray.childNodes;
- const nodeAfterFiller = childNodes[ offset ];
- if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( nodeAfterFiller ) ) {
- nodeAfterFiller.data = _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER"] + nodeAfterFiller.data;
- return nodeAfterFiller;
- } else {
- const fillerNode = domDocument.createTextNode( _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER"] );
- if ( Array.isArray( domParentOrArray ) ) {
- childNodes.splice( offset, 0, fillerNode );
- } else {
- Object(_ckeditor_ckeditor5_utils_src_dom_insertat__WEBPACK_IMPORTED_MODULE_5__["default"])( domParentOrArray, offset, fillerNode );
- }
- return fillerNode;
- }
- }
- // Whether two DOM nodes should be considered as similar.
- // Nodes are considered similar if they have the same tag name.
- //
- // @private
- // @param {Node} node1
- // @param {Node} node2
- // @returns {Boolean}
- function areSimilar( node1, node2 ) {
- return Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_10__["default"])( node1 ) && Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_10__["default"])( node2 ) &&
- !Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( node1 ) && !Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( node2 ) &&
- node1.nodeType !== Node.COMMENT_NODE && node2.nodeType !== Node.COMMENT_NODE &&
- node1.tagName.toLowerCase() === node2.tagName.toLowerCase();
- }
- // Whether two dom nodes should be considered as the same.
- // Two nodes which are considered the same are:
- //
- // * Text nodes with the same text.
- // * Element nodes represented by the same object.
- // * Two block filler elements.
- //
- // @private
- // @param {String} blockFillerMode Block filler mode, see {@link module:engine/view/domconverter~DomConverter#blockFillerMode}.
- // @param {Node} node1
- // @param {Node} node2
- // @returns {Boolean}
- function sameNodes( domConverter, actualDomChild, expectedDomChild ) {
- // Elements.
- if ( actualDomChild === expectedDomChild ) {
- return true;
- }
- // Texts.
- else if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( actualDomChild ) && Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( expectedDomChild ) ) {
- return actualDomChild.data === expectedDomChild.data;
- }
- // Block fillers.
- else if ( domConverter.isBlockFiller( actualDomChild ) &&
- domConverter.isBlockFiller( expectedDomChild ) ) {
- return true;
- }
- // Not matching types.
- return false;
- }
- // The following is a Firefox–specific hack (https://github.com/ckeditor/ckeditor5-engine/issues/1439).
- // When the native DOM selection is at the end of the block and preceded by <br /> e.g.
- //
- // <p>foo<br/>[]</p>
- //
- // which happens a lot when using the soft line break, the browser fails to (visually) move the
- // caret to the new line. A quick fix is as simple as force–refreshing the selection with the same range.
- function fixGeckoSelectionAfterBr( focus, domSelection ) {
- const parent = focus.parent;
- // This fix works only when the focus point is at the very end of an element.
- // There is no point in running it in cases unrelated to the browser bug.
- if ( parent.nodeType != Node.ELEMENT_NODE || focus.offset != parent.childNodes.length - 1 ) {
- return;
- }
- const childAtOffset = parent.childNodes[ focus.offset ];
- // To stay on the safe side, the fix being as specific as possible, it targets only the
- // selection which is at the very end of the element and preceded by <br />.
- if ( childAtOffset && childAtOffset.tagName == 'BR' ) {
- domSelection.addRange( domSelection.getRangeAt( 0 ) );
- }
- }
- function filterOutFakeSelectionContainer( domChildList, fakeSelectionContainer ) {
- const childList = Array.from( domChildList );
- if ( childList.length == 0 || !fakeSelectionContainer ) {
- return childList;
- }
- const last = childList[ childList.length - 1 ];
- if ( last == fakeSelectionContainer ) {
- childList.pop();
- }
- return childList;
- }
- // Creates a fake selection container for a given document.
- //
- // @private
- // @param {Document} domDocument
- // @returns {HTMLElement}
- function createFakeSelectionContainer( domDocument ) {
- const container = domDocument.createElement( 'div' );
- container.className = 'ck-fake-selection-container';
- Object.assign( container.style, {
- position: 'fixed',
- top: 0,
- left: '-9999px',
- // See https://github.com/ckeditor/ckeditor5/issues/752.
- width: '42px'
- } );
- // Fill it with a text node so we can update it later.
- container.textContent = '\u00A0';
- return container;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RootEditableElement; });
- /* harmony import */ var _editableelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/rooteditableelement
- */
- const rootNameSymbol = Symbol( 'rootName' );
- /**
- * Class representing a single root in the data view. A root can be either {@link ~RootEditableElement#isReadOnly editable or read-only},
- * but in both cases it is called "an editable". Roots can contain other {@link module:engine/view/editableelement~EditableElement
- * editable elements} making them "nested editables".
- *
- * @extends module:engine/view/editableelement~EditableElement
- */
- class RootEditableElement extends _editableelement__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates root editable element.
- *
- * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
- * @param {String} name Node name.
- */
- constructor( document, name ) {
- super( document, name );
- /**
- * Name of this root inside {@link module:engine/view/document~Document} that is an owner of this root. If no
- * other name is set, `main` name is used.
- *
- * @readonly
- * @member {String}
- */
- this.rootName = 'main';
- }
- /**
- * Checks whether this object is of the given.
- *
- * rootEditableElement.is( 'rootElement' ); // -> true
- * rootEditableElement.is( 'editableElement' ); // -> true
- * rootEditableElement.is( 'element' ); // -> true
- * rootEditableElement.is( 'node' ); // -> true
- * rootEditableElement.is( 'view:editableElement' ); // -> true
- * rootEditableElement.is( 'view:element' ); // -> true
- * rootEditableElement.is( 'view:node' ); // -> true
- *
- * rootEditableElement.is( 'model:element' ); // -> false
- * rootEditableElement.is( 'documentFragment' ); // -> false
- *
- * Assuming that the object being checked is a root editable element, you can also check its
- * {@link module:engine/view/rooteditableelement~RootEditableElement#name name}:
- *
- * rootEditableElement.is( 'element', 'div' ); // -> true if this is a div root editable element
- * rootEditableElement.is( 'rootElement', 'div' ); // -> same as above
- * text.is( 'element', 'div' ); -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type Type to check.
- * @param {String} [name] Element name.
- * @returns {Boolean}
- */
- is( type, name = null ) {
- if ( !name ) {
- return type === 'rootElement' || type === 'view:rootElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'editableElement' || type === 'view:editableElement' ||
- type === 'containerElement' || type === 'view:containerElement' ||
- type === 'element' || type === 'view:element' ||
- type === 'node' || type === 'view:node';
- } else {
- return name === this.name && (
- type === 'rootElement' || type === 'view:rootElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'editableElement' || type === 'view:editableElement' ||
- type === 'containerElement' || type === 'view:containerElement' ||
- type === 'element' || type === 'view:element'
- );
- }
- }
- get rootName() {
- return this.getCustomProperty( rootNameSymbol );
- }
- set rootName( rootName ) {
- this._setCustomProperty( rootNameSymbol, rootName );
- }
- /**
- * Overrides old element name and sets new one.
- * This is needed because view roots are created before they are attached to the DOM.
- * The name of the root element is temporary at this stage. It has to be changed when the
- * view root element is attached to the DOM element.
- *
- * @protected
- * @param {String} name The new name of element.
- */
- set _name( name ) {
- this.name = name;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Selection; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/count */ "./node_modules/@ckeditor/ckeditor5-utils/src/count.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
- /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/selection
- */
- /**
- * Class representing an arbirtary selection in the view.
- * See also {@link module:engine/view/documentselection~DocumentSelection}.
- *
- * New selection instances can be created via the constructor or one these methods:
- *
- * * {@link module:engine/view/view~View#createSelection `View#createSelection()`},
- * * {@link module:engine/view/upcastwriter~UpcastWriter#createSelection `UpcastWriter#createSelection()`}.
- *
- * A selection can consist of {@link module:engine/view/range~Range ranges} that can be set by using
- * the {@link module:engine/view/selection~Selection#setTo `Selection#setTo()`} method.
- */
- class Selection {
- /**
- * Creates new selection instance.
- *
- * **Note**: The selection constructor is available as a factory method:
- *
- * * {@link module:engine/view/view~View#createSelection `View#createSelection()`},
- * * {@link module:engine/view/upcastwriter~UpcastWriter#createSelection `UpcastWriter#createSelection()`}.
- *
- * // Creates empty selection without ranges.
- * const selection = writer.createSelection();
- *
- * // Creates selection at the given range.
- * const range = writer.createRange( start, end );
- * const selection = writer.createSelection( range );
- *
- * // Creates selection at the given ranges
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
- * const selection = writer.createSelection( ranges );
- *
- * // Creates selection from the other selection.
- * const otherSelection = writer.createSelection();
- * const selection = writer.createSelection( otherSelection );
- *
- * // Creates selection from the document selection.
- * const selection = writer.createSelection( editor.editing.view.document.selection );
- *
- * // Creates selection at the given position.
- * const position = writer.createPositionFromPath( root, path );
- * const selection = writer.createSelection( position );
- *
- * // Creates collapsed selection at the position of given item and offset.
- * const paragraph = writer.createContainerElement( 'paragraph' );
- * const selection = writer.createSelection( paragraph, offset );
- *
- * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
- * // first child of that element and ends after the last child of that element.
- * const selection = writer.createSelection( paragraph, 'in' );
- *
- * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
- * // just after the item.
- * const selection = writer.createSelection( paragraph, 'on' );
- *
- * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
- *
- * // Creates backward selection.
- * const selection = writer.createSelection( range, { backward: true } );
- *
- * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
- * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
- * represented in other way, for example by applying proper CSS class.
- *
- * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
- * (and be properly handled by screen readers).
- *
- * // Creates fake selection with label.
- * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
- *
- * @param {module:engine/view/selection~Selectable} [selectable=null]
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
- * @param {String} [options.label] Label for the fake selection.
- */
- constructor( selectable = null, placeOrOffset, options ) {
- /**
- * Stores all ranges that are selected.
- *
- * @protected
- * @member {Array.<module:engine/view/range~Range>}
- */
- this._ranges = [];
- /**
- * Specifies whether the last added range was added as a backward or forward range.
- *
- * @protected
- * @member {Boolean}
- */
- this._lastRangeBackward = false;
- /**
- * Specifies whether selection instance is fake.
- *
- * @private
- * @member {Boolean}
- */
- this._isFake = false;
- /**
- * Fake selection's label.
- *
- * @private
- * @member {String}
- */
- this._fakeSelectionLabel = '';
- this.setTo( selectable, placeOrOffset, options );
- }
- /**
- * Returns true if selection instance is marked as `fake`.
- *
- * @see #setTo
- * @type {Boolean}
- */
- get isFake() {
- return this._isFake;
- }
- /**
- * Returns fake selection label.
- *
- * @see #setTo
- * @type {String}
- */
- get fakeSelectionLabel() {
- return this._fakeSelectionLabel;
- }
- /**
- * Selection anchor. Anchor may be described as a position where the selection starts. Together with
- * {@link #focus focus} they define the direction of selection, which is important
- * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.
- * It may be a bit unintuitive when there are multiple ranges in selection.
- *
- * @see #focus
- * @type {module:engine/view/position~Position}
- */
- get anchor() {
- if ( !this._ranges.length ) {
- return null;
- }
- const range = this._ranges[ this._ranges.length - 1 ];
- const anchor = this._lastRangeBackward ? range.end : range.start;
- return anchor.clone();
- }
- /**
- * Selection focus. Focus is a position where the selection ends.
- *
- * @see #anchor
- * @type {module:engine/view/position~Position}
- */
- get focus() {
- if ( !this._ranges.length ) {
- return null;
- }
- const range = this._ranges[ this._ranges.length - 1 ];
- const focus = this._lastRangeBackward ? range.start : range.end;
- return focus.clone();
- }
- /**
- * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
- * collapsed.
- *
- * @type {Boolean}
- */
- get isCollapsed() {
- return this.rangeCount === 1 && this._ranges[ 0 ].isCollapsed;
- }
- /**
- * Returns number of ranges in selection.
- *
- * @type {Number}
- */
- get rangeCount() {
- return this._ranges.length;
- }
- /**
- * Specifies whether the {@link #focus} precedes {@link #anchor}.
- *
- * @type {Boolean}
- */
- get isBackward() {
- return !this.isCollapsed && this._lastRangeBackward;
- }
- /**
- * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`
- * if the selection is not inside an editable element.
- *
- * @type {module:engine/view/editableelement~EditableElement|null}
- */
- get editableElement() {
- if ( this.anchor ) {
- return this.anchor.editableElement;
- }
- return null;
- }
- /**
- * Returns an iterable that contains copies of all ranges added to the selection.
- *
- * @returns {Iterable.<module:engine/view/range~Range>}
- */
- * getRanges() {
- for ( const range of this._ranges ) {
- yield range.clone();
- }
- }
- /**
- * Returns copy of the first range in the selection. First range is the one which
- * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start
- * position of all other ranges (not to confuse with the first range added to the selection).
- * Returns `null` if no ranges are added to selection.
- *
- * @returns {module:engine/view/range~Range|null}
- */
- getFirstRange() {
- let first = null;
- for ( const range of this._ranges ) {
- if ( !first || range.start.isBefore( first.start ) ) {
- first = range;
- }
- }
- return first ? first.clone() : null;
- }
- /**
- * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}
- * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse
- * with the last range added to the selection). Returns `null` if no ranges are added to selection.
- *
- * @returns {module:engine/view/range~Range|null}
- */
- getLastRange() {
- let last = null;
- for ( const range of this._ranges ) {
- if ( !last || range.end.isAfter( last.end ) ) {
- last = range;
- }
- }
- return last ? last.clone() : null;
- }
- /**
- * Returns copy of the first position in the selection. First position is the position that
- * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.
- * Returns `null` if no ranges are added to selection.
- *
- * @returns {module:engine/view/position~Position|null}
- */
- getFirstPosition() {
- const firstRange = this.getFirstRange();
- return firstRange ? firstRange.start.clone() : null;
- }
- /**
- * Returns copy of the last position in the selection. Last position is the position that
- * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.
- * Returns `null` if no ranges are added to selection.
- *
- * @returns {module:engine/view/position~Position|null}
- */
- getLastPosition() {
- const lastRange = this.getLastRange();
- return lastRange ? lastRange.end.clone() : null;
- }
- /**
- * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,
- * same number of ranges and all ranges from one selection equal to a range from other selection.
- *
- * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
- * Selection to compare with.
- * @returns {Boolean} `true` if selections are equal, `false` otherwise.
- */
- isEqual( otherSelection ) {
- if ( this.isFake != otherSelection.isFake ) {
- return false;
- }
- if ( this.isFake && this.fakeSelectionLabel != otherSelection.fakeSelectionLabel ) {
- return false;
- }
- if ( this.rangeCount != otherSelection.rangeCount ) {
- return false;
- } else if ( this.rangeCount === 0 ) {
- return true;
- }
- if ( !this.anchor.isEqual( otherSelection.anchor ) || !this.focus.isEqual( otherSelection.focus ) ) {
- return false;
- }
- for ( const thisRange of this._ranges ) {
- let found = false;
- for ( const otherRange of otherSelection._ranges ) {
- if ( thisRange.isEqual( otherRange ) ) {
- found = true;
- break;
- }
- }
- if ( !found ) {
- return false;
- }
- }
- return true;
- }
- /**
- * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same
- * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are
- * equal to any trimmed range from other selection.
- *
- * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
- * Selection to compare with.
- * @returns {Boolean} `true` if selections are similar, `false` otherwise.
- */
- isSimilar( otherSelection ) {
- if ( this.isBackward != otherSelection.isBackward ) {
- return false;
- }
- const numOfRangesA = Object(_ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_6__["default"])( this.getRanges() );
- const numOfRangesB = Object(_ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_6__["default"])( otherSelection.getRanges() );
- // If selections have different number of ranges, they cannot be similar.
- if ( numOfRangesA != numOfRangesB ) {
- return false;
- }
- // If both selections have no ranges, they are similar.
- if ( numOfRangesA == 0 ) {
- return true;
- }
- // Check if each range in one selection has a similar range in other selection.
- for ( let rangeA of this.getRanges() ) {
- rangeA = rangeA.getTrimmed();
- let found = false;
- for ( let rangeB of otherSelection.getRanges() ) {
- rangeB = rangeB.getTrimmed();
- if ( rangeA.start.isEqual( rangeB.start ) && rangeA.end.isEqual( rangeB.end ) ) {
- found = true;
- break;
- }
- }
- // For `rangeA`, neither range in `otherSelection` was similar. So selections are not similar.
- if ( !found ) {
- return false;
- }
- }
- // There were no ranges that weren't matched. Selections are similar.
- return true;
- }
- /**
- * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only
- * one range in the selection, and that range contains exactly one element.
- * Returns `null` if there is no selected element.
- *
- * @returns {module:engine/view/element~Element|null}
- */
- getSelectedElement() {
- if ( this.rangeCount !== 1 ) {
- return null;
- }
- return this.getFirstRange().getContainedElement();
- }
- /**
- * Sets this selection's ranges and direction to the specified location based on the given
- * {@link module:engine/view/selection~Selectable selectable}.
- *
- * // Sets selection to the given range.
- * const range = writer.createRange( start, end );
- * selection.setTo( range );
- *
- * // Sets selection to given ranges.
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
- * selection.setTo( range );
- *
- * // Sets selection to the other selection.
- * const otherSelection = writer.createSelection();
- * selection.setTo( otherSelection );
- *
- * // Sets selection to contents of DocumentSelection.
- * selection.setTo( editor.editing.view.document.selection );
- *
- * // Sets collapsed selection at the given position.
- * const position = writer.createPositionAt( root, path );
- * selection.setTo( position );
- *
- * // Sets collapsed selection at the position of given item and offset.
- * selection.setTo( paragraph, offset );
- *
- * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
- * that element and ends after the last child of that element.
- *
- * selection.setTo( paragraph, 'in' );
- *
- * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
- *
- * selection.setTo( paragraph, 'on' );
- *
- * // Clears selection. Removes all ranges.
- * selection.setTo( null );
- *
- * `Selection#setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
- *
- * // Sets selection as backward.
- * selection.setTo( range, { backward: true } );
- *
- * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
- * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
- * represented in other way, for example by applying proper CSS class.
- *
- * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
- * (and be properly handled by screen readers).
- *
- * // Creates fake selection with label.
- * selection.setTo( range, { fake: true, label: 'foo' } );
- *
- * @fires change
- * @param {module:engine/view/selection~Selectable} selectable
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
- * @param {String} [options.label] Label for the fake selection.
- */
- setTo( selectable, placeOrOffset, options ) {
- if ( selectable === null ) {
- this._setRanges( [] );
- this._setFakeOptions( placeOrOffset );
- } else if ( selectable instanceof Selection || selectable instanceof _documentselection__WEBPACK_IMPORTED_MODULE_8__["default"] ) {
- this._setRanges( selectable.getRanges(), selectable.isBackward );
- this._setFakeOptions( { fake: selectable.isFake, label: selectable.fakeSelectionLabel } );
- } else if ( selectable instanceof _range__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
- this._setRanges( [ selectable ], placeOrOffset && placeOrOffset.backward );
- this._setFakeOptions( placeOrOffset );
- } else if ( selectable instanceof _position__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
- this._setRanges( [ new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( selectable ) ] );
- this._setFakeOptions( placeOrOffset );
- } else if ( selectable instanceof _node__WEBPACK_IMPORTED_MODULE_5__["default"] ) {
- const backward = !!options && !!options.backward;
- let range;
- if ( placeOrOffset === undefined ) {
- /**
- * selection.setTo requires the second parameter when the first parameter is a node.
- *
- * @error view-selection-setto-required-second-parameter
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-selection-setto-required-second-parameter', this );
- } else if ( placeOrOffset == 'in' ) {
- range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( selectable );
- } else if ( placeOrOffset == 'on' ) {
- range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( selectable );
- } else {
- range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( selectable, placeOrOffset ) );
- }
- this._setRanges( [ range ], backward );
- this._setFakeOptions( options );
- } else if ( Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__["default"])( selectable ) ) {
- // We assume that the selectable is an iterable of ranges.
- // Array.from() is used to prevent setting ranges to the old iterable
- this._setRanges( selectable, placeOrOffset && placeOrOffset.backward );
- this._setFakeOptions( placeOrOffset );
- } else {
- /**
- * Cannot set selection to given place.
- *
- * @error view-selection-setto-not-selectable
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-selection-setto-not-selectable', this );
- }
- this.fire( 'change' );
- }
- /**
- * Moves {@link #focus} to the specified location.
- *
- * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
- * parameters.
- *
- * @fires change
- * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * first parameter is a {@link module:engine/view/item~Item view item}.
- */
- setFocus( itemOrPosition, offset ) {
- if ( this.anchor === null ) {
- /**
- * Cannot set selection focus if there are no ranges in selection.
- *
- * @error view-selection-setfocus-no-ranges
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-selection-setfocus-no-ranges', this );
- }
- const newFocus = _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( itemOrPosition, offset );
- if ( newFocus.compareWith( this.focus ) == 'same' ) {
- return;
- }
- const anchor = this.anchor;
- this._ranges.pop();
- if ( newFocus.compareWith( anchor ) == 'before' ) {
- this._addRange( new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( newFocus, anchor ), true );
- } else {
- this._addRange( new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( anchor, newFocus ) );
- }
- this.fire( 'change' );
- }
- /**
- * Checks whether this object is of the given type.
- *
- * selection.is( 'selection' ); // -> true
- * selection.is( 'view:selection' ); // -> true
- *
- * selection.is( 'model:selection' ); // -> false
- * selection.is( 'element' ); // -> false
- * selection.is( 'range' ); // -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type
- * @returns {Boolean}
- */
- is( type ) {
- return type === 'selection' || type === 'view:selection';
- }
- /**
- * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array
- * is treated like the last added range and is used to set {@link #anchor anchor} and {@link #focus focus}.
- * Accepts a flag describing in which way the selection is made.
- *
- * @private
- * @param {Iterable.<module:engine/view/range~Range>} newRanges Iterable object of ranges to set.
- * @param {Boolean} [isLastBackward=false] Flag describing if last added range was selected forward - from start to end
- * (`false`) or backward - from end to start (`true`). Defaults to `false`.
- */
- _setRanges( newRanges, isLastBackward = false ) {
- // New ranges should be copied to prevent removing them by setting them to `[]` first.
- // Only applies to situations when selection is set to the same selection or same selection's ranges.
- newRanges = Array.from( newRanges );
- this._ranges = [];
- for ( const range of newRanges ) {
- this._addRange( range );
- }
- this._lastRangeBackward = !!isLastBackward;
- }
- /**
- * Sets this selection instance to be marked as `fake`. A fake selection does not render as browser native selection
- * over selected elements and is hidden to the user. This way, no native selection UI artifacts are displayed to
- * the user and selection over elements can be represented in other way, for example by applying proper CSS class.
- *
- * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM (and be
- * properly handled by screen readers).
- *
- * @private
- * @param {Object} [options] Options.
- * @param {Boolean} [options.fake] If set to true selection will be marked as `fake`.
- * @param {String} [options.label=''] Fake selection label.
- */
- _setFakeOptions( options = {} ) {
- this._isFake = !!options.fake;
- this._fakeSelectionLabel = options.fake ? options.label || '' : '';
- }
- /**
- * Adds a range to the selection. Added range is copied. This means that passed range is not saved in the
- * selection instance and you can safely operate on it.
- *
- * Accepts a flag describing in which way the selection is made - passed range might be selected from
- * {@link module:engine/view/range~Range#start start} to {@link module:engine/view/range~Range#end end}
- * or from {@link module:engine/view/range~Range#end end} to {@link module:engine/view/range~Range#start start}.
- * The flag is used to set {@link #anchor anchor} and {@link #focus focus} properties.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects
- * with ranges already stored in Selection instance.
- *
- * @private
- * @fires change
- * @param {module:engine/view/range~Range} range
- * @param {Boolean} [isBackward]
- */
- _addRange( range, isBackward = false ) {
- if ( !( range instanceof _range__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
- /**
- * Selection range set to an object that is not an instance of {@link module:engine/view/range~Range}.
- *
- * @error view-selection-add-range-not-range
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'view-selection-add-range-not-range',
- this
- );
- }
- this._pushRange( range );
- this._lastRangeBackward = !!isBackward;
- }
- /**
- * Adds range to selection - creates copy of given range so it can be safely used and modified.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects
- * with ranges already stored in selection instance.
- *
- * @private
- * @param {module:engine/view/range~Range} range
- */
- _pushRange( range ) {
- for ( const storedRange of this._ranges ) {
- if ( range.isIntersecting( storedRange ) ) {
- /**
- * Trying to add a range that intersects with another range from selection.
- *
- * @error view-selection-range-intersects
- * @param {module:engine/view/range~Range} addedRange Range that was added to the selection.
- * @param {module:engine/view/range~Range} intersectingRange Range from selection that intersects with `addedRange`.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'view-selection-range-intersects',
- this,
- { addedRange: range, intersectingRange: storedRange }
- );
- }
- }
- this._ranges.push( new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( range.start, range.end ) );
- }
- /**
- * Fired whenever selection ranges are changed through {@link ~Selection Selection API}.
- *
- * @event change
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( Selection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
- /**
- * An entity that is used to set selection.
- *
- * See also {@link module:engine/view/selection~Selection#setTo}
- *
- * @typedef {
- * module:engine/view/selection~Selection|
- * module:engine/view/documentselection~DocumentSelection|
- * module:engine/view/position~Position|
- * Iterable.<module:engine/view/range~Range>|
- * module:engine/view/range~Range|
- * module:engine/view/item~Item|
- * null
- * } module:engine/view/selection~Selectable
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js ***!
- \*******************************************************************************/
- /*! exports provided: addBackgroundRules */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addBackgroundRules", function() { return addBackgroundRules; });
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/styles/background
- */
- /**
- * Adds a background CSS styles processing rules.
- *
- * editor.data.addStyleProcessorRules( addBackgroundRules );
- *
- * The normalized value is stored as:
- *
- * const styles = {
- * background: {
- * color,
- * repeat,
- * position,
- * attachment,
- * image
- * }
- * };
- *
- * **Note**: Currently only `'background-color'` longhand value is parsed besides `'background'` shorthand. The reducer also supports only
- * `'background-color'` value.
- *
- * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
- */
- function addBackgroundRules( stylesProcessor ) {
- stylesProcessor.setNormalizer( 'background', normalizeBackground );
- stylesProcessor.setNormalizer( 'background-color', value => ( { path: 'background.color', value } ) );
- stylesProcessor.setReducer( 'background', value => {
- const ret = [];
- ret.push( [ 'background-color', value.color ] );
- return ret;
- } );
- }
- function normalizeBackground( value ) {
- const background = {};
- const parts = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getShorthandValues"])( value );
- for ( const part of parts ) {
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isRepeat"])( part ) ) {
- background.repeat = background.repeat || [];
- background.repeat.push( part );
- } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isPosition"])( part ) ) {
- background.position = background.position || [];
- background.position.push( part );
- } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isAttachment"])( part ) ) {
- background.attachment = part;
- } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isColor"])( part ) ) {
- background.color = part;
- } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isURL"])( part ) ) {
- background.image = part;
- }
- }
- return {
- path: 'background',
- value: background
- };
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.js ***!
- \***************************************************************************/
- /*! exports provided: addBorderRules */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addBorderRules", function() { return addBorderRules; });
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/styles/border
- */
- /**
- * Adds a border CSS styles processing rules.
- *
- * editor.data.addStyleProcessorRules( addBorderRules );
- *
- * This rules merges all [border](https://developer.mozilla.org/en-US/docs/Web/CSS/border) styles notation shorthands:
- *
- * - border
- * - border-top
- * - border-right
- * - border-bottom
- * - border-left
- * - border-color
- * - border-style
- * - border-width
- *
- * and all corresponding longhand forms (like `border-top-color`, `border-top-style`, etc).
- *
- * It does not handle other shorthands (like `border-radius` or `border-image`).
- *
- * The normalized model stores border values as:
- *
- * const styles = {
- * border: {
- * color: { top, right, bottom, left },
- * style: { top, right, bottom, left },
- * width: { top, right, bottom, left },
- * }
- * };
- *
- * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
- */
- function addBorderRules( stylesProcessor ) {
- stylesProcessor.setNormalizer( 'border', borderNormalizer );
- // Border-position shorthands.
- stylesProcessor.setNormalizer( 'border-top', getBorderPositionNormalizer( 'top' ) );
- stylesProcessor.setNormalizer( 'border-right', getBorderPositionNormalizer( 'right' ) );
- stylesProcessor.setNormalizer( 'border-bottom', getBorderPositionNormalizer( 'bottom' ) );
- stylesProcessor.setNormalizer( 'border-left', getBorderPositionNormalizer( 'left' ) );
- // Border-property shorthands.
- stylesProcessor.setNormalizer( 'border-color', getBorderPropertyNormalizer( 'color' ) );
- stylesProcessor.setNormalizer( 'border-width', getBorderPropertyNormalizer( 'width' ) );
- stylesProcessor.setNormalizer( 'border-style', getBorderPropertyNormalizer( 'style' ) );
- // Border longhands.
- stylesProcessor.setNormalizer( 'border-top-color', getBorderPropertyPositionNormalizer( 'color', 'top' ) );
- stylesProcessor.setNormalizer( 'border-top-style', getBorderPropertyPositionNormalizer( 'style', 'top' ) );
- stylesProcessor.setNormalizer( 'border-top-width', getBorderPropertyPositionNormalizer( 'width', 'top' ) );
- stylesProcessor.setNormalizer( 'border-right-color', getBorderPropertyPositionNormalizer( 'color', 'right' ) );
- stylesProcessor.setNormalizer( 'border-right-style', getBorderPropertyPositionNormalizer( 'style', 'right' ) );
- stylesProcessor.setNormalizer( 'border-right-width', getBorderPropertyPositionNormalizer( 'width', 'right' ) );
- stylesProcessor.setNormalizer( 'border-bottom-color', getBorderPropertyPositionNormalizer( 'color', 'bottom' ) );
- stylesProcessor.setNormalizer( 'border-bottom-style', getBorderPropertyPositionNormalizer( 'style', 'bottom' ) );
- stylesProcessor.setNormalizer( 'border-bottom-width', getBorderPropertyPositionNormalizer( 'width', 'bottom' ) );
- stylesProcessor.setNormalizer( 'border-left-color', getBorderPropertyPositionNormalizer( 'color', 'left' ) );
- stylesProcessor.setNormalizer( 'border-left-style', getBorderPropertyPositionNormalizer( 'style', 'left' ) );
- stylesProcessor.setNormalizer( 'border-left-width', getBorderPropertyPositionNormalizer( 'width', 'left' ) );
- stylesProcessor.setExtractor( 'border-top', getBorderPositionExtractor( 'top' ) );
- stylesProcessor.setExtractor( 'border-right', getBorderPositionExtractor( 'right' ) );
- stylesProcessor.setExtractor( 'border-bottom', getBorderPositionExtractor( 'bottom' ) );
- stylesProcessor.setExtractor( 'border-left', getBorderPositionExtractor( 'left' ) );
- stylesProcessor.setExtractor( 'border-top-color', 'border.color.top' );
- stylesProcessor.setExtractor( 'border-right-color', 'border.color.right' );
- stylesProcessor.setExtractor( 'border-bottom-color', 'border.color.bottom' );
- stylesProcessor.setExtractor( 'border-left-color', 'border.color.left' );
- stylesProcessor.setExtractor( 'border-top-width', 'border.width.top' );
- stylesProcessor.setExtractor( 'border-right-width', 'border.width.right' );
- stylesProcessor.setExtractor( 'border-bottom-width', 'border.width.bottom' );
- stylesProcessor.setExtractor( 'border-left-width', 'border.width.left' );
- stylesProcessor.setExtractor( 'border-top-style', 'border.style.top' );
- stylesProcessor.setExtractor( 'border-right-style', 'border.style.right' );
- stylesProcessor.setExtractor( 'border-bottom-style', 'border.style.bottom' );
- stylesProcessor.setExtractor( 'border-left-style', 'border.style.left' );
- stylesProcessor.setReducer( 'border-color', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'border-color' ) );
- stylesProcessor.setReducer( 'border-style', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'border-style' ) );
- stylesProcessor.setReducer( 'border-width', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'border-width' ) );
- stylesProcessor.setReducer( 'border-top', getBorderPositionReducer( 'top' ) );
- stylesProcessor.setReducer( 'border-right', getBorderPositionReducer( 'right' ) );
- stylesProcessor.setReducer( 'border-bottom', getBorderPositionReducer( 'bottom' ) );
- stylesProcessor.setReducer( 'border-left', getBorderPositionReducer( 'left' ) );
- stylesProcessor.setReducer( 'border', getBorderReducer() );
- stylesProcessor.setStyleRelation( 'border', [
- 'border-color', 'border-style', 'border-width',
- 'border-top', 'border-right', 'border-bottom', 'border-left',
- 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color',
- 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style',
- 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'
- ] );
- stylesProcessor.setStyleRelation( 'border-color', [
- 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color'
- ] );
- stylesProcessor.setStyleRelation( 'border-style', [
- 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style'
- ] );
- stylesProcessor.setStyleRelation( 'border-width', [
- 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'
- ] );
- stylesProcessor.setStyleRelation( 'border-top', [ 'border-top-color', 'border-top-style', 'border-top-width' ] );
- stylesProcessor.setStyleRelation( 'border-right', [ 'border-right-color', 'border-right-style', 'border-right-width' ] );
- stylesProcessor.setStyleRelation( 'border-bottom', [ 'border-bottom-color', 'border-bottom-style', 'border-bottom-width' ] );
- stylesProcessor.setStyleRelation( 'border-left', [ 'border-left-color', 'border-left-style', 'border-left-width' ] );
- }
- function borderNormalizer( value ) {
- const { color, style, width } = normalizeBorderShorthand( value );
- return {
- path: 'border',
- value: {
- color: Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"])( color ),
- style: Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"])( style ),
- width: Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"])( width )
- }
- };
- }
- function getBorderPositionNormalizer( side ) {
- return value => {
- const { color, style, width } = normalizeBorderShorthand( value );
- const border = {};
- if ( color !== undefined ) {
- border.color = { [ side ]: color };
- }
- if ( style !== undefined ) {
- border.style = { [ side ]: style };
- }
- if ( width !== undefined ) {
- border.width = { [ side ]: width };
- }
- return {
- path: 'border',
- value: border
- };
- };
- }
- function getBorderPropertyNormalizer( propertyName ) {
- return value => {
- return {
- path: 'border',
- value: toBorderPropertyShorthand( value, propertyName )
- };
- };
- }
- function toBorderPropertyShorthand( value, property ) {
- return {
- [ property ]: Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"])( value )
- };
- }
- function getBorderPropertyPositionNormalizer( property, side ) {
- return value => {
- return {
- path: 'border',
- value: {
- [ property ]: {
- [ side ]: value
- }
- }
- };
- };
- }
- function getBorderPositionExtractor( which ) {
- return ( name, styles ) => {
- if ( styles.border ) {
- return extractBorderPosition( styles.border, which );
- }
- };
- }
- function extractBorderPosition( border, which ) {
- const value = {};
- if ( border.width && border.width[ which ] ) {
- value.width = border.width[ which ];
- }
- if ( border.style && border.style[ which ] ) {
- value.style = border.style[ which ];
- }
- if ( border.color && border.color[ which ] ) {
- value.color = border.color[ which ];
- }
- return value;
- }
- function normalizeBorderShorthand( string ) {
- const result = {};
- const parts = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getShorthandValues"])( string );
- for ( const part of parts ) {
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isLength"])( part ) || /thin|medium|thick/.test( part ) ) {
- result.width = part;
- } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isLineStyle"])( part ) ) {
- result.style = part;
- } else {
- result.color = part;
- }
- }
- return result;
- }
- // The border reducer factory.
- //
- // It tries to produce the most optimal output for the specified styles.
- //
- // For border style:
- //
- // style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
- //
- // It will produce: `border-style: solid` output.
- // For border style and color:
- //
- // color: {top: "#ff0", bottom: "#ff0", right: "#ff0", left: "#ff0"}
- // style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
- //
- // It will produce: `border-color: #ff0; border-style: solid`
- // If all border parameters are specified:
- //
- // color: {top: "#ff0", bottom: "#ff0", right: "#ff0", left: "#ff0"}
- // style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
- // width: {top: "2px", bottom: "2px", right: "2px", left: "2px"}
- //
- // It will combine everything into the single property: `border: 2px solid #ff0`.
- //
- // Definitions are merged only if all border selectors have the same values.
- //
- // @returns {Function}
- function getBorderReducer() {
- return value => {
- const topStyles = extractBorderPosition( value, 'top' );
- const rightStyles = extractBorderPosition( value, 'right' );
- const bottomStyles = extractBorderPosition( value, 'bottom' );
- const leftStyles = extractBorderPosition( value, 'left' );
- const borderStyles = [ topStyles, rightStyles, bottomStyles, leftStyles ];
- const borderStylesByType = {
- width: getReducedStyleValueForType( borderStyles, 'width' ),
- style: getReducedStyleValueForType( borderStyles, 'style' ),
- color: getReducedStyleValueForType( borderStyles, 'color' )
- };
- // Try reducing to a single `border:` property.
- const reducedBorderStyle = reduceBorderPosition( borderStylesByType, 'all' );
- if ( reducedBorderStyle.length ) {
- return reducedBorderStyle;
- }
- // Try reducing to `border-style:`, `border-width:`, `border-color:` properties.
- const reducedStyleTypes = Object.entries( borderStylesByType ).reduce( ( reducedStyleTypes, [ type, value ] ) => {
- if ( value ) {
- reducedStyleTypes.push( [ `border-${ type }`, value ] );
- // Remove it from the full set to not include it in the most specific properties later.
- borderStyles.forEach( style => ( style[ type ] = null ) );
- }
- return reducedStyleTypes;
- }, [] );
- // The reduced properties (by type) and all the rest that could not be reduced.
- return [
- ...reducedStyleTypes,
- ...reduceBorderPosition( topStyles, 'top' ),
- ...reduceBorderPosition( rightStyles, 'right' ),
- ...reduceBorderPosition( bottomStyles, 'bottom' ),
- ...reduceBorderPosition( leftStyles, 'left' )
- ];
- };
- // @param {Array.<Object>} styles The array of objects with `style`, `color`, `width` properties.
- // @param {'width'|'style'|'color'} type
- function getReducedStyleValueForType( styles, type ) {
- return styles
- .map( style => style[ type ] )
- .reduce( ( result, style ) => result == style ? result : null );
- }
- }
- function getBorderPositionReducer( which ) {
- return value => reduceBorderPosition( value, which );
- }
- // Returns an array with reduced border styles depending on specified values.
- //
- // If all (width, style, color) border properties are specified, the returned selector will be
- // merged into the group: `border-*: [width] [style] [color]`.
- //
- // Otherwise, the specific definitions will be returned: `border-(width|style|color)-*: [value]`.
- //
- // @param {Object|null} value Styles if defined.
- // @param {'top'|'right'|'bottom'|'left'|'all'} which The border position.
- // @returns {Array}
- function reduceBorderPosition( value, which ) {
- const borderTypes = [];
- if ( value && value.width ) {
- borderTypes.push( 'width' );
- }
- if ( value && value.style ) {
- borderTypes.push( 'style' );
- }
- if ( value && value.color ) {
- borderTypes.push( 'color' );
- }
- if ( borderTypes.length == 3 ) {
- const borderValue = borderTypes.map( item => value[ item ] ).join( ' ' );
- return [
- which == 'all' ? [ 'border', borderValue ] : [ `border-${ which }`, borderValue ]
- ];
- }
- // We are unable to reduce to a single `border:` property.
- if ( which == 'all' ) {
- return [];
- }
- return borderTypes.map( type => {
- return [ `border-${ which }-${ type }`, value[ type ] ];
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/margin.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/margin.js ***!
- \***************************************************************************/
- /*! exports provided: addMarginRules */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMarginRules", function() { return addMarginRules; });
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/styles/margin
- */
- /**
- * Adds a margin CSS styles processing rules.
- *
- * editor.data.addStyleProcessorRules( addMarginRules );
- *
- * The normalized value is stored as:
- *
- * const styles = {
- * margin: {
- * top,
- * right,
- * bottom,
- * left
- * }
- * };
- *
- * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
- */
- function addMarginRules( stylesProcessor ) {
- stylesProcessor.setNormalizer( 'margin', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getPositionShorthandNormalizer"])( 'margin' ) );
- stylesProcessor.setNormalizer( 'margin-top', value => ( { path: 'margin.top', value } ) );
- stylesProcessor.setNormalizer( 'margin-right', value => ( { path: 'margin.right', value } ) );
- stylesProcessor.setNormalizer( 'margin-bottom', value => ( { path: 'margin.bottom', value } ) );
- stylesProcessor.setNormalizer( 'margin-left', value => ( { path: 'margin.left', value } ) );
- stylesProcessor.setReducer( 'margin', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'margin' ) );
- stylesProcessor.setStyleRelation( 'margin', [ 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ] );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.js ***!
- \****************************************************************************/
- /*! exports provided: addPaddingRules */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addPaddingRules", function() { return addPaddingRules; });
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/styles/padding
- */
- /**
- * Adds a margin CSS styles processing rules.
- *
- * editor.data.addStyleProcessorRules( addPaddingRules );
- *
- * The normalized value is stored as:
- *
- * const styles = {
- * padding: {
- * top,
- * right,
- * bottom,
- * left
- * }
- * };
- *
- * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
- */
- function addPaddingRules( stylesProcessor ) {
- stylesProcessor.setNormalizer( 'padding', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getPositionShorthandNormalizer"])( 'padding' ) );
- stylesProcessor.setNormalizer( 'padding-top', value => ( { path: 'padding.top', value } ) );
- stylesProcessor.setNormalizer( 'padding-right', value => ( { path: 'padding.right', value } ) );
- stylesProcessor.setNormalizer( 'padding-bottom', value => ( { path: 'padding.bottom', value } ) );
- stylesProcessor.setNormalizer( 'padding-left', value => ( { path: 'padding.left', value } ) );
- stylesProcessor.setReducer( 'padding', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'padding' ) );
- stylesProcessor.setStyleRelation( 'padding', [ 'padding-top', 'padding-right', 'padding-bottom', 'padding-left' ] );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js ***!
- \**************************************************************************/
- /*! exports provided: isColor, isLineStyle, isLength, isPercentage, isRepeat, isPosition, isAttachment, isURL, getBoxSidesValues, getBoxSidesValueReducer, getBoxSidesShorthandValue, getPositionShorthandNormalizer, getShorthandValues */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isColor", function() { return isColor; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLineStyle", function() { return isLineStyle; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return isLength; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPercentage", function() { return isPercentage; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRepeat", function() { return isRepeat; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPosition", function() { return isPosition; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAttachment", function() { return isAttachment; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return isURL; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValues", function() { return getBoxSidesValues; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValueReducer", function() { return getBoxSidesValueReducer; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesShorthandValue", function() { return getBoxSidesShorthandValue; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPositionShorthandNormalizer", function() { return getPositionShorthandNormalizer; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getShorthandValues", function() { return getShorthandValues; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/styles/utils
- */
- const HEX_COLOR_REGEXP = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
- const RGB_COLOR_REGEXP = /^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i;
- const RGBA_COLOR_REGEXP = /^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;
- const HSL_COLOR_REGEXP = /^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i;
- const HSLA_COLOR_REGEXP = /^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;
- const COLOR_NAMES = new Set( [
- // CSS Level 1
- 'black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia',
- 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua',
- // CSS Level 2 (Revision 1)
- 'orange',
- // CSS Color Module Level 3
- 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', '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', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod',
- 'greenyellow', 'grey', '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', 'limegreen', 'linen', 'magenta', 'mediumaquamarine',
- 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen',
- 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite',
- 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred',
- 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon',
- 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow',
- 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen',
- // CSS Color Module Level 4
- 'rebeccapurple',
- // Keywords
- 'currentcolor', 'transparent'
- ] );
- /**
- * Checks if string contains [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS value.
- *
- * isColor( '#f00' ); // true
- * isColor( '#AA00BB33' ); // true
- * isColor( 'rgb(0, 0, 250)' ); // true
- * isColor( 'hsla(240, 100%, 50%, .7)' ); // true
- * isColor( 'deepskyblue' ); // true
- *
- * **Note**: It does not support CSS Level 4 whitespace syntax, system colors and radius values for HSL colors.
- *
- * @param {String} string
- * @returns {Boolean}
- */
- function isColor( string ) {
- // As far as I was able to test checking some pre-conditions is faster than joining each test with ||.
- if ( string.startsWith( '#' ) ) {
- return HEX_COLOR_REGEXP.test( string );
- }
- if ( string.startsWith( 'rgb' ) ) {
- return RGB_COLOR_REGEXP.test( string ) || RGBA_COLOR_REGEXP.test( string );
- }
- if ( string.startsWith( 'hsl' ) ) {
- return HSL_COLOR_REGEXP.test( string ) || HSLA_COLOR_REGEXP.test( string );
- }
- // Array check > RegExp test.
- return COLOR_NAMES.has( string.toLowerCase() );
- }
- const lineStyleValues = [ 'none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset' ];
- /**
- * Checks if string contains [line style](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style) CSS value.
- *
- * @param {String} string
- * @returns {Boolean}
- */
- function isLineStyle( string ) {
- return lineStyleValues.includes( string );
- }
- const lengthRegExp = /^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;
- /**
- * Checks if string contains [length](https://developer.mozilla.org/en-US/docs/Web/CSS/length) CSS value.
- *
- * @param {String} string
- * @returns {Boolean}
- */
- function isLength( string ) {
- return lengthRegExp.test( string );
- }
- const PERCENTAGE_VALUE_REGEXP = /^[+-]?[0-9]*([.][0-9]+)?%$/;
- /**
- * Checks if string contains [percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/percentage) CSS value.
- *
- * @param {String} string
- * @returns {Boolean}
- */
- function isPercentage( string ) {
- return PERCENTAGE_VALUE_REGEXP.test( string );
- }
- const repeatValues = [ 'repeat-x', 'repeat-y', 'repeat', 'space', 'round', 'no-repeat' ];
- /**
- * Checks if string contains [background repeat](https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat) CSS value.
- *
- * @param {String} string
- * @returns {Boolean}
- */
- function isRepeat( string ) {
- return repeatValues.includes( string );
- }
- const positionValues = [ 'center', 'top', 'bottom', 'left', 'right' ];
- /**
- * Checks if string contains [background position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position) CSS value.
- *
- * @param {String} string
- * @returns {Boolean}
- */
- function isPosition( string ) {
- return positionValues.includes( string );
- }
- const attachmentValues = [ 'fixed', 'scroll', 'local' ];
- /**
- * Checks if string contains [background attachment](https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment) CSS value.
- *
- * @param {String} string
- * @returns {Boolean}
- */
- function isAttachment( string ) {
- return attachmentValues.includes( string );
- }
- const urlRegExp = /^url\(/;
- /**
- * Checks if string contains [URL](https://developer.mozilla.org/en-US/docs/Web/CSS/url) CSS value.
- *
- * @param {String} string
- * @returns {Boolean}
- */
- function isURL( string ) {
- return urlRegExp.test( string );
- }
- function getBoxSidesValues( value = '' ) {
- if ( value === '' ) {
- return { top: undefined, right: undefined, bottom: undefined, left: undefined };
- }
- const values = getShorthandValues( value );
- const top = values[ 0 ];
- const bottom = values[ 2 ] || top;
- const right = values[ 1 ] || top;
- const left = values[ 3 ] || right;
- return { top, bottom, right, left };
- }
- /**
- * Default reducer for CSS properties that concerns edges of a box
- * [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notations:
- *
- * stylesProcessor.setReducer( 'padding', getBoxSidesValueReducer( 'padding' ) );
- *
- * @param {String} styleShorthand
- * @returns {Function}
- */
- function getBoxSidesValueReducer( styleShorthand ) {
- return value => {
- const { top, right, bottom, left } = value;
- const reduced = [];
- if ( ![ top, right, left, bottom ].every( value => !!value ) ) {
- if ( top ) {
- reduced.push( [ styleShorthand + '-top', top ] );
- }
- if ( right ) {
- reduced.push( [ styleShorthand + '-right', right ] );
- }
- if ( bottom ) {
- reduced.push( [ styleShorthand + '-bottom', bottom ] );
- }
- if ( left ) {
- reduced.push( [ styleShorthand + '-left', left ] );
- }
- } else {
- reduced.push( [ styleShorthand, getBoxSidesShorthandValue( value ) ] );
- }
- return reduced;
- };
- }
- /**
- * Returns a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notation
- * of a CSS property value.
- *
- * getBoxSidesShorthandValue( { top: '1px', right: '1px', bottom: '2px', left: '1px' } );
- * // will return '1px 1px 2px'
- *
- * @param {module:engine/view/stylesmap~BoxSides} styleShorthand
- * @returns {String}
- */
- function getBoxSidesShorthandValue( { top, right, bottom, left } ) {
- const out = [];
- if ( left !== right ) {
- out.push( top, right, bottom, left );
- } else if ( bottom !== top ) {
- out.push( top, right, bottom );
- } else if ( right !== top ) {
- out.push( top, right );
- } else {
- out.push( top );
- }
- return out.join( ' ' );
- }
- /**
- * Creates a normalizer for a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) 1-to-4 value.
- *
- * stylesProcessor.setNormalizer( 'margin', getPositionShorthandNormalizer( 'margin' ) );
- *
- * @param {String} shorthand
- * @returns {Function}
- */
- function getPositionShorthandNormalizer( shorthand ) {
- return value => {
- return {
- path: shorthand,
- value: getBoxSidesValues( value )
- };
- };
- }
- /**
- * Parses parts of a 1-to-4 value notation - handles some CSS values with spaces (like RGB()).
- *
- * getShorthandValues( 'red blue RGB(0, 0, 0)');
- * // will return [ 'red', 'blue', 'RGB(0, 0, 0)' ]
- *
- * @param {String} string
- * @returns {Array.<String>}
- */
- function getShorthandValues( string ) {
- return string
- .replace( /, /g, ',' ) // Exclude comma from spaces evaluation as values are separated by spaces.
- .split( ' ' )
- .map( string => string.replace( /,/g, ', ' ) ); // Restore original notation.
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js ***!
- \***********************************************************************/
- /*! exports provided: default, StylesProcessor */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StylesMap; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StylesProcessor", function() { return StylesProcessor; });
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/stylesmap
- */
- /**
- * Styles map. Allows handling (adding, removing, retrieving) a set of style rules (usually, of an element).
- *
- * The styles map is capable of normalizing style names so e.g. the following operations are possible:
- */
- class StylesMap {
- /**
- * Creates Styles instance.
- *
- * @param {module:engine/view/stylesmap~StylesProcessor} styleProcessor
- */
- constructor( styleProcessor ) {
- /**
- * Keeps an internal representation of styles map. Normalized styles are kept as object tree to allow unified modification and
- * value access model using lodash's get, set, unset, etc methods.
- *
- * When no style processor rules are defined the it acts as simple key-value storage.
- *
- * @private
- * @type {Object}
- */
- this._styles = {};
- /**
- * An instance of the {@link module:engine/view/stylesmap~StylesProcessor}.
- *
- * @private
- * @member {module:engine/view/stylesmap~StylesProcessor}
- */
- this._styleProcessor = styleProcessor;
- }
- /**
- * Returns true if style map has no styles set.
- *
- * @type {Boolean}
- */
- get isEmpty() {
- const entries = Object.entries( this._styles );
- const from = Array.from( entries );
- return !from.length;
- }
- /**
- * Number of styles defined.
- *
- * @type {Number}
- */
- get size() {
- if ( this.isEmpty ) {
- return 0;
- }
- return this.getStyleNames().length;
- }
- /**
- * Set styles map to a new value.
- *
- * styles.setTo( 'border:1px solid blue;margin-top:1px;' );
- *
- * @param {String} inlineStyle
- */
- setTo( inlineStyle ) {
- this.clear();
- const parsedStyles = Array.from( parseInlineStyles( inlineStyle ).entries() );
- for ( const [ key, value ] of parsedStyles ) {
- this._styleProcessor.toNormalizedForm( key, value, this._styles );
- }
- }
- /**
- * Checks if a given style is set.
- *
- * styles.setTo( 'margin-left:1px;' );
- *
- * styles.has( 'margin-left' ); // -> true
- * styles.has( 'padding' ); // -> false
- *
- * **Note**: This check supports normalized style names.
- *
- * // Enable 'margin' shorthand processing:
- * editor.data.addStyleProcessorRules( addMarginRules );
- *
- * styles.setTo( 'margin:2px;' );
- *
- * styles.has( 'margin' ); // -> true
- * styles.has( 'margin-top' ); // -> true
- * styles.has( 'margin-left' ); // -> true
- *
- * styles.remove( 'margin-top' );
- *
- * styles.has( 'margin' ); // -> false
- * styles.has( 'margin-top' ); // -> false
- * styles.has( 'margin-left' ); // -> true
- *
- * @param {String} name Style name.
- * @returns {Boolean}
- */
- has( name ) {
- if ( this.isEmpty ) {
- return false;
- }
- const styles = this._styleProcessor.getReducedForm( name, this._styles );
- const propertyDescriptor = styles.find( ( [ property ] ) => property === name );
- // Only return a value if it is set;
- return Array.isArray( propertyDescriptor );
- }
- /**
- * Sets a given style.
- *
- * Can insert one by one:
- *
- * styles.set( 'color', 'blue' );
- * styles.set( 'margin-right', '1em' );
- *
- * or many styles at once:
- *
- * styles.set( {
- * color: 'blue',
- * 'margin-right': '1em'
- * } );
- *
- * ***Note**:* This method uses {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules
- * enabled style processor rules} to normalize passed values.
- *
- * // Enable 'margin' shorthand processing:
- * editor.data.addStyleProcessorRules( addMarginRules );
- *
- * styles.set( 'margin', '2px' );
- *
- * The above code will set margin to:
- *
- * styles.getNormalized( 'margin' );
- * // -> { top: '2px', right: '2px', bottom: '2px', left: '2px' }
- *
- * Which makes it possible to retrieve a "sub-value":
- *
- * styles.get( 'margin-left' ); // -> '2px'
- *
- * Or modify it:
- *
- * styles.remove( 'margin-left' );
- *
- * styles.getNormalized( 'margin' ); // -> { top: '1px', bottom: '1px', right: '1px' }
- * styles.toString(); // -> 'margin-bottom:1px;margin-right:1px;margin-top:1px;'
- *
- * This method also allows to set normalized values directly (if a particular styles processor rule was enabled):
- *
- * styles.set( 'border-color', { top: 'blue' } );
- * styles.set( 'margin', { right: '2em' } );
- *
- * styles.toString(); // -> 'border-color-top:blue;margin-right:2em;'
- *
- * @param {String|Object} nameOrObject Style property name or object with multiple properties.
- * @param {String|Object} valueOrObject Value to set.
- */
- set( nameOrObject, valueOrObject ) {
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( nameOrObject ) ) {
- for ( const [ key, value ] of Object.entries( nameOrObject ) ) {
- this._styleProcessor.toNormalizedForm( key, value, this._styles );
- }
- } else {
- this._styleProcessor.toNormalizedForm( nameOrObject, valueOrObject, this._styles );
- }
- }
- /**
- * Removes given style.
- *
- * styles.setTo( 'background:#f00;margin-right:2px;' );
- *
- * styles.remove( 'background' );
- *
- * styles.toString(); // -> 'margin-right:2px;'
- *
- * ***Note**:* This method uses {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules
- * enabled style processor rules} to normalize passed values.
- *
- * // Enable 'margin' shorthand processing:
- * editor.data.addStyleProcessorRules( addMarginRules );
- *
- * styles.setTo( 'margin:1px' );
- *
- * styles.remove( 'margin-top' );
- * styles.remove( 'margin-right' );
- *
- * styles.toString(); // -> 'margin-bottom:1px;margin-left:1px;'
- *
- * @param {String} name Style name.
- */
- remove( name ) {
- const path = toPath( name );
- Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["unset"])( this._styles, path );
- delete this._styles[ name ];
- this._cleanEmptyObjectsOnPath( path );
- }
- /**
- * Returns a normalized style object or a single value.
- *
- * // Enable 'margin' shorthand processing:
- * editor.data.addStyleProcessorRules( addMarginRules );
- *
- * const styles = new Styles();
- * styles.setTo( 'margin:1px 2px 3em;' );
- *
- * styles.getNormalized( 'margin' );
- * // will log:
- * // {
- * // top: '1px',
- * // right: '2px',
- * // bottom: '3em',
- * // left: '2px' // normalized value from margin shorthand
- * // }
- *
- * styles.getNormalized( 'margin-left' ); // -> '2px'
- *
- * **Note**: This method will only return normalized styles if a style processor was defined.
- *
- * @param {String} name Style name.
- * @returns {Object|String|undefined}
- */
- getNormalized( name ) {
- return this._styleProcessor.getNormalized( name, this._styles );
- }
- /**
- * Returns a normalized style string. Styles are sorted by name.
- *
- * styles.set( 'margin' , '1px' );
- * styles.set( 'background', '#f00' );
- *
- * styles.toString(); // -> 'background:#f00;margin:1px;'
- *
- * **Note**: This method supports normalized styles if defined.
- *
- * // Enable 'margin' shorthand processing:
- * editor.data.addStyleProcessorRules( addMarginRules );
- *
- * styles.set( 'margin' , '1px' );
- * styles.set( 'background', '#f00' );
- * styles.remove( 'margin-top' );
- * styles.remove( 'margin-right' );
- *
- * styles.toString(); // -> 'background:#f00;margin-bottom:1px;margin-left:1px;'
- *
- * @returns {String}
- */
- toString() {
- if ( this.isEmpty ) {
- return '';
- }
- return this._getStylesEntries()
- .map( arr => arr.join( ':' ) )
- .sort()
- .join( ';' ) + ';';
- }
- /**
- * Returns property as a value string or undefined if property is not set.
- *
- * // Enable 'margin' shorthand processing:
- * editor.data.addStyleProcessorRules( addMarginRules );
- *
- * const styles = new Styles();
- * styles.setTo( 'margin:1px;' );
- * styles.set( 'margin-bottom', '3em' );
- *
- * styles.getAsString( 'margin' ); // -> 'margin: 1px 1px 3em;'
- *
- * Note, however, that all sub-values must be set for the longhand property name to return a value:
- *
- * const styles = new Styles();
- * styles.setTo( 'margin:1px;' );
- * styles.remove( 'margin-bottom' );
- *
- * styles.getAsString( 'margin' ); // -> undefined
- *
- * In the above scenario, it is not possible to return a `margin` value, so `undefined` is returned.
- * Instead, you should use:
- *
- * const styles = new Styles();
- * styles.setTo( 'margin:1px;' );
- * styles.remove( 'margin-bottom' );
- *
- * for ( const styleName of styles.getStyleNames() ) {
- * console.log( styleName, styles.getAsString( styleName ) );
- * }
- * // 'margin-top', '1px'
- * // 'margin-right', '1px'
- * // 'margin-left', '1px'
- *
- * In general, it is recommend to iterate over style names like in the example above. This way, you will always get all
- * the currently set style values. So, if all the 4 margin values would be set
- * the for-of loop above would yield only `'margin'`, `'1px'`:
- *
- * const styles = new Styles();
- * styles.setTo( 'margin:1px;' );
- *
- * for ( const styleName of styles.getStyleNames() ) {
- * console.log( styleName, styles.getAsString( styleName ) );
- * }
- * // 'margin', '1px'
- *
- * **Note**: To get a normalized version of a longhand property use the {@link #getNormalized `#getNormalized()`} method.
- *
- * @param {String} propertyName
- * @returns {String|undefined}
- */
- getAsString( propertyName ) {
- if ( this.isEmpty ) {
- return;
- }
- if ( this._styles[ propertyName ] && !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( this._styles[ propertyName ] ) ) {
- // Try return styles set directly - values that are not parsed.
- return this._styles[ propertyName ];
- }
- const styles = this._styleProcessor.getReducedForm( propertyName, this._styles );
- const propertyDescriptor = styles.find( ( [ property ] ) => property === propertyName );
- // Only return a value if it is set;
- if ( Array.isArray( propertyDescriptor ) ) {
- return propertyDescriptor[ 1 ];
- }
- }
- /**
- * Returns style property names as they would appear when using {@link #toString `#toString()`}.
- *
- * @returns {Array.<String>}
- */
- getStyleNames() {
- if ( this.isEmpty ) {
- return [];
- }
- const entries = this._getStylesEntries();
- return entries.map( ( [ key ] ) => key );
- }
- /**
- * Removes all styles.
- */
- clear() {
- this._styles = {};
- }
- /**
- * Returns normalized styles entries for further processing.
- *
- * @private
- * @returns {Array.<module:engine/view/stylesmap~PropertyDescriptor>}
- */
- _getStylesEntries() {
- const parsed = [];
- const keys = Object.keys( this._styles );
- for ( const key of keys ) {
- parsed.push( ...this._styleProcessor.getReducedForm( key, this._styles ) );
- }
- return parsed;
- }
- /**
- * Removes empty objects upon removing an entry from internal object.
- *
- * @param {String} path
- * @private
- */
- _cleanEmptyObjectsOnPath( path ) {
- const pathParts = path.split( '.' );
- const isChildPath = pathParts.length > 1;
- if ( !isChildPath ) {
- return;
- }
- const parentPath = pathParts.splice( 0, pathParts.length - 1 ).join( '.' );
- const parentObject = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( this._styles, parentPath );
- if ( !parentObject ) {
- return;
- }
- const isParentEmpty = !Array.from( Object.keys( parentObject ) ).length;
- if ( isParentEmpty ) {
- this.remove( parentPath );
- }
- }
- }
- /**
- * Style processor is responsible for writing and reading a normalized styles object.
- */
- class StylesProcessor {
- /**
- * Creates StylesProcessor instance.
- *
- * @private
- */
- constructor() {
- this._normalizers = new Map();
- this._extractors = new Map();
- this._reducers = new Map();
- this._consumables = new Map();
- }
- /**
- * Parse style string value to a normalized object and appends it to styles object.
- *
- * const styles = {};
- *
- * stylesProcessor.toNormalizedForm( 'margin', '1px', styles );
- *
- * // styles will consist: { margin: { top: '1px', right: '1px', bottom: '1px', left: '1px; } }
- *
- * **Note**: To define normalizer callbacks use {@link #setNormalizer}.
- *
- * @param {String} name Name of style property.
- * @param {String} propertyValue Value of style property.
- * @param {Object} styles Object holding normalized styles.
- */
- toNormalizedForm( name, propertyValue, styles ) {
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( propertyValue ) ) {
- appendStyleValue( styles, toPath( name ), propertyValue );
- return;
- }
- if ( this._normalizers.has( name ) ) {
- const normalizer = this._normalizers.get( name );
- const { path, value } = normalizer( propertyValue );
- appendStyleValue( styles, path, value );
- } else {
- appendStyleValue( styles, name, propertyValue );
- }
- }
- /**
- * Returns a normalized version of a style property.
- * const styles = {
- * margin: { top: '1px', right: '1px', bottom: '1px', left: '1px; },
- * background: { color: '#f00' }
- * };
- *
- * stylesProcessor.getNormalized( 'background' );
- * // will return: { color: '#f00' }
- *
- * stylesProcessor.getNormalized( 'margin-top' );
- * // will return: '1px'
- *
- * **Note**: In some cases extracting single value requires defining an extractor callback {@link #setExtractor}.
- *
- * @param {String} name Name of style property.
- * @param {Object} styles Object holding normalized styles.
- * @returns {*}
- */
- getNormalized( name, styles ) {
- if ( !name ) {
- return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["merge"])( {}, styles );
- }
- // Might be empty string.
- if ( styles[ name ] !== undefined ) {
- return styles[ name ];
- }
- if ( this._extractors.has( name ) ) {
- const extractor = this._extractors.get( name );
- if ( typeof extractor === 'string' ) {
- return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( styles, extractor );
- }
- const value = extractor( name, styles );
- if ( value ) {
- return value;
- }
- }
- return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( styles, toPath( name ) );
- }
- /**
- * Returns a reduced form of style property form normalized object.
- *
- * For default margin reducer, the below code:
- *
- * stylesProcessor.getReducedForm( 'margin', {
- * margin: { top: '1px', right: '1px', bottom: '2px', left: '1px; }
- * } );
- *
- * will return:
- *
- * [
- * [ 'margin', '1px 1px 2px' ]
- * ]
- *
- * because it might be represented as a shorthand 'margin' value. However if one of margin long hand values is missing it should return:
- *
- * [
- * [ 'margin-top', '1px' ],
- * [ 'margin-right', '1px' ],
- * [ 'margin-bottom', '2px' ]
- * // the 'left' value is missing - cannot use 'margin' shorthand.
- * ]
- *
- * **Note**: To define reducer callbacks use {@link #setReducer}.
- *
- * @param {String} name Name of style property.
- * @param {Object} styles Object holding normalized styles.
- * @returns {Array.<module:engine/view/stylesmap~PropertyDescriptor>}
- */
- getReducedForm( name, styles ) {
- const normalizedValue = this.getNormalized( name, styles );
- // Might be empty string.
- if ( normalizedValue === undefined ) {
- return [];
- }
- if ( this._reducers.has( name ) ) {
- const reducer = this._reducers.get( name );
- return reducer( normalizedValue );
- }
- return [ [ name, normalizedValue ] ];
- }
- /**
- * Returns related style names.
- *
- * stylesProcessor.getRelatedStyles( 'margin' );
- * // will return: [ 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ];
- *
- * stylesProcessor.getRelatedStyles( 'margin-top' );
- * // will return: [ 'margin' ];
- *
- * **Note**: To define new style relations load an existing style processor or use
- * {@link module:engine/view/stylesmap~StylesProcessor#setStyleRelation `StylesProcessor.setStyleRelation()`}.
- *
- * @param {String} name
- * @returns {Array.<String>}
- */
- getRelatedStyles( name ) {
- return this._consumables.get( name ) || [];
- }
- /**
- * Adds a normalizer method for a style property.
- *
- * A normalizer returns describing how the value should be normalized.
- *
- * For instance 'margin' style is a shorthand for four margin values:
- *
- * - 'margin-top'
- * - 'margin-right'
- * - 'margin-bottom'
- * - 'margin-left'
- *
- * and can be written in various ways if some values are equal to others. For instance `'margin: 1px 2em;'` is a shorthand for
- * `'margin-top: 1px;margin-right: 2em;margin-bottom: 1px;margin-left: 2em'`.
- *
- * A normalizer should parse various margin notations as a single object:
- *
- * const styles = {
- * margin: {
- * top: '1px',
- * right: '2em',
- * bottom: '1px',
- * left: '2em'
- * }
- * };
- *
- * Thus a normalizer for 'margin' style should return an object defining style path and value to store:
- *
- * const returnValue = {
- * path: 'margin',
- * value: {
- * top: '1px',
- * right: '2em',
- * bottom: '1px',
- * left: '2em'
- * }
- * };
- *
- * Additionally to fully support all margin notations there should be also defined 4 normalizers for longhand margin notations. Below
- * is an example for 'margin-top' style property normalizer:
- *
- * stylesProcessor.setNormalizer( 'margin-top', valueString => {
- * return {
- * path: 'margin.top',
- * value: valueString
- * }
- * } );
- *
- * @param {String} name
- * @param {Function} callback
- */
- setNormalizer( name, callback ) {
- this._normalizers.set( name, callback );
- }
- /**
- * Adds a extractor callback for a style property.
- *
- * Most normalized style values are stored as one level objects. It is assumed that `'margin-top'` style will be stored as:
- *
- * const styles = {
- * margin: {
- * top: 'value'
- * }
- * }
- *
- * However, some styles can have conflicting notations and thus it might be harder to extract a style value from shorthand. For instance
- * the 'border-top-style' can be defined using `'border-top:solid'`, `'border-style:solid none none none'` or by `'border:solid'`
- * shorthands. The default border styles processors stores styles as:
- *
- * const styles = {
- * border: {
- * style: {
- * top: 'solid'
- * }
- * }
- * }
- *
- * as it is better to modify border style independently from other values. On the other part the output of the border might be
- * desired as `border-top`, `border-left`, etc notation.
- *
- * In the above example a reducer should return a side border value that combines style, color and width:
- *
- * styleProcessor.setExtractor( 'border-top', styles => {
- * return {
- * color: styles.border.color.top,
- * style: styles.border.style.top,
- * width: styles.border.width.top
- * }
- * } );
- *
- * @param {String} name
- * @param {Function|String} callbackOrPath Callback that return a requested value or path string for single values.
- */
- setExtractor( name, callbackOrPath ) {
- this._extractors.set( name, callbackOrPath );
- }
- /**
- * Adds a reducer callback for a style property.
- *
- * Reducer returns a minimal notation for given style name. For longhand properties it is not required to write a reducer as
- * by default the direct value from style path is taken.
- *
- * For shorthand styles a reducer should return minimal style notation either by returning single name-value tuple or multiple tuples
- * if a shorthand cannot be used. For instance for a margin shorthand a reducer might return:
- *
- * const marginShortHandTuple = [
- * [ 'margin', '1px 1px 2px' ]
- * ];
- *
- * or a longhand tuples for defined values:
- *
- * // Considering margin.bottom and margin.left are undefined.
- * const marginLonghandsTuples = [
- * [ 'margin-top', '1px' ],
- * [ 'margin-right', '1px' ]
- * ];
- *
- * A reducer obtains a normalized style value:
- *
- * // Simplified reducer that always outputs 4 values which are always present:
- * stylesProcessor.setReducer( 'margin', margin => {
- * return [
- * [ 'margin', `${ margin.top } ${ margin.right } ${ margin.bottom } ${ margin.left }` ]
- * ]
- * } );
- *
- * @param {String} name
- * @param {Function} callback
- */
- setReducer( name, callback ) {
- this._reducers.set( name, callback );
- }
- /**
- * Defines a style shorthand relation to other style notations.
- *
- * stylesProcessor.setStyleRelation( 'margin', [
- * 'margin-top',
- * 'margin-right',
- * 'margin-bottom',
- * 'margin-left'
- * ] );
- *
- * This enables expanding of style names for shorthands. For instance, if defined,
- * {@link module:engine/conversion/viewconsumable~ViewConsumable view consumable} items are automatically created
- * for long-hand margin style notation alongside the `'margin'` item.
- *
- * This means that when an element being converted has a style `margin`, a converter for `margin-left` will work just
- * fine since the view consumable will contain a consumable `margin-left` item (thanks to the relation) and
- * `element.getStyle( 'margin-left' )` will work as well assuming that the style processor was correctly configured.
- * However, once `margin-left` is consumed, `margin` will not be consumable anymore.
- *
- * @param {String} shorthandName
- * @param {Array.<String>} styleNames
- */
- setStyleRelation( shorthandName, styleNames ) {
- this._mapStyleNames( shorthandName, styleNames );
- for ( const alsoName of styleNames ) {
- this._mapStyleNames( alsoName, [ shorthandName ] );
- }
- }
- /**
- * Set two-way binding of style names.
- *
- * @param {String} name
- * @param {Array.<String>} styleNames
- * @private
- */
- _mapStyleNames( name, styleNames ) {
- if ( !this._consumables.has( name ) ) {
- this._consumables.set( name, [] );
- }
- this._consumables.get( name ).push( ...styleNames );
- }
- }
- // Parses inline styles and puts property - value pairs into styles map.
- //
- // @param {String} stylesString Styles to parse.
- // @returns {Map.<String, String>} stylesMap Map of parsed properties and values.
- function parseInlineStyles( stylesString ) {
- // `null` if no quote was found in input string or last found quote was a closing quote. See below.
- let quoteType = null;
- let propertyNameStart = 0;
- let propertyValueStart = 0;
- let propertyName = null;
- const stylesMap = new Map();
- // Do not set anything if input string is empty.
- if ( stylesString === '' ) {
- return stylesMap;
- }
- // Fix inline styles that do not end with `;` so they are compatible with algorithm below.
- if ( stylesString.charAt( stylesString.length - 1 ) != ';' ) {
- stylesString = stylesString + ';';
- }
- // Seek the whole string for "special characters".
- for ( let i = 0; i < stylesString.length; i++ ) {
- const char = stylesString.charAt( i );
- if ( quoteType === null ) {
- // No quote found yet or last found quote was a closing quote.
- switch ( char ) {
- case ':':
- // Most of time colon means that property name just ended.
- // Sometimes however `:` is found inside property value (for example in background image url).
- if ( !propertyName ) {
- // Treat this as end of property only if property name is not already saved.
- // Save property name.
- propertyName = stylesString.substr( propertyNameStart, i - propertyNameStart );
- // Save this point as the start of property value.
- propertyValueStart = i + 1;
- }
- break;
- case '"':
- case '\'':
- // Opening quote found (this is an opening quote, because `quoteType` is `null`).
- quoteType = char;
- break;
- case ';': {
- // Property value just ended.
- // Use previously stored property value start to obtain property value.
- const propertyValue = stylesString.substr( propertyValueStart, i - propertyValueStart );
- if ( propertyName ) {
- // Save parsed part.
- stylesMap.set( propertyName.trim(), propertyValue.trim() );
- }
- propertyName = null;
- // Save this point as property name start. Property name starts immediately after previous property value ends.
- propertyNameStart = i + 1;
- break;
- }
- }
- } else if ( char === quoteType ) {
- // If a quote char is found and it is a closing quote, mark this fact by `null`-ing `quoteType`.
- quoteType = null;
- }
- }
- return stylesMap;
- }
- // Return lodash compatible path from style name.
- function toPath( name ) {
- return name.replace( '-', '.' );
- }
- // Appends style definition to the styles object.
- //
- // @param {String} nameOrPath
- // @param {String|Object} valueOrObject
- // @private
- function appendStyleValue( stylesObject, nameOrPath, valueOrObject ) {
- let valueToSet = valueOrObject;
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( valueOrObject ) ) {
- valueToSet = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["merge"])( {}, Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( stylesObject, nameOrPath ), valueOrObject );
- }
- Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["set"])( stylesObject, nameOrPath, valueToSet );
- }
- /**
- * A CSS style property descriptor that contains tuplet of two strings:
- *
- * - first string describes property name
- * - second string describes property value
- *
- * const marginDescriptor = [ 'margin', '2px 3em' ];
- * const marginTopDescriptor = [ 'margin-top', '2px' ];
- *
- * @typedef {Array.<String, String>} module:engine/view/stylesmap~PropertyDescriptor
- */
- /**
- * An object describing values associated with the sides of a box, for instance margins, paddings,
- * border widths, border colors, etc.
- *
- * const margin = {
- * top: '1px',
- * right: '3px',
- * bottom: '3px',
- * left: '7px'
- * };
- *
- * const borderColor = {
- * top: 'red',
- * right: 'blue',
- * bottom: 'blue',
- * left: 'red'
- * };
- *
- * @typedef {Object} module:engine/view/stylesmap~BoxSides
- *
- * @property {String} top Top side value.
- * @property {String} right Right side value.
- * @property {String} bottom Bottom side value.
- * @property {String} left Left side value.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Text; });
- /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/text
- */
- /**
- * Tree view text node.
- *
- * The constructor of this class should not be used directly. To create a new text node instance
- * use the {@link module:engine/view/downcastwriter~DowncastWriter#createText `DowncastWriter#createText()`}
- * method when working on data downcasted from the model or the
- * {@link module:engine/view/upcastwriter~UpcastWriter#createText `UpcastWriter#createText()`}
- * method when working on non-semantic views.
- *
- * @extends module:engine/view/node~Node
- */
- class Text extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates a tree view text node.
- *
- * @protected
- * @param {module:engine/view/document~Document} document The document instance to which this text node belongs.
- * @param {String} data The text's data.
- */
- constructor( document, data ) {
- super( document );
- /**
- * The text content.
- *
- * Setting the data fires the {@link module:engine/view/node~Node#event:change:text change event}.
- *
- * @protected
- * @member {String} module:engine/view/text~Text#_textData
- */
- this._textData = data;
- }
- /**
- * Checks whether this object is of the given type.
- *
- * text.is( '$text' ); // -> true
- * text.is( 'node' ); // -> true
- * text.is( 'view:$text' ); // -> true
- * text.is( 'view:node' ); // -> true
- *
- * text.is( 'model:$text' ); // -> false
- * text.is( 'element' ); // -> false
- * text.is( 'range' ); // -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * **Note:** Until version 20.0.0 this method wasn't accepting `'$text'` type. The legacy `'text'` type is still
- * accepted for backward compatibility.
- *
- * @param {String} type Type to check.
- * @returns {Boolean}
- */
- is( type ) {
- return type === '$text' || type === 'view:$text' ||
- // This are legacy values kept for backward compatibility.
- type === 'text' || type === 'view:text' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'node' || type === 'view:node';
- }
- /**
- * The text content.
- *
- * @readonly
- * @type {String}
- */
- get data() {
- return this._textData;
- }
- /**
- * The `_data` property is controlled by a getter and a setter.
- *
- * The getter is required when using the addition assignment operator on protected property:
- *
- * const foo = downcastWriter.createText( 'foo' );
- * const bar = downcastWriter.createText( 'bar' );
- *
- * foo._data += bar.data; // executes: `foo._data = foo._data + bar.data`
- * console.log( foo.data ); // prints: 'foobar'
- *
- * If the protected getter didn't exist, `foo._data` will return `undefined` and result of the merge will be invalid.
- *
- * The setter sets data and fires the {@link module:engine/view/node~Node#event:change:text change event}.
- *
- * @protected
- * @type {String}
- */
- get _data() {
- return this.data;
- }
- set _data( data ) {
- this._fireChange( 'text', this );
- this._textData = data;
- }
- /**
- * Checks if this text node is similar to other text node.
- * Both nodes should have the same data to be considered as similar.
- *
- * @param {module:engine/view/text~Text} otherNode Node to check if it is same as this node.
- * @returns {Boolean}
- */
- isSimilar( otherNode ) {
- if ( !( otherNode instanceof Text ) ) {
- return false;
- }
- return this === otherNode || this.data === otherNode.data;
- }
- /**
- * Clones this node.
- *
- * @protected
- * @returns {module:engine/view/text~Text} Text node that is a clone of this node.
- */
- _clone() {
- return new Text( this.document, this.data );
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // log() {
- // @if CK_DEBUG_ENGINE // console.log( 'ViewText: ' + this );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // logExtended() {
- // @if CK_DEBUG_ENGINE // console.log( 'ViewText: ' + this );
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextProxy; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/textproxy
- */
- /**
- * TextProxy is a wrapper for substring of {@link module:engine/view/text~Text}. Instance of this class is created by
- * {@link module:engine/view/treewalker~TreeWalker} when only a part of {@link module:engine/view/text~Text} needs to be returned.
- *
- * `TextProxy` has an API similar to {@link module:engine/view/text~Text Text} and allows to do most of the common tasks performed
- * on view nodes.
- *
- * **Note:** Some `TextProxy` instances may represent whole text node, not just a part of it.
- * See {@link module:engine/view/textproxy~TextProxy#isPartial}.
- *
- * **Note:** `TextProxy` is a readonly interface.
- *
- * **Note:** `TextProxy` instances are created on the fly basing on the current state of parent {@link module:engine/view/text~Text}.
- * Because of this it is highly unrecommended to store references to `TextProxy instances because they might get
- * invalidated due to operations on Document. Also TextProxy is not a {@link module:engine/view/node~Node} so it can not be
- * inserted as a child of {@link module:engine/view/element~Element}.
- *
- * `TextProxy` instances are created by {@link module:engine/view/treewalker~TreeWalker view tree walker}. You should not need to create
- * an instance of this class by your own.
- */
- class TextProxy {
- /**
- * Creates a text proxy.
- *
- * @protected
- * @param {module:engine/view/text~Text} textNode Text node which part is represented by this text proxy.
- * @param {Number} offsetInText Offset in {@link module:engine/view/textproxy~TextProxy#textNode text node}
- * from which the text proxy starts.
- * @param {Number} length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.
- * @constructor
- */
- constructor( textNode, offsetInText, length ) {
- /**
- * Reference to the {@link module:engine/view/text~Text} element which TextProxy is a substring.
- *
- * @readonly
- * @member {module:engine/view/text~Text} module:engine/view/textproxy~TextProxy#textNode
- */
- this.textNode = textNode;
- if ( offsetInText < 0 || offsetInText > textNode.data.length ) {
- /**
- * Given offsetInText value is incorrect.
- *
- * @error view-textproxy-wrong-offsetintext
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-textproxy-wrong-offsetintext', this );
- }
- if ( length < 0 || offsetInText + length > textNode.data.length ) {
- /**
- * Given length value is incorrect.
- *
- * @error view-textproxy-wrong-length
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-textproxy-wrong-length', this );
- }
- /**
- * Text data represented by this text proxy.
- *
- * @readonly
- * @member {String} module:engine/view/textproxy~TextProxy#data
- */
- this.data = textNode.data.substring( offsetInText, offsetInText + length );
- /**
- * Offset in the `textNode` where this `TextProxy` instance starts.
- *
- * @readonly
- * @member {Number} module:engine/view/textproxy~TextProxy#offsetInText
- */
- this.offsetInText = offsetInText;
- }
- /**
- * Offset size of this node.
- *
- * @readonly
- * @type {Number}
- */
- get offsetSize() {
- return this.data.length;
- }
- /**
- * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/view/text~Text text node}
- * (`true`) or the whole text node (`false`).
- *
- * This is `false` when text proxy starts at the very beginning of {@link module:engine/view/textproxy~TextProxy#textNode textNode}
- * ({@link module:engine/view/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to
- * text node size.
- *
- * @readonly
- * @type {Boolean}
- */
- get isPartial() {
- return this.data.length !== this.textNode.data.length;
- }
- /**
- * Parent of this text proxy, which is same as parent of text node represented by this text proxy.
- *
- * @readonly
- * @type {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}
- */
- get parent() {
- return this.textNode.parent;
- }
- /**
- * Root of this text proxy, which is same as root of text node represented by this text proxy.
- *
- * @readonly
- * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
- */
- get root() {
- return this.textNode.root;
- }
- /**
- * {@link module:engine/view/document~Document View document} that owns this text proxy, or `null` if the text proxy is inside
- * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
- *
- * @readonly
- * @type {module:engine/view/document~Document|null}
- */
- get document() {
- return this.textNode.document;
- }
- /**
- * Checks whether this object is of the given type.
- *
- * textProxy.is( '$textProxy' ); // -> true
- * textProxy.is( 'view:$textProxy' ); // -> true
- *
- * textProxy.is( 'model:$textProxy' ); // -> false
- * textProxy.is( 'element' ); // -> false
- * textProxy.is( 'range' ); // -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * **Note:** Until version 20.0.0 this method wasn't accepting `'$textProxy'` type. The legacy `'textProxy'` type is still
- * accepted for backward compatibility.
- *
- * @param {String} type Type to check.
- * @returns {Boolean}
- */
- is( type ) {
- return type === '$textProxy' || type === 'view:$textProxy' ||
- // This are legacy values kept for backward compatibility.
- type === 'textProxy' || type === 'view:textProxy';
- }
- /**
- * Returns ancestors array of this text proxy.
- *
- * @param {Object} options Options object.
- * @param {Boolean} [options.includeSelf=false] When set to `true` {#textNode} will be also included in parent's array.
- * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from text proxy parent to
- * root element, otherwise root element will be the first item in the array.
- * @returns {Array} Array with ancestors.
- */
- getAncestors( options = { includeSelf: false, parentFirst: false } ) {
- const ancestors = [];
- let parent = options.includeSelf ? this.textNode : this.parent;
- while ( parent !== null ) {
- ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
- parent = parent.parent;
- }
- return ancestors;
- }
- // @if CK_DEBUG_ENGINE // toString() {
- // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // log() {
- // @if CK_DEBUG_ENGINE // console.log( 'ViewTextProxy: ' + this );
- // @if CK_DEBUG_ENGINE // }
- // @if CK_DEBUG_ENGINE // logExtended() {
- // @if CK_DEBUG_ENGINE // console.log( 'ViewTextProxy: ' + this );
- // @if CK_DEBUG_ENGINE // }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TreeWalker; });
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
- /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/treewalker
- */
- /**
- * Position iterator class. It allows to iterate forward and backward over the document.
- */
- class TreeWalker {
- /**
- * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.
- *
- * @constructor
- * @param {Object} options Object with configuration.
- * @param {module:engine/view/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.
- * @param {module:engine/view/position~Position} [options.startPosition] Starting position.
- * @param {'forward'|'backward'} [options.direction='forward'] Walking direction.
- * @param {Boolean} [options.singleCharacters=false] Flag indicating whether all characters from
- * {@link module:engine/view/text~Text} should be returned as one {@link module:engine/view/text~Text} (`false`) ore one by one as
- * {@link module:engine/view/textproxy~TextProxy} (`true`).
- * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the
- * iterator is shallow child nodes of any iterated node will not be returned along with `elementEnd` tag.
- * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `elementEnd`
- * tags. If the option is true walker will not return a parent node of start position. If this option is `true`
- * each {@link module:engine/view/element~Element} will be returned once, while if the option is `false` they might be returned
- * twice: for `'elementStart'` and `'elementEnd'`.
- */
- constructor( options = {} ) {
- if ( !options.boundaries && !options.startPosition ) {
- /**
- * Neither boundaries nor starting position have been defined.
- *
- * @error view-tree-walker-no-start-position
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
- 'view-tree-walker-no-start-position',
- null
- );
- }
- if ( options.direction && options.direction != 'forward' && options.direction != 'backward' ) {
- /**
- * Only `backward` and `forward` direction allowed.
- *
- * @error view-tree-walker-unknown-direction
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'view-tree-walker-unknown-direction', options.startPosition, { direction: options.direction } );
- }
- /**
- * Iterator boundaries.
- *
- * When the iterator is walking `'forward'` on the end of boundary or is walking `'backward'`
- * on the start of boundary, then `{ done: true }` is returned.
- *
- * If boundaries are not defined they are set before first and after last child of the root node.
- *
- * @readonly
- * @member {module:engine/view/range~Range} module:engine/view/treewalker~TreeWalker#boundaries
- */
- this.boundaries = options.boundaries || null;
- /**
- * Iterator position. If start position is not defined then position depends on {@link #direction}. If direction is
- * `'forward'` position starts form the beginning, when direction is `'backward'` position starts from the end.
- *
- * @readonly
- * @member {module:engine/view/position~Position} module:engine/view/treewalker~TreeWalker#position
- */
- if ( options.startPosition ) {
- this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAt( options.startPosition );
- } else {
- this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAt( options.boundaries[ options.direction == 'backward' ? 'end' : 'start' ] );
- }
- /**
- * Walking direction. Defaults `'forward'`.
- *
- * @readonly
- * @member {'backward'|'forward'} module:engine/view/treewalker~TreeWalker#direction
- */
- this.direction = options.direction || 'forward';
- /**
- * Flag indicating whether all characters from {@link module:engine/view/text~Text} should be returned as one
- * {@link module:engine/view/text~Text} or one by one as {@link module:engine/view/textproxy~TextProxy}.
- *
- * @readonly
- * @member {Boolean} module:engine/view/treewalker~TreeWalker#singleCharacters
- */
- this.singleCharacters = !!options.singleCharacters;
- /**
- * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
- * iterated node will not be returned along with `elementEnd` tag.
- *
- * @readonly
- * @member {Boolean} module:engine/view/treewalker~TreeWalker#shallow
- */
- this.shallow = !!options.shallow;
- /**
- * Flag indicating whether iterator should ignore `elementEnd` tags. If set to `true`, walker will not
- * return a parent node of the start position. Each {@link module:engine/view/element~Element} will be returned once.
- * When set to `false` each element might be returned twice: for `'elementStart'` and `'elementEnd'`.
- *
- * @readonly
- * @member {Boolean} module:engine/view/treewalker~TreeWalker#ignoreElementEnd
- */
- this.ignoreElementEnd = !!options.ignoreElementEnd;
- /**
- * Start boundary parent.
- *
- * @private
- * @member {module:engine/view/node~Node} module:engine/view/treewalker~TreeWalker#_boundaryStartParent
- */
- this._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;
- /**
- * End boundary parent.
- *
- * @private
- * @member {module:engine/view/node~Node} module:engine/view/treewalker~TreeWalker#_boundaryEndParent
- */
- this._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;
- }
- /**
- * Iterable interface.
- *
- * @returns {Iterable.<module:engine/view/treewalker~TreeWalkerValue>}
- */
- [ Symbol.iterator ]() {
- return this;
- }
- /**
- * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.
- *
- * For example:
- *
- * walker.skip( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>
- * walker.skip( value => true ); // Move the position to the end: <p>{}foo</p> -> <p>foo</p>[]
- * walker.skip( value => false ); // Do not move the position.
- *
- * @param {Function} skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should
- * return `true` if the value should be skipped or `false` if not.
- */
- skip( skip ) {
- let done, value, prevPosition;
- do {
- prevPosition = this.position;
- ( { done, value } = this.next() );
- } while ( !done && skip( value ) );
- if ( !done ) {
- this.position = prevPosition;
- }
- }
- /**
- * Gets the next tree walker's value.
- *
- * @returns {module:engine/view/treewalker~TreeWalkerValue} Object implementing iterator interface, returning
- * information about taken step.
- */
- next() {
- if ( this.direction == 'forward' ) {
- return this._next();
- } else {
- return this._previous();
- }
- }
- /**
- * Makes a step forward in view. Moves the {@link #position} to the next position and returns the encountered value.
- *
- * @private
- * @returns {Object}
- * @returns {Boolean} return.done `true` if iterator is done, `false` otherwise.
- * @returns {module:engine/view/treewalker~TreeWalkerValue} return.value Information about taken step.
- */
- _next() {
- let position = this.position.clone();
- const previousPosition = this.position;
- const parent = position.parent;
- // We are at the end of the root.
- if ( parent.parent === null && position.offset === parent.childCount ) {
- return { done: true };
- }
- // We reached the walker boundary.
- if ( parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset ) {
- return { done: true };
- }
- // Get node just after current position.
- let node;
- // Text is a specific parent because it contains string instead of child nodes.
- if ( parent instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
- if ( position.isAtEnd ) {
- // Prevent returning "elementEnd" for Text node. Skip that value and return the next walker step.
- this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( parent );
- return this._next();
- }
- node = parent.data[ position.offset ];
- } else {
- node = parent.getChild( position.offset );
- }
- if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- if ( !this.shallow ) {
- position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, 0 );
- } else {
- position.offset++;
- }
- this.position = position;
- return this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
- } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
- if ( this.singleCharacters ) {
- position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, 0 );
- this.position = position;
- return this._next();
- } else {
- let charactersCount = node.data.length;
- let item;
- // If text stick out of walker range, we need to cut it and wrap in TextProxy.
- if ( node == this._boundaryEndParent ) {
- charactersCount = this.boundaries.end.offset;
- item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, 0, charactersCount );
- position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( item );
- } else {
- item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, 0, node.data.length );
- // If not just keep moving forward.
- position.offset++;
- }
- this.position = position;
- return this._formatReturnValue( 'text', item, previousPosition, position, charactersCount );
- }
- } else if ( typeof node == 'string' ) {
- let textLength;
- if ( this.singleCharacters ) {
- textLength = 1;
- } else {
- // Check if text stick out of walker range.
- const endOffset = parent === this._boundaryEndParent ? this.boundaries.end.offset : parent.data.length;
- textLength = endOffset - position.offset;
- }
- const textProxy = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( parent, position.offset, textLength );
- position.offset += textLength;
- this.position = position;
- return this._formatReturnValue( 'text', textProxy, previousPosition, position, textLength );
- } else {
- // `node` is not set, we reached the end of current `parent`.
- position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( parent );
- this.position = position;
- if ( this.ignoreElementEnd ) {
- return this._next();
- } else {
- return this._formatReturnValue( 'elementEnd', parent, previousPosition, position );
- }
- }
- }
- /**
- * Makes a step backward in view. Moves the {@link #position} to the previous position and returns the encountered value.
- *
- * @private
- * @returns {Object}
- * @returns {Boolean} return.done True if iterator is done.
- * @returns {module:engine/view/treewalker~TreeWalkerValue} return.value Information about taken step.
- */
- _previous() {
- let position = this.position.clone();
- const previousPosition = this.position;
- const parent = position.parent;
- // We are at the beginning of the root.
- if ( parent.parent === null && position.offset === 0 ) {
- return { done: true };
- }
- // We reached the walker boundary.
- if ( parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset ) {
- return { done: true };
- }
- // Get node just before current position.
- let node;
- // Text {@link module:engine/view/text~Text} element is a specific parent because contains string instead of child nodes.
- if ( parent instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
- if ( position.isAtStart ) {
- // Prevent returning "elementStart" for Text node. Skip that value and return the next walker step.
- this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( parent );
- return this._previous();
- }
- node = parent.data[ position.offset - 1 ];
- } else {
- node = parent.getChild( position.offset - 1 );
- }
- if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
- if ( !this.shallow ) {
- position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, node.childCount );
- this.position = position;
- if ( this.ignoreElementEnd ) {
- return this._previous();
- } else {
- return this._formatReturnValue( 'elementEnd', node, previousPosition, position );
- }
- } else {
- position.offset--;
- this.position = position;
- return this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
- }
- } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
- if ( this.singleCharacters ) {
- position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, node.data.length );
- this.position = position;
- return this._previous();
- } else {
- let charactersCount = node.data.length;
- let item;
- // If text stick out of walker range, we need to cut it and wrap in TextProxy.
- if ( node == this._boundaryStartParent ) {
- const offset = this.boundaries.start.offset;
- item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, offset, node.data.length - offset );
- charactersCount = item.data.length;
- position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( item );
- } else {
- item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, 0, node.data.length );
- // If not just keep moving backward.
- position.offset--;
- }
- this.position = position;
- return this._formatReturnValue( 'text', item, previousPosition, position, charactersCount );
- }
- } else if ( typeof node == 'string' ) {
- let textLength;
- if ( !this.singleCharacters ) {
- // Check if text stick out of walker range.
- const startOffset = parent === this._boundaryStartParent ? this.boundaries.start.offset : 0;
- textLength = position.offset - startOffset;
- } else {
- textLength = 1;
- }
- position.offset -= textLength;
- const textProxy = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( parent, position.offset, textLength );
- this.position = position;
- return this._formatReturnValue( 'text', textProxy, previousPosition, position, textLength );
- } else {
- // `node` is not set, we reached the beginning of current `parent`.
- position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( parent );
- this.position = position;
- return this._formatReturnValue( 'elementStart', parent, previousPosition, position, 1 );
- }
- }
- /**
- * Format returned data and adjust `previousPosition` and `nextPosition` if reach the bound of the {@link module:engine/view/text~Text}.
- *
- * @private
- * @param {module:engine/view/treewalker~TreeWalkerValueType} type Type of step.
- * @param {module:engine/view/item~Item} item Item between old and new position.
- * @param {module:engine/view/position~Position} previousPosition Previous position of iterator.
- * @param {module:engine/view/position~Position} nextPosition Next position of iterator.
- * @param {Number} [length] Length of the item.
- * @returns {module:engine/view/treewalker~TreeWalkerValue}
- */
- _formatReturnValue( type, item, previousPosition, nextPosition, length ) {
- // Text is a specific parent, because contains string instead of children.
- // Walker doesn't enter to the Text except situations when walker is iterating over every single character,
- // or the bound starts/ends inside the Text. So when the position is at the beginning or at the end of the Text
- // we move it just before or just after Text.
- if ( item instanceof _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
- // Position is at the end of Text.
- if ( item.offsetInText + item.data.length == item.textNode.data.length ) {
- if ( this.direction == 'forward' && !( this.boundaries && this.boundaries.end.isEqual( this.position ) ) ) {
- nextPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( item.textNode );
- // When we change nextPosition of returned value we need also update walker current position.
- this.position = nextPosition;
- } else {
- previousPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( item.textNode );
- }
- }
- // Position is at the begining ot the text.
- if ( item.offsetInText === 0 ) {
- if ( this.direction == 'backward' && !( this.boundaries && this.boundaries.start.isEqual( this.position ) ) ) {
- nextPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( item.textNode );
- // When we change nextPosition of returned value we need also update walker current position.
- this.position = nextPosition;
- } else {
- previousPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( item.textNode );
- }
- }
- }
- return {
- done: false,
- value: {
- type,
- item,
- previousPosition,
- nextPosition,
- length
- }
- };
- }
- }
- /**
- * Type of the step made by {@link module:engine/view/treewalker~TreeWalker}.
- * Possible values: `'elementStart'` if walker is at the beginning of a node, `'elementEnd'` if walker is at the end
- * of node, or `'text'` if walker traversed over single and multiple characters.
- * For {@link module:engine/view/text~Text} `elementStart` and `elementEnd` is not returned.
- *
- * @typedef {String} module:engine/view/treewalker~TreeWalkerValueType
- */
- /**
- * Object returned by {@link module:engine/view/treewalker~TreeWalker} when traversing tree view.
- *
- * @typedef {Object} module:engine/view/treewalker~TreeWalkerValue
- * @property {module:engine/view/treewalker~TreeWalkerValueType} type
- * @property {module:engine/view/item~Item} item Item between the old and the new positions
- * of the tree walker.
- * @property {module:engine/view/position~Position} previousPosition Previous position of the iterator.
- * * Forward iteration: For `'elementEnd'` it is the last position inside the element. For all other types it is the
- * position before the item.
- * * Backward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
- * the position after item.
- * * If the position is at the beginning or at the end of the {@link module:engine/view/text~Text} it is always moved from the
- * inside of the text to its parent just before or just after that text.
- * @property {module:engine/view/position~Position} nextPosition Next position of the iterator.
- * * Forward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
- * the position after the item.
- * * Backward iteration: For `'elementEnd'` it is last position inside element. For all other types it is the position
- * before the item.
- * * If the position is at the beginning or at the end of the {@link module:engine/view/text~Text} it is always moved from the
- * inside of the text to its parent just before or just after that text.
- * @property {Number} [length] Length of the item. For `'elementStart'` it is `1`. For `'text'` it is
- * the length of that text. For `'elementEnd'` it is `undefined`.
- */
- /**
- * Tree walking directions.
- *
- * @typedef {'forward'|'backward'} module:engine/view/treewalker~TreeWalkerDirection
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js ***!
- \***********************************************************************/
- /*! exports provided: default, injectUiElementHandling */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UIElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectUiElementHandling", function() { return injectUiElementHandling; });
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/uielement
- */
- /**
- * UI element class. It should be used to represent editing UI which needs to be injected into the editing view
- * If possible, you should keep your UI outside the editing view. However, if that is not possible,
- * UI elements can be used.
- *
- * How a UI element is rendered is in your control (you pass a callback to
- * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`}).
- * The editor will ignore your UI element – the selection cannot be placed in it, it is skipped (invisible) when
- * the user modifies the selection by using arrow keys and the editor does not listen to any mutations which
- * happen inside your UI elements.
- *
- * The limitation is that you cannot convert a model element to a UI element. UI elements need to be
- * created for {@link module:engine/model/markercollection~Marker markers} or as additinal elements
- * inside normal {@link module:engine/view/containerelement~ContainerElement container elements}.
- *
- * To create a new UI element use the
- * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`} method.
- *
- * @extends module:engine/view/element~Element
- */
- class UIElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates new instance of UIElement.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` when third parameter is passed,
- * to inform that usage of UIElement is incorrect (adding child nodes to UIElement is forbidden).
- *
- * @see module:engine/view/downcastwriter~DowncastWriter#createUIElement
- * @protected
- * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
- * @param {String} name Node name.
- * @param {Object|Iterable} [attributes] Collection of attributes.
- * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
- * A list of nodes to be inserted into created element.
- */
- constructor( document, name, attributes, children ) {
- super( document, name, attributes, children );
- // Override the default of the base class.
- this._isAllowedInsideAttributeElement = true;
- /**
- * Returns `null` because filler is not needed for UIElements.
- *
- * @method #getFillerOffset
- * @returns {null} Always returns null.
- */
- this.getFillerOffset = getFillerOffset;
- }
- /**
- * Checks whether this object is of the given.
- *
- * uiElement.is( 'uiElement' ); // -> true
- * uiElement.is( 'element' ); // -> true
- * uiElement.is( 'node' ); // -> true
- * uiElement.is( 'view:uiElement' ); // -> true
- * uiElement.is( 'view:element' ); // -> true
- * uiElement.is( 'view:node' ); // -> true
- *
- * uiElement.is( 'model:element' ); // -> false
- * uiElement.is( 'documentFragment' ); // -> false
- *
- * Assuming that the object being checked is an ui element, you can also check its
- * {@link module:engine/view/uielement~UIElement#name name}:
- *
- * uiElement.is( 'element', 'span' ); // -> true if this is a span ui element
- * uiElement.is( 'uiElement', 'span' ); // -> same as above
- * text.is( 'element', 'span' ); -> false
- *
- * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
- *
- * @param {String} type Type to check.
- * @param {String} [name] Element name.
- * @returns {Boolean}
- */
- is( type, name = null ) {
- if ( !name ) {
- return type === 'uiElement' || type === 'view:uiElement' ||
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
- type === 'element' || type === 'view:element' ||
- type === 'node' || type === 'view:node';
- } else {
- return name === this.name && (
- type === 'uiElement' || type === 'view:uiElement' ||
- type === 'element' || type === 'view:element'
- );
- }
- }
- /**
- * Overrides {@link module:engine/view/element~Element#_insertChild} method.
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` to prevent adding any child nodes
- * to UIElement.
- *
- * @protected
- */
- _insertChild( index, nodes ) {
- if ( nodes && ( nodes instanceof _node__WEBPACK_IMPORTED_MODULE_2__["default"] || Array.from( nodes ).length > 0 ) ) {
- /**
- * Cannot add children to {@link module:engine/view/uielement~UIElement}.
- *
- * @error view-uielement-cannot-add
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'view-uielement-cannot-add', this );
- }
- }
- /**
- * Renders this {@link module:engine/view/uielement~UIElement} to DOM. This method is called by
- * {@link module:engine/view/domconverter~DomConverter}.
- * Do not use inheritance to create custom rendering method, replace `render()` method instead:
- *
- * const myUIElement = downcastWriter.createUIElement( 'span' );
- * myUIElement.render = function( domDocument ) {
- * const domElement = this.toDomElement( domDocument );
- * domElement.innerHTML = '<b>this is ui element</b>';
- *
- * return domElement;
- * };
- *
- * If changes in your UI element should trigger some editor UI update you should call
- * the {@link module:core/editor/editorui~EditorUI#update `editor.ui.update()`} method
- * after rendering your UI element.
- *
- * @param {Document} domDocument
- * @returns {HTMLElement}
- */
- render( domDocument ) {
- return this.toDomElement( domDocument );
- }
- /**
- * Creates DOM element based on this view UIElement.
- * Note that each time this method is called new DOM element is created.
- *
- * @param {Document} domDocument
- * @returns {HTMLElement}
- */
- toDomElement( domDocument ) {
- const domElement = domDocument.createElement( this.name );
- for ( const key of this.getAttributeKeys() ) {
- domElement.setAttribute( key, this.getAttribute( key ) );
- }
- return domElement;
- }
- }
- /**
- * This function injects UI element handling to the given {@link module:engine/view/document~Document document}.
- *
- * A callback is added to {@link module:engine/view/document~Document#event:keydown document keydown event}.
- * The callback handles the situation when right arrow key is pressed and selection is collapsed before a UI element.
- * Without this handler, it would be impossible to "jump over" UI element using right arrow key.
- *
- * @param {module:engine/view/view~View} view View controller to which the quirks handling will be injected.
- */
- function injectUiElementHandling( view ) {
- view.document.on( 'arrowKey', ( evt, data ) => jumpOverUiElement( evt, data, view.domConverter ), { priority: 'low' } );
- }
- // Returns `null` because block filler is not needed for UIElements.
- //
- // @returns {null}
- function getFillerOffset() {
- return null;
- }
- // Selection cannot be placed in a `UIElement`. Whenever it is placed there, it is moved before it. This
- // causes a situation when it is impossible to jump over `UIElement` using right arrow key, because the selection
- // ends up in ui element (in DOM) and is moved back to the left. This handler fixes this situation.
- function jumpOverUiElement( evt, data, domConverter ) {
- if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].arrowright ) {
- const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
- const domSelectionCollapsed = domSelection.rangeCount == 1 && domSelection.getRangeAt( 0 ).collapsed;
- // Jump over UI element if selection is collapsed or shift key is pressed. These are the cases when selection would extend.
- if ( domSelectionCollapsed || data.shiftKey ) {
- const domParent = domSelection.focusNode;
- const domOffset = domSelection.focusOffset;
- const viewPosition = domConverter.domPositionToView( domParent, domOffset );
- // In case if dom element is not converted to view or is not mapped or something. Happens for example in some tests.
- if ( viewPosition === null ) {
- return;
- }
- // Skip all following ui elements.
- let jumpedOverAnyUiElement = false;
- const nextViewPosition = viewPosition.getLastMatchingPosition( value => {
- if ( value.item.is( 'uiElement' ) ) {
- // Remember that there was at least one ui element.
- jumpedOverAnyUiElement = true;
- }
- // Jump over ui elements, jump over empty attribute elements, move up from inside of attribute element.
- if ( value.item.is( 'uiElement' ) || value.item.is( 'attributeElement' ) ) {
- return true;
- }
- // Don't jump over text or don't get out of container element.
- return false;
- } );
- // If anything has been skipped, fix position.
- // This `if` could be possibly omitted but maybe it is better not to mess with DOM selection if not needed.
- if ( jumpedOverAnyUiElement ) {
- const newDomPosition = domConverter.viewPositionToDom( nextViewPosition );
- if ( domSelectionCollapsed ) {
- // Selection was collapsed, so collapse it at further position.
- domSelection.collapse( newDomPosition.parent, newDomPosition.offset );
- } else {
- // Selection was not collapse, so extend it instead of collapsing.
- domSelection.extend( newDomPosition.parent, newDomPosition.offset );
- }
- }
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpcastWriter; });
- /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
- /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
- /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
- /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module module:engine/view/upcastwriter
- */
- /**
- * View upcast writer. It provides a set of methods used to manipulate non-semantic view trees.
- *
- * It should be used only while working on a non-semantic view
- * (e.g. a view created from HTML string on paste).
- * To manipulate a view which was or is being downcasted from the the model use the
- * {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.
- *
- * Read more about changing the view in the {@glink framework/guides/architecture/editing-engine#changing-the-view Changing the view}
- * section of the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide.
- *
- * Unlike `DowncastWriter`, which is available in the {@link module:engine/view/view~View#change `View#change()`} block,
- * `UpcastWriter` can be created wherever you need it:
- *
- * const writer = new UpcastWriter( viewDocument );
- * const text = writer.createText( 'foo!' );
- *
- * writer.appendChild( text, someViewElement );
- */
- class UpcastWriter {
- /**
- * @param {module:engine/view/document~Document} document The view document instance in which this upcast writer operates.
- */
- constructor( document ) {
- /**
- * The view document instance in which this upcast writer operates.
- *
- * @readonly
- * @type {module:engine/view/document~Document}
- */
- this.document = document;
- }
- /**
- * Creates a new {@link module:engine/view/documentfragment~DocumentFragment} instance.
- *
- * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
- * A list of nodes to be inserted into the created document fragment.
- * @returns {module:engine/view/documentfragment~DocumentFragment} The created document fragment.
- */
- createDocumentFragment( children ) {
- return new _documentfragment__WEBPACK_IMPORTED_MODULE_0__["default"]( this.document, children );
- }
- /**
- * Creates a new {@link module:engine/view/element~Element} instance.
- *
- * Attributes can be passed in various formats:
- *
- * upcastWriter.createElement( 'div', { class: 'editor', contentEditable: 'true' } ); // object
- * upcastWriter.createElement( 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator
- * upcastWriter.createElement( 'div', mapOfAttributes ); // map
- *
- * @param {String} name Node name.
- * @param {Object|Iterable} [attrs] Collection of attributes.
- * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
- * A list of nodes to be inserted into created element.
- * @returns {module:engine/view/element~Element} Created element.
- */
- createElement( name, attrs, children ) {
- return new _element__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, name, attrs, children );
- }
- /**
- * Creates a new {@link module:engine/view/text~Text} instance.
- *
- * @param {String} data The text's data.
- * @returns {module:engine/view/text~Text} The created text node.
- */
- createText( data ) {
- return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( this.document, data );
- }
- /**
- * Clones the provided element.
- *
- * @see module:engine/view/element~Element#_clone
- * @param {module:engine/view/element~Element} element Element to be cloned.
- * @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
- * element will be cloned without any children.
- * @returns {module:engine/view/element~Element} Clone of this element.
- */
- clone( element, deep = false ) {
- return element._clone( deep );
- }
- /**
- * Appends a child node or a list of child nodes at the end of this node
- * and sets the parent of these nodes to this element.
- *
- * @see module:engine/view/element~Element#_appendChild
- * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
- * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} element Element
- * to which items will be appended.
- * @fires module:engine/view/node~Node#event:change
- * @returns {Number} Number of appended nodes.
- */
- appendChild( items, element ) {
- return element._appendChild( items );
- }
- /**
- * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
- * this element.
- *
- * @see module:engine/view/element~Element#_insertChild
- * @param {Number} index Offset at which nodes should be inserted.
- * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
- * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} element Element
- * to which items will be inserted.
- * @fires module:engine/view/node~Node#event:change
- * @returns {Number} Number of inserted nodes.
- */
- insertChild( index, items, element ) {
- return element._insertChild( index, items );
- }
- /**
- * Removes the given number of child nodes starting at the given index and set the parent of these nodes to `null`.
- *
- * @see module:engine/view/element~Element#_removeChildren
- * @param {Number} index Offset from which nodes will be removed.
- * @param {Number} howMany Number of nodes to remove.
- * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} element Element
- * which children will be removed.
- * @fires module:engine/view/node~Node#event:change
- * @returns {Array.<module:engine/view/node~Node>} The array containing removed nodes.
- */
- removeChildren( index, howMany, element ) {
- return element._removeChildren( index, howMany );
- }
- /**
- * Removes given element from the view structure. Will not have effect on detached elements.
- *
- * @param {module:engine/view/element~Element} element Element which will be removed.
- * @returns {Array.<module:engine/view/node~Node>} The array containing removed nodes.
- */
- remove( element ) {
- const parent = element.parent;
- if ( parent ) {
- return this.removeChildren( parent.getChildIndex( element ), 1, parent );
- }
- return [];
- }
- /**
- * Replaces given element with the new one in the view structure. Will not have effect on detached elements.
- *
- * @param {module:engine/view/element~Element} oldElement Element which will be replaced.
- * @param {module:engine/view/element~Element} newElement Element which will be inserted in the place of the old element.
- * @returns {Boolean} Whether old element was successfully replaced.
- */
- replace( oldElement, newElement ) {
- const parent = oldElement.parent;
- if ( parent ) {
- const index = parent.getChildIndex( oldElement );
- this.removeChildren( index, 1, parent );
- this.insertChild( index, newElement, parent );
- return true;
- }
- return false;
- }
- /**
- * Removes given element from view structure and places its children in its position.
- * It does nothing if element has no parent.
- *
- * @param {module:engine/view/element~Element} element Element to unwrap.
- */
- unwrapElement( element ) {
- const parent = element.parent;
- if ( parent ) {
- const index = parent.getChildIndex( element );
- this.remove( element );
- this.insertChild( index, element.getChildren(), parent );
- }
- }
- /**
- * Renames element by creating a copy of a given element but with its name changed and then moving contents of the
- * old element to the new one.
- *
- * Since this function creates a new element and removes the given one, the new element is returned to keep reference.
- *
- * @param {String} newName New element name.
- * @param {module:engine/view/element~Element} element Element to be renamed.
- * @returns {module:engine/view/element~Element|null} New element or null if the old element
- * was not replaced (happens for detached elements).
- */
- rename( newName, element ) {
- const newElement = new _element__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, newName, element.getAttributes(), element.getChildren() );
- return this.replace( element, newElement ) ? newElement : null;
- }
- /**
- * Adds or overwrites element's attribute with a specified key and value.
- *
- * writer.setAttribute( 'href', 'http://ckeditor.com', linkElement );
- *
- * @see module:engine/view/element~Element#_setAttribute
- * @param {String} key Attribute key.
- * @param {String} value Attribute value.
- * @param {module:engine/view/element~Element} element Element for which attribute will be set.
- */
- setAttribute( key, value, element ) {
- element._setAttribute( key, value );
- }
- /**
- * Removes attribute from the element.
- *
- * writer.removeAttribute( 'href', linkElement );
- *
- * @see module:engine/view/element~Element#_removeAttribute
- * @param {String} key Attribute key.
- * @param {module:engine/view/element~Element} element Element from which attribute will be removed.
- */
- removeAttribute( key, element ) {
- element._removeAttribute( key );
- }
- /**
- * Adds specified class to the element.
- *
- * writer.addClass( 'foo', linkElement );
- * writer.addClass( [ 'foo', 'bar' ], linkElement );
- *
- * @see module:engine/view/element~Element#_addClass
- * @param {Array.<String>|String} className Single class name or array of class names which will be added.
- * @param {module:engine/view/element~Element} element Element for which class will be added.
- */
- addClass( className, element ) {
- element._addClass( className );
- }
- /**
- * Removes specified class from the element.
- *
- * writer.removeClass( 'foo', linkElement );
- * writer.removeClass( [ 'foo', 'bar' ], linkElement );
- *
- * @see module:engine/view/element~Element#_removeClass
- * @param {Array.<String>|String} className Single class name or array of class names which will be removed.
- * @param {module:engine/view/element~Element} element Element from which class will be removed.
- */
- removeClass( className, element ) {
- element._removeClass( className );
- }
- /**
- * Adds style to the element.
- *
- * writer.setStyle( 'color', 'red', element );
- * writer.setStyle( {
- * color: 'red',
- * position: 'fixed'
- * }, element );
- *
- * **Note**: This method can work with normalized style names if
- * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
- * See {@link module:engine/view/stylesmap~StylesMap#set `StylesMap#set()`} for details.
- *
- * @see module:engine/view/element~Element#_setStyle
- * @param {String|Object} property Property name or object with key - value pairs.
- * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.
- * @param {module:engine/view/element~Element} element Element for which style will be added.
- */
- setStyle( property, value, element ) {
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["isPlainObject"])( property ) && element === undefined ) {
- element = value;
- }
- element._setStyle( property, value );
- }
- /**
- * Removes specified style from the element.
- *
- * writer.removeStyle( 'color', element ); // Removes 'color' style.
- * writer.removeStyle( [ 'color', 'border-top' ], element ); // Removes both 'color' and 'border-top' styles.
- *
- * **Note**: This method can work with normalized style names if
- * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
- * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.
- *
- * @see module:engine/view/element~Element#_removeStyle
- * @param {Array.<String>|String} property Style property name or names to be removed.
- * @param {module:engine/view/element~Element} element Element from which style will be removed.
- */
- removeStyle( property, element ) {
- element._removeStyle( property );
- }
- /**
- * Sets a custom property on element. Unlike attributes, custom properties are not rendered to the DOM,
- * so they can be used to add special data to elements.
- *
- * @see module:engine/view/element~Element#_setCustomProperty
- * @param {String|Symbol} key Custom property name/key.
- * @param {*} value Custom property value to be stored.
- * @param {module:engine/view/element~Element} element Element for which custom property will be set.
- */
- setCustomProperty( key, value, element ) {
- element._setCustomProperty( key, value );
- }
- /**
- * Removes a custom property stored under the given key.
- *
- * @see module:engine/view/element~Element#_removeCustomProperty
- * @param {String|Symbol} key Name/key of the custom property to be removed.
- * @param {module:engine/view/element~Element} element Element from which the custom property will be removed.
- * @returns {Boolean} Returns true if property was removed.
- */
- removeCustomProperty( key, element ) {
- return element._removeCustomProperty( key );
- }
- /**
- * Creates position at the given location. The location can be specified as:
- *
- * * a {@link module:engine/view/position~Position position},
- * * parent element and offset (offset defaults to `0`),
- * * parent element and `'end'` (sets position at the end of that element),
- * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
- *
- * This method is a shortcut to other constructors such as:
- *
- * * {@link #createPositionBefore},
- * * {@link #createPositionAfter},
- *
- * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * first parameter is a {@link module:engine/view/item~Item view item}.
- * @returns {module:engine/view/position~Position}
- */
- createPositionAt( itemOrPosition, offset ) {
- return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAt( itemOrPosition, offset );
- }
- /**
- * Creates a new position after given view item.
- *
- * @param {module:engine/view/item~Item} item View item after which the position should be located.
- * @returns {module:engine/view/position~Position}
- */
- createPositionAfter( item ) {
- return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
- }
- /**
- * Creates a new position before given view item.
- *
- * @param {module:engine/view/item~Item} item View item before which the position should be located.
- * @returns {module:engine/view/position~Position}
- */
- createPositionBefore( item ) {
- return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createBefore( item );
- }
- /**
- * Creates a range spanning from `start` position to `end` position.
- *
- * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
- *
- * @param {module:engine/view/position~Position} start Start position.
- * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
- * @returns {module:engine/view/range~Range}
- */
- createRange( start, end ) {
- return new _range__WEBPACK_IMPORTED_MODULE_5__["default"]( start, end );
- }
- /**
- * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
- *
- * @param {module:engine/view/item~Item} item
- * @returns {module:engine/view/range~Range}
- */
- createRangeOn( item ) {
- return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createOn( item );
- }
- /**
- * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
- * that element and ends after the last child of that element.
- *
- * @param {module:engine/view/element~Element} element Element which is a parent for the range.
- * @returns {module:engine/view/range~Range}
- */
- createRangeIn( element ) {
- return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createIn( element );
- }
- /**
- * Creates a new {@link module:engine/view/selection~Selection} instance.
- *
- * // Creates empty selection without ranges.
- * const selection = writer.createSelection();
- *
- * // Creates selection at the given range.
- * const range = writer.createRange( start, end );
- * const selection = writer.createSelection( range );
- *
- * // Creates selection at the given ranges
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
- * const selection = writer.createSelection( ranges );
- *
- * // Creates selection from the other selection.
- * const otherSelection = writer.createSelection();
- * const selection = writer.createSelection( otherSelection );
- *
- * // Creates selection from the document selection.
- * const selection = writer.createSelection( editor.editing.view.document.selection );
- *
- * // Creates selection at the given position.
- * const position = writer.createPositionFromPath( root, path );
- * const selection = writer.createSelection( position );
- *
- * // Creates collapsed selection at the position of given item and offset.
- * const paragraph = writer.createContainerElement( 'paragraph' );
- * const selection = writer.createSelection( paragraph, offset );
- *
- * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
- * // first child of that element and ends after the last child of that element.
- * const selection = writer.createSelection( paragraph, 'in' );
- *
- * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
- * // just after the item.
- * const selection = writer.createSelection( paragraph, 'on' );
- *
- * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
- *
- * // Creates backward selection.
- * const selection = writer.createSelection( range, { backward: true } );
- *
- * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
- * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
- * represented in other way, for example by applying proper CSS class.
- *
- * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
- * (and be properly handled by screen readers).
- *
- * // Creates fake selection with label.
- * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
- *
- * @param {module:engine/view/selection~Selectable} [selectable=null]
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
- * @param {String} [options.label] Label for the fake selection.
- * @returns {module:engine/view/selection~Selection}
- */
- createSelection( selectable, placeOrOffset, options ) {
- return new _selection__WEBPACK_IMPORTED_MODULE_6__["default"]( selectable, placeOrOffset, options );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return View; });
- /* harmony import */ var _document__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./document */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js");
- /* harmony import */ var _downcastwriter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./downcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js");
- /* harmony import */ var _renderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./renderer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js");
- /* harmony import */ var _domconverter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
- /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
- /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
- /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
- /* harmony import */ var _observer_mutationobserver__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./observer/mutationobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js");
- /* harmony import */ var _observer_keyobserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./observer/keyobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js");
- /* harmony import */ var _observer_fakeselectionobserver__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./observer/fakeselectionobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js");
- /* harmony import */ var _observer_selectionobserver__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./observer/selectionobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js");
- /* harmony import */ var _observer_focusobserver__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./observer/focusobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js");
- /* harmony import */ var _observer_compositionobserver__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./observer/compositionobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js");
- /* harmony import */ var _observer_inputobserver__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./observer/inputobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js");
- /* harmony import */ var _observer_arrowkeysobserver__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./observer/arrowkeysobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_scroll__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/scroll */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js");
- /* harmony import */ var _uielement__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./uielement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js");
- /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module engine/view/view
- */
- /**
- * Editor's view controller class. Its main responsibility is DOM - View management for editing purposes, to provide
- * abstraction over the DOM structure and events and hide all browsers quirks.
- *
- * View controller renders view document to DOM whenever view structure changes. To determine when view can be rendered,
- * all changes need to be done using the {@link module:engine/view/view~View#change} method, using
- * {@link module:engine/view/downcastwriter~DowncastWriter}:
- *
- * view.change( writer => {
- * writer.insert( position, writer.createText( 'foo' ) );
- * } );
- *
- * View controller also register {@link module:engine/view/observer/observer~Observer observers} which observes changes
- * on DOM and fire events on the {@link module:engine/view/document~Document Document}.
- * Note that the following observers are added by the class constructor and are always available:
- *
- * * {@link module:engine/view/observer/mutationobserver~MutationObserver},
- * * {@link module:engine/view/observer/selectionobserver~SelectionObserver},
- * * {@link module:engine/view/observer/focusobserver~FocusObserver},
- * * {@link module:engine/view/observer/keyobserver~KeyObserver},
- * * {@link module:engine/view/observer/fakeselectionobserver~FakeSelectionObserver}.
- * * {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
- *
- * This class also {@link module:engine/view/view~View#attachDomRoot binds the DOM and the view elements}.
- *
- * If you do not need full a DOM - view management, and only want to transform a tree of view elements to a tree of DOM
- * elements you do not need this controller. You can use the {@link module:engine/view/domconverter~DomConverter DomConverter} instead.
- *
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class View {
- /**
- * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
- */
- constructor( stylesProcessor ) {
- /**
- * Instance of the {@link module:engine/view/document~Document} associated with this view controller.
- *
- * @readonly
- * @type {module:engine/view/document~Document}
- */
- this.document = new _document__WEBPACK_IMPORTED_MODULE_0__["default"]( stylesProcessor );
- /**
- * Instance of the {@link module:engine/view/domconverter~DomConverter domConverter} used by
- * {@link module:engine/view/view~View#_renderer renderer}
- * and {@link module:engine/view/observer/observer~Observer observers}.
- *
- * @readonly
- * @type {module:engine/view/domconverter~DomConverter}
- */
- this.domConverter = new _domconverter__WEBPACK_IMPORTED_MODULE_3__["default"]( this.document );
- /**
- * Roots of the DOM tree. Map on the `HTMLElement`s with roots names as keys.
- *
- * @readonly
- * @type {Map.<String, HTMLElement>}
- */
- this.domRoots = new Map();
- /**
- * Used to prevent calling {@link #forceRender} and {@link #change} during rendering view to the DOM.
- *
- * @readonly
- * @member {Boolean} #isRenderingInProgress
- */
- this.set( 'isRenderingInProgress', false );
- /**
- * Informs whether the DOM selection is inside any of the DOM roots managed by the view.
- *
- * @readonly
- * @member {Boolean} #hasDomSelection
- */
- this.set( 'hasDomSelection', false );
- /**
- * Instance of the {@link module:engine/view/renderer~Renderer renderer}.
- *
- * @protected
- * @type {module:engine/view/renderer~Renderer}
- */
- this._renderer = new _renderer__WEBPACK_IMPORTED_MODULE_2__["default"]( this.domConverter, this.document.selection );
- this._renderer.bind( 'isFocused' ).to( this.document );
- /**
- * A DOM root attributes cache. It saves the initial values of DOM root attributes before the DOM element
- * is {@link module:engine/view/view~View#attachDomRoot attached} to the view so later on, when
- * the view is destroyed ({@link module:engine/view/view~View#detachDomRoot}), they can be easily restored.
- * This way, the DOM element can go back to the (clean) state as if the editing view never used it.
- *
- * @private
- * @member {WeakMap.<HTMLElement,Object>}
- */
- this._initialDomRootAttributes = new WeakMap();
- /**
- * Map of registered {@link module:engine/view/observer/observer~Observer observers}.
- *
- * @private
- * @type {Map.<Function, module:engine/view/observer/observer~Observer>}
- */
- this._observers = new Map();
- /**
- * Is set to `true` when {@link #change view changes} are currently in progress.
- *
- * @private
- * @type {Boolean}
- */
- this._ongoingChange = false;
- /**
- * Used to prevent calling {@link #forceRender} and {@link #change} during rendering view to the DOM.
- *
- * @private
- * @type {Boolean}
- */
- this._postFixersInProgress = false;
- /**
- * Internal flag to temporary disable rendering. See the usage in the {@link #_disableRendering}.
- *
- * @private
- * @type {Boolean}
- */
- this._renderingDisabled = false;
- /**
- * Internal flag that disables rendering when there are no changes since the last rendering.
- * It stores information about changed selection and changed elements from attached document roots.
- *
- * @private
- * @type {Boolean}
- */
- this._hasChangedSinceTheLastRendering = false;
- /**
- * DowncastWriter instance used in {@link #change change method} callbacks.
- *
- * @private
- * @type {module:engine/view/downcastwriter~DowncastWriter}
- */
- this._writer = new _downcastwriter__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document );
- // Add default observers.
- this.addObserver( _observer_mutationobserver__WEBPACK_IMPORTED_MODULE_7__["default"] );
- this.addObserver( _observer_selectionobserver__WEBPACK_IMPORTED_MODULE_10__["default"] );
- this.addObserver( _observer_focusobserver__WEBPACK_IMPORTED_MODULE_11__["default"] );
- this.addObserver( _observer_keyobserver__WEBPACK_IMPORTED_MODULE_8__["default"] );
- this.addObserver( _observer_fakeselectionobserver__WEBPACK_IMPORTED_MODULE_9__["default"] );
- this.addObserver( _observer_compositionobserver__WEBPACK_IMPORTED_MODULE_12__["default"] );
- this.addObserver( _observer_arrowkeysobserver__WEBPACK_IMPORTED_MODULE_14__["default"] );
- if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_21__["default"].isAndroid ) {
- this.addObserver( _observer_inputobserver__WEBPACK_IMPORTED_MODULE_13__["default"] );
- }
- // Inject quirks handlers.
- Object(_filler__WEBPACK_IMPORTED_MODULE_19__["injectQuirksHandling"])( this );
- Object(_uielement__WEBPACK_IMPORTED_MODULE_18__["injectUiElementHandling"])( this );
- // Use 'normal' priority so that rendering is performed as first when using that priority.
- this.on( 'render', () => {
- this._render();
- // Informs that layout has changed after render.
- this.document.fire( 'layoutChanged' );
- // Reset the `_hasChangedSinceTheLastRendering` flag after rendering.
- this._hasChangedSinceTheLastRendering = false;
- } );
- // Listen to the document selection changes directly.
- this.listenTo( this.document.selection, 'change', () => {
- this._hasChangedSinceTheLastRendering = true;
- } );
- }
- /**
- * Attaches a DOM root element to the view element and enable all observers on that element.
- * Also {@link module:engine/view/renderer~Renderer#markToSync mark element} to be synchronized
- * with the view what means that all child nodes will be removed and replaced with content of the view root.
- *
- * This method also will change view element name as the same as tag name of given dom root.
- * Name is always transformed to lower case.
- *
- * **Note:** Use {@link #detachDomRoot `detachDomRoot()`} to revert this action.
- *
- * @param {Element} domRoot DOM root element.
- * @param {String} [name='main'] Name of the root.
- */
- attachDomRoot( domRoot, name = 'main' ) {
- const viewRoot = this.document.getRoot( name );
- // Set view root name the same as DOM root tag name.
- viewRoot._name = domRoot.tagName.toLowerCase();
- const initialDomRootAttributes = {};
- // 1. Copy and cache the attributes to remember the state of the element before attaching.
- // The cached attributes will be restored in detachDomRoot() so the element goes to the
- // clean state as if the editing view never used it.
- // 2. Apply the attributes using the view writer, so they all go under the control of the engine.
- // The editing view takes over the attribute management completely because various
- // features (e.g. addPlaceholder()) require dynamic changes of those attributes and they
- // cannot be managed by the engine and the UI library at the same time.
- for ( const { name, value } of Array.from( domRoot.attributes ) ) {
- initialDomRootAttributes[ name ] = value;
- // Do not use writer.setAttribute() for the class attribute. The EditableUIView class
- // and its descendants could have already set some using the writer.addClass() on the view
- // document root. They haven't been rendered yet so they are not present in the DOM root.
- // Using writer.setAttribute( 'class', ... ) would override them completely.
- if ( name === 'class' ) {
- this._writer.addClass( value.split( ' ' ), viewRoot );
- } else {
- this._writer.setAttribute( name, value, viewRoot );
- }
- }
- this._initialDomRootAttributes.set( domRoot, initialDomRootAttributes );
- const updateContenteditableAttribute = () => {
- this._writer.setAttribute( 'contenteditable', !viewRoot.isReadOnly, viewRoot );
- if ( viewRoot.isReadOnly ) {
- this._writer.addClass( 'ck-read-only', viewRoot );
- } else {
- this._writer.removeClass( 'ck-read-only', viewRoot );
- }
- };
- // Set initial value.
- updateContenteditableAttribute();
- this.domRoots.set( name, domRoot );
- this.domConverter.bindElements( domRoot, viewRoot );
- this._renderer.markToSync( 'children', viewRoot );
- this._renderer.markToSync( 'attributes', viewRoot );
- this._renderer.domDocuments.add( domRoot.ownerDocument );
- viewRoot.on( 'change:children', ( evt, node ) => this._renderer.markToSync( 'children', node ) );
- viewRoot.on( 'change:attributes', ( evt, node ) => this._renderer.markToSync( 'attributes', node ) );
- viewRoot.on( 'change:text', ( evt, node ) => this._renderer.markToSync( 'text', node ) );
- viewRoot.on( 'change:isReadOnly', () => this.change( updateContenteditableAttribute ) );
- viewRoot.on( 'change', () => {
- this._hasChangedSinceTheLastRendering = true;
- } );
- for ( const observer of this._observers.values() ) {
- observer.observe( domRoot, name );
- }
- }
- /**
- * Detaches a DOM root element from the view element and restores its attributes to the state before
- * {@link #attachDomRoot `attachDomRoot()`}.
- *
- * @param {String} name Name of the root to detach.
- */
- detachDomRoot( name ) {
- const domRoot = this.domRoots.get( name );
- // Remove all root attributes so the DOM element is "bare".
- Array.from( domRoot.attributes ).forEach( ( { name } ) => domRoot.removeAttribute( name ) );
- const initialDomRootAttributes = this._initialDomRootAttributes.get( domRoot );
- // Revert all view root attributes back to the state before attachDomRoot was called.
- for ( const attribute in initialDomRootAttributes ) {
- domRoot.setAttribute( attribute, initialDomRootAttributes[ attribute ] );
- }
- this.domRoots.delete( name );
- this.domConverter.unbindDomElement( domRoot );
- }
- /**
- * Gets DOM root element.
- *
- * @param {String} [name='main'] Name of the root.
- * @returns {Element} DOM root element instance.
- */
- getDomRoot( name = 'main' ) {
- return this.domRoots.get( name );
- }
- /**
- * Creates observer of the given type if not yet created, {@link module:engine/view/observer/observer~Observer#enable enables} it
- * and {@link module:engine/view/observer/observer~Observer#observe attaches} to all existing and future
- * {@link #domRoots DOM roots}.
- *
- * Note: Observers are recognized by their constructor (classes). A single observer will be instantiated and used only
- * when registered for the first time. This means that features and other components can register a single observer
- * multiple times without caring whether it has been already added or not.
- *
- * @param {Function} Observer The constructor of an observer to add.
- * Should create an instance inheriting from {@link module:engine/view/observer/observer~Observer}.
- * @returns {module:engine/view/observer/observer~Observer} Added observer instance.
- */
- addObserver( Observer ) {
- let observer = this._observers.get( Observer );
- if ( observer ) {
- return observer;
- }
- observer = new Observer( this );
- this._observers.set( Observer, observer );
- for ( const [ name, domElement ] of this.domRoots ) {
- observer.observe( domElement, name );
- }
- observer.enable();
- return observer;
- }
- /**
- * Returns observer of the given type or `undefined` if such observer has not been added yet.
- *
- * @param {Function} Observer The constructor of an observer to get.
- * @returns {module:engine/view/observer/observer~Observer|undefined} Observer instance or undefined.
- */
- getObserver( Observer ) {
- return this._observers.get( Observer );
- }
- /**
- * Disables all added observers.
- */
- disableObservers() {
- for ( const observer of this._observers.values() ) {
- observer.disable();
- }
- }
- /**
- * Enables all added observers.
- */
- enableObservers() {
- for ( const observer of this._observers.values() ) {
- observer.enable();
- }
- }
- /**
- * Scrolls the page viewport and {@link #domRoots} with their ancestors to reveal the
- * caret, if not already visible to the user.
- */
- scrollToTheSelection() {
- const range = this.document.selection.getFirstRange();
- if ( range ) {
- Object(_ckeditor_ckeditor5_utils_src_dom_scroll__WEBPACK_IMPORTED_MODULE_17__["scrollViewportToShowTarget"])( {
- target: this.domConverter.viewRangeToDom( range ),
- viewportOffset: 20
- } );
- }
- }
- /**
- * It will focus DOM element representing {@link module:engine/view/editableelement~EditableElement EditableElement}
- * that is currently having selection inside.
- */
- focus() {
- if ( !this.document.isFocused ) {
- const editable = this.document.selection.editableElement;
- if ( editable ) {
- this.domConverter.focus( editable );
- this.forceRender();
- } else {
- // Before focusing view document, selection should be placed inside one of the view's editables.
- // Normally its selection will be converted from model document (which have default selection), but
- // when using view document on its own, we need to manually place selection before focusing it.
- //
- // @if CK_DEBUG // console.warn( 'There is no selection in any editable to focus.' );
- }
- }
- }
- /**
- * The `change()` method is the primary way of changing the view. You should use it to modify any node in the view tree.
- * It makes sure that after all changes are made the view is rendered to the DOM (assuming that the view will be changed
- * inside the callback). It prevents situations when the DOM is updated when the view state is not yet correct. It allows
- * to nest calls one inside another and still performs a single rendering after all those changes are made.
- * It also returns the return value of its callback.
- *
- * const text = view.change( writer => {
- * const newText = writer.createText( 'foo' );
- * writer.insert( position1, newText );
- *
- * view.change( writer => {
- * writer.insert( position2, writer.createText( 'bar' ) );
- * } );
- *
- * writer.remove( range );
- *
- * return newText;
- * } );
- *
- * When the outermost change block is done and rendering to the DOM is over the
- * {@link module:engine/view/view~View#event:render `View#render`} event is fired.
- *
- * This method throws a `applying-view-changes-on-rendering` error when
- * the change block is used after rendering to the DOM has started.
- *
- * @param {Function} callback Callback function which may modify the view.
- * @returns {*} Value returned by the callback.
- */
- change( callback ) {
- if ( this.isRenderingInProgress || this._postFixersInProgress ) {
- /**
- * Thrown when there is an attempt to make changes to the view tree when it is in incorrect state. This may
- * cause some unexpected behaviour and inconsistency between the DOM and the view.
- * This may be caused by:
- *
- * * calling {@link #change} or {@link #forceRender} during rendering process,
- * * calling {@link #change} or {@link #forceRender} inside of
- * {@link module:engine/view/document~Document#registerPostFixer post-fixer function}.
- *
- * @error cannot-change-view-tree
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_20__["default"](
- 'cannot-change-view-tree',
- this
- );
- }
- try {
- // Recursive call to view.change() method - execute listener immediately.
- if ( this._ongoingChange ) {
- return callback( this._writer );
- }
- // This lock will assure that all recursive calls to view.change() will end up in same block - one "render"
- // event for all nested calls.
- this._ongoingChange = true;
- const callbackResult = callback( this._writer );
- this._ongoingChange = false;
- // This lock is used by editing controller to render changes from outer most model.change() once. As plugins might call
- // view.change() inside model.change() block - this will ensures that postfixers and rendering are called once after all
- // changes. Also, we don't need to render anything if there're no changes since last rendering.
- if ( !this._renderingDisabled && this._hasChangedSinceTheLastRendering ) {
- this._postFixersInProgress = true;
- this.document._callPostFixers( this._writer );
- this._postFixersInProgress = false;
- this.fire( 'render' );
- }
- return callbackResult;
- } catch ( err ) {
- // @if CK_DEBUG // throw err;
- /* istanbul ignore next */
- _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_20__["default"].rethrowUnexpectedError( err, this );
- }
- }
- /**
- * Forces rendering {@link module:engine/view/document~Document view document} to DOM. If any view changes are
- * currently in progress, rendering will start after all {@link #change change blocks} are processed.
- *
- * Note that this method is dedicated for special cases. All view changes should be wrapped in the {@link #change}
- * block and the view will automatically check whether it needs to render DOM or not.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `applying-view-changes-on-rendering` when
- * trying to re-render when rendering to DOM has already started.
- */
- forceRender() {
- this._hasChangedSinceTheLastRendering = true;
- this.change( () => {} );
- }
- /**
- * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.
- */
- destroy() {
- for ( const observer of this._observers.values() ) {
- observer.destroy();
- }
- this.document.destroy();
- this.stopListening();
- }
- /**
- * Creates position at the given location. The location can be specified as:
- *
- * * a {@link module:engine/view/position~Position position},
- * * parent element and offset (offset defaults to `0`),
- * * parent element and `'end'` (sets position at the end of that element),
- * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
- *
- * This method is a shortcut to other constructors such as:
- *
- * * {@link #createPositionBefore},
- * * {@link #createPositionAfter},
- *
- * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
- * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
- * first parameter is a {@link module:engine/view/item~Item view item}.
- */
- createPositionAt( itemOrPosition, offset ) {
- return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAt( itemOrPosition, offset );
- }
- /**
- * Creates a new position after given view item.
- *
- * @param {module:engine/view/item~Item} item View item after which the position should be located.
- * @returns {module:engine/view/position~Position}
- */
- createPositionAfter( item ) {
- return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
- }
- /**
- * Creates a new position before given view item.
- *
- * @param {module:engine/view/item~Item} item View item before which the position should be located.
- * @returns {module:engine/view/position~Position}
- */
- createPositionBefore( item ) {
- return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createBefore( item );
- }
- /**
- * Creates a range spanning from `start` position to `end` position.
- *
- * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
- *
- * @param {module:engine/view/position~Position} start Start position.
- * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
- * @returns {module:engine/view/range~Range}
- */
- createRange( start, end ) {
- return new _range__WEBPACK_IMPORTED_MODULE_5__["default"]( start, end );
- }
- /**
- * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
- *
- * @param {module:engine/view/item~Item} item
- * @returns {module:engine/view/range~Range}
- */
- createRangeOn( item ) {
- return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createOn( item );
- }
- /**
- * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
- * that element and ends after the last child of that element.
- *
- * @param {module:engine/view/element~Element} element Element which is a parent for the range.
- * @returns {module:engine/view/range~Range}
- */
- createRangeIn( element ) {
- return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createIn( element );
- }
- /**
- Creates new {@link module:engine/view/selection~Selection} instance.
- *
- * // Creates empty selection without ranges.
- * const selection = view.createSelection();
- *
- * // Creates selection at the given range.
- * const range = view.createRange( start, end );
- * const selection = view.createSelection( range );
- *
- * // Creates selection at the given ranges
- * const ranges = [ view.createRange( start1, end2 ), view.createRange( star2, end2 ) ];
- * const selection = view.createSelection( ranges );
- *
- * // Creates selection from the other selection.
- * const otherSelection = view.createSelection();
- * const selection = view.createSelection( otherSelection );
- *
- * // Creates selection from the document selection.
- * const selection = view.createSelection( editor.editing.view.document.selection );
- *
- * // Creates selection at the given position.
- * const position = view.createPositionFromPath( root, path );
- * const selection = view.createSelection( position );
- *
- * // Creates collapsed selection at the position of given item and offset.
- * const paragraph = view.createContainerElement( 'paragraph' );
- * const selection = view.createSelection( paragraph, offset );
- *
- * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
- * // first child of that element and ends after the last child of that element.
- * const selection = view.createSelection( paragraph, 'in' );
- *
- * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
- * // just after the item.
- * const selection = view.createSelection( paragraph, 'on' );
- *
- * `Selection`'s factory method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
- *
- * // Creates backward selection.
- * const selection = view.createSelection( range, { backward: true } );
- *
- * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
- * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
- * represented in other way, for example by applying proper CSS class.
- *
- * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
- * (and be properly handled by screen readers).
- *
- * // Creates fake selection with label.
- * const selection = view.createSelection( range, { fake: true, label: 'foo' } );
- *
- * @param {module:engine/view/selection~Selectable} [selectable=null]
- * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
- * @param {Object} [options]
- * @param {Boolean} [options.backward] Sets this selection instance to be backward.
- * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
- * @param {String} [options.label] Label for the fake selection.
- * @returns {module:engine/view/selection~Selection}
- */
- createSelection( selectable, placeOrOffset, options ) {
- return new _selection__WEBPACK_IMPORTED_MODULE_6__["default"]( selectable, placeOrOffset, options );
- }
- /**
- * Disables or enables rendering. If the flag is set to `true` then the rendering will be disabled.
- * If the flag is set to `false` and if there was some change in the meantime, then the rendering action will be performed.
- *
- * @protected
- * @param {Boolean} flag A flag indicates whether the rendering should be disabled.
- */
- _disableRendering( flag ) {
- this._renderingDisabled = flag;
- if ( flag == false ) {
- // Render when you stop blocking rendering.
- this.change( () => {} );
- }
- }
- /**
- * Renders all changes. In order to avoid triggering the observers (e.g. mutations) all observers are disabled
- * before rendering and re-enabled after that.
- *
- * @private
- */
- _render() {
- this.isRenderingInProgress = true;
- this.disableObservers();
- this._renderer.render();
- this.enableObservers();
- this.isRenderingInProgress = false;
- }
- /**
- * Fired after a topmost {@link module:engine/view/view~View#change change block} and all
- * {@link module:engine/view/document~Document#registerPostFixer post-fixers} are executed.
- *
- * Actual rendering is performed as a first listener on 'normal' priority.
- *
- * view.on( 'render', () => {
- * // Rendering to the DOM is complete.
- * } );
- *
- * This event is useful when you want to update interface elements after the rendering, e.g. position of the
- * balloon panel. If you wants to change view structure use
- * {@link module:engine/view/document~Document#registerPostFixer post-fixers}.
- *
- * @event module:engine/view/view~View#event:render
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_16__["default"])( View, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_15__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css ***!
- \***********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./placeholder.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/enter.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-enter/src/enter.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Enter; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _entercommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./entercommand */ "./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js");
- /* harmony import */ var _enterobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./enterobserver */ "./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module enter/enter
- */
- /**
- * This plugin handles the <kbd>Enter</kbd> key (hard line break) in the editor.
- *
- * See also the {@link module:enter/shiftenter~ShiftEnter} plugin.
- *
- * For more information about this feature see the {@glink api/enter package page}.
- *
- * @extends module:core/plugin~Plugin
- */
- class Enter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Enter';
- }
- init() {
- const editor = this.editor;
- const view = editor.editing.view;
- const viewDocument = view.document;
- view.addObserver( _enterobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
- editor.commands.add( 'enter', new _entercommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
- this.listenTo( viewDocument, 'enter', ( evt, data ) => {
- data.preventDefault();
- // The soft enter key is handled by the ShiftEnter plugin.
- if ( data.isSoft ) {
- return;
- }
- editor.execute( 'enter' );
- view.scrollToTheSelection();
- }, { priority: 'low' } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EnterCommand; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-enter/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module enter/entercommand
- */
- /**
- * Enter command. It is used by the {@link module:enter/enter~Enter Enter feature} to handle the <kbd>Enter</kbd> key.
- *
- * @extends module:core/command~Command
- */
- class EnterCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- execute() {
- const model = this.editor.model;
- const doc = model.document;
- model.change( writer => {
- enterBlock( this.editor.model, writer, doc.selection, model.schema );
- this.fire( 'afterExecute', { writer } );
- } );
- }
- }
- // Creates a new block in the way that the <kbd>Enter</kbd> key is expected to work.
- //
- // @param {module:engine/model~Model} model
- // @param {module:engine/model/writer~Writer} writer
- // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- // Selection on which the action should be performed.
- // @param {module:engine/model/schema~Schema} schema
- function enterBlock( model, writer, selection, schema ) {
- const isSelectionEmpty = selection.isCollapsed;
- const range = selection.getFirstRange();
- const startElement = range.start.parent;
- const endElement = range.end.parent;
- // Don't touch the roots and other limit elements.
- if ( schema.isLimit( startElement ) || schema.isLimit( endElement ) ) {
- // Delete the selected content but only if inside a single limit element.
- // Abort, when crossing limit elements boundary (e.g. <limit1>x[x</limit1>donttouchme<limit2>y]y</limit2>).
- // This is an edge case and it's hard to tell what should actually happen because such a selection
- // is not entirely valid.
- if ( !isSelectionEmpty && startElement == endElement ) {
- model.deleteContent( selection );
- }
- return;
- }
- if ( isSelectionEmpty ) {
- const attributesToCopy = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getCopyOnEnterAttributes"])( writer.model.schema, selection.getAttributes() );
- splitBlock( writer, range.start );
- writer.setSelectionAttribute( attributesToCopy );
- } else {
- const leaveUnmerged = !( range.start.isAtStart && range.end.isAtEnd );
- const isContainedWithinOneElement = ( startElement == endElement );
- model.deleteContent( selection, { leaveUnmerged } );
- if ( leaveUnmerged ) {
- // Partially selected elements.
- //
- // <h>x[xx]x</h> -> <h>x^x</h> -> <h>x</h><h>^x</h>
- if ( isContainedWithinOneElement ) {
- splitBlock( writer, selection.focus );
- }
- // Selection over multiple elements.
- //
- // <h>x[x</h><p>y]y<p> -> <h>x^</h><p>y</p> -> <h>x</h><p>^y</p>
- else {
- writer.setSelection( endElement, 0 );
- }
- }
- }
- }
- function splitBlock( writer, splitPos ) {
- writer.split( splitPos );
- writer.setSelection( splitPos.parent.nextSibling, 0 );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EnterObserver; });
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_bubblingeventinfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module enter/enterobserver
- */
- /**
- * Enter observer introduces the {@link module:engine/view/document~Document#event:enter} event.
- *
- * @extends module:engine/view/observer/observer~Observer
- */
- class EnterObserver extends _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( view ) {
- super( view );
- const doc = this.document;
- doc.on( 'keydown', ( evt, data ) => {
- if ( this.isEnabled && data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].enter ) {
- const event = new _ckeditor_ckeditor5_engine_src_view_observer_bubblingeventinfo__WEBPACK_IMPORTED_MODULE_2__["default"]( doc, 'enter', doc.selection.getFirstRange() );
- doc.fire( event, new _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__["default"]( doc, data.domEvent, {
- isSoft: data.shiftKey
- } ) );
- // Stop `keydown` event if `enter` event was stopped.
- // https://github.com/ckeditor/ckeditor5/issues/753
- if ( event.stop.called ) {
- evt.stop();
- }
- }
- } );
- }
- /**
- * @inheritDoc
- */
- observe() {}
- }
- /**
- * Event fired when the user presses the <kbd>Enter</kbd> key.
- *
- * Note: This event is fired by the {@link module:enter/enterobserver~EnterObserver observer}
- * (usually registered by the {@link module:enter/enter~Enter Enter feature} and
- * {@link module:enter/shiftenter~ShiftEnter ShiftEnter feature}).
- *
- * @event module:engine/view/document~Document#event:enter
- * @param {module:engine/view/observer/domeventdata~DomEventData} data
- * @param {Boolean} data.isSoft Whether it's a soft enter (<kbd>Shift</kbd>+<kbd>Enter</kbd>) or hard enter (<kbd>Enter</kbd>).
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/index.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-enter/src/index.js ***!
- \*************************************************************/
- /*! exports provided: Enter, ShiftEnter */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _enter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./enter */ "./node_modules/@ckeditor/ckeditor5-enter/src/enter.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Enter", function() { return _enter__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _shiftenter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shiftenter */ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShiftEnter", function() { return _shiftenter__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module enter
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ShiftEnter; });
- /* harmony import */ var _shiftentercommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shiftentercommand */ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js");
- /* harmony import */ var _enterobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./enterobserver */ "./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js");
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module enter/shiftenter
- */
- /**
- * This plugin handles the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke (soft line break) in the editor.
- *
- * See also the {@link module:enter/enter~Enter} plugin.
- *
- * For more information about this feature see the {@glink api/enter package page}.
- *
- * @extends module:core/plugin~Plugin
- */
- class ShiftEnter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ShiftEnter';
- }
- init() {
- const editor = this.editor;
- const schema = editor.model.schema;
- const conversion = editor.conversion;
- const view = editor.editing.view;
- const viewDocument = view.document;
- // Configure the schema.
- schema.register( 'softBreak', {
- allowWhere: '$text',
- isInline: true
- } );
- // Configure converters.
- conversion.for( 'upcast' )
- .elementToElement( {
- model: 'softBreak',
- view: 'br'
- } );
- conversion.for( 'downcast' )
- .elementToElement( {
- model: 'softBreak',
- view: ( modelElement, { writer } ) => writer.createEmptyElement( 'br' )
- } );
- view.addObserver( _enterobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
- editor.commands.add( 'shiftEnter', new _shiftentercommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor ) );
- this.listenTo( viewDocument, 'enter', ( evt, data ) => {
- data.preventDefault();
- // The hard enter key is handled by the Enter plugin.
- if ( !data.isSoft ) {
- return;
- }
- editor.execute( 'shiftEnter' );
- view.scrollToTheSelection();
- }, { priority: 'low' } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js ***!
- \*************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ShiftEnterCommand; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-enter/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module enter/shiftentercommand
- */
- /**
- * ShiftEnter command. It is used by the {@link module:enter/shiftenter~ShiftEnter ShiftEnter feature} to handle
- * the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke.
- *
- * @extends module:core/command~Command
- */
- class ShiftEnterCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- execute() {
- const model = this.editor.model;
- const doc = model.document;
- model.change( writer => {
- softBreakAction( model, writer, doc.selection );
- this.fire( 'afterExecute', { writer } );
- } );
- }
- refresh() {
- const model = this.editor.model;
- const doc = model.document;
- this.isEnabled = isEnabled( model.schema, doc.selection );
- }
- }
- // Checks whether the ShiftEnter command should be enabled in the specified selection.
- //
- // @param {module:engine/model/schema~Schema} schema
- // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- function isEnabled( schema, selection ) {
- // At this moment it is okay to support single range selections only.
- // But in the future we may need to change that.
- if ( selection.rangeCount > 1 ) {
- return false;
- }
- const anchorPos = selection.anchor;
- // Check whether the break element can be inserted in the current selection anchor.
- if ( !anchorPos || !schema.checkChild( anchorPos, 'softBreak' ) ) {
- return false;
- }
- const range = selection.getFirstRange();
- const startElement = range.start.parent;
- const endElement = range.end.parent;
- // Do not modify the content if selection is cross-limit elements.
- if ( ( isInsideLimitElement( startElement, schema ) || isInsideLimitElement( endElement, schema ) ) && startElement !== endElement ) {
- return false;
- }
- return true;
- }
- // Creates a break in the way that the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke is expected to work.
- //
- // @param {module:engine/model~Model} model
- // @param {module:engine/model/writer~Writer} writer
- // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- // Selection on which the action should be performed.
- function softBreakAction( model, writer, selection ) {
- const isSelectionEmpty = selection.isCollapsed;
- const range = selection.getFirstRange();
- const startElement = range.start.parent;
- const endElement = range.end.parent;
- const isContainedWithinOneElement = ( startElement == endElement );
- if ( isSelectionEmpty ) {
- const attributesToCopy = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getCopyOnEnterAttributes"])( model.schema, selection.getAttributes() );
- insertBreak( model, writer, range.end );
- writer.removeSelectionAttribute( selection.getAttributeKeys() );
- writer.setSelectionAttribute( attributesToCopy );
- } else {
- const leaveUnmerged = !( range.start.isAtStart && range.end.isAtEnd );
- model.deleteContent( selection, { leaveUnmerged } );
- // Selection within one element:
- //
- // <h>x[xx]x</h> -> <h>x^x</h> -> <h>x<br>^x</h>
- if ( isContainedWithinOneElement ) {
- insertBreak( model, writer, selection.focus );
- }
- // Selection over multiple elements.
- //
- // <h>x[x</h><p>y]y<p> -> <h>x^</h><p>y</p> -> <h>x</h><p>^y</p>
- //
- // We chose not to insert a line break in this case because:
- //
- // * it's not a very common scenario,
- // * it actually surprised me when I saw the "expected behavior" in real life.
- //
- // It's ok if the user will need to be more specific where they want the <br> to be inserted.
- else {
- // Move the selection to the 2nd element (last step of the example above).
- if ( leaveUnmerged ) {
- writer.setSelection( endElement, 0 );
- }
- }
- }
- }
- function insertBreak( model, writer, position ) {
- const breakLineElement = writer.createElement( 'softBreak' );
- model.insertContent( breakLineElement, position );
- writer.setSelection( breakLineElement, 'after' );
- }
- // Checks whether the specified `element` is a child of the limit element.
- //
- // Checking whether the `<p>` element is inside a limit element:
- // - <$root><p>Text.</p></$root> => false
- // - <$root><limitElement><p>Text</p></limitElement></$root> => true
- //
- // @param {module:engine/model/element~Element} element
- // @param {module:engine/schema~Schema} schema
- // @returns {Boolean}
- function isInsideLimitElement( element, schema ) {
- // `$root` is a limit element but in this case is an invalid element.
- if ( element.is( 'rootElement' ) ) {
- return false;
- }
- return schema.isLimit( element ) || isInsideLimitElement( element.parent, schema );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/utils.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-enter/src/utils.js ***!
- \*************************************************************/
- /*! exports provided: getCopyOnEnterAttributes */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCopyOnEnterAttributes", function() { return getCopyOnEnterAttributes; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module enter/utils
- */
- /**
- * Returns attributes that should be preserved on the enter key.
- *
- * Filtering is realized based on `copyOnEnter` attribute property. Read more about attribute properties
- * {@link module:engine/model/schema~Schema#setAttributeProperties here}.
- *
- * @param {module:engine/model/schema~Schema} schema
- * @param {Iterable.<*>} allAttributes attributes to filter.
- * @returns {Iterable.<*>}
- */
- function* getCopyOnEnterAttributes( schema, allAttributes ) {
- for ( const attribute of allAttributes ) {
- if ( attribute && schema.getAttributeProperties( attribute[ 0 ] ).copyOnEnter ) {
- yield attribute;
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Essentials; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
- /* harmony import */ var ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/enter */ "./node_modules/ckeditor5/src/enter.js");
- /* harmony import */ var ckeditor5_src_select_all__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/select-all */ "./node_modules/ckeditor5/src/select-all.js");
- /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
- /* harmony import */ var ckeditor5_src_undo__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ckeditor5/src/undo */ "./node_modules/ckeditor5/src/undo.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module essentials/essentials
- */
- /**
- * A plugin including all essential editing features. It represents a set of features that enables similar functionalities
- * to a `<textarea>` element.
- *
- * It includes:
- *
- * * {@link module:clipboard/clipboard~Clipboard},
- * * {@link module:enter/enter~Enter},
- * * {@link module:select-all/selectall~SelectAll},
- * * {@link module:enter/shiftenter~ShiftEnter},
- * * {@link module:typing/typing~Typing},
- * * {@link module:undo/undo~Undo}.
- *
- * This plugin set does not define any block-level containers (such as {@link module:paragraph/paragraph~Paragraph}).
- * If your editor is supposed to handle block content, make sure to include it.
- *
- * @extends module:core/plugin~Plugin
- */
- class Essentials extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__["Clipboard"], ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_2__["Enter"], ckeditor5_src_select_all__WEBPACK_IMPORTED_MODULE_3__["SelectAll"], ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_2__["ShiftEnter"], ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_4__["Typing"], ckeditor5_src_undo__WEBPACK_IMPORTED_MODULE_5__["Undo"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Essentials';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentColorCollection; });
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/documentcolorcollection
- */
- /**
- * A collection to store document colors. It enforces colors to be unique.
- *
- * @mixes module:utils/observablemixin~ObservableMixin
- * @extends module:utils/collection~Collection
- */
- class DocumentColorCollection extends ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["Collection"] {
- constructor( options ) {
- super( options );
- /**
- * Indicates whether the document color collection is empty.
- *
- * @observable
- * @readonly
- * @member {Boolean} #isEmpty
- */
- this.set( 'isEmpty', true );
- this.on( 'change', () => {
- this.set( 'isEmpty', this.length === 0 );
- } );
- }
- /**
- * Adds a color to the document color collection.
- *
- * This method ensures that no color duplicates are inserted (compared using
- * the color value of the {@link module:ui/colorgrid/colorgrid~ColorDefinition}).
- *
- * If the item does not have an ID, it will be automatically generated and set on the item.
- *
- * @chainable
- * @param {module:ui/colorgrid/colorgrid~ColorDefinition} item
- * @param {Number} [index] The position of the item in the collection. The item
- * is pushed to the collection when `index` is not specified.
- * @fires add
- * @fires change
- */
- add( item, index ) {
- if ( this.find( element => element.color === item.color ) ) {
- // No duplicates are allowed.
- return;
- }
- super.add( item, index );
- }
- /**
- * Checks if an object with given colors is present in the document color collection.
- *
- * @param {String} color
- * @returns {Boolean}
- */
- hasColor( color ) {
- return !!this.find( item => item.color === color );
- }
- }
- Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["mix"])( DocumentColorCollection, ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["ObservableMixin"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColor; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _fontbackgroundcolor_fontbackgroundcolorediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontbackgroundcolor/fontbackgroundcolorediting */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js");
- /* harmony import */ var _fontbackgroundcolor_fontbackgroundcolorui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fontbackgroundcolor/fontbackgroundcolorui */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/fontbackgroundcolor
- */
- /**
- * The font background color plugin.
- *
- * For a detailed overview, check the {@glink features/font font feature} documentation
- * and the {@glink api/font package page}.
- *
- * This is a "glue" plugin which loads
- * the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} and
- * {@link module:font/fontbackgroundcolor/fontbackgroundcolorui~FontBackgroundColorUI} features in the editor.
- *
- * @extends module:core/plugin~Plugin
- */
- class FontBackgroundColor extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _fontbackgroundcolor_fontbackgroundcolorediting__WEBPACK_IMPORTED_MODULE_1__["default"], _fontbackgroundcolor_fontbackgroundcolorui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'FontBackgroundColor';
- }
- }
- /**
- * The configuration of the font background color feature.
- * It is introduced by the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} feature.
- *
- * Read more in {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig}.
- *
- * @member {module:font/fontbackgroundcolor~FontBackgroundColorConfig} module:core/editor/editorconfig~EditorConfig#fontBackgroundColor
- */
- /**
- * The configuration of the font background color feature.
- * This option is used by the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} feature.
- *
- * ClassicEditor
- * .create( {
- * fontBackgroundColor: ... // Font background color feature configuration.
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- *
- * @interface module:font/fontbackgroundcolor~FontBackgroundColorConfig
- */
- /**
- * Available font background colors defined as an array of strings or objects.
- *
- * The default value registers the following colors:
- *
- * const fontBackgroundColorConfig = {
- * colors: [
- * {
- * color: 'hsl(0, 0%, 0%)',
- * label: 'Black'
- * },
- * {
- * color: 'hsl(0, 0%, 30%)',
- * label: 'Dim grey'
- * },
- * {
- * color: 'hsl(0, 0%, 60%)',
- * label: 'Grey'
- * },
- * {
- * color: 'hsl(0, 0%, 90%)',
- * label: 'Light grey'
- * },
- * {
- * color: 'hsl(0, 0%, 100%)',
- * label: 'White',
- * hasBorder: true
- * },
- * {
- * color: 'hsl(0, 75%, 60%)',
- * label: 'Red'
- * },
- * {
- * color: 'hsl(30, 75%, 60%)',
- * label: 'Orange'
- * },
- * {
- * color: 'hsl(60, 75%, 60%)',
- * label: 'Yellow'
- * },
- * {
- * color: 'hsl(90, 75%, 60%)',
- * label: 'Light green'
- * },
- * {
- * color: 'hsl(120, 75%, 60%)',
- * label: 'Green'
- * },
- * {
- * color: 'hsl(150, 75%, 60%)',
- * label: 'Aquamarine'
- * },
- * {
- * color: 'hsl(180, 75%, 60%)',
- * label: 'Turquoise'
- * },
- * {
- * color: 'hsl(210, 75%, 60%)',
- * label: 'Light blue'
- * },
- * {
- * color: 'hsl(240, 75%, 60%)',
- * label: 'Blue'
- * },
- * {
- * color: 'hsl(270, 75%, 60%)',
- * label: 'Purple'
- * }
- * ]
- * };
- *
- * **Note**: The colors are displayed in the `'fontBackgroundColor'` dropdown.
- *
- * @member {Array.<String|Object>} module:font/fontbackgroundcolor~FontBackgroundColorConfig#colors
- */
- /**
- * Represents the number of columns in the font background color dropdown.
- *
- * The default value is:
- *
- * const fontBackgroundColorConfig = {
- * columns: 5
- * }
- *
- * @member {Number} module:font/fontbackgroundcolor~FontBackgroundColorConfig#columns
- */
- /**
- * Determines the maximum number of available document colors.
- * Setting it to `0` will disable the document colors feature.
- *
- * By default it equals to the {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig#columns} value.
- *
- * Examples:
- *
- * // 1) Neither document colors nor columns are defined in the configuration.
- * // Document colors will equal 5,
- * // because the value will be inherited from columns,
- * // which has a predefined value of 5.
- * const fontBackgroundColorConfig = {}
- *
- * // 2) Document colors will equal 8, because the value will be inherited from columns.
- * const fontBackgroundColorConfig = {
- * columns: 8
- * }
- *
- * // 3) Document colors will equal 24, because it has its own value defined.
- * const fontBackgroundColorConfig = {
- * columns: 8,
- * documentColors: 24
- * }
- *
- * // 4) The document colors feature will be disabled.
- * const fontBackgroundColorConfig = {
- * columns: 8,
- * documentColors: 0
- * }
- *
- * @member {Number} module:font/fontbackgroundcolor~FontBackgroundColorConfig#documentColors
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js":
- /*!*****************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js ***!
- \*****************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColorCommand; });
- /* harmony import */ var _fontcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../fontcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/fontbackgroundcolor/fontbackgroundcolorcommand
- */
- /**
- * The font background color command. It is used by
- * {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing}
- * to apply the font background color.
- *
- * editor.execute( 'fontBackgroundColor', { value: 'rgb(250, 20, 20)' } );
- *
- * **Note**: Executing the command with the `null` value removes the attribute from the model.
- *
- * @extends module:font/fontcommand~FontCommand
- */
- class FontBackgroundColorCommand extends _fontcommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor, _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_BACKGROUND_COLOR"] );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js":
- /*!*****************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js ***!
- \*****************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColorEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /* harmony import */ var _fontbackgroundcolorcommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fontbackgroundcolorcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/fontbackgroundcolor/fontbackgroundcolorediting
- */
- /**
- * The font background color editing feature.
- *
- * It introduces the {@link module:font/fontbackgroundcolor/fontbackgroundcolorcommand~FontBackgroundColorCommand command} and
- * the `fontBackgroundColor` attribute in the {@link module:engine/model/model~Model model} which renders
- * in the {@link module:engine/view/view view} as a `<span>` element (`<span style="background-color: ...">`),
- * depending on the {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig configuration}.
- *
- * @extends module:core/plugin~Plugin
- */
- class FontBackgroundColorEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'FontBackgroundColorEditing';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- editor.config.define( _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"], {
- colors: [
- {
- color: 'hsl(0, 0%, 0%)',
- label: 'Black'
- },
- {
- color: 'hsl(0, 0%, 30%)',
- label: 'Dim grey'
- },
- {
- color: 'hsl(0, 0%, 60%)',
- label: 'Grey'
- },
- {
- color: 'hsl(0, 0%, 90%)',
- label: 'Light grey'
- },
- {
- color: 'hsl(0, 0%, 100%)',
- label: 'White',
- hasBorder: true
- },
- {
- color: 'hsl(0, 75%, 60%)',
- label: 'Red'
- },
- {
- color: 'hsl(30, 75%, 60%)',
- label: 'Orange'
- },
- {
- color: 'hsl(60, 75%, 60%)',
- label: 'Yellow'
- },
- {
- color: 'hsl(90, 75%, 60%)',
- label: 'Light green'
- },
- {
- color: 'hsl(120, 75%, 60%)',
- label: 'Green'
- },
- {
- color: 'hsl(150, 75%, 60%)',
- label: 'Aquamarine'
- },
- {
- color: 'hsl(180, 75%, 60%)',
- label: 'Turquoise'
- },
- {
- color: 'hsl(210, 75%, 60%)',
- label: 'Light blue'
- },
- {
- color: 'hsl(240, 75%, 60%)',
- label: 'Blue'
- },
- {
- color: 'hsl(270, 75%, 60%)',
- label: 'Purple'
- }
- ],
- columns: 5
- } );
- editor.data.addStyleProcessorRules( ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["addBackgroundRules"] );
- editor.conversion.for( 'upcast' ).elementToAttribute( {
- view: {
- name: 'span',
- styles: {
- 'background-color': /[\s\S]+/
- }
- },
- model: {
- key: _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"],
- value: Object(_utils__WEBPACK_IMPORTED_MODULE_3__["renderUpcastAttribute"])( 'background-color' )
- }
- } );
- editor.conversion.for( 'downcast' ).attributeToElement( {
- model: _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"],
- view: Object(_utils__WEBPACK_IMPORTED_MODULE_3__["renderDowncastElement"])( 'background-color' )
- } );
- editor.commands.add( _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"], new _fontbackgroundcolorcommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor ) );
- // Allow the font backgroundColor attribute on text nodes.
- editor.model.schema.extend( '$text', { allowAttributes: _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"] } );
- editor.model.schema.setAttributeProperties( _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"], {
- isFormatting: true,
- copyOnEnter: true
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js":
- /*!************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js ***!
- \************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColorUI; });
- /* harmony import */ var _ui_colorui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ui/colorui */ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
- /* harmony import */ var _theme_icons_font_background_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/font-background.svg */ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/fontbackgroundcolor/fontbackgroundcolorui
- */
- /**
- * The font background color UI plugin. It introduces the `'fontBackgroundColor'` dropdown.
- *
- * @extends module:core/plugin~Plugin
- */
- class FontBackgroundColorUI extends _ui_colorui__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- const t = editor.locale.t;
- super( editor, {
- commandName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_BACKGROUND_COLOR"],
- componentName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_BACKGROUND_COLOR"],
- icon: _theme_icons_font_background_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
- dropdownLabel: t( 'Font Background Color' )
- } );
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'FontBackgroundColorUI';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js":
- /*!****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColor; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _fontcolor_fontcolorediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontcolor/fontcolorediting */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js");
- /* harmony import */ var _fontcolor_fontcolorui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fontcolor/fontcolorui */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/fontcolor
- */
- /**
- * The font color plugin.
- *
- * For a detailed overview, check the {@glink features/font font feature} documentation
- * and the {@glink api/font package page}.
- *
- * This is a "glue" plugin which loads the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} and
- * {@link module:font/fontcolor/fontcolorui~FontColorUI} features in the editor.
- *
- * @extends module:core/plugin~Plugin
- */
- class FontColor extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _fontcolor_fontcolorediting__WEBPACK_IMPORTED_MODULE_1__["default"], _fontcolor_fontcolorui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'FontColor';
- }
- }
- /**
- * The configuration of the font color feature.
- * It is introduced by the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} feature.
- *
- * Read more in {@link module:font/fontcolor~FontColorConfig}.
- *
- * @member {module:font/fontcolor~FontColorConfig} module:core/editor/editorconfig~EditorConfig#fontColor
- */
- /**
- * The configuration of the font color feature.
- * This option is used by the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} feature.
- *
- * ClassicEditor
- * .create( {
- * fontColor: ... // Font color feature configuration.
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- *
- * @interface module:font/fontcolor~FontColorConfig
- */
- /**
- * Available font colors defined as an array of strings or objects.
- *
- * The default value registers the following colors:
- *
- * const fontColorConfig = {
- * colors: [
- * {
- * color: 'hsl(0, 0%, 0%)',
- * label: 'Black'
- * },
- * {
- * color: 'hsl(0, 0%, 30%)',
- * label: 'Dim grey'
- * },
- * {
- * color: 'hsl(0, 0%, 60%)',
- * label: 'Grey'
- * },
- * {
- * color: 'hsl(0, 0%, 90%)',
- * label: 'Light grey'
- * },
- * {
- * color: 'hsl(0, 0%, 100%)',
- * label: 'White',
- * hasBorder: true
- * },
- * {
- * color: 'hsl(0, 75%, 60%)',
- * label: 'Red'
- * },
- * {
- * color: 'hsl(30, 75%, 60%)',
- * label: 'Orange'
- * },
- * {
- * color: 'hsl(60, 75%, 60%)',
- * label: 'Yellow'
- * },
- * {
- * color: 'hsl(90, 75%, 60%)',
- * label: 'Light green'
- * },
- * {
- * color: 'hsl(120, 75%, 60%)',
- * label: 'Green'
- * },
- * {
- * color: 'hsl(150, 75%, 60%)',
- * label: 'Aquamarine'
- * },
- * {
- * color: 'hsl(180, 75%, 60%)',
- * label: 'Turquoise'
- * },
- * {
- * color: 'hsl(210, 75%, 60%)',
- * label: 'Light blue'
- * },
- * {
- * color: 'hsl(240, 75%, 60%)',
- * label: 'Blue'
- * },
- * {
- * color: 'hsl(270, 75%, 60%)',
- * label: 'Purple'
- * }
- * ]
- * };
- *
- * **Note**: The colors are displayed in the `'fontColor'` dropdown.
- *
- * @member {Array.<String|Object>} module:font/fontcolor~FontColorConfig#colors
- */
- /**
- * Represents the number of columns in the font color dropdown.
- *
- * The default value is:
- *
- * const fontColorConfig = {
- * columns: 5
- * }
- *
- * @member {Number} module:font/fontcolor~FontColorConfig#columns
- */
- /**
- * Determines the maximum number of available document colors.
- * Setting it to `0` will disable the document colors feature.
- *
- * By default it equals to the {@link module:font/fontcolor~FontColorConfig#columns} value.
- *
- * Examples:
- *
- * // 1) Neither document colors nor columns are defined in the configuration.
- * // Document colors will equal 5,
- * // because the value will be inherited from columns,
- * // which has a predefined value of 5.
- * const fontColorConfig = {}
- *
- * // 2) Document colors will equal 8, because the value will be inherited from columns.
- * const fontColorConfig = {
- * columns: 8
- * }
- *
- * // 3) Document colors will equal 24, because it has its own value defined.
- * const fontColorConfig = {
- * columns: 8,
- * documentColors: 24
- * }
- *
- * // 4) The document colors feature will be disabled.
- * const fontColorConfig = {
- * columns: 8,
- * documentColors: 0
- * }
- *
- * @member {Number} module:font/fontcolor~FontColorConfig#documentColors
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColorCommand; });
- /* harmony import */ var _fontcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../fontcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/fontcolor/fontcolorcommand
- */
- /**
- * The font color command. It is used by {@link module:font/fontcolor/fontcolorediting~FontColorEditing}
- * to apply the font color.
- *
- * editor.execute( 'fontColor', { value: 'rgb(250, 20, 20)' } );
- *
- * **Note**: Executing the command with the `null` value removes the attribute from the model.
- *
- * @extends module:font/fontcommand~FontCommand
- */
- class FontColorCommand extends _fontcommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor, _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_COLOR"] );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColorEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _fontcolorcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontcolorcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/fontcolor/fontcolorediting
- */
- /**
- * The font color editing feature.
- *
- * It introduces the {@link module:font/fontcolor/fontcolorcommand~FontColorCommand command} and
- * the `fontColor` attribute in the {@link module:engine/model/model~Model model} which renders
- * in the {@link module:engine/view/view view} as a `<span>` element (`<span style="color: ...">`),
- * depending on the {@link module:font/fontcolor~FontColorConfig configuration}.
- *
- * @extends module:core/plugin~Plugin
- */
- class FontColorEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'FontColorEditing';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- editor.config.define( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"], {
- colors: [
- {
- color: 'hsl(0, 0%, 0%)',
- label: 'Black'
- },
- {
- color: 'hsl(0, 0%, 30%)',
- label: 'Dim grey'
- },
- {
- color: 'hsl(0, 0%, 60%)',
- label: 'Grey'
- },
- {
- color: 'hsl(0, 0%, 90%)',
- label: 'Light grey'
- },
- {
- color: 'hsl(0, 0%, 100%)',
- label: 'White',
- hasBorder: true
- },
- {
- color: 'hsl(0, 75%, 60%)',
- label: 'Red'
- },
- {
- color: 'hsl(30, 75%, 60%)',
- label: 'Orange'
- },
- {
- color: 'hsl(60, 75%, 60%)',
- label: 'Yellow'
- },
- {
- color: 'hsl(90, 75%, 60%)',
- label: 'Light green'
- },
- {
- color: 'hsl(120, 75%, 60%)',
- label: 'Green'
- },
- {
- color: 'hsl(150, 75%, 60%)',
- label: 'Aquamarine'
- },
- {
- color: 'hsl(180, 75%, 60%)',
- label: 'Turquoise'
- },
- {
- color: 'hsl(210, 75%, 60%)',
- label: 'Light blue'
- },
- {
- color: 'hsl(240, 75%, 60%)',
- label: 'Blue'
- },
- {
- color: 'hsl(270, 75%, 60%)',
- label: 'Purple'
- }
- ],
- columns: 5
- } );
- editor.conversion.for( 'upcast' ).elementToAttribute( {
- view: {
- name: 'span',
- styles: {
- 'color': /[\s\S]+/
- }
- },
- model: {
- key: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"],
- value: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["renderUpcastAttribute"])( 'color' )
- }
- } );
- // Support legacy `<font color="..">` formatting.
- editor.conversion.for( 'upcast' ).elementToAttribute( {
- view: {
- name: 'font',
- attributes: {
- 'color': /^#?\w+$/
- }
- },
- model: {
- key: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"],
- value: viewElement => viewElement.getAttribute( 'color' )
- }
- } );
- editor.conversion.for( 'downcast' ).attributeToElement( {
- model: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"],
- view: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["renderDowncastElement"])( 'color' )
- } );
- editor.commands.add( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"], new _fontcolorcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
- // Allow the font color attribute on text nodes.
- editor.model.schema.extend( '$text', { allowAttributes: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"] } );
- editor.model.schema.setAttributeProperties( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"], {
- isFormatting: true,
- copyOnEnter: true
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColorUI; });
- /* harmony import */ var _ui_colorui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ui/colorui */ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
- /* harmony import */ var _theme_icons_font_color_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/font-color.svg */ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/fontcolor/fontcolorui
- */
- /**
- * The font color UI plugin. It introduces the `'fontColor'` dropdown.
- *
- * @extends module:core/plugin~Plugin
- */
- class FontColorUI extends _ui_colorui__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- const t = editor.locale.t;
- super( editor, {
- commandName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_COLOR"],
- componentName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_COLOR"],
- icon: _theme_icons_font_color_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
- dropdownLabel: t( 'Font Color' )
- } );
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'FontColorUI';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/fontcommand
- */
- /**
- * The base font command.
- *
- * @extends module:core/command~Command
- */
- class FontCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * Creates an instance of the command.
- *
- * @param {module:core/editor/editor~Editor} editor Editor instance.
- * @param {String} attributeKey The name of a model attribute on which this command operates.
- */
- constructor( editor, attributeKey ) {
- super( editor );
- /**
- * When set, it reflects the {@link #attributeKey} value of the selection.
- *
- * @observable
- * @readonly
- * @member {String} module:font/fontcommand~FontCommand#value
- */
- /**
- * A model attribute on which this command operates.
- *
- * @readonly
- * @member {Boolean} module:font/fontcommand~FontCommand#attributeKey
- */
- this.attributeKey = attributeKey;
- }
- /**
- * @inheritDoc
- */
- refresh() {
- const model = this.editor.model;
- const doc = model.document;
- this.value = doc.selection.getAttribute( this.attributeKey );
- this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, this.attributeKey );
- }
- /**
- * Executes the command. Applies the `value` of the {@link #attributeKey} to the selection.
- * If no `value` is passed, it removes the attribute from the selection.
- *
- * @protected
- * @param {Object} [options] Options for the executed command.
- * @param {String} [options.value] The value to apply.
- * @fires execute
- */
- execute( options = {} ) {
- const model = this.editor.model;
- const document = model.document;
- const selection = document.selection;
- const value = options.value;
- model.change( writer => {
- if ( selection.isCollapsed ) {
- if ( value ) {
- writer.setSelectionAttribute( this.attributeKey, value );
- } else {
- writer.removeSelectionAttribute( this.attributeKey );
- }
- } else {
- const ranges = model.schema.getValidRanges( selection.getRanges(), this.attributeKey );
- for ( const range of ranges ) {
- if ( value ) {
- writer.setAttribute( this.attributeKey, value, range );
- } else {
- writer.removeAttribute( this.attributeKey, range );
- }
- }
- }
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorTableView; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _documentcolorcollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../documentcolorcollection */ "./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js");
- /* harmony import */ var _theme_fontcolor_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/fontcolor.css */ "./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css");
- /* harmony import */ var _theme_fontcolor_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_fontcolor_css__WEBPACK_IMPORTED_MODULE_4__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/ui/colortableview
- */
- /**
- * A class which represents a view with the following sub–components:
- *
- * * A remove color button,
- * * A static {@link module:ui/colorgrid/colorgrid~ColorGridView} of colors defined in the configuration,
- * * A dynamic {@link module:ui/colorgrid/colorgrid~ColorGridView} of colors used in the document.
- *
- * @extends module:ui/view~View
- */
- class ColorTableView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["View"] {
- /**
- * Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.
- *
- * @param {module:utils/locale~Locale} [locale] The localization services instance.
- * @param {Object} config The configuration object.
- * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} config.colors An array with definitions of colors to
- * be displayed in the table.
- * @param {Number} config.columns The number of columns in the color grid.
- * @param {String} config.removeButtonLabel The label of the button responsible for removing the color.
- * @param {String} config.documentColorsLabel The label for the section with the document colors.
- * @param {String} config.documentColorsCount The number of colors in the document colors section inside the color dropdown.
- */
- constructor( locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount } ) {
- super( locale );
- /**
- * A collection of the children of the table.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.items = this.createCollection();
- /**
- * An array with objects representing colors to be displayed in the grid.
- *
- * @type {Arrray.<module:ui/colorgrid/colorgrid~ColorDefinition>}
- */
- this.colorDefinitions = colors;
- /**
- * Tracks information about the DOM focus in the list.
- *
- * @readonly
- * @member {module:utils/focustracker~FocusTracker}
- */
- this.focusTracker = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["FocusTracker"]();
- /**
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
- *
- * @readonly
- * @member {module:utils/keystrokehandler~KeystrokeHandler}
- */
- this.keystrokes = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["KeystrokeHandler"]();
- /**
- * Keeps the value of the command associated with the table for the current selection.
- *
- * @type {String}
- */
- this.set( 'selectedColor' );
- /**
- * The label of the button responsible for removing color attributes.
- *
- * @type {String}
- */
- this.removeButtonLabel = removeButtonLabel;
- /**
- * The number of columns in the color grid.
- *
- * @type {Number}
- */
- this.columns = columns;
- /**
- * A collection of definitions that store the document colors.
- *
- * @readonly
- * @member {module:font/documentcolorcollection~DocumentColorCollection}
- */
- this.documentColors = new _documentcolorcollection__WEBPACK_IMPORTED_MODULE_3__["default"]();
- /**
- * The maximum number of colors in the document colors section.
- * If it equals 0, the document colors section is not added.
- *
- * @readonly
- * @type {Number}
- */
- this.documentColorsCount = documentColorsCount;
- /**
- * Preserves the reference to {@link module:ui/colorgrid/colorgrid~ColorGridView} used to create
- * the default (static) color set.
- *
- * The property is loaded once the the parent dropdown is opened the first time.
- *
- * @readonly
- * @member {module:ui/colorgrid/colorgrid~ColorGridView|undefined} #staticColorsGrid
- */
- /**
- * Preserves the reference to {@link module:ui/colorgrid/colorgrid~ColorGridView} used to create
- * the document colors. It remains undefined if the document colors feature is disabled.
- *
- * The property is loaded once the the parent dropdown is opened the first time.
- *
- * @readonly
- * @member {module:ui/colorgrid/colorgrid~ColorGridView|undefined} #documentColorsGrid
- */
- /**
- * Helps cycling over focusable {@link #items} in the list.
- *
- * @readonly
- * @protected
- * @member {module:ui/focuscycler~FocusCycler}
- */
- this._focusCycler = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["FocusCycler"]( {
- focusables: this.items,
- focusTracker: this.focusTracker,
- keystrokeHandler: this.keystrokes,
- actions: {
- // Navigate list items backwards using the Arrow Up key.
- focusPrevious: 'arrowup',
- // Navigate list items forwards using the Arrow Down key.
- focusNext: 'arrowdown'
- }
- } );
- /**
- * Document color section's label.
- *
- * @private
- * @readonly
- * @type {String}
- */
- this._documentColorsLabel = documentColorsLabel;
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-color-table'
- ]
- },
- children: this.items
- } );
- this.items.add( this._removeColorButton() );
- }
- /**
- * Scans through the editor model and searches for text node attributes with the given attribute name.
- * Found entries are set as document colors.
- *
- * All the previously stored document colors will be lost in the process.
- *
- * @param {module:engine/model/model~Model} model The model used as a source to obtain the document colors.
- * @param {String} attributeName Determines the name of the related model's attribute for a given dropdown.
- */
- updateDocumentColors( model, attributeName ) {
- const document = model.document;
- const maxCount = this.documentColorsCount;
- this.documentColors.clear();
- for ( const rootName of document.getRootNames() ) {
- const root = document.getRoot( rootName );
- const range = model.createRangeIn( root );
- for ( const node of range.getItems() ) {
- if ( node.is( '$textProxy' ) && node.hasAttribute( attributeName ) ) {
- this._addColorToDocumentColors( node.getAttribute( attributeName ) );
- if ( this.documentColors.length >= maxCount ) {
- return;
- }
- }
- }
- }
- }
- /**
- * Refreshes the state of the selected color in one or both {@link module:ui/colorgrid/colorgrid~ColorGridView}s
- * available in the {@link module:font/ui/colortableview~ColorTableView}. It guarantees that the selection will occur only in one
- * of them.
- */
- updateSelectedColors() {
- const documentColorsGrid = this.documentColorsGrid;
- const staticColorsGrid = this.staticColorsGrid;
- const selectedColor = this.selectedColor;
- staticColorsGrid.selectedColor = selectedColor;
- if ( documentColorsGrid ) {
- documentColorsGrid.selectedColor = selectedColor;
- }
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- // Items added before rendering should be known to the #focusTracker.
- for ( const item of this.items ) {
- this.focusTracker.add( item.element );
- }
- // Start listening for the keystrokes coming from #element.
- this.keystrokes.listenTo( this.element );
- }
- /**
- * Appends {@link #staticColorsGrid} and {@link #documentColorsGrid} views.
- */
- appendGrids() {
- if ( this.staticColorsGrid ) {
- return;
- }
- this.staticColorsGrid = this._createStaticColorsGrid();
- this.items.add( this.staticColorsGrid );
- if ( this.documentColorsCount ) {
- // Create a label for document colors.
- const bind = ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Template"].bind( this.documentColors, this.documentColors );
- const label = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["LabelView"]( this.locale );
- label.text = this._documentColorsLabel;
- label.extendTemplate( {
- attributes: {
- class: [
- 'ck',
- 'ck-color-grid__label',
- bind.if( 'isEmpty', 'ck-hidden' )
- ]
- }
- } );
- this.items.add( label );
- this.documentColorsGrid = this._createDocumentColorsGrid();
- this.items.add( this.documentColorsGrid );
- }
- }
- /**
- * Focuses the first focusable element in {@link #items}.
- */
- focus() {
- this._focusCycler.focusFirst();
- }
- /**
- * Focuses the last focusable element in {@link #items}.
- */
- focusLast() {
- this._focusCycler.focusLast();
- }
- /**
- * Adds the remove color button as a child of the current view.
- *
- * @private
- * @returns {module:ui/button/buttonview~ButtonView}
- */
- _removeColorButton() {
- const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]();
- buttonView.set( {
- withText: true,
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].eraser,
- tooltip: true,
- label: this.removeButtonLabel
- } );
- buttonView.class = 'ck-color-table__remove-color';
- buttonView.on( 'execute', () => {
- this.fire( 'execute', { value: null } );
- } );
- return buttonView;
- }
- /**
- * Creates a static color table grid based on the editor configuration.
- *
- * @private
- * @returns {module:ui/colorgrid/colorgrid~ColorGridView}
- */
- _createStaticColorsGrid() {
- const colorGrid = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ColorGridView"]( this.locale, {
- colorDefinitions: this.colorDefinitions,
- columns: this.columns
- } );
- colorGrid.delegate( 'execute' ).to( this );
- return colorGrid;
- }
- /**
- * Creates the document colors section view and binds it to {@link #documentColors}.
- *
- * @private
- * @returns {module:ui/colorgrid/colorgrid~ColorGridView}
- */
- _createDocumentColorsGrid() {
- const bind = ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Template"].bind( this.documentColors, this.documentColors );
- const documentColorsGrid = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ColorGridView"]( this.locale, {
- columns: this.columns
- } );
- documentColorsGrid.delegate( 'execute' ).to( this );
- documentColorsGrid.extendTemplate( {
- attributes: {
- class: bind.if( 'isEmpty', 'ck-hidden' )
- }
- } );
- documentColorsGrid.items.bindTo( this.documentColors ).using(
- colorObj => {
- const colorTile = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ColorTileView"]();
- colorTile.set( {
- color: colorObj.color,
- hasBorder: colorObj.options && colorObj.options.hasBorder
- } );
- if ( colorObj.label ) {
- colorTile.set( {
- label: colorObj.label,
- tooltip: true
- } );
- }
- colorTile.on( 'execute', () => {
- this.fire( 'execute', {
- value: colorObj.color
- } );
- } );
- return colorTile;
- }
- );
- // Selected color should be cleared when document colors became empty.
- this.documentColors.on( 'change:isEmpty', ( evt, name, val ) => {
- if ( val ) {
- documentColorsGrid.selectedColor = null;
- }
- } );
- return documentColorsGrid;
- }
- /**
- * Adds a given color to the document colors list. If possible, the method will attempt to use
- * data from the {@link #colorDefinitions} (label, color options).
- *
- * @private
- * @param {String} color A string that stores the value of the recently applied color.
- */
- _addColorToDocumentColors( color ) {
- const predefinedColor = this.colorDefinitions
- .find( definition => definition.color === color );
- if ( !predefinedColor ) {
- this.documentColors.add( {
- color,
- label: color,
- options: {
- hasBorder: false
- }
- } );
- } else {
- this.documentColors.add( Object.assign( {}, predefinedColor ) );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/ui/colorui
- */
- /**
- * The color UI plugin which isolates the common logic responsible for displaying dropdowns with color grids.
- *
- * It is used to create the `'fontBackgroundColor'` and `'fontColor'` dropdowns, each hosting
- * a {@link module:font/ui/colortableview~ColorTableView}.
- *
- * @extends module:core/plugin~Plugin
- */
- class ColorUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * Creates a plugin which introduces a dropdown with a pre–configured {@link module:font/ui/colortableview~ColorTableView}.
- *
- * @param {module:core/editor/editor~Editor} editor
- * @param {Object} config The configuration object.
- * @param {String} config.commandName The name of the command which will be executed when a color tile is clicked.
- * @param {String} config.componentName The name of the dropdown in the {@link module:ui/componentfactory~ComponentFactory}
- * and the configuration scope name in `editor.config`.
- * @param {String} config.icon The SVG icon used by the dropdown.
- * @param {String} config.dropdownLabel The label used by the dropdown.
- */
- constructor( editor, { commandName, icon, componentName, dropdownLabel } ) {
- super( editor );
- /**
- * The name of the command which will be executed when a color tile is clicked.
- *
- * @type {String}
- */
- this.commandName = commandName;
- /**
- * The name of this component in the {@link module:ui/componentfactory~ComponentFactory}.
- * Also the configuration scope name in `editor.config`.
- *
- * @type {String}
- */
- this.componentName = componentName;
- /**
- * The SVG icon used by the dropdown.
- * @type {String}
- */
- this.icon = icon;
- /**
- * The label used by the dropdown.
- *
- * @type {String}
- */
- this.dropdownLabel = dropdownLabel;
- /**
- * The number of columns in the color grid.
- *
- * @type {Number}
- */
- this.columns = editor.config.get( `${ this.componentName }.columns` );
- /**
- * Keeps a reference to {@link module:font/ui/colortableview~ColorTableView}.
- *
- * @member {module:font/ui/colortableview~ColorTableView}
- */
- this.colorTableView = undefined;
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const locale = editor.locale;
- const t = locale.t;
- const command = editor.commands.get( this.commandName );
- const colorsConfig = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["normalizeColorOptions"])( editor.config.get( this.componentName ).colors );
- const localizedColors = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["getLocalizedColorOptions"])( locale, colorsConfig );
- const documentColorsCount = editor.config.get( `${ this.componentName }.documentColors` );
- // Register the UI component.
- editor.ui.componentFactory.add( this.componentName, locale => {
- const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
- this.colorTableView = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["addColorTableToDropdown"])( {
- dropdownView,
- colors: localizedColors.map( option => ( {
- label: option.label,
- color: option.model,
- options: {
- hasBorder: option.hasBorder
- }
- } ) ),
- columns: this.columns,
- removeButtonLabel: t( 'Remove color' ),
- documentColorsLabel: documentColorsCount !== 0 ? t( 'Document colors' ) : undefined,
- documentColorsCount: documentColorsCount === undefined ? this.columns : documentColorsCount
- } );
- this.colorTableView.bind( 'selectedColor' ).to( command, 'value' );
- dropdownView.buttonView.set( {
- label: this.dropdownLabel,
- icon: this.icon,
- tooltip: true
- } );
- dropdownView.extendTemplate( {
- attributes: {
- class: 'ck-color-ui-dropdown'
- }
- } );
- dropdownView.bind( 'isEnabled' ).to( command );
- dropdownView.on( 'execute', ( evt, data ) => {
- editor.execute( this.commandName, data );
- editor.editing.view.focus();
- } );
- dropdownView.on( 'change:isOpen', ( evt, name, isVisible ) => {
- // Grids rendering is deferred (#6192).
- dropdownView.colorTableView.appendGrids();
- if ( isVisible ) {
- if ( documentColorsCount !== 0 ) {
- this.colorTableView.updateDocumentColors( editor.model, this.componentName );
- }
- this.colorTableView.updateSelectedColors();
- }
- } );
- return dropdownView;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js":
- /*!************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/src/utils.js ***!
- \************************************************************/
- /*! exports provided: FONT_SIZE, FONT_FAMILY, FONT_COLOR, FONT_BACKGROUND_COLOR, buildDefinition, renderUpcastAttribute, renderDowncastElement, addColorTableToDropdown */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_SIZE", function() { return FONT_SIZE; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_FAMILY", function() { return FONT_FAMILY; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_COLOR", function() { return FONT_COLOR; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_BACKGROUND_COLOR", function() { return FONT_BACKGROUND_COLOR; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildDefinition", function() { return buildDefinition; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderUpcastAttribute", function() { return renderUpcastAttribute; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderDowncastElement", function() { return renderDowncastElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addColorTableToDropdown", function() { return addColorTableToDropdown; });
- /* harmony import */ var _ui_colortableview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ui/colortableview */ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module font/utils
- */
- /**
- * The name of the font size plugin.
- */
- const FONT_SIZE = 'fontSize';
- /**
- * The name of the font family plugin.
- */
- const FONT_FAMILY = 'fontFamily';
- /**
- * The name of the font color plugin.
- */
- const FONT_COLOR = 'fontColor';
- /**
- * The name of the font background color plugin.
- */
- const FONT_BACKGROUND_COLOR = 'fontBackgroundColor';
- /**
- * Builds a proper {@link module:engine/conversion/conversion~ConverterDefinition converter definition} out of input data.
- *
- * @param {String} modelAttributeKey Key
- * @param {Array.<module:font/fontfamily~FontFamilyOption>|Array.<module:font/fontsize~FontSizeOption>} options
- * @returns {module:engine/conversion/conversion~ConverterDefinition}
- */
- function buildDefinition( modelAttributeKey, options ) {
- const definition = {
- model: {
- key: modelAttributeKey,
- values: []
- },
- view: {},
- upcastAlso: {}
- };
- for ( const option of options ) {
- definition.model.values.push( option.model );
- definition.view[ option.model ] = option.view;
- if ( option.upcastAlso ) {
- definition.upcastAlso[ option.model ] = option.upcastAlso;
- }
- }
- return definition;
- }
- /**
- * A {@link module:font/fontcolor~FontColor font color} and
- * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
- * responsible for upcasting data to the model.
- *
- * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
- *
- * @param {String} styleAttr
- * @return {String}
- */
- function renderUpcastAttribute( styleAttr ) {
- return viewElement => normalizeColorCode( viewElement.getStyle( styleAttr ) );
- }
- /**
- * A {@link module:font/fontcolor~FontColor font color} and
- * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
- * responsible for downcasting a color attribute to a `<span>` element.
- *
- * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
- *
- * @param {String} styleAttr
- */
- function renderDowncastElement( styleAttr ) {
- return ( modelAttributeValue, { writer } ) => writer.createAttributeElement( 'span', {
- style: `${ styleAttr }:${ modelAttributeValue }`
- }, { priority: 7 } );
- }
- /**
- * A helper that adds {@link module:font/ui/colortableview~ColorTableView} to the color dropdown with proper initial values.
- *
- * @param {Object} config The configuration object.
- * @param {module:ui/dropdown/dropdownview~DropdownView} config.dropdownView The dropdown view to which
- * a {@link module:font/ui/colortableview~ColorTableView} will be added.
- * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} config.colors An array with definitions
- * representing colors to be displayed in the color table.
- * @param {String} config.removeButtonLabel The label for the button responsible for removing the color.
- * @param {String} config.documentColorsLabel The label for the section with document colors.
- * @param {String} config.documentColorsCount The number of document colors inside the dropdown.
- * @returns {module:font/ui/colortableview~ColorTableView} The new color table view.
- */
- function addColorTableToDropdown( { dropdownView, colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount } ) {
- const locale = dropdownView.locale;
- const colorTableView = new _ui_colortableview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount } );
- dropdownView.colorTableView = colorTableView;
- dropdownView.panelView.children.add( colorTableView );
- colorTableView.delegate( 'execute' ).to( dropdownView, 'execute' );
- return colorTableView;
- }
- // Fixes the color value string.
- //
- // @param {String} value
- // @returns {String}
- function normalizeColorCode( value ) {
- return value.replace( /\s/g, '' );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css ***!
- \*******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./fontcolor.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8.38 9.262H7.62L10 5.506l2.38 5.756zm.532 1.285L14.34 16h1.426L10.804 4H9.196L4.234 16H5.66l1.428-3.453h5.824z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.4 10.3 10 4.5l-2.4 5.8h4.8zm.5 1.2H7.1L5.7 15H4.2l5-12h1.6l5 12h-1.5L13 11.5zm3.1 7H4a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/heading.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-heading/src/heading.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Heading; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _headingediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./headingediting */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js");
- /* harmony import */ var _headingui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./headingui */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js");
- /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/heading.css */ "./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css");
- /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_heading_css__WEBPACK_IMPORTED_MODULE_3__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module heading/heading
- */
- /**
- * The headings feature.
- *
- * For a detailed overview, check the {@glink features/headings Headings feature documentation}
- * and the {@glink api/heading package page}.
- *
- * This is a "glue" plugin which loads the {@link module:heading/headingediting~HeadingEditing heading editing feature}
- * and {@link module:heading/headingui~HeadingUI heading UI feature}.
- *
- * @extends module:core/plugin~Plugin
- */
- class Heading extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _headingediting__WEBPACK_IMPORTED_MODULE_1__["default"], _headingui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Heading';
- }
- }
- /**
- * The configuration of the heading feature. Introduced by the {@link module:heading/headingediting~HeadingEditing} feature.
- *
- * Read more in {@link module:heading/heading~HeadingConfig}.
- *
- * @member {module:heading/heading~HeadingConfig} module:core/editor/editorconfig~EditorConfig#heading
- */
- /**
- * The configuration of the heading feature.
- * The option is used by the {@link module:heading/headingediting~HeadingEditing} feature.
- *
- * ClassicEditor
- * .create( {
- * heading: ... // Heading feature config.
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- *
- * @interface HeadingConfig
- */
- /**
- * The available heading options.
- *
- * The default value is:
- *
- * const headingConfig = {
- * options: [
- * { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
- * { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
- * { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
- * { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
- * ]
- * };
- *
- * It defines 3 levels of headings. In the editor model they will use `heading1`, `heading2`, and `heading3` elements.
- * Their respective view elements (so the elements output by the editor) will be: `h2`, `h3`, and `h4`. This means that
- * if you choose "Heading 1" in the headings dropdown the editor will turn the current block to `<heading1>` in the model
- * which will result in rendering (and outputting to data) the `<h2>` element.
- *
- * The `title` and `class` properties will be used by the `headings` dropdown to render available options.
- * Usually, the first option in the headings dropdown is the "Paragraph" option, hence it's also defined on the list.
- * However, you don't need to define its view representation because it's handled by
- * the {@link module:paragraph/paragraph~Paragraph} feature (which is required by
- * the {@link module:heading/headingediting~HeadingEditing} feature).
- *
- * You can **read more** about configuring heading levels and **see more examples** in
- * the {@glink features/headings Headings} guide.
- *
- * Note: In the model you should always start from `heading1`, regardless of how the headings are represented in the view.
- * That's assumption is used by features like {@link module:autoformat/autoformat~Autoformat} to know which element
- * they should use when applying the first level heading.
- *
- * The defined headings are also available as values passed to the `'heading'` command under their model names.
- * For example, the below code will apply `<heading1>` to the current selection:
- *
- * editor.execute( 'heading', { value: 'heading1' } );
- *
- * @member {Array.<module:heading/heading~HeadingOption>} module:heading/heading~HeadingConfig#options
- */
- /**
- * Heading option descriptor.
- *
- * @typedef {Object} module:heading/heading~HeadingOption
- * @property {String} model Name of the model element to convert.
- * @property {module:engine/view/elementdefinition~ElementDefinition} view Definition of a view element to convert from/to.
- * @property {String} title The user-readable title of the option.
- * @property {String} class The class which will be added to the dropdown item representing this option.
- * @property {String} [icon] Icon used by {@link module:heading/headingbuttonsui~HeadingButtonsUI}. It can be omitted when using
- * the default configuration.
- * @extends module:engine/conversion/conversion~ConverterDefinition
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadingCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module heading/headingcommand
- */
- /**
- * The heading command. It is used by the {@link module:heading/heading~Heading heading feature} to apply headings.
- *
- * @extends module:core/command~Command
- */
- class HeadingCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * Creates an instance of the command.
- *
- * @param {module:core/editor/editor~Editor} editor Editor instance.
- * @param {Array.<String>} modelElements Names of the element which this command can apply in the model.
- */
- constructor( editor, modelElements ) {
- super( editor );
- /**
- * If the selection starts in a heading (which {@link #modelElements is supported by this command})
- * the value is set to the name of that heading model element.
- * It is set to `false` otherwise.
- *
- * @observable
- * @readonly
- * @member {Boolean|String} #value
- */
- /**
- * Set of defined model's elements names that this command support.
- * See {@link module:heading/heading~HeadingOption}.
- *
- * @readonly
- * @member {Array.<String>}
- */
- this.modelElements = modelElements;
- }
- /**
- * @inheritDoc
- */
- refresh() {
- const block = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this.editor.model.document.selection.getSelectedBlocks() );
- this.value = !!block && this.modelElements.includes( block.name ) && block.name;
- this.isEnabled = !!block && this.modelElements.some( heading => checkCanBecomeHeading( block, heading, this.editor.model.schema ) );
- }
- /**
- * Executes the command. Applies the heading to the selected blocks or, if the first selected
- * block is a heading already, turns selected headings (of this level only) to paragraphs.
- *
- * @param {Object} options
- * @param {String} options.value Name of the element which this command will apply in the model.
- * @fires execute
- */
- execute( options ) {
- const model = this.editor.model;
- const document = model.document;
- const modelElement = options.value;
- model.change( writer => {
- const blocks = Array.from( document.selection.getSelectedBlocks() )
- .filter( block => {
- return checkCanBecomeHeading( block, modelElement, model.schema );
- } );
- for ( const block of blocks ) {
- if ( !block.is( 'element', modelElement ) ) {
- writer.rename( block, modelElement );
- }
- }
- } );
- }
- }
- // Checks whether the given block can be replaced by a specific heading.
- //
- // @private
- // @param {module:engine/model/element~Element} block A block to be tested.
- // @param {module:heading/headingcommand~HeadingCommand#modelElement} heading Command element name in the model.
- // @param {module:engine/model/schema~Schema} schema The schema of the document.
- // @returns {Boolean}
- function checkCanBecomeHeading( block, heading, schema ) {
- return schema.checkChild( block.parent, heading ) && !schema.isObject( block );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadingEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_paragraph__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/paragraph */ "./node_modules/ckeditor5/src/paragraph.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _headingcommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./headingcommand */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module heading/headingediting
- */
- const defaultModelElement = 'paragraph';
- /**
- * The headings engine feature. It handles switching between block formats – headings and paragraph.
- * This class represents the engine part of the heading feature. See also {@link module:heading/heading~Heading}.
- * It introduces `heading1`-`headingN` commands which allow to convert paragraphs into headings.
- *
- * @extends module:core/plugin~Plugin
- */
- class HeadingEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'HeadingEditing';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- editor.config.define( 'heading', {
- options: [
- { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
- { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
- { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
- { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
- ]
- } );
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_paragraph__WEBPACK_IMPORTED_MODULE_1__["Paragraph"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const options = editor.config.get( 'heading.options' );
- const modelElements = [];
- for ( const option of options ) {
- // Skip paragraph - it is defined in required Paragraph feature.
- if ( option.model !== defaultModelElement ) {
- // Schema.
- editor.model.schema.register( option.model, {
- inheritAllFrom: '$block'
- } );
- editor.conversion.elementToElement( option );
- modelElements.push( option.model );
- }
- }
- this._addDefaultH1Conversion( editor );
- // Register the heading command for this option.
- editor.commands.add( 'heading', new _headingcommand__WEBPACK_IMPORTED_MODULE_3__["default"]( editor, modelElements ) );
- }
- /**
- * @inheritDoc
- */
- afterInit() {
- // If the enter command is added to the editor, alter its behavior.
- // Enter at the end of a heading element should create a paragraph.
- const editor = this.editor;
- const enterCommand = editor.commands.get( 'enter' );
- const options = editor.config.get( 'heading.options' );
- if ( enterCommand ) {
- this.listenTo( enterCommand, 'afterExecute', ( evt, data ) => {
- const positionParent = editor.model.document.selection.getFirstPosition().parent;
- const isHeading = options.some( option => positionParent.is( 'element', option.model ) );
- if ( isHeading && !positionParent.is( 'element', defaultModelElement ) && positionParent.childCount === 0 ) {
- data.writer.rename( positionParent, defaultModelElement );
- }
- } );
- }
- }
- /**
- * Adds default conversion for `h1` -> `heading1` with a low priority.
- *
- * @private
- * @param {module:core/editor/editor~Editor} editor Editor instance on which to add the `h1` conversion.
- */
- _addDefaultH1Conversion( editor ) {
- editor.conversion.for( 'upcast' ).elementToElement( {
- model: 'heading1',
- view: 'h1',
- // With a `low` priority, `paragraph` plugin autoparagraphing mechanism is executed. Make sure
- // this listener is called before it. If not, `h1` will be transformed into a paragraph.
- converterPriority: ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["priorities"].get( 'low' ) + 1
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadingUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-heading/src/utils.js");
- /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/heading.css */ "./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css");
- /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_heading_css__WEBPACK_IMPORTED_MODULE_4__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module heading/headingui
- */
- /**
- * The headings UI feature. It introduces the `headings` dropdown.
- *
- * @extends module:core/plugin~Plugin
- */
- class HeadingUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'HeadingUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const t = editor.t;
- const options = Object(_utils__WEBPACK_IMPORTED_MODULE_3__["getLocalizedOptions"])( editor );
- const defaultTitle = t( 'Choose heading' );
- const dropdownTooltip = t( 'Heading' );
- // Register UI component.
- editor.ui.componentFactory.add( 'heading', locale => {
- const titles = {};
- const itemDefinitions = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["Collection"]();
- const headingCommand = editor.commands.get( 'heading' );
- const paragraphCommand = editor.commands.get( 'paragraph' );
- const commands = [ headingCommand ];
- for ( const option of options ) {
- const def = {
- type: 'button',
- model: new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Model"]( {
- label: option.title,
- class: option.class,
- withText: true
- } )
- };
- if ( option.model === 'paragraph' ) {
- def.model.bind( 'isOn' ).to( paragraphCommand, 'value' );
- def.model.set( 'commandName', 'paragraph' );
- commands.push( paragraphCommand );
- } else {
- def.model.bind( 'isOn' ).to( headingCommand, 'value', value => value === option.model );
- def.model.set( {
- commandName: 'heading',
- commandValue: option.model
- } );
- }
- // Add the option to the collection.
- itemDefinitions.add( def );
- titles[ option.model ] = option.title;
- }
- const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
- Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addListToDropdown"])( dropdownView, itemDefinitions );
- dropdownView.buttonView.set( {
- isOn: false,
- withText: true,
- tooltip: dropdownTooltip
- } );
- dropdownView.extendTemplate( {
- attributes: {
- class: [
- 'ck-heading-dropdown'
- ]
- }
- } );
- dropdownView.bind( 'isEnabled' ).toMany( commands, 'isEnabled', ( ...areEnabled ) => {
- return areEnabled.some( isEnabled => isEnabled );
- } );
- dropdownView.buttonView.bind( 'label' ).to( headingCommand, 'value', paragraphCommand, 'value', ( value, para ) => {
- const whichModel = value || para && 'paragraph';
- // If none of the commands is active, display default title.
- return titles[ whichModel ] ? titles[ whichModel ] : defaultTitle;
- } );
- // Execute command when an item from the dropdown is selected.
- this.listenTo( dropdownView, 'execute', evt => {
- editor.execute( evt.source.commandName, evt.source.commandValue ? { value: evt.source.commandValue } : undefined );
- editor.editing.view.focus();
- } );
- return dropdownView;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/utils.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-heading/src/utils.js ***!
- \***************************************************************/
- /*! exports provided: getLocalizedOptions */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedOptions", function() { return getLocalizedOptions; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module heading/utils
- */
- /**
- * Returns heading options as defined in `config.heading.options` but processed to consider
- * the editor localization, i.e. to display {@link module:heading/heading~HeadingOption}
- * in the correct language.
- *
- * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
- * when the user configuration is defined because the editor does not exist yet.
- *
- * @param {module:core/editor/editor~Editor} editor
- * @returns {Array.<module:heading/heading~HeadingOption>}.
- */
- function getLocalizedOptions( editor ) {
- const t = editor.t;
- const localizedTitles = {
- Paragraph: t( 'Paragraph' ),
- 'Heading 1': t( 'Heading 1' ),
- 'Heading 2': t( 'Heading 2' ),
- 'Heading 3': t( 'Heading 3' ),
- 'Heading 4': t( 'Heading 4' ),
- 'Heading 5': t( 'Heading 5' ),
- 'Heading 6': t( 'Heading 6' )
- };
- return editor.config.get( 'heading.options' ).map( option => {
- const title = localizedTitles[ option.title ];
- if ( title && title != option.title ) {
- option.title = title;
- }
- return option;
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css ***!
- \********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./heading.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembed.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembed.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlEmbed; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /* harmony import */ var _htmlembedediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./htmlembedediting */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedediting.js");
- /* harmony import */ var _htmlembedui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./htmlembedui */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module html-embed/htmlembed
- */
- /**
- * The HTML embed feature.
- *
- * It allows inserting HTML snippets directly into the editor.
- *
- * For a detailed overview, check the {@glink features/html-embed HTML embed feature} documentation.
- *
- * @extends module:core/plugin~Plugin
- */
- class HtmlEmbed extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _htmlembedediting__WEBPACK_IMPORTED_MODULE_2__["default"], _htmlembedui__WEBPACK_IMPORTED_MODULE_3__["default"], ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["Widget"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'HtmlEmbed';
- }
- }
- /**
- * The configuration of the HTML embed feature.
- *
- * ClassicEditor
- * .create( editorElement, {
- * htmlEmbed: ... // HTML embed feature options.
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- *
- * @interface HtmlEmbedConfig
- */
- /**
- * Whether the feature should render previews of the embedded HTML.
- *
- * When set to `true`, the feature will produce a preview of the inserted HTML based on a sanitized
- * version of the HTML provided by the user.
- *
- * The function responsible for sanitizing the HTML needs to be specified in
- * {@link module:html-embed/htmlembed~HtmlEmbedConfig#sanitizeHtml `config.htmlEmbed.sanitizeHtml()`}.
- *
- * Read more about the security aspect of this feature in the {@glink features/html-embed#security "Security"} section of
- * the {@glink features/html-embed HTML embed} feature guide.
- *
- * @member {Boolean} [module:html-embed/htmlembed~HtmlEmbedConfig#showPreviews=false]
- */
- /**
- * Callback used to sanitize the HTML provided by the user when generating previews of it in the editor.
- *
- * We strongly recommend overwriting the default function to avoid XSS vulnerabilities.
- *
- * Read more about the security aspect of this feature in the {@glink features/html-embed#security "Security"} section of
- * the {@glink features/html-embed HTML embed} feature guide.
- *
- * The function receives the input HTML (as a string), and should return an object
- * that matches the {@link module:html-embed/htmlembed~HtmlEmbedSanitizeOutput} interface.
- *
- * ClassicEditor
- * .create( editorElement, {
- * htmlEmbed: {
- * showPreviews: true,
- * sanitizeHtml( inputHtml ) {
- * // Strip unsafe elements and attributes, e.g.:
- * // the `<script>` elements and `on*` attributes.
- * const outputHtml = sanitize( inputHtml );
- *
- * return {
- * html: outputHtml,
- * // true or false depending on whether the sanitizer stripped anything.
- * hasChanged: ...
- * };
- * },
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * **Note:** The function is used only when the feature
- * {@link module:html-embed/htmlembed~HtmlEmbedConfig#showPreviews is configured to render previews}.
- *
- * @member {Function} [module:html-embed/htmlembed~HtmlEmbedConfig#sanitizeHtml]
- */
- /**
- * An object returned by the {@link module:html-embed/htmlembed~HtmlEmbedConfig#sanitizeHtml} function.
- *
- * @interface HtmlEmbedSanitizeOutput
- */
- /**
- * An output (safe) HTML that will be inserted into the {@glink framework/guides/architecture/editing-engine editing view}.
- *
- * @member {String} module:html-embed/htmlembed~HtmlEmbedSanitizeOutput#html
- */
- /**
- * A flag that indicates whether the output HTML is different than the input value.
- *
- * @member {Boolean} [module:html-embed/htmlembed~HtmlEmbedSanitizeOutput#hasChanged]
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedediting.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedediting.js ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlEmbedEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _inserthtmlembedcommand__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./inserthtmlembedcommand */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/inserthtmlembedcommand.js");
- /* harmony import */ var _updatehtmlembedcommand__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./updatehtmlembedcommand */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/updatehtmlembedcommand.js");
- /* harmony import */ var _theme_htmlembed_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../theme/htmlembed.css */ "./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css");
- /* harmony import */ var _theme_htmlembed_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_theme_htmlembed_css__WEBPACK_IMPORTED_MODULE_6__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module html-embed/htmlembedediting
- */
- /**
- * The HTML embed editing feature.
- *
- * @extends module:core/plugin~Plugin
- */
- class HtmlEmbedEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'HtmlEmbedEditing';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- editor.config.define( 'htmlEmbed', {
- showPreviews: false,
- sanitizeHtml: rawHtml => {
- /**
- * When using the HTML embed feature with the `htmlEmbed.showPreviews=true` option, it is strongly recommended to
- * define a sanitize function that will clean up the input HTML in order to avoid XSS vulnerability.
- *
- * For a detailed overview, check the {@glink features/html-embed HTML embed feature} documentation.
- *
- * @error html-embed-provide-sanitize-function
- */
- Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["logWarning"])( 'html-embed-provide-sanitize-function' );
- return {
- html: rawHtml,
- hasChanged: false
- };
- }
- } );
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const schema = editor.model.schema;
- schema.register( 'rawHtml', {
- isObject: true,
- allowWhere: '$block',
- allowAttributes: [ 'value' ]
- } );
- editor.commands.add( 'updateHtmlEmbed', new _updatehtmlembedcommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor ) );
- editor.commands.add( 'insertHtmlEmbed', new _inserthtmlembedcommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor ) );
- this._setupConversion();
- }
- /**
- * Prepares converters for the feature.
- *
- * @private
- */
- _setupConversion() {
- const editor = this.editor;
- const t = editor.t;
- const view = editor.editing.view;
- const htmlEmbedConfig = editor.config.get( 'htmlEmbed' );
- // Register div.raw-html-embed as a raw content element so all of it's content will be provided
- // as a view element's custom property while data upcasting.
- editor.data.registerRawContentMatcher( {
- name: 'div',
- classes: 'raw-html-embed'
- } );
- editor.conversion.for( 'upcast' ).elementToElement( {
- view: {
- name: 'div',
- classes: 'raw-html-embed'
- },
- model: ( viewElement, { writer } ) => {
- // The div.raw-html-embed is registered as a raw content element,
- // so all it's content is available in a custom property.
- return writer.createElement( 'rawHtml', {
- value: viewElement.getCustomProperty( '$rawContent' )
- } );
- }
- } );
- editor.conversion.for( 'dataDowncast' ).elementToElement( {
- model: 'rawHtml',
- view: ( modelElement, { writer } ) => {
- return writer.createRawElement( 'div', { class: 'raw-html-embed' }, function( domElement ) {
- domElement.innerHTML = modelElement.getAttribute( 'value' ) || '';
- } );
- }
- } );
- editor.conversion.for( 'editingDowncast' ).elementToElement( {
- triggerBy: {
- attributes: [ 'value' ]
- },
- model: 'rawHtml',
- view: ( modelElement, { writer } ) => {
- let domContentWrapper, state, props;
- const viewContainer = writer.createContainerElement( 'div', {
- class: 'raw-html-embed',
- 'data-html-embed-label': t( 'HTML snippet' ),
- dir: editor.locale.uiLanguageDirection
- } );
- // Widget cannot be a raw element because the widget system would not be able
- // to add its UI to it. Thus, we need this wrapper.
- const viewContentWrapper = writer.createRawElement( 'div', {
- class: 'raw-html-embed__content-wrapper'
- }, function( domElement ) {
- domContentWrapper = domElement;
- renderContent( { domElement, editor, state, props } );
- // Since there is a `data-cke-ignore-events` attribute set on the wrapper element in the editable mode,
- // the explicit `mousedown` handler on the `capture` phase is needed to move the selection onto the whole
- // HTML embed widget.
- domContentWrapper.addEventListener( 'mousedown', () => {
- if ( state.isEditable ) {
- const model = editor.model;
- const selectedElement = model.document.selection.getSelectedElement();
- // Move the selection onto the whole HTML embed widget if it's currently not selected.
- if ( selectedElement !== modelElement ) {
- model.change( writer => writer.setSelection( modelElement, 'on' ) );
- }
- }
- }, true );
- } );
- // API exposed on each raw HTML embed widget so other features can control a particular widget.
- const rawHtmlApi = {
- makeEditable() {
- state = Object.assign( {}, state, {
- isEditable: true
- } );
- renderContent( { domElement: domContentWrapper, editor, state, props } );
- view.change( writer => {
- writer.setAttribute( 'data-cke-ignore-events', 'true', viewContentWrapper );
- } );
- // This could be potentially pulled to a separate method called focusTextarea().
- domContentWrapper.querySelector( 'textarea' ).focus();
- },
- save( newValue ) {
- // If the value didn't change, we just cancel. If it changed,
- // it's enough to update the model – the entire widget will be reconverted.
- if ( newValue !== state.getRawHtmlValue() ) {
- editor.execute( 'updateHtmlEmbed', newValue );
- editor.editing.view.focus();
- } else {
- this.cancel();
- }
- },
- cancel() {
- state = Object.assign( {}, state, {
- isEditable: false
- } );
- renderContent( { domElement: domContentWrapper, editor, state, props } );
- editor.editing.view.focus();
- view.change( writer => {
- writer.removeAttribute( 'data-cke-ignore-events', viewContentWrapper );
- } );
- }
- };
- state = {
- showPreviews: htmlEmbedConfig.showPreviews,
- isEditable: false,
- getRawHtmlValue: () => modelElement.getAttribute( 'value' ) || ''
- };
- props = {
- sanitizeHtml: htmlEmbedConfig.sanitizeHtml,
- textareaPlaceholder: t( 'Paste raw HTML here...' ),
- onEditClick() {
- rawHtmlApi.makeEditable();
- },
- onSaveClick( newValue ) {
- rawHtmlApi.save( newValue );
- },
- onCancelClick() {
- rawHtmlApi.cancel();
- }
- };
- writer.insert( writer.createPositionAt( viewContainer, 0 ), viewContentWrapper );
- writer.setCustomProperty( 'rawHtmlApi', rawHtmlApi, viewContainer );
- writer.setCustomProperty( 'rawHtml', true, viewContainer );
- return Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_2__["toWidget"])( viewContainer, writer, {
- widgetLabel: t( 'HTML snippet' ),
- hasSelectionHandle: true
- } );
- }
- } );
- function renderContent( { domElement, editor, state, props } ) {
- // Remove all children;
- domElement.textContent = '';
- const domDocument = domElement.ownerDocument;
- let domTextarea;
- if ( state.isEditable ) {
- const textareaProps = {
- isDisabled: false,
- placeholder: props.textareaPlaceholder
- };
- domTextarea = createDomTextarea( { domDocument, state, props: textareaProps } );
- domElement.append( domTextarea );
- } else if ( state.showPreviews ) {
- const previewContainerProps = {
- sanitizeHtml: props.sanitizeHtml
- };
- domElement.append( createPreviewContainer( { domDocument, state, props: previewContainerProps, editor } ) );
- } else {
- const textareaProps = {
- isDisabled: true,
- placeholder: props.textareaPlaceholder
- };
- domElement.append( createDomTextarea( { domDocument, state, props: textareaProps } ) );
- }
- const buttonsWrapperProps = {
- onEditClick: props.onEditClick,
- onSaveClick: () => {
- props.onSaveClick( domTextarea.value );
- },
- onCancelClick: props.onCancelClick
- };
- domElement.prepend( createDomButtonsWrapper( { editor, domDocument, state, props: buttonsWrapperProps } ) );
- }
- function createDomButtonsWrapper( { editor, domDocument, state, props } ) {
- const domButtonsWrapper = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'div', {
- class: 'raw-html-embed__buttons-wrapper'
- } );
- // TODO these should be cached and we should only clone here these cached nodes!
- const domEditButton = createDomButton( editor, 'edit' );
- const domSaveButton = createDomButton( editor, 'save' );
- const domCancelButton = createDomButton( editor, 'cancel' );
- if ( state.isEditable ) {
- const clonedDomSaveButton = domSaveButton.cloneNode( true );
- const clonedDomCancelButton = domCancelButton.cloneNode( true );
- clonedDomSaveButton.addEventListener( 'click', evt => {
- evt.preventDefault();
- props.onSaveClick( );
- } );
- clonedDomCancelButton.addEventListener( 'click', evt => {
- evt.preventDefault();
- props.onCancelClick( );
- } );
- domButtonsWrapper.appendChild( clonedDomSaveButton );
- domButtonsWrapper.appendChild( clonedDomCancelButton );
- } else {
- const clonedDomEditButton = domEditButton.cloneNode( true );
- clonedDomEditButton.addEventListener( 'click', evt => {
- evt.preventDefault();
- props.onEditClick();
- } );
- domButtonsWrapper.appendChild( clonedDomEditButton );
- }
- return domButtonsWrapper;
- }
- function createDomTextarea( { domDocument, state, props } ) {
- const domTextarea = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'textarea', {
- placeholder: props.placeholder,
- class: 'ck ck-reset ck-input ck-input-text raw-html-embed__source'
- } );
- domTextarea.disabled = props.isDisabled;
- domTextarea.value = state.getRawHtmlValue();
- return domTextarea;
- }
- function createPreviewContainer( { domDocument, state, props, editor } ) {
- const sanitizedOutput = props.sanitizeHtml( state.getRawHtmlValue() );
- const placeholderText = state.getRawHtmlValue().length > 0 ?
- t( 'No preview available' ) :
- t( 'Empty snippet content' );
- const domPreviewPlaceholder = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'div', {
- class: 'ck ck-reset_all raw-html-embed__preview-placeholder'
- }, placeholderText );
- const domPreviewContent = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'div', {
- class: 'raw-html-embed__preview-content',
- dir: editor.locale.contentLanguageDirection
- } );
- // Creating a contextual document fragment allows executing scripts when inserting into the preview element.
- // See: #8326.
- const domRange = domDocument.createRange();
- const domDocumentFragment = domRange.createContextualFragment( sanitizedOutput.html );
- domPreviewContent.appendChild( domDocumentFragment );
- const domPreviewContainer = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'div', {
- class: 'raw-html-embed__preview'
- }, [
- domPreviewPlaceholder, domPreviewContent
- ] );
- return domPreviewContainer;
- }
- }
- }
- // Returns a toggle mode button DOM element that can be cloned and used in conversion.
- //
- // @param {module:utils/locale~Locale} locale Editor locale.
- // @param {'edit'|'save'|'cancel'} type Type of button to create.
- // @returns {HTMLElement}
- function createDomButton( editor, type ) {
- const t = editor.locale.t;
- const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( editor.locale );
- const command = editor.commands.get( 'updateHtmlEmbed' );
- buttonView.set( {
- tooltipPosition: editor.locale.uiLanguageDirection === 'rtl' ? 'e' : 'w',
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].pencil,
- tooltip: true
- } );
- buttonView.render();
- if ( type === 'edit' ) {
- buttonView.set( {
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].pencil,
- label: t( 'Edit source' ),
- class: 'raw-html-embed__edit-button'
- } );
- } else if ( type === 'save' ) {
- buttonView.set( {
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].check,
- label: t( 'Save changes' ),
- class: 'raw-html-embed__save-button'
- } );
- buttonView.bind( 'isEnabled' ).to( command, 'isEnabled' );
- } else {
- buttonView.set( {
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].cancel,
- label: t( 'Cancel' ),
- class: 'raw-html-embed__cancel-button'
- } );
- }
- buttonView.destroy();
- return buttonView.element.cloneNode( true );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedui.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedui.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlEmbedUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _theme_icons_html_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/html.svg */ "./node_modules/@ckeditor/ckeditor5-html-embed/theme/icons/html.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module html-embed/htmlembedui
- */
- /**
- * The HTML embed UI plugin.
- *
- * @extends module:core/plugin~Plugin
- */
- class HtmlEmbedUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'HtmlEmbedUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const t = editor.t;
- // Add the `htmlEmbed` button to feature components.
- editor.ui.componentFactory.add( 'htmlEmbed', locale => {
- const command = editor.commands.get( 'insertHtmlEmbed' );
- const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- view.set( {
- label: t( 'Insert HTML' ),
- icon: _theme_icons_html_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
- tooltip: true
- } );
- view.bind( 'isEnabled' ).to( command, 'isEnabled' );
- // Execute the command.
- this.listenTo( view, 'execute', () => {
- editor.execute( 'insertHtmlEmbed' );
- editor.editing.view.focus();
- const widgetWrapper = editor.editing.view.document.selection.getSelectedElement();
- widgetWrapper.getCustomProperty( 'rawHtmlApi' ).makeEditable();
- } );
- return view;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/inserthtmlembedcommand.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/inserthtmlembedcommand.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertHtmlEmbedCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module html-embed/inserthtmlembedcommand
- */
- /**
- * The insert HTML embed element command.
- *
- * The command is registered by {@link module:html-embed/htmlembedediting~HtmlEmbedEditing} as `'insertHtmlEmbed'`.
- *
- * To insert the HTML embed element at the current selection, execute the command:
- *
- * editor.execute( 'insertHtmlEmbed' );
- *
- * @extends module:core/command~Command
- */
- class InsertHtmlEmbedCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- this.isEnabled = isHtmlEmbedAllowed( this.editor.model );
- }
- /**
- * Executes the command, which creates and inserts a new HTML embed element.
- *
- * @fires execute
- */
- execute() {
- const model = this.editor.model;
- model.change( writer => {
- const rawHtmlElement = writer.createElement( 'rawHtml' );
- model.insertContent( rawHtmlElement );
- writer.setSelection( rawHtmlElement, 'on' );
- } );
- }
- }
- // Checks if the `htmlEmbed` element can be inserted at the current model selection.
- //
- // @param {module:engine/model/model~Model} model
- // @returns {Boolean}
- function isHtmlEmbedAllowed( model ) {
- const schema = model.schema;
- const selection = model.document.selection;
- return isHtmlEmbedAllowedInParent( selection, schema, model ) &&
- !Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["checkSelectionOnObject"])( selection, schema );
- }
- // Checks if an HTML embed is allowed by the schema in the optimal insertion parent.
- //
- // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- // @param {module:engine/model/schema~Schema} schema
- // @param {module:engine/model/model~Model} model Model instance.
- // @returns {Boolean}
- function isHtmlEmbedAllowedInParent( selection, schema, model ) {
- const parent = getInsertPageBreakParent( selection, model );
- return schema.checkChild( parent, 'rawHtml' );
- }
- // Returns a node that will be used to insert a page break with `model.insertContent` to check if a html embed element can be placed there.
- //
- // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- // @param {module:engine/model/model~Model} model Model instance.
- // @returns {module:engine/model/element~Element}
- function getInsertPageBreakParent( selection, model ) {
- const insertAt = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["findOptimalInsertionPosition"])( selection, model );
- const parent = insertAt.parent;
- if ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {
- return parent.parent;
- }
- return parent;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/updatehtmlembedcommand.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/updatehtmlembedcommand.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpdateHtmlEmbedCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module html-embed/updatehtmlembedcommand
- */
- /**
- * The update HTML embed value command.
- *
- * The command is registered by {@link module:html-embed/htmlembedediting~HtmlEmbedEditing} as `'updateHtmlEmbed'`.
- *
- * To update the value of the HTML embed element at the current selection, execute the command:
- *
- * editor.execute( 'updateHtmlEmbed', '<b>HTML.</b>' );
- *
- * @extends module:core/command~Command
- */
- class UpdateHtmlEmbedCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const model = this.editor.model;
- const selection = model.document.selection;
- const rawHtmlElement = getSelectedRawHtmlModelWidget( selection );
- this.isEnabled = !!rawHtmlElement;
- }
- /**
- * Executes the command, which updates the `value` attribute of the embedded HTML element:
- *
- * @fires execute
- * @param {String} value HTML as a string.
- */
- execute( value ) {
- const model = this.editor.model;
- const selection = model.document.selection;
- const selectedRawHtmlElement = getSelectedRawHtmlModelWidget( selection );
- model.change( writer => {
- writer.setAttribute( 'value', value, selectedRawHtmlElement );
- } );
- }
- }
- // Returns the selected HTML embed element in the model, if any.
- //
- // @param {module:engine/model/selection~Selection} selection
- // @returns {module:engine/model/element~Element|null}
- function getSelectedRawHtmlModelWidget( selection ) {
- const selectedElement = selection.getSelectedElement();
- if ( selectedElement && selectedElement.is( 'element', 'rawHtml' ) ) {
- return selectedElement;
- }
- return null;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css":
- /*!*************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css ***!
- \*************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./htmlembed.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/theme/icons/html.svg":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-html-embed/theme/icons/html.svg ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17 0a2 2 0 0 1 2 2v7a1 1 0 0 1 1 1v5a1 1 0 0 1-.883.993l-.118.006L19 17a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2l-.001-1.001-.116-.006A1 1 0 0 1 0 15v-5a1 1 0 0 1 .999-1L1 2a2 2 0 0 1 2-2h14zm.499 15.999h-15L2.5 17a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5l-.001-1.001zm-3.478-6.013-.014.014H14v.007l-1.525 1.525-1.46-1.46-.015.013V10h-1v5h1v-3.53l1.428 1.43.048.043.131-.129L14 11.421V15h1v-5h-.965l-.014-.014zM2 10H1v5h1v-2h2v2h1v-5H4v2H2v-2zm7 0H6v1h1v4h1v-4h1v-1zm8 0h-1v5h3v-1h-2v-4zm0-8.5H3a.5.5 0 0 0-.5.5l-.001 6.999h15L17.5 2a.5.5 0 0 0-.5-.5zM10 7v1H4V7h6zm3-2v1H4V5h9zm-3-2v1H4V3h6z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/image.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Image; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /* harmony import */ var _image_imageediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./image/imageediting */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js");
- /* harmony import */ var _imagetextalternative__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imagetextalternative */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js");
- /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /* harmony import */ var _theme_image_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme/image.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/image.css");
- /* harmony import */ var _theme_image_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_image_css__WEBPACK_IMPORTED_MODULE_5__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/image
- */
- /**
- * The image plugin.
- *
- * For a detailed overview, check the {@glink features/image image feature} documentation.
- *
- * This is a "glue" plugin which loads the following plugins:
- *
- * * {@link module:image/image/imageediting~ImageEditing},
- * * {@link module:image/imagetextalternative~ImageTextAlternative}.
- *
- * Usually, it is used in conjuction with other plugins from this package. See the {@glink api/image package page}
- * for more information.
- *
- * @extends module:core/plugin~Plugin
- */
- class Image extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _image_imageediting__WEBPACK_IMPORTED_MODULE_2__["default"], ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["Widget"], _imagetextalternative__WEBPACK_IMPORTED_MODULE_3__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Image';
- }
- /**
- * Checks if a given view element is an image widget.
- *
- * @param {module:engine/view/element~Element} viewElement
- * @returns {Boolean}
- */
- isImageWidget( viewElement ) {
- return Object(_image_utils__WEBPACK_IMPORTED_MODULE_4__["isImageWidget"])( viewElement );
- }
- }
- /**
- * The configuration of the image features. Used by the image features in the `@ckeditor/ckeditor5-image` package.
- *
- * Read more in {@link module:image/image~ImageConfig}.
- *
- * @member {module:image/image~ImageConfig} module:core/editor/editorconfig~EditorConfig#image
- */
- /**
- * The configuration of the image features. Used by the image features in the `@ckeditor/ckeditor5-image` package.
- *
- * ClassicEditor
- * .create( editorElement, {
- * image: ... // Image feature options.
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- *
- * @interface ImageConfig
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js ***!
- \************************************************************************/
- /*! exports provided: viewFigureToModel, srcsetAttributeConverter, modelToViewAttributeConverter */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewFigureToModel", function() { return viewFigureToModel; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "srcsetAttributeConverter", function() { return srcsetAttributeConverter; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelToViewAttributeConverter", function() { return modelToViewAttributeConverter; });
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/image/converters
- */
- /**
- * Returns a function that converts the image view representation:
- *
- * <figure class="image"><img src="..." alt="..."></img></figure>
- *
- * to the model representation:
- *
- * <image src="..." alt="..."></image>
- *
- * The entire content of the `<figure>` element except the first `<img>` is being converted as children
- * of the `<image>` model element.
- *
- * @returns {Function}
- */
- function viewFigureToModel() {
- return dispatcher => {
- dispatcher.on( 'element:figure', converter );
- };
- function converter( evt, data, conversionApi ) {
- // Do not convert if this is not an "image figure".
- if ( !conversionApi.consumable.test( data.viewItem, { name: true, classes: 'image' } ) ) {
- return;
- }
- // Find an image element inside the figure element.
- const viewImage = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getViewImgFromWidget"])( data.viewItem );
- // Do not convert if image element is absent, is missing src attribute or was already converted.
- if ( !viewImage || !viewImage.hasAttribute( 'src' ) || !conversionApi.consumable.test( viewImage, { name: true } ) ) {
- return;
- }
- // Convert view image to model image.
- const conversionResult = conversionApi.convertItem( viewImage, data.modelCursor );
- // Get image element from conversion result.
- const modelImage = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["first"])( conversionResult.modelRange.getItems() );
- // When image wasn't successfully converted then finish conversion.
- if ( !modelImage ) {
- return;
- }
- // Convert rest of the figure element's children as an image children.
- conversionApi.convertChildren( data.viewItem, modelImage );
- conversionApi.updateConversionResult( modelImage, data );
- }
- }
- /**
- * Converter used to convert the `srcset` model image attribute to the `srcset`, `sizes` and `width` attributes in the view.
- *
- * @returns {Function}
- */
- function srcsetAttributeConverter() {
- return dispatcher => {
- dispatcher.on( 'attribute:srcset:image', converter );
- };
- function converter( evt, data, conversionApi ) {
- if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
- return;
- }
- const writer = conversionApi.writer;
- const figure = conversionApi.mapper.toViewElement( data.item );
- const img = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getViewImgFromWidget"])( figure );
- if ( data.attributeNewValue === null ) {
- const srcset = data.attributeOldValue;
- if ( srcset.data ) {
- writer.removeAttribute( 'srcset', img );
- writer.removeAttribute( 'sizes', img );
- if ( srcset.width ) {
- writer.removeAttribute( 'width', img );
- }
- }
- } else {
- const srcset = data.attributeNewValue;
- if ( srcset.data ) {
- writer.setAttribute( 'srcset', srcset.data, img );
- // Always outputting `100vw`. See https://github.com/ckeditor/ckeditor5-image/issues/2.
- writer.setAttribute( 'sizes', '100vw', img );
- if ( srcset.width ) {
- writer.setAttribute( 'width', srcset.width, img );
- }
- }
- }
- }
- }
- function modelToViewAttributeConverter( attributeKey ) {
- return dispatcher => {
- dispatcher.on( `attribute:${ attributeKey }:image`, converter );
- };
- function converter( evt, data, conversionApi ) {
- if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
- return;
- }
- const viewWriter = conversionApi.writer;
- const figure = conversionApi.mapper.toViewElement( data.item );
- const img = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getViewImgFromWidget"])( figure );
- viewWriter.setAttribute( data.attributeKey, data.attributeNewValue || '', img );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js ***!
- \**************************************************************************/
- /*! exports provided: default, createImageViewElement */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageEditing; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createImageViewElement", function() { return createImageViewElement; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _imageloadobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageloadobserver */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js");
- /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /* harmony import */ var _insertimagecommand__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./insertimagecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/image/imageediting
- */
- /**
- * The image engine plugin.
- *
- * It registers:
- *
- * * `<image>` as a block element in the document schema, and allows `alt`, `src` and `srcset` attributes.
- * * converters for editing and data pipelines.
- * * `'insertImage'` command.
- * * `'imageInsert'` command as an alias for `insertImage` command.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const schema = editor.model.schema;
- const t = editor.t;
- const conversion = editor.conversion;
- // See https://github.com/ckeditor/ckeditor5-image/issues/142.
- editor.editing.view.addObserver( _imageloadobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
- // Configure schema.
- schema.register( 'image', {
- isObject: true,
- isBlock: true,
- allowWhere: '$block',
- allowAttributes: [ 'alt', 'src', 'srcset' ]
- } );
- conversion.for( 'dataDowncast' ).elementToElement( {
- model: 'image',
- view: ( modelElement, { writer } ) => createImageViewElement( writer )
- } );
- conversion.for( 'editingDowncast' ).elementToElement( {
- model: 'image',
- view: ( modelElement, { writer } ) => Object(_utils__WEBPACK_IMPORTED_MODULE_3__["toImageWidget"])( createImageViewElement( writer ), writer, t( 'image widget' ) )
- } );
- conversion.for( 'downcast' )
- .add( Object(_converters__WEBPACK_IMPORTED_MODULE_2__["modelToViewAttributeConverter"])( 'src' ) )
- .add( Object(_converters__WEBPACK_IMPORTED_MODULE_2__["modelToViewAttributeConverter"])( 'alt' ) )
- .add( Object(_converters__WEBPACK_IMPORTED_MODULE_2__["srcsetAttributeConverter"])() );
- conversion.for( 'upcast' )
- .elementToElement( {
- view: {
- name: 'img',
- attributes: {
- src: true
- }
- },
- model: ( viewImage, { writer } ) => writer.createElement( 'image', { src: viewImage.getAttribute( 'src' ) } )
- } )
- .attributeToAttribute( {
- view: {
- name: 'img',
- key: 'alt'
- },
- model: 'alt'
- } )
- .attributeToAttribute( {
- view: {
- name: 'img',
- key: 'srcset'
- },
- model: {
- key: 'srcset',
- value: viewImage => {
- const value = {
- data: viewImage.getAttribute( 'srcset' )
- };
- if ( viewImage.hasAttribute( 'width' ) ) {
- value.width = viewImage.getAttribute( 'width' );
- }
- return value;
- }
- }
- } )
- .add( Object(_converters__WEBPACK_IMPORTED_MODULE_2__["viewFigureToModel"])() );
- const insertImageCommand = new _insertimagecommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor );
- // Register `insertImage` command and add `imageInsert` command as an alias for backward compatibility.
- editor.commands.add( 'insertImage', insertImageCommand );
- editor.commands.add( 'imageInsert', insertImageCommand );
- }
- }
- // Creates a view element representing the image.
- //
- // <figure class="image"><img></img></figure>
- //
- // Note that `alt` and `src` attributes are converted separately, so they are not included.
- //
- // @private
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- // @returns {module:engine/view/containerelement~ContainerElement}
- function createImageViewElement( writer ) {
- const emptyElement = writer.createEmptyElement( 'img' );
- const figure = writer.createContainerElement( 'figure', { class: 'image' } );
- writer.insert( writer.createPositionAt( figure, 0 ), emptyElement );
- return figure;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageLoadObserver; });
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/image/imageloadobserver
- */
- /**
- * Observes all new images added to the {@link module:engine/view/document~Document},
- * fires {@link module:engine/view/document~Document#event:imageLoaded} and
- * {@link module:engine/view/document~Document#event:layoutChanged} event every time when the new image
- * has been loaded.
- *
- * **Note:** This event is not fired for images that has been added to the document and rendered as `complete` (already loaded).
- *
- * @extends module:engine/view/observer/observer~Observer
- */
- class ImageLoadObserver extends ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Observer"] {
- /**
- * @inheritDoc
- */
- observe( domRoot ) {
- this.listenTo( domRoot, 'load', ( event, domEvent ) => {
- const domElement = domEvent.target;
- if ( this.checkShouldIgnoreEventFromTarget( domElement ) ) {
- return;
- }
- if ( domElement.tagName == 'IMG' ) {
- this._fireEvents( domEvent );
- }
- // Use capture phase for better performance (#4504).
- }, { useCapture: true } );
- }
- /**
- * Fires {@link module:engine/view/document~Document#event:layoutChanged} and
- * {@link module:engine/view/document~Document#event:imageLoaded}
- * if observer {@link #isEnabled is enabled}.
- *
- * @protected
- * @param {Event} domEvent The DOM event.
- */
- _fireEvents( domEvent ) {
- if ( this.isEnabled ) {
- this.document.fire( 'layoutChanged' );
- this.document.fire( 'imageLoaded', domEvent );
- }
- }
- }
- /**
- * Fired when an <img/> DOM element has been loaded in the DOM root.
- *
- * Introduced by {@link module:image/image/imageloadobserver~ImageLoadObserver}.
- *
- * @see module:image/image/imageloadobserver~ImageLoadObserver
- * @event module:engine/view/document~Document#event:imageLoaded
- * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.js ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertImageCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/image/insertimagecommand
- */
- /**
- * Insert image command.
- *
- * The command is registered by the {@link module:image/image/imageediting~ImageEditing} plugin as `insertImage`
- * and it is also available via aliased `imageInsert` name.
- *
- * In order to insert an image at the current selection position
- * (according to the {@link module:widget/utils~findOptimalInsertionPosition} algorithm),
- * execute the command and specify the image source:
- *
- * editor.execute( 'insertImage', { source: 'http://url.to.the/image' } );
- *
- * It is also possible to insert multiple images at once:
- *
- * editor.execute( 'insertImage', {
- * source: [
- * 'path/to/image.jpg',
- * 'path/to/other-image.jpg'
- * ]
- * } );
- *
- * @extends module:core/command~Command
- */
- class InsertImageCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- this.isEnabled = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isImageAllowed"])( this.editor.model );
- }
- /**
- * Executes the command.
- *
- * @fires execute
- * @param {Object} options Options for the executed command.
- * @param {String|Array.<String>} options.source The image source or an array of image sources to insert.
- */
- execute( options ) {
- const model = this.editor.model;
- for ( const src of Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["toArray"])( options.source ) ) {
- Object(_utils__WEBPACK_IMPORTED_MODULE_2__["insertImage"])( model, { src } );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js ***!
- \**********************************************************************/
- /*! exports provided: repositionContextualBalloon, getBalloonPositionData */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repositionContextualBalloon", function() { return repositionContextualBalloon; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBalloonPositionData", function() { return getBalloonPositionData; });
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/image/ui/utils
- */
- /**
- * A helper utility that positions the
- * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance
- * with respect to the image in the editor content, if one is selected.
- *
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- */
- function repositionContextualBalloon( editor ) {
- const balloon = editor.plugins.get( 'ContextualBalloon' );
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getSelectedImageWidget"])( editor.editing.view.document.selection ) ) {
- const position = getBalloonPositionData( editor );
- balloon.updatePosition( position );
- }
- }
- /**
- * Returns the positioning options that control the geometry of the
- * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect
- * to the selected element in the editor content.
- *
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- * @returns {module:utils/dom/position~Options}
- */
- function getBalloonPositionData( editor ) {
- const editingView = editor.editing.view;
- const defaultPositions = ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["BalloonPanelView"].defaultPositions;
- return {
- target: editingView.domConverter.viewToDom( editingView.document.selection.getSelectedElement() ),
- positions: [
- defaultPositions.northArrowSouth,
- defaultPositions.northArrowSouthWest,
- defaultPositions.northArrowSouthEast,
- defaultPositions.southArrowNorth,
- defaultPositions.southArrowNorthWest,
- defaultPositions.southArrowNorthEast
- ]
- };
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js ***!
- \*******************************************************************/
- /*! exports provided: toImageWidget, isImageWidget, getSelectedImageWidget, isImage, insertImage, isImageAllowed, getViewImgFromWidget */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toImageWidget", function() { return toImageWidget; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isImageWidget", function() { return isImageWidget; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedImageWidget", function() { return getSelectedImageWidget; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isImage", function() { return isImage; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertImage", function() { return insertImage; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isImageAllowed", function() { return isImageAllowed; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getViewImgFromWidget", function() { return getViewImgFromWidget; });
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/image/utils
- */
- /**
- * Converts a given {@link module:engine/view/element~Element} to an image widget:
- * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the image widget element.
- * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
- *
- * @param {module:engine/view/element~Element} viewElement
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer An instance of the view writer.
- * @param {String} label The element's label. It will be concatenated with the image `alt` attribute if one is present.
- * @returns {module:engine/view/element~Element}
- */
- function toImageWidget( viewElement, writer, label ) {
- writer.setCustomProperty( 'image', true, viewElement );
- return Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["toWidget"])( viewElement, writer, { label: labelCreator } );
- function labelCreator() {
- const imgElement = getViewImgFromWidget( viewElement );
- const altText = imgElement.getAttribute( 'alt' );
- return altText ? `${ altText } ${ label }` : label;
- }
- }
- /**
- * Checks if a given view element is an image widget.
- *
- * @param {module:engine/view/element~Element} viewElement
- * @returns {Boolean}
- */
- function isImageWidget( viewElement ) {
- return !!viewElement.getCustomProperty( 'image' ) && Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["isWidget"])( viewElement );
- }
- /**
- * Returns an image widget editing view element if one is selected.
- *
- * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
- * @returns {module:engine/view/element~Element|null}
- */
- function getSelectedImageWidget( selection ) {
- const viewElement = selection.getSelectedElement();
- if ( viewElement && isImageWidget( viewElement ) ) {
- return viewElement;
- }
- return null;
- }
- /**
- * Checks if the provided model element is an `image`.
- *
- * @param {module:engine/model/element~Element} modelElement
- * @returns {Boolean}
- */
- function isImage( modelElement ) {
- return !!modelElement && modelElement.is( 'element', 'image' );
- }
- /**
- * Handles inserting single file. This method unifies image insertion using {@link module:widget/utils~findOptimalInsertionPosition} method.
- *
- * insertImage( model, { src: 'path/to/image.jpg' } );
- *
- * @param {module:engine/model/model~Model} model
- * @param {Object} [attributes={}] Attributes of inserted image
- * @param {module:engine/model/position~Position} [insertPosition] Position to insert the image. If not specified,
- * the {@link module:widget/utils~findOptimalInsertionPosition} logic will be applied.
- */
- function insertImage( model, attributes = {}, insertPosition = null ) {
- model.change( writer => {
- const imageElement = writer.createElement( 'image', attributes );
- const insertAtSelection = insertPosition || Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["findOptimalInsertionPosition"])( model.document.selection, model );
- model.insertContent( imageElement, insertAtSelection );
- // Inserting an image might've failed due to schema regulations.
- if ( imageElement.parent ) {
- writer.setSelection( imageElement, 'on' );
- }
- } );
- }
- /**
- * Checks if image can be inserted at current model selection.
- *
- * @param {module:engine/model/model~Model} model
- * @returns {Boolean}
- */
- function isImageAllowed( model ) {
- const schema = model.schema;
- const selection = model.document.selection;
- return isImageAllowedInParent( selection, schema, model ) &&
- !Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["checkSelectionOnObject"])( selection, schema ) &&
- isInOtherImage( selection );
- }
- /**
- * Get view `<img>` element from the view widget (`<figure>`).
- *
- * Assuming that image is always a first child of a widget (ie. `figureView.getChild( 0 )`) is unsafe as other features might
- * inject their own elements to the widget.
- *
- * The `<img>` can be wrapped to other elements, e.g. `<a>`. Nested check required.
- *
- * @param {module:engine/view/element~Element} figureView
- * @returns {module:engine/view/element~Element}
- */
- function getViewImgFromWidget( figureView ) {
- const figureChildren = [];
- for ( const figureChild of figureView.getChildren() ) {
- figureChildren.push( figureChild );
- if ( figureChild.is( 'element' ) ) {
- figureChildren.push( ...figureChild.getChildren() );
- }
- }
- return figureChildren.find( viewChild => viewChild.is( 'element', 'img' ) );
- }
- // Checks if image is allowed by schema in optimal insertion parent.
- //
- // @returns {Boolean}
- function isImageAllowedInParent( selection, schema, model ) {
- const parent = getInsertImageParent( selection, model );
- return schema.checkChild( parent, 'image' );
- }
- // Checks if selection is placed in other image (ie. in caption).
- function isInOtherImage( selection ) {
- return [ ...selection.focus.getAncestors() ].every( ancestor => !ancestor.is( 'element', 'image' ) );
- }
- // Returns a node that will be used to insert image with `model.insertContent` to check if image can be placed there.
- function getInsertImageParent( selection, model ) {
- const insertAt = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["findOptimalInsertionPosition"])( selection, model );
- const parent = insertAt.parent;
- if ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {
- return parent.parent;
- }
- return parent;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageCaption; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _imagecaption_imagecaptionediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagecaption/imagecaptionediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js");
- /* harmony import */ var _theme_imagecaption_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/imagecaption.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css");
- /* harmony import */ var _theme_imagecaption_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_imagecaption_css__WEBPACK_IMPORTED_MODULE_2__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagecaption
- */
- /**
- * The image caption plugin.
- *
- * For a detailed overview, check the {@glink features/image#image-captions image caption} documentation.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageCaption extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _imagecaption_imagecaptionediting__WEBPACK_IMPORTED_MODULE_1__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageCaption';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js ***!
- \****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageCaptionEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagecaption/imagecaptionediting
- */
- /**
- * The image caption engine plugin.
- *
- * It registers proper converters. It takes care of adding a caption element if the image without it is inserted
- * to the model document.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageCaptionEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageCaptionEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const view = editor.editing.view;
- const schema = editor.model.schema;
- const data = editor.data;
- const editing = editor.editing;
- const t = editor.t;
- /**
- * The last selected caption editable.
- * It is used for hiding the editable when it is empty and the image widget is no longer selected.
- *
- * @private
- * @member {module:engine/view/editableelement~EditableElement} #_lastSelectedCaption
- */
- // Schema configuration.
- if ( !schema.isRegistered( 'caption' ) ) {
- schema.register( 'caption', {
- allowIn: 'image',
- allowContentOf: '$block',
- isLimit: true
- } );
- } else {
- schema.extend( 'caption', {
- allowIn: 'image'
- } );
- }
- // Add caption element to each image inserted without it.
- editor.model.document.registerPostFixer( writer => this._insertMissingModelCaptionElement( writer ) );
- // View to model converter for the data pipeline.
- editor.conversion.for( 'upcast' ).elementToElement( {
- view: _utils__WEBPACK_IMPORTED_MODULE_2__["matchImageCaption"],
- model: 'caption'
- } );
- // Model to view converter for the data pipeline.
- const createCaptionForData = writer => writer.createContainerElement( 'figcaption' );
- data.downcastDispatcher.on( 'insert:caption', captionModelToView( createCaptionForData, false ) );
- // Model to view converter for the editing pipeline.
- const createCaptionForEditing = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["captionElementCreator"])( view, t( 'Enter image caption' ) );
- editing.downcastDispatcher.on( 'insert:caption', captionModelToView( createCaptionForEditing ) );
- // Always show caption in view when something is inserted in model.
- editing.downcastDispatcher.on(
- 'insert',
- this._fixCaptionVisibility( data => data.item ),
- { priority: 'high' }
- );
- // Hide caption when everything is removed from it.
- editing.downcastDispatcher.on( 'remove', this._fixCaptionVisibility( data => data.position.parent ), { priority: 'high' } );
- // Update caption visibility on view in post fixer.
- view.document.registerPostFixer( writer => this._updateCaptionVisibility( writer ) );
- }
- /**
- * Updates the view before each rendering, making sure that empty captions (so unnecessary ones) are hidden
- * and then visible when the image is selected.
- *
- * @private
- * @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
- * @returns {Boolean} Returns `true` when the view is updated.
- */
- _updateCaptionVisibility( viewWriter ) {
- const mapper = this.editor.editing.mapper;
- const lastCaption = this._lastSelectedCaption;
- let viewCaption;
- // If whole image is selected.
- const modelSelection = this.editor.model.document.selection;
- const selectedElement = modelSelection.getSelectedElement();
- if ( selectedElement && selectedElement.is( 'element', 'image' ) ) {
- const modelCaption = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromImage"])( selectedElement );
- viewCaption = mapper.toViewElement( modelCaption );
- }
- // If selection is placed inside caption.
- const position = modelSelection.getFirstPosition();
- const modelCaption = getParentCaption( position.parent );
- if ( modelCaption ) {
- viewCaption = mapper.toViewElement( modelCaption );
- }
- // Is currently any caption selected?
- if ( viewCaption && !this.editor.isReadOnly ) {
- // Was any caption selected before?
- if ( lastCaption ) {
- // Same caption as before?
- if ( lastCaption === viewCaption ) {
- return showCaption( viewCaption, viewWriter );
- } else {
- hideCaptionIfEmpty( lastCaption, viewWriter );
- this._lastSelectedCaption = viewCaption;
- return showCaption( viewCaption, viewWriter );
- }
- } else {
- this._lastSelectedCaption = viewCaption;
- return showCaption( viewCaption, viewWriter );
- }
- } else {
- // Was any caption selected before?
- if ( lastCaption ) {
- const viewModified = hideCaptionIfEmpty( lastCaption, viewWriter );
- this._lastSelectedCaption = null;
- return viewModified;
- } else {
- return false;
- }
- }
- }
- /**
- * Returns a converter that fixes caption visibility during the model-to-view conversion.
- * Checks if the changed node is placed inside the caption element and fixes its visibility in the view.
- *
- * @private
- * @param {Function} nodeFinder
- * @returns {Function}
- */
- _fixCaptionVisibility( nodeFinder ) {
- return ( evt, data, conversionApi ) => {
- const node = nodeFinder( data );
- const modelCaption = getParentCaption( node );
- const mapper = this.editor.editing.mapper;
- const viewWriter = conversionApi.writer;
- if ( modelCaption ) {
- const viewCaption = mapper.toViewElement( modelCaption );
- if ( viewCaption ) {
- if ( modelCaption.childCount ) {
- viewWriter.removeClass( 'ck-hidden', viewCaption );
- } else {
- viewWriter.addClass( 'ck-hidden', viewCaption );
- }
- }
- }
- };
- }
- /**
- * Checks whether the data inserted to the model document have an image element that has no caption element inside it.
- * If there is none, it adds it to the image element.
- *
- * @private
- * @param {module:engine/model/writer~Writer} writer The writer to make changes with.
- * @returns {Boolean} `true` if any change was applied, `false` otherwise.
- */
- _insertMissingModelCaptionElement( writer ) {
- const model = this.editor.model;
- const changes = model.document.differ.getChanges();
- const imagesWithoutCaption = [];
- for ( const entry of changes ) {
- if ( entry.type == 'insert' && entry.name != '$text' ) {
- const item = entry.position.nodeAfter;
- if ( item.is( 'element', 'image' ) && !Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromImage"])( item ) ) {
- imagesWithoutCaption.push( item );
- }
- // Check elements with children for nested images.
- if ( !item.is( 'element', 'image' ) && item.childCount ) {
- for ( const nestedItem of model.createRangeIn( item ).getItems() ) {
- if ( nestedItem.is( 'element', 'image' ) && !Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromImage"])( nestedItem ) ) {
- imagesWithoutCaption.push( nestedItem );
- }
- }
- }
- }
- }
- for ( const image of imagesWithoutCaption ) {
- writer.appendElement( 'caption', image );
- }
- return !!imagesWithoutCaption.length;
- }
- }
- // Creates a converter that converts image caption model element to view element.
- //
- // @private
- // @param {Function} elementCreator
- // @param {Boolean} [hide=true] When set to `false` view element will not be inserted when it's empty.
- // @returns {Function}
- function captionModelToView( elementCreator, hide = true ) {
- return ( evt, data, conversionApi ) => {
- const captionElement = data.item;
- // Return if element shouldn't be present when empty.
- if ( !captionElement.childCount && !hide ) {
- return;
- }
- if ( Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( captionElement.parent ) ) {
- if ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {
- return;
- }
- const viewImage = conversionApi.mapper.toViewElement( data.range.start.parent );
- const viewCaption = elementCreator( conversionApi.writer );
- const viewWriter = conversionApi.writer;
- // Hide if empty.
- if ( !captionElement.childCount ) {
- viewWriter.addClass( 'ck-hidden', viewCaption );
- }
- insertViewCaptionAndBind( viewCaption, data.item, viewImage, conversionApi );
- }
- };
- }
- // Inserts `viewCaption` at the end of `viewImage` and binds it to `modelCaption`.
- //
- // @private
- // @param {module:engine/view/containerelement~ContainerElement} viewCaption
- // @param {module:engine/model/element~Element} modelCaption
- // @param {module:engine/view/containerelement~ContainerElement} viewImage
- // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
- function insertViewCaptionAndBind( viewCaption, modelCaption, viewImage, conversionApi ) {
- const viewPosition = conversionApi.writer.createPositionAt( viewImage, 'end' );
- conversionApi.writer.insert( viewPosition, viewCaption );
- conversionApi.mapper.bindElements( modelCaption, viewCaption );
- }
- // Checks if the provided node or one of its ancestors is a caption element, and returns it.
- //
- // @private
- // @param {module:engine/model/node~Node} node
- // @returns {module:engine/model/element~Element|null}
- function getParentCaption( node ) {
- const ancestors = node.getAncestors( { includeSelf: true } );
- const caption = ancestors.find( ancestor => ancestor.name == 'caption' );
- if ( caption && caption.parent && caption.parent.name == 'image' ) {
- return caption;
- }
- return null;
- }
- // Hides a given caption in the view if it is empty.
- //
- // @private
- // @param {module:engine/view/containerelement~ContainerElement} caption
- // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
- // @returns {Boolean} Returns `true` if the view was modified.
- function hideCaptionIfEmpty( caption, viewWriter ) {
- if ( !caption.childCount && !caption.hasClass( 'ck-hidden' ) ) {
- viewWriter.addClass( 'ck-hidden', caption );
- return true;
- }
- return false;
- }
- // Shows the caption.
- //
- // @private
- // @param {module:engine/view/containerelement~ContainerElement} caption
- // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
- // @returns {Boolean} Returns `true` if the view was modified.
- function showCaption( caption, viewWriter ) {
- if ( caption.hasClass( 'ck-hidden' ) ) {
- viewWriter.removeClass( 'ck-hidden', caption );
- return true;
- }
- return false;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js ***!
- \**************************************************************************/
- /*! exports provided: captionElementCreator, isCaption, getCaptionFromImage, matchImageCaption */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "captionElementCreator", function() { return captionElementCreator; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCaption", function() { return isCaption; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCaptionFromImage", function() { return getCaptionFromImage; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchImageCaption", function() { return matchImageCaption; });
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagecaption/utils
- */
- /**
- * Returns a function that creates a caption editable element for the given {@link module:engine/view/document~Document}.
- *
- * @param {module:engine/view/view~View} view
- * @param {String} placeholderText The text to be displayed when the caption is empty.
- * @returns {Function}
- */
- function captionElementCreator( view, placeholderText ) {
- return writer => {
- const editable = writer.createEditableElement( 'figcaption' );
- writer.setCustomProperty( 'imageCaption', true, editable );
- Object(ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["enablePlaceholder"])( {
- view,
- element: editable,
- text: placeholderText
- } );
- return Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["toWidgetEditable"])( editable, writer );
- };
- }
- /**
- * Returns `true` if a given view element is the image caption editable.
- *
- * @param {module:engine/view/element~Element} viewElement
- * @returns {Boolean}
- */
- function isCaption( viewElement ) {
- return !!viewElement.getCustomProperty( 'imageCaption' );
- }
- /**
- * Returns the caption model element from a given image element. Returns `null` if no caption is found.
- *
- * @param {module:engine/model/element~Element} imageModelElement
- * @returns {module:engine/model/element~Element|null}
- */
- function getCaptionFromImage( imageModelElement ) {
- for ( const node of imageModelElement.getChildren() ) {
- if ( !!node && node.is( 'element', 'caption' ) ) {
- return node;
- }
- }
- return null;
- }
- /**
- * {@link module:engine/view/matcher~Matcher} pattern. Checks if a given element is a `<figcaption>` element that is placed
- * inside the image `<figure>` element.
- *
- * @param {module:engine/view/element~Element} element
- * @returns {Object|null} Returns the object accepted by {@link module:engine/view/matcher~Matcher} or `null` if the element
- * cannot be matched.
- */
- function matchImageCaption( element ) {
- const parent = element.parent;
- // Convert only captions for images.
- if ( element.name == 'figcaption' && parent && parent.name == 'figure' && parent.hasClass( 'image' ) ) {
- return { name: true };
- }
- return null;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResize; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _imageresize_imageresizebuttons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageresize/imageresizebuttons */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js");
- /* harmony import */ var _imageresize_imageresizeediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imageresize/imageresizeediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js");
- /* harmony import */ var _imageresize_imageresizehandles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imageresize/imageresizehandles */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js");
- /* harmony import */ var _theme_imageresize_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/imageresize.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css");
- /* harmony import */ var _theme_imageresize_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_imageresize_css__WEBPACK_IMPORTED_MODULE_4__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imageresize
- */
- /**
- * The image resize plugin.
- *
- * It adds a possibility to resize each image using handles.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageResize extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _imageresize_imageresizeediting__WEBPACK_IMPORTED_MODULE_2__["default"], _imageresize_imageresizehandles__WEBPACK_IMPORTED_MODULE_3__["default"], _imageresize_imageresizebuttons__WEBPACK_IMPORTED_MODULE_1__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageResize';
- }
- }
- /**
- * The available options are `'px'` or `'%'`.
- *
- * Determines the size unit applied to the resized image.
- *
- * ClassicEditor
- * .create( editorElement, {
- * image: {
- * resizeUnit: 'px'
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- *
- * This option is used by the {@link module:image/imageresize~ImageResize} feature.
- *
- * @default '%'
- * @member {String} module:image/image~ImageConfig#resizeUnit
- */
- /**
- * The image resize options.
- *
- * Each option should have at least these two properties:
- *
- * * name: The name of the UI component registered in the global
- * {@link module:core/editor/editorui~EditorUI#componentFactory component factory} of the editor,
- * representing the button a user can click to change the size of an image,
- * * value: An actual image width applied when a user clicks the mentioned button
- * ({@link module:image/imageresize/resizeimagecommand~ResizeImageCommand} gets executed).
- * The value property is combined with the {@link module:image/image~ImageConfig#resizeUnit `config.image.resizeUnit`} (`%` by default).
- * For instance: `value: '50'` and `resizeUnit: '%'` will render as `'50%'` in the UI.
- *
- * **Resetting the image size**
- *
- * If you want to set an option that will reset image to its original size, you need to pass a `null` value
- * to one of the options. The `:original` token is not mandatory, you can call it anything you wish, but it must reflect
- * in the standalone buttons configuration for the image toolbar.
- *
- * ClassicEditor
- * .create( editorElement, {
- * image: {
- * resizeUnit: "%",
- * resizeOptions: [ {
- * name: 'resizeImage:original',
- * value: null
- * },
- * {
- * name: 'resizeImage:50',
- * value: '50'
- * },
- * {
- * name: 'resizeImage:75',
- * value: '75'
- * } ]
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * **Resizing images using a dropdown**
- *
- * With resize options defined, you can decide whether you want to display them as a dropdown or as standalone buttons.
- * For the dropdown, you need to pass only the `resizeImage` token to the
- {@link module:image/image~ImageConfig#toolbar `config.image.toolbar`}. The dropdown contains all defined options by default:
- *
- * ClassicEditor
- * .create( editorElement, {
- * image: {
- * resizeUnit: "%",
- * resizeOptions: [ {
- * name: 'resizeImage:original',
- * value: null
- * },
- * {
- * name: 'resizeImage:50',
- * value: '50'
- * },
- * {
- * name: 'resizeImage:75',
- * value: '75'
- * } ],
- * toolbar: [ 'resizeImage', ... ],
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * **Resizing images using individual buttons**
- *
- * If you want to have separate buttons for {@link module:image/imageresize/imageresizebuttons~ImageResizeOption each option},
- * pass their names to the {@link module:image/image~ImageConfig#toolbar `config.image.toolbar`} instead. Please keep in mind
- * that this time **you must define the additional
- * {@link module:image/imageresize/imageresizebuttons~ImageResizeOption `icon` property}**:
- *
- * ClassicEditor
- * .create( editorElement, {
- * image: {
- * resizeUnit: "%",
- * resizeOptions: [ {
- * name: 'resizeImage:original',
- * value: null,
- * icon: 'original'
- * },
- * {
- * name: 'resizeImage:25',
- * value: '25',
- * icon: 'small'
- * },
- * {
- * name: 'resizeImage:50',
- * value: '50',
- * icon: 'medium'
- * },
- * {
- * name: 'resizeImage:75',
- * value: '75',
- * icon: 'large'
- * } ],
- * toolbar: [ 'resizeImage:25', 'resizeImage:50', 'resizeImage:75', 'resizeImage:original', ... ],
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * **Customizing resize button labels**
- *
- * You can set your own label for each resize button. To do that, add the `label` property like in the example below.
- *
- * * When using the **dropdown**, the labels are displayed on the list of all options when you open the dropdown.
- * * When using **standalone buttons**, the labels will are displayed as tooltips when a user hovers over the button.
- *
- * ClassicEditor
- * .create( editorElement, {
- * image: {
- * resizeUnit: "%",
- * resizeOptions: [ {
- * name: 'resizeImage:original',
- * value: null,
- * label: 'Original size'
- * // Note: add the "icon" property if you're configuring a standalone button.
- * },
- * {
- * name: 'resizeImage:50',
- * value: '50',
- * label: 'Medium size'
- * // Note: add the "icon" property if you're configuring a standalone button.
- * },
- * {
- * name: 'resizeImage:75',
- * value: '75',
- * label: 'Large size'
- * // Note: add the "icon" property if you're configuring a standalone button.
- * } ]
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * **Default value**
- *
- * The following configuration is used by default:
- *
- * resizeOptions = [
- * {
- * name: 'resizeImage:original',
- * value: null,
- * icon: 'original'
- * },
- * {
- * name: 'resizeImage:25',
- * value: '25',
- * icon: 'small'
- * },
- * {
- * name: 'resizeImage:50',
- * value: '50',
- * icon: 'medium'
- * },
- * {
- * name: 'resizeImage:75',
- * value: '75',
- * icon: 'large'
- * }
- * ];
- *
- * @member {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} module:image/image~ImageConfig#resizeOptions
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js ***!
- \**************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeButtons; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _imageresizeediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imageresizeediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imageresize/imageresizebuttons
- */
- const RESIZE_ICONS = {
- small: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].objectSizeSmall,
- medium: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].objectSizeMedium,
- large: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].objectSizeLarge,
- original: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].objectSizeFull
- };
- /**
- * The image resize buttons plugin.
- *
- * It adds a possibility to resize images using the toolbar dropdown or individual buttons, depending on the plugin configuration.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageResizeButtons extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _imageresizeediting__WEBPACK_IMPORTED_MODULE_3__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageResizeButtons';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- /**
- * The resize unit.
- *
- * @readonly
- * @private
- * @type {module:image/image~ImageConfig#resizeUnit}
- * @default '%'
- */
- this._resizeUnit = editor.config.get( 'image.resizeUnit' );
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const options = editor.config.get( 'image.resizeOptions' );
- const command = editor.commands.get( 'resizeImage' );
- this.bind( 'isEnabled' ).to( command );
- for ( const option of options ) {
- this._registerImageResizeButton( option );
- }
- this._registerImageResizeDropdown( options );
- }
- /**
- * A helper function that creates a standalone button component for the plugin.
- *
- * @private
- * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} resizeOption A model of the resize option.
- */
- _registerImageResizeButton( option ) {
- const editor = this.editor;
- const { name, value, icon } = option;
- const optionValueWithUnit = value ? value + this._resizeUnit : null;
- editor.ui.componentFactory.add( name, locale => {
- const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- const command = editor.commands.get( 'resizeImage' );
- const labelText = this._getOptionLabelValue( option, true );
- if ( !RESIZE_ICONS[ icon ] ) {
- /**
- * When configuring {@link module:image/image~ImageConfig#resizeOptions `config.image.resizeOptions`} for standalone
- * buttons, a valid `icon` token must be set for each option.
- *
- * See all valid options described in the
- * {@link module:image/imageresize/imageresizebuttons~ImageResizeOption plugin configuration}.
- *
- * @error imageresizebuttons-missing-icon
- * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} option Invalid image resize option.
- */
- throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["CKEditorError"](
- 'imageresizebuttons-missing-icon',
- editor,
- option
- );
- }
- button.set( {
- // Use the `label` property for a verbose description (because of ARIA).
- label: labelText,
- icon: RESIZE_ICONS[ icon ],
- tooltip: labelText,
- isToggleable: true
- } );
- // Bind button to the command.
- button.bind( 'isEnabled' ).to( this );
- button.bind( 'isOn' ).to( command, 'value', getIsOnButtonCallback( optionValueWithUnit ) );
- this.listenTo( button, 'execute', () => {
- editor.execute( 'resizeImage', { width: optionValueWithUnit } );
- } );
- return button;
- } );
- }
- /**
- * A helper function that creates a dropdown component for the plugin containing all the resize options defined in
- * the editor configuration.
- *
- * @private
- * @param {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} options An array of configured options.
- */
- _registerImageResizeDropdown( options ) {
- const editor = this.editor;
- const t = editor.t;
- const originalSizeOption = options.find( option => !option.value );
- const componentCreator = locale => {
- const command = editor.commands.get( 'resizeImage' );
- const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["DropdownButtonView"] );
- const dropdownButton = dropdownView.buttonView;
- dropdownButton.set( {
- tooltip: t( 'Resize image' ),
- commandValue: originalSizeOption.value,
- icon: RESIZE_ICONS.medium,
- isToggleable: true,
- label: this._getOptionLabelValue( originalSizeOption ),
- withText: true,
- class: 'ck-resize-image-button'
- } );
- dropdownButton.bind( 'label' ).to( command, 'value', commandValue => {
- if ( commandValue && commandValue.width ) {
- return commandValue.width;
- } else {
- return this._getOptionLabelValue( originalSizeOption );
- }
- } );
- dropdownView.bind( 'isOn' ).to( command );
- dropdownView.bind( 'isEnabled' ).to( this );
- Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addListToDropdown"])( dropdownView, this._getResizeDropdownListItemDefinitions( options, command ) );
- dropdownView.listView.ariaLabel = t( 'Image resize list' );
- // Execute command when an item from the dropdown is selected.
- this.listenTo( dropdownView, 'execute', evt => {
- editor.execute( evt.source.commandName, { width: evt.source.commandValue } );
- editor.editing.view.focus();
- } );
- return dropdownView;
- };
- // Register `resizeImage` dropdown and add `imageResize` dropdown as an alias for backward compatibility.
- editor.ui.componentFactory.add( 'resizeImage', componentCreator );
- editor.ui.componentFactory.add( 'imageResize', componentCreator );
- }
- /**
- * A helper function for creating an option label value string.
- *
- * @private
- * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} option A resize option object.
- * @param {Boolean} [forTooltip] An optional flag for creating a tooltip label.
- * @returns {String} A user-defined label combined from the numeric value and the resize unit or the default label
- * for reset options (`Original`).
- */
- _getOptionLabelValue( option, forTooltip ) {
- const t = this.editor.t;
- if ( option.label ) {
- return option.label;
- } else if ( forTooltip ) {
- if ( option.value ) {
- return t( 'Resize image to %0', option.value + this._resizeUnit );
- } else {
- return t( 'Resize image to the original size' );
- }
- } else {
- if ( option.value ) {
- return option.value + this._resizeUnit;
- } else {
- return t( 'Original' );
- }
- }
- }
- /**
- * A helper function that parses the resize options and returns list item definitions ready for use in the dropdown.
- *
- * @private
- * @param {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} options The resize options.
- * @param {module:image/imageresize/resizeimagecommand~ResizeImageCommand} command The resize image command.
- * @returns {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} Dropdown item definitions.
- */
- _getResizeDropdownListItemDefinitions( options, command ) {
- const itemDefinitions = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["Collection"]();
- options.map( option => {
- const optionValueWithUnit = option.value ? option.value + this._resizeUnit : null;
- const definition = {
- type: 'button',
- model: new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Model"]( {
- commandName: 'resizeImage',
- commandValue: optionValueWithUnit,
- label: this._getOptionLabelValue( option ),
- withText: true,
- icon: null
- } )
- };
- definition.model.bind( 'isOn' ).to( command, 'value', getIsOnButtonCallback( optionValueWithUnit ) );
- itemDefinitions.add( definition );
- } );
- return itemDefinitions;
- }
- }
- // A helper function for setting the `isOn` state of buttons in value bindings.
- function getIsOnButtonCallback( value ) {
- return commandValue => {
- if ( value === null && commandValue === value ) {
- return true;
- }
- return commandValue && commandValue.width === value;
- };
- }
- /**
- * The image resize option used in the {@link module:image/image~ImageConfig#resizeOptions image resize configuration}.
- *
- * @typedef {Object} module:image/imageresize/imageresizebuttons~ImageResizeOption
- * @property {String} name The name of the UI component that changes the image size.
- * * If you configure the feature using individual resize buttons, you can refer to this name in the
- * {@link module:image/image~ImageConfig#toolbar image toolbar configuration}.
- * * If you configure the feature using the resize dropdown, this name will be used for a list item in the dropdown.
- * @property {String} value The value of the resize option without the unit
- * ({@link module:image/image~ImageConfig#resizeUnit configured separately}). `null` resets an image to its original size.
- * @property {String} [resizeOptions.icon] An icon used by an individual resize button (see the `name` property to learn more).
- * Available icons are: `'small'`, `'medium'`, `'large'`, `'original'`.
- * @property {String} [label] An option label displayed in the dropdown or, if the feature is configured using
- * individual buttons, a {@link module:ui/button/buttonview~ButtonView#tooltip} and an ARIA attribute of a button.
- * If not specified, the label is generated automatically based on the `value` option and the
- * {@link module:image/image~ImageConfig#resizeUnit `config.image.resizeUnit`}.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js ***!
- \**************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _resizeimagecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resizeimagecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imageresize/imageresizeediting
- */
- /**
- * The image resize editing feature.
- *
- * It adds the ability to resize each image using handles or manually by
- * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageResizeEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageResizeEditing';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- editor.config.define( 'image', {
- resizeUnit: '%',
- resizeOptions: [ {
- name: 'resizeImage:original',
- value: null,
- icon: 'original'
- },
- {
- name: 'resizeImage:25',
- value: '25',
- icon: 'small'
- },
- {
- name: 'resizeImage:50',
- value: '50',
- icon: 'medium'
- },
- {
- name: 'resizeImage:75',
- value: '75',
- icon: 'large'
- } ]
- } );
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const resizeImageCommand = new _resizeimagecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor );
- this._registerSchema();
- this._registerConverters();
- // Register `resizeImage` command and add `imageResize` command as an alias for backward compatibility.
- editor.commands.add( 'resizeImage', resizeImageCommand );
- editor.commands.add( 'imageResize', resizeImageCommand );
- }
- /**
- * @private
- */
- _registerSchema() {
- this.editor.model.schema.extend( 'image', { allowAttributes: 'width' } );
- this.editor.model.schema.setAttributeProperties( 'width', {
- isFormatting: true
- } );
- }
- /**
- * Registers image resize converters.
- *
- * @private
- */
- _registerConverters() {
- const editor = this.editor;
- // Dedicated converter to propagate image's attribute to the img tag.
- editor.conversion.for( 'downcast' ).add( dispatcher =>
- dispatcher.on( 'attribute:width:image', ( evt, data, conversionApi ) => {
- if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
- return;
- }
- const viewWriter = conversionApi.writer;
- const figure = conversionApi.mapper.toViewElement( data.item );
- if ( data.attributeNewValue !== null ) {
- viewWriter.setStyle( 'width', data.attributeNewValue, figure );
- viewWriter.addClass( 'image_resized', figure );
- } else {
- viewWriter.removeStyle( 'width', figure );
- viewWriter.removeClass( 'image_resized', figure );
- }
- } )
- );
- editor.conversion.for( 'upcast' )
- .attributeToAttribute( {
- view: {
- name: 'figure',
- styles: {
- width: /.+/
- }
- },
- model: {
- key: 'width',
- value: viewElement => viewElement.getStyle( 'width' )
- }
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js ***!
- \**************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeHandles; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /* harmony import */ var _image_imageloadobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../image/imageloadobserver */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imageresize/imageresizehandles
- */
- /**
- * The image resize by handles feature.
- *
- * It adds the ability to resize each image using handles or manually by
- * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageResizeHandles extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetResize"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageResizeHandles';
- }
- /**
- * @inheritDoc
- */
- init() {
- const command = this.editor.commands.get( 'resizeImage' );
- this.bind( 'isEnabled' ).to( command );
- this._setupResizerCreator();
- }
- /**
- * Attaches the listeners responsible for creating a resizer for each image, except for images inside the HTML embed preview.
- *
- * @private
- */
- _setupResizerCreator() {
- const editor = this.editor;
- const editingView = editor.editing.view;
- editingView.addObserver( _image_imageloadobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
- this.listenTo( editingView.document, 'imageLoaded', ( evt, domEvent ) => {
- // The resizer must be attached only to images loaded by the `ImageInsert`, `ImageUpload` or `LinkImage` plugins.
- if ( !domEvent.target.matches( 'figure.image.ck-widget > img, figure.image.ck-widget > a > img' ) ) {
- return;
- }
- const imageView = editor.editing.view.domConverter.domToView( domEvent.target );
- const widgetView = imageView.findAncestor( 'figure' );
- let resizer = this.editor.plugins.get( ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetResize"] ).getResizerByViewElement( widgetView );
- if ( resizer ) {
- // There are rare cases when the image will be triggered multiple times for the same widget, e.g. when
- // the image's source was changed after upload (https://github.com/ckeditor/ckeditor5/pull/8108#issuecomment-708302992).
- resizer.redraw();
- return;
- }
- const mapper = editor.editing.mapper;
- const imageModel = mapper.toModelElement( widgetView );
- resizer = editor.plugins
- .get( ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetResize"] )
- .attachTo( {
- unit: editor.config.get( 'image.resizeUnit' ),
- modelElement: imageModel,
- viewElement: widgetView,
- editor,
- getHandleHost( domWidgetElement ) {
- return domWidgetElement.querySelector( 'img' );
- },
- getResizeHost( domWidgetElement ) {
- return domWidgetElement;
- },
- // TODO consider other positions.
- isCentered() {
- const imageStyle = imageModel.getAttribute( 'imageStyle' );
- return !imageStyle || imageStyle == 'full' || imageStyle == 'alignCenter';
- },
- onCommit( newValue ) {
- editor.execute( 'resizeImage', { width: newValue } );
- }
- } );
- resizer.on( 'updateSize', () => {
- if ( !widgetView.hasClass( 'image_resized' ) ) {
- editingView.change( writer => {
- writer.addClass( 'image_resized', widgetView );
- } );
- }
- } );
- resizer.bind( 'isEnabled' ).to( this );
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.js ***!
- \**************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ResizeImageCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imageresize/resizeimagecommand
- */
- /**
- * The resize image command. Currently, it only supports the width attribute.
- *
- * @extends module:core/command~Command
- */
- class ResizeImageCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const element = this.editor.model.document.selection.getSelectedElement();
- this.isEnabled = Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( element );
- if ( !element || !element.hasAttribute( 'width' ) ) {
- this.value = null;
- } else {
- this.value = {
- width: element.getAttribute( 'width' ),
- height: null
- };
- }
- }
- /**
- * Executes the command.
- *
- * // Sets the width to 50%:
- * editor.execute( 'resizeImage', { width: '50%' } );
- *
- * // Removes the width attribute:
- * editor.execute( 'resizeImage', { width: null } );
- *
- * @param {Object} options
- * @param {String|null} options.width The new width of the image.
- * @fires execute
- */
- execute( options ) {
- const model = this.editor.model;
- const imageElement = model.document.selection.getSelectedElement();
- this.value = {
- width: options.width,
- height: null
- };
- if ( imageElement ) {
- model.change( writer => {
- writer.setAttribute( 'width', options.width, imageElement );
- } );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyle; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _imagestyle_imagestyleediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagestyle/imagestyleediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js");
- /* harmony import */ var _imagestyle_imagestyleui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imagestyle/imagestyleui */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagestyle
- */
- /**
- * The image style plugin.
- *
- * For a detailed overview, check the {@glink features/image#image-styles image styles} documentation.
- *
- * This is a "glue" plugin which loads the {@link module:image/imagestyle/imagestyleediting~ImageStyleEditing}
- * and {@link module:image/imagestyle/imagestyleui~ImageStyleUI} plugins.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageStyle extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _imagestyle_imagestyleediting__WEBPACK_IMPORTED_MODULE_1__["default"], _imagestyle_imagestyleui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageStyle';
- }
- }
- /**
- * Available image styles.
- *
- * The default value is:
- *
- * const imageConfig = {
- * styles: [ 'full', 'side' ]
- * };
- *
- * which configures two default styles:
- *
- * * the "full" style which does not apply any class, e.g. for images styled to span 100% width of the content,
- * * the "side" style with the `.image-style-side` CSS class.
- *
- * See {@link module:image/imagestyle/utils~defaultStyles} to learn more about default
- * styles provided by the image feature.
- *
- * The {@link module:image/imagestyle/utils~defaultStyles default styles} can be customized,
- * e.g. to change the icon, title or CSS class of the style. The feature also provides several
- * {@link module:image/imagestyle/utils~defaultIcons default icons} to choose from.
- *
- * import customIcon from 'custom-icon.svg';
- *
- * // ...
- *
- * const imageConfig = {
- * styles: [
- * // This will only customize the icon of the "full" style.
- * // Note: 'right' is one of default icons provided by the feature.
- * { name: 'full', icon: 'right' },
- *
- * // This will customize the icon, title and CSS class of the default "side" style.
- * { name: 'side', icon: customIcon, title: 'My side style', className: 'custom-side-image' }
- * ]
- * };
- *
- * If none of the default styles is good enough, it is possible to define independent custom styles, too:
- *
- * import { icons } from 'ckeditor5/src/core';
- *
- * const fullSizeIcon = icons.objectCenter';
- * const sideIcon = icons.objectRight';
- *
- * // ...
- *
- * const imageConfig = {
- * styles: [
- * // A completely custom full size style with no class, used as a default.
- * { name: 'fullSize', title: 'Full size', icon: fullSizeIcon, isDefault: true },
- *
- * { name: 'side', title: 'To the side', icon: sideIcon, className: 'side-image' }
- * ]
- * };
- *
- * Note: Setting `title` to one of {@link module:image/imagestyle/imagestyleui~ImageStyleUI#localizedDefaultStylesTitles}
- * will automatically translate it to the language of the editor.
- *
- * Read more about styling images in the {@glink features/image#image-styles Image styles guide}.
- *
- * The feature creates commands based on defined styles, so you can change the style of a selected image by executing
- * the following command:
- *
- * editor.execute( 'imageStyle' { value: 'side' } );
- *
- * The feature also creates buttons that execute the commands. So, assuming that you use the
- * default image styles setting, you can {@link module:image/image~ImageConfig#toolbar configure the image toolbar}
- * (or any other toolbar) to contain these options:
- *
- * const imageConfig = {
- * toolbar: [ 'imageStyle:full', 'imageStyle:side' ]
- * };
- *
- * @member {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} module:image/image~ImageConfig#styles
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js ***!
- \*****************************************************************************/
- /*! exports provided: modelToViewStyleAttribute, viewToModelStyleAttribute */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelToViewStyleAttribute", function() { return modelToViewStyleAttribute; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewToModelStyleAttribute", function() { return viewToModelStyleAttribute; });
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagestyle/converters
- */
- /**
- * Returns a converter for the `imageStyle` attribute. It can be used for adding, changing and removing the attribute.
- *
- * @param {Object} styles An object containing available styles. See {@link module:image/imagestyle/imagestyleediting~ImageStyleFormat}
- * for more details.
- * @returns {Function} A model-to-view attribute converter.
- */
- function modelToViewStyleAttribute( styles ) {
- return ( evt, data, conversionApi ) => {
- if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
- return;
- }
- // Check if there is class name associated with given value.
- const newStyle = getStyleByName( data.attributeNewValue, styles );
- const oldStyle = getStyleByName( data.attributeOldValue, styles );
- const viewElement = conversionApi.mapper.toViewElement( data.item );
- const viewWriter = conversionApi.writer;
- if ( oldStyle ) {
- viewWriter.removeClass( oldStyle.className, viewElement );
- }
- if ( newStyle ) {
- viewWriter.addClass( newStyle.className, viewElement );
- }
- };
- }
- /**
- * Returns a view-to-model converter converting image CSS classes to a proper value in the model.
- *
- * @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} styles The styles for which the converter is created.
- * @returns {Function} A view-to-model converter.
- */
- function viewToModelStyleAttribute( styles ) {
- // Convert only non–default styles.
- const filteredStyles = styles.filter( style => !style.isDefault );
- return ( evt, data, conversionApi ) => {
- if ( !data.modelRange ) {
- return;
- }
- const viewFigureElement = data.viewItem;
- const modelImageElement = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["first"])( data.modelRange.getItems() );
- // Check if `modelImageElement` exists (see: https://github.com/ckeditor/ckeditor5/issues/8270)
- // and `imageStyle` attribute is allowed for that element, otherwise stop conversion early.
- if ( modelImageElement && !conversionApi.schema.checkAttribute( modelImageElement, 'imageStyle' ) ) {
- return;
- }
- // Convert style one by one.
- for ( const style of filteredStyles ) {
- // Try to consume class corresponding with style.
- if ( conversionApi.consumable.consume( viewFigureElement, { classes: style.className } ) ) {
- // And convert this style to model attribute.
- conversionApi.writer.setAttribute( 'imageStyle', style.name, modelImageElement );
- }
- }
- };
- }
- // Returns the style with a given `name` from an array of styles.
- //
- // @param {String} name
- // @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat> } styles
- // @returns {module:image/imagestyle/imagestyleediting~ImageStyleFormat|undefined}
- function getStyleByName( name, styles ) {
- for ( const style of styles ) {
- if ( style.name === name ) {
- return style;
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyleCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagestyle/imagestylecommand
- */
- /**
- * The image style command. It is used to apply different image styles.
- *
- * @extends module:core/command~Command
- */
- class ImageStyleCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * Creates an instance of the image style command. Each command instance is handling one style.
- *
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- * @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} styles The styles that this command supports.
- */
- constructor( editor, styles ) {
- super( editor );
- /**
- * The name of the default style, if it is present. If there is no default style, it defaults to `false`.
- *
- * @readonly
- * @type {Boolean|String}
- */
- this.defaultStyle = false;
- /**
- * A style handled by this command.
- *
- * @readonly
- * @member {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} #styles
- */
- this.styles = styles.reduce( ( styles, style ) => {
- styles[ style.name ] = style;
- if ( style.isDefault ) {
- this.defaultStyle = style.name;
- }
- return styles;
- }, {} );
- }
- /**
- * @inheritDoc
- */
- refresh() {
- const element = this.editor.model.document.selection.getSelectedElement();
- this.isEnabled = Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( element );
- if ( !element ) {
- this.value = false;
- } else if ( element.hasAttribute( 'imageStyle' ) ) {
- const attributeValue = element.getAttribute( 'imageStyle' );
- this.value = this.styles[ attributeValue ] ? attributeValue : false;
- } else {
- this.value = this.defaultStyle;
- }
- }
- /**
- * Executes the command.
- *
- * editor.execute( 'imageStyle', { value: 'side' } );
- *
- * @param {Object} options
- * @param {String} options.value The name of the style (based on the
- * {@link module:image/image~ImageConfig#styles `image.styles`} configuration option).
- * @fires execute
- */
- execute( options ) {
- const styleName = options.value;
- const model = this.editor.model;
- const imageElement = model.document.selection.getSelectedElement();
- model.change( writer => {
- // Default style means that there is no `imageStyle` attribute in the model.
- // https://github.com/ckeditor/ckeditor5-image/issues/147
- if ( this.styles[ styleName ].isDefault ) {
- writer.removeAttribute( 'imageStyle', imageElement );
- } else {
- writer.setAttribute( 'imageStyle', styleName, imageElement );
- }
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyleEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _imagestylecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagestylecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js");
- /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagestyle/imagestyleediting
- */
- /**
- * The image style engine plugin. It sets the default configuration, creates converters and registers
- * {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand ImageStyleCommand}.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageStyleEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageStyleEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const schema = editor.model.schema;
- const data = editor.data;
- const editing = editor.editing;
- // Define default configuration.
- editor.config.define( 'image.styles', [ 'full', 'side' ] );
- // Get configuration.
- const styles = Object(_utils__WEBPACK_IMPORTED_MODULE_3__["normalizeImageStyles"])( editor.config.get( 'image.styles' ) );
- // Allow imageStyle attribute in image.
- // We could call it 'style' but https://github.com/ckeditor/ckeditor5-engine/issues/559.
- schema.extend( 'image', { allowAttributes: 'imageStyle' } );
- // Converters for imageStyle attribute from model to view.
- const modelToViewConverter = Object(_converters__WEBPACK_IMPORTED_MODULE_2__["modelToViewStyleAttribute"])( styles );
- editing.downcastDispatcher.on( 'attribute:imageStyle:image', modelToViewConverter );
- data.downcastDispatcher.on( 'attribute:imageStyle:image', modelToViewConverter );
- // Converter for figure element from view to model.
- data.upcastDispatcher.on( 'element:figure', Object(_converters__WEBPACK_IMPORTED_MODULE_2__["viewToModelStyleAttribute"])( styles ), { priority: 'low' } );
- // Register imageStyle command.
- editor.commands.add( 'imageStyle', new _imagestylecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, styles ) );
- }
- }
- /**
- * The image style format descriptor.
- *
- * import fullSizeIcon from 'path/to/icon.svg';
- *
- * const imageStyleFormat = {
- * name: 'fullSize',
- * icon: fullSizeIcon,
- * title: 'Full size image',
- * className: 'image-full-size'
- * }
- *
- * @typedef {Object} module:image/imagestyle/imagestyleediting~ImageStyleFormat
- *
- * @property {String} name The unique name of the style. It will be used to:
- *
- * * Store the chosen style in the model by setting the `imageStyle` attribute of the `<image>` element.
- * * As a value of the {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand#execute `imageStyle` command},
- * * when registering a button for each of the styles (`'imageStyle:{name}'`) in the
- * {@link module:ui/componentfactory~ComponentFactory UI components factory} (this functionality is provided by the
- * {@link module:image/imagestyle/imagestyleui~ImageStyleUI} plugin).
- *
- * @property {Boolean} [isDefault] When set, the style will be used as the default one.
- * A default style does not apply any CSS class to the view element.
- *
- * @property {String} icon One of the following to be used when creating the style's button:
- *
- * * An SVG icon source (as an XML string).
- * * One of {@link module:image/imagestyle/utils~defaultIcons} to use a default icon provided by the plugin.
- *
- * @property {String} title The style's title.
- *
- * @property {String} className The CSS class used to represent the style in the view.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyleUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js");
- /* harmony import */ var _theme_imagestyle_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/imagestyle.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css");
- /* harmony import */ var _theme_imagestyle_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_imagestyle_css__WEBPACK_IMPORTED_MODULE_3__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagestyle/imagestyleui
- */
- /**
- * The image style UI plugin.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageStyleUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageStyleUI';
- }
- /**
- * Returns the default localized style titles provided by the plugin.
- *
- * The following localized titles corresponding with
- * {@link module:image/imagestyle/utils~defaultStyles} are available:
- *
- * * `'Full size image'`,
- * * `'Side image'`,
- * * `'Left aligned image'`,
- * * `'Centered image'`,
- * * `'Right aligned image'`
- *
- * @returns {Object.<String,String>}
- */
- get localizedDefaultStylesTitles() {
- const t = this.editor.t;
- return {
- 'Full size image': t( 'Full size image' ),
- 'Side image': t( 'Side image' ),
- 'Left aligned image': t( 'Left aligned image' ),
- 'Centered image': t( 'Centered image' ),
- 'Right aligned image': t( 'Right aligned image' )
- };
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const configuredStyles = editor.config.get( 'image.styles' );
- const translatedStyles = translateStyles( Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeImageStyles"])( configuredStyles ), this.localizedDefaultStylesTitles );
- for ( const style of translatedStyles ) {
- this._createButton( style );
- }
- }
- /**
- * Creates a button for each style and stores it in the editor {@link module:ui/componentfactory~ComponentFactory ComponentFactory}.
- *
- * @private
- * @param {module:image/imagestyle/imagestyleediting~ImageStyleFormat} style
- */
- _createButton( style ) {
- const editor = this.editor;
- const componentName = `imageStyle:${ style.name }`;
- editor.ui.componentFactory.add( componentName, locale => {
- const command = editor.commands.get( 'imageStyle' );
- const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- view.set( {
- label: style.title,
- icon: style.icon,
- tooltip: true,
- isToggleable: true
- } );
- view.bind( 'isEnabled' ).to( command, 'isEnabled' );
- view.bind( 'isOn' ).to( command, 'value', value => value === style.name );
- this.listenTo( view, 'execute', () => {
- editor.execute( 'imageStyle', { value: style.name } );
- editor.editing.view.focus();
- } );
- return view;
- } );
- }
- }
- /**
- * Returns the translated `title` from the passed styles array.
- *
- * @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} styles
- * @param titles
- * @returns {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>}
- */
- function translateStyles( styles, titles ) {
- for ( const style of styles ) {
- // Localize the titles of the styles, if a title corresponds with
- // a localized default provided by the plugin.
- if ( titles[ style.title ] ) {
- style.title = titles[ style.title ];
- }
- }
- return styles;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js ***!
- \************************************************************************/
- /*! exports provided: normalizeImageStyles */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeImageStyles", function() { return normalizeImageStyles; });
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagestyle/utils
- */
- /**
- * Default image styles provided by the plugin that can be referred in the
- * {@link module:image/image~ImageConfig#styles} configuration.
- *
- * Among them, 2 default semantic content styles are available:
- *
- * * `full` is a full–width image without any CSS class,
- * * `side` is a side image styled with the `image-style-side` CSS class.
- *
- * There are also 3 styles focused on formatting:
- *
- * * `alignLeft` aligns the image to the left using the `image-style-align-left` class,
- * * `alignCenter` centers the image using the `image-style-align-center` class,
- * * `alignRight` aligns the image to the right using the `image-style-align-right` class,
- *
- * @member {Object.<String,Object>}
- */
- const defaultStyles = {
- // This option is equal to the situation when no style is applied.
- full: {
- name: 'full',
- title: 'Full size image',
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectFullWidth,
- isDefault: true
- },
- // This represents a side image.
- side: {
- name: 'side',
- title: 'Side image',
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectRight,
- className: 'image-style-side'
- },
- // This style represents an image aligned to the left.
- alignLeft: {
- name: 'alignLeft',
- title: 'Left aligned image',
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectLeft,
- className: 'image-style-align-left'
- },
- // This style represents a centered image.
- alignCenter: {
- name: 'alignCenter',
- title: 'Centered image',
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectCenter,
- className: 'image-style-align-center'
- },
- // This style represents an image aligned to the right.
- alignRight: {
- name: 'alignRight',
- title: 'Right aligned image',
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectRight,
- className: 'image-style-align-right'
- }
- };
- /**
- * Default image style icons provided by the plugin that can be referred in the
- * {@link module:image/image~ImageConfig#styles} configuration.
- *
- * There are 4 icons available: `'full'`, `'left'`, `'center'` and `'right'`.
- *
- * @member {Object.<String, String>}
- */
- const defaultIcons = {
- full: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectFullWidth,
- left: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectLeft,
- right: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectRight,
- center: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["icons"].objectCenter
- };
- /**
- * Returns a {@link module:image/image~ImageConfig#styles} array with items normalized in the
- * {@link module:image/imagestyle/imagestyleediting~ImageStyleFormat} format and a complete `icon` markup for each style.
- *
- * @returns {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>}
- */
- function normalizeImageStyles( configuredStyles = [] ) {
- return configuredStyles.map( _normalizeStyle );
- }
- // Normalizes an image style provided in the {@link module:image/image~ImageConfig#styles}
- // and returns it in a {@link module:image/imagestyle/imagestyleediting~ImageStyleFormat}.
- //
- // @param {Object} style
- // @returns {@link module:image/imagestyle/imagestyleediting~ImageStyleFormat}
- function _normalizeStyle( style ) {
- // Just the name of the style has been passed.
- if ( typeof style == 'string' ) {
- const styleName = style;
- // If it's one of the defaults, just use it.
- if ( defaultStyles[ styleName ] ) {
- // Clone the style to avoid overriding defaults.
- style = Object.assign( {}, defaultStyles[ styleName ] );
- }
- // If it's just a name but none of the defaults, warn because probably it's a mistake.
- else {
- /**
- * There is no such image style of given name.
- *
- * @error image-style-not-found
- * @param {String} name Name of a missing style name.
- */
- Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["logWarning"])( 'image-style-not-found', { name: styleName } );
- // Normalize the style anyway to prevent errors.
- style = {
- name: styleName
- };
- }
- }
- // If an object style has been passed and if the name matches one of the defaults,
- // extend it with defaults – the user wants to customize a default style.
- // Note: Don't override the user–defined style object, clone it instead.
- else if ( defaultStyles[ style.name ] ) {
- const defaultStyle = defaultStyles[ style.name ];
- const extendedStyle = Object.assign( {}, style );
- for ( const prop in defaultStyle ) {
- if ( !Object.prototype.hasOwnProperty.call( style, prop ) ) {
- extendedStyle[ prop ] = defaultStyle[ prop ];
- }
- }
- style = extendedStyle;
- }
- // If an icon is defined as a string and correspond with a name
- // in default icons, use the default icon provided by the plugin.
- if ( typeof style.icon == 'string' && defaultIcons[ style.icon ] ) {
- style.icon = defaultIcons[ style.icon ];
- }
- return style;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternative; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _imagetextalternative_imagetextalternativeediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagetextalternative/imagetextalternativeediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js");
- /* harmony import */ var _imagetextalternative_imagetextalternativeui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imagetextalternative/imagetextalternativeui */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagetextalternative
- */
- /**
- * The image text alternative plugin.
- *
- * For a detailed overview, check the {@glink features/image#image-styles image styles} documentation.
- *
- * This is a "glue" plugin which loads the
- * {@link module:image/imagetextalternative/imagetextalternativeediting~ImageTextAlternativeEditing}
- * and {@link module:image/imagetextalternative/imagetextalternativeui~ImageTextAlternativeUI} plugins.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageTextAlternative extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _imagetextalternative_imagetextalternativeediting__WEBPACK_IMPORTED_MODULE_1__["default"], _imagetextalternative_imagetextalternativeui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageTextAlternative';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js":
- /*!********************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js ***!
- \********************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternativeCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagetextalternative/imagetextalternativecommand
- */
- /**
- * The image text alternative command. It is used to change the `alt` attribute of `<image>` elements.
- *
- * @extends module:core/command~Command
- */
- class ImageTextAlternativeCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * The command value: `false` if there is no `alt` attribute, otherwise the value of the `alt` attribute.
- *
- * @readonly
- * @observable
- * @member {String|Boolean} #value
- */
- /**
- * @inheritDoc
- */
- refresh() {
- const element = this.editor.model.document.selection.getSelectedElement();
- this.isEnabled = Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( element );
- if ( Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( element ) && element.hasAttribute( 'alt' ) ) {
- this.value = element.getAttribute( 'alt' );
- } else {
- this.value = false;
- }
- }
- /**
- * Executes the command.
- *
- * @fires execute
- * @param {Object} options
- * @param {String} options.newValue The new value of the `alt` attribute to set.
- */
- execute( options ) {
- const model = this.editor.model;
- const imageElement = model.document.selection.getSelectedElement();
- model.change( writer => {
- writer.setAttribute( 'alt', options.newValue, imageElement );
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js":
- /*!********************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js ***!
- \********************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternativeEditing; });
- /* harmony import */ var _imagetextalternativecommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./imagetextalternativecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagetextalternative/imagetextalternativeediting
- */
- /**
- * The image text alternative editing plugin.
- *
- * Registers the `'imageTextAlternative'` command.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageTextAlternativeEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageTextAlternativeEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- this.editor.commands.add( 'imageTextAlternative', new _imagetextalternativecommand__WEBPACK_IMPORTED_MODULE_0__["default"]( this.editor ) );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js":
- /*!***************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js ***!
- \***************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternativeUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _ui_textalternativeformview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ui/textalternativeformview */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js");
- /* harmony import */ var _image_ui_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../image/ui/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js");
- /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagetextalternative/imagetextalternativeui
- */
- /**
- * The image text alternative UI plugin.
- *
- * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageTextAlternativeUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ContextualBalloon"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageTextAlternativeUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- this._createButton();
- this._createForm();
- }
- /**
- * @inheritDoc
- */
- destroy() {
- super.destroy();
- // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
- this._form.destroy();
- }
- /**
- * Creates a button showing the balloon panel for changing the image text alternative and
- * registers it in the editor {@link module:ui/componentfactory~ComponentFactory ComponentFactory}.
- *
- * @private
- */
- _createButton() {
- const editor = this.editor;
- const t = editor.t;
- editor.ui.componentFactory.add( 'imageTextAlternative', locale => {
- const command = editor.commands.get( 'imageTextAlternative' );
- const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- view.set( {
- label: t( 'Change image text alternative' ),
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].lowVision,
- tooltip: true
- } );
- view.bind( 'isEnabled' ).to( command, 'isEnabled' );
- this.listenTo( view, 'execute', () => {
- this._showForm();
- } );
- return view;
- } );
- }
- /**
- * Creates the {@link module:image/imagetextalternative/ui/textalternativeformview~TextAlternativeFormView}
- * form.
- *
- * @private
- */
- _createForm() {
- const editor = this.editor;
- const view = editor.editing.view;
- const viewDocument = view.document;
- /**
- * The contextual balloon plugin instance.
- *
- * @private
- * @member {module:ui/panel/balloon/contextualballoon~ContextualBalloon}
- */
- this._balloon = this.editor.plugins.get( 'ContextualBalloon' );
- /**
- * A form containing a textarea and buttons, used to change the `alt` text value.
- *
- * @member {module:image/imagetextalternative/ui/textalternativeformview~TextAlternativeFormView}
- */
- this._form = new _ui_textalternativeformview__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.locale );
- // Render the form so its #element is available for clickOutsideHandler.
- this._form.render();
- this.listenTo( this._form, 'submit', () => {
- editor.execute( 'imageTextAlternative', {
- newValue: this._form.labeledInput.fieldView.element.value
- } );
- this._hideForm( true );
- } );
- this.listenTo( this._form, 'cancel', () => {
- this._hideForm( true );
- } );
- // Close the form on Esc key press.
- this._form.keystrokes.set( 'Esc', ( data, cancel ) => {
- this._hideForm( true );
- cancel();
- } );
- // Reposition the balloon or hide the form if an image widget is no longer selected.
- this.listenTo( editor.ui, 'update', () => {
- if ( !Object(_image_utils__WEBPACK_IMPORTED_MODULE_4__["getSelectedImageWidget"])( viewDocument.selection ) ) {
- this._hideForm( true );
- } else if ( this._isVisible ) {
- Object(_image_ui_utils__WEBPACK_IMPORTED_MODULE_3__["repositionContextualBalloon"])( editor );
- }
- } );
- // Close on click outside of balloon panel element.
- Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["clickOutsideHandler"])( {
- emitter: this._form,
- activator: () => this._isVisible,
- contextElements: [ this._balloon.view.element ],
- callback: () => this._hideForm()
- } );
- }
- /**
- * Shows the {@link #_form} in the {@link #_balloon}.
- *
- * @private
- */
- _showForm() {
- if ( this._isVisible ) {
- return;
- }
- const editor = this.editor;
- const command = editor.commands.get( 'imageTextAlternative' );
- const labeledInput = this._form.labeledInput;
- this._form.disableCssTransitions();
- if ( !this._isInBalloon ) {
- this._balloon.add( {
- view: this._form,
- position: Object(_image_ui_utils__WEBPACK_IMPORTED_MODULE_3__["getBalloonPositionData"])( editor )
- } );
- }
- // Make sure that each time the panel shows up, the field remains in sync with the value of
- // the command. If the user typed in the input, then canceled the balloon (`labeledInput#value`
- // stays unaltered) and re-opened it without changing the value of the command, they would see the
- // old value instead of the actual value of the command.
- // https://github.com/ckeditor/ckeditor5-image/issues/114
- labeledInput.fieldView.value = labeledInput.fieldView.element.value = command.value || '';
- this._form.labeledInput.fieldView.select();
- this._form.enableCssTransitions();
- }
- /**
- * Removes the {@link #_form} from the {@link #_balloon}.
- *
- * @param {Boolean} [focusEditable=false] Controls whether the editing view is focused afterwards.
- * @private
- */
- _hideForm( focusEditable ) {
- if ( !this._isInBalloon ) {
- return;
- }
- // Blur the input element before removing it from DOM to prevent issues in some browsers.
- // See https://github.com/ckeditor/ckeditor5/issues/1501.
- if ( this._form.focusTracker.isFocused ) {
- this._form.saveButtonView.focus();
- }
- this._balloon.remove( this._form );
- if ( focusEditable ) {
- this.editor.editing.view.focus();
- }
- }
- /**
- * Returns `true` when the {@link #_form} is the visible view in the {@link #_balloon}.
- *
- * @private
- * @type {Boolean}
- */
- get _isVisible() {
- return this._balloon.visibleView === this._form;
- }
- /**
- * Returns `true` when the {@link #_form} is in the {@link #_balloon}.
- *
- * @private
- * @type {Boolean}
- */
- get _isInBalloon() {
- return this._balloon.hasView( this._form );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js":
- /*!*******************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js ***!
- \*******************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextAlternativeFormView; });
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _theme_textalternativeform_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../theme/textalternativeform.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css");
- /* harmony import */ var _theme_textalternativeform_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_textalternativeform_css__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
- /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagetextalternative/ui/textalternativeformview
- */
- // See: #8833.
- // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
- /**
- * The TextAlternativeFormView class.
- *
- * @extends module:ui/view~View
- */
- class TextAlternativeFormView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- const t = this.locale.t;
- /**
- * Tracks information about the DOM focus in the form.
- *
- * @readonly
- * @member {module:utils/focustracker~FocusTracker}
- */
- this.focusTracker = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["FocusTracker"]();
- /**
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
- *
- * @readonly
- * @member {module:utils/keystrokehandler~KeystrokeHandler}
- */
- this.keystrokes = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["KeystrokeHandler"]();
- /**
- * An input with a label.
- *
- * @member {module:ui/labeledfield/labeledfieldview~LabeledFieldView} #labeledInput
- */
- this.labeledInput = this._createLabeledInputView();
- /**
- * A button used to submit the form.
- *
- * @member {module:ui/button/buttonview~ButtonView} #saveButtonView
- */
- this.saveButtonView = this._createButton( t( 'Save' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].check, 'ck-button-save' );
- this.saveButtonView.type = 'submit';
- /**
- * A button used to cancel the form.
- *
- * @member {module:ui/button/buttonview~ButtonView} #cancelButtonView
- */
- this.cancelButtonView = this._createButton( t( 'Cancel' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].cancel, 'ck-button-cancel', 'cancel' );
- /**
- * A collection of views which can be focused in the form.
- *
- * @readonly
- * @protected
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this._focusables = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ViewCollection"]();
- /**
- * Helps cycling over {@link #_focusables} in the form.
- *
- * @readonly
- * @protected
- * @member {module:ui/focuscycler~FocusCycler}
- */
- this._focusCycler = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["FocusCycler"]( {
- focusables: this._focusables,
- focusTracker: this.focusTracker,
- keystrokeHandler: this.keystrokes,
- actions: {
- // Navigate form fields backwards using the Shift + Tab keystroke.
- focusPrevious: 'shift + tab',
- // Navigate form fields forwards using the Tab key.
- focusNext: 'tab'
- }
- } );
- this.setTemplate( {
- tag: 'form',
- attributes: {
- class: [
- 'ck',
- 'ck-text-alternative-form',
- 'ck-responsive-form'
- ],
- // https://github.com/ckeditor/ckeditor5-image/issues/40
- tabindex: '-1'
- },
- children: [
- this.labeledInput,
- this.saveButtonView,
- this.cancelButtonView
- ]
- } );
- Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["injectCssTransitionDisabler"])( this );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- this.keystrokes.listenTo( this.element );
- Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["submitHandler"])( { view: this } );
- [ this.labeledInput, this.saveButtonView, this.cancelButtonView ]
- .forEach( v => {
- // Register the view as focusable.
- this._focusables.add( v );
- // Register the view in the focus tracker.
- this.focusTracker.add( v.element );
- } );
- }
- /**
- * Creates the button view.
- *
- * @private
- * @param {String} label The button label
- * @param {String} icon The button's icon.
- * @param {String} className The additional button CSS class name.
- * @param {String} [eventName] The event name that the ButtonView#execute event will be delegated to.
- * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
- */
- _createButton( label, icon, className, eventName ) {
- const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( this.locale );
- button.set( {
- label,
- icon,
- tooltip: true
- } );
- button.extendTemplate( {
- attributes: {
- class: className
- }
- } );
- if ( eventName ) {
- button.delegate( 'execute' ).to( this, eventName );
- }
- return button;
- }
- /**
- * Creates an input with a label.
- *
- * @private
- * @returns {module:ui/labeledfield/labeledfieldview~LabeledFieldView} Labeled field view instance.
- */
- _createLabeledInputView() {
- const t = this.locale.t;
- const labeledInput = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["LabeledFieldView"]( this.locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["createLabeledInputText"] );
- labeledInput.label = t( 'Text alternative' );
- return labeledInput;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageToolbar; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imagetoolbar
- */
- /**
- * The image toolbar plugin. It creates and manages the image toolbar (the toolbar displayed when an image is selected).
- *
- * For a detailed overview, check the {@glink features/image#image-contextual-toolbar image contextual toolbar} documentation.
- *
- * Instances of toolbar components (e.g. buttons) are created using the editor's
- * {@link module:ui/componentfactory~ComponentFactory component factory}
- * based on the {@link module:image/image~ImageConfig#toolbar `image.toolbar` configuration option}.
- *
- * The toolbar uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageToolbar extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetToolbarRepository"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageToolbar';
- }
- /**
- * @inheritDoc
- */
- afterInit() {
- const editor = this.editor;
- const t = editor.t;
- const widgetToolbarRepository = editor.plugins.get( ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetToolbarRepository"] );
- widgetToolbarRepository.register( 'image', {
- ariaLabel: t( 'Image toolbar' ),
- items: editor.config.get( 'image.toolbar' ) || [],
- getRelatedElement: _image_utils__WEBPACK_IMPORTED_MODULE_2__["getSelectedImageWidget"]
- } );
- }
- }
- /**
- * Items to be placed in the image toolbar.
- * This option is used by the {@link module:image/imagetoolbar~ImageToolbar} feature.
- *
- * Assuming that you use the following features:
- *
- * * {@link module:image/imagestyle~ImageStyle} (with a default configuration),
- * * {@link module:image/imagetextalternative~ImageTextAlternative},
- *
- * three toolbar items will be available in {@link module:ui/componentfactory~ComponentFactory}:
- * `'imageStyle:full'`, `'imageStyle:side'`, and `'imageTextAlternative'` so you can configure the toolbar like this:
- *
- * const imageConfig = {
- * toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
- * };
- *
- * Of course, the same buttons can also be used in the
- * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
- *
- * Read more about configuring toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
- *
- * @member {Array.<String>} module:image/image~ImageConfig#toolbar
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUpload; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _imageupload_imageuploadui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageupload/imageuploadui */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js");
- /* harmony import */ var _imageupload_imageuploadprogress__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imageupload/imageuploadprogress */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js");
- /* harmony import */ var _imageupload_imageuploadediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imageupload/imageuploadediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imageupload
- */
- /**
- * The image upload plugin.
- *
- * For a detailed overview, check the {@glink features/image-upload/image-upload image upload feature} documentation.
- *
- * This plugin does not do anything directly, but it loads a set of specific plugins to enable image uploading:
- *
- * * {@link module:image/imageupload/imageuploadediting~ImageUploadEditing},
- * * {@link module:image/imageupload/imageuploadui~ImageUploadUI},
- * * {@link module:image/imageupload/imageuploadprogress~ImageUploadProgress}.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageUpload extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageUpload';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _imageupload_imageuploadediting__WEBPACK_IMPORTED_MODULE_3__["default"], _imageupload_imageuploadui__WEBPACK_IMPORTED_MODULE_1__["default"], _imageupload_imageuploadprogress__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- }
- /**
- * The image upload configuration.
- *
- * @member {module:image/imageupload~ImageUploadConfig} module:image/image~ImageConfig#upload
- */
- /**
- * The configuration of the image upload feature. Used by the image upload feature in the `@ckeditor/ckeditor5-image` package.
- *
- * ClassicEditor
- * .create( editorElement, {
- * image: {
- * upload: ... // Image upload feature options.
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- *
- * @interface module:image/imageupload~ImageUploadConfig
- */
- /**
- * The list of accepted image types.
- *
- * The accepted types of images can be customized to allow only certain types of images:
- *
- * // Allow only JPEG and PNG images:
- * const imageUploadConfig = {
- * types: [ 'png', 'jpeg' ]
- * };
- *
- * The type string should match [one of the sub-types](https://www.iana.org/assignments/media-types/media-types.xhtml#image)
- * of the image MIME type. For example, for the `image/jpeg` MIME type, add `'jpeg'` to your image upload configuration.
- *
- * **Note:** This setting only restricts some image types to be selected and uploaded through the CKEditor UI and commands. Image type
- * recognition and filtering should also be implemented on the server which accepts image uploads.
- *
- * @member {Array.<String>} module:image/imageupload~ImageUploadConfig#types
- * @default [ 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff' ]
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js ***!
- \**************************************************************************************/
- /*! exports provided: default, isHtmlIncluded */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadEditing; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHtmlIncluded", function() { return isHtmlIncluded; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
- /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _uploadimagecommand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./uploadimagecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.js");
- /* harmony import */ var _src_imageupload_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../src/imageupload/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js");
- /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imageupload/imageuploadediting
- */
- /**
- * The editing part of the image upload feature. It registers the `'uploadImage'` command
- * and the `imageUpload` command as an aliased name.
- *
- * When an image is uploaded, it fires the {@link ~ImageUploadEditing#event:uploadComplete `uploadComplete` event}
- * that allows adding custom attributes to the {@link module:engine/model/element~Element image element}.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageUploadEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_4__["FileRepository"], ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["Notification"], ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_3__["ClipboardPipeline"] ];
- }
- static get pluginName() {
- return 'ImageUploadEditing';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- editor.config.define( 'image', {
- upload: {
- types: [ 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff' ]
- }
- } );
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const doc = editor.model.document;
- const schema = editor.model.schema;
- const conversion = editor.conversion;
- const fileRepository = editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_4__["FileRepository"] );
- const imageTypes = Object(_src_imageupload_utils__WEBPACK_IMPORTED_MODULE_7__["createImageTypeRegExp"])( editor.config.get( 'image.upload.types' ) );
- // Setup schema to allow uploadId and uploadStatus for images.
- schema.extend( 'image', {
- allowAttributes: [ 'uploadId', 'uploadStatus' ]
- } );
- const uploadImageCommand = new _uploadimagecommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor );
- // Register `uploadImage` command and add `imageUpload` command as an alias for backward compatibility.
- editor.commands.add( 'uploadImage', uploadImageCommand );
- editor.commands.add( 'imageUpload', uploadImageCommand );
- // Register upcast converter for uploadId.
- conversion.for( 'upcast' )
- .attributeToAttribute( {
- view: {
- name: 'img',
- key: 'uploadId'
- },
- model: 'uploadId'
- } );
- // Handle pasted images.
- // For every image file, a new file loader is created and a placeholder image is
- // inserted into the content. Then, those images are uploaded once they appear in the model
- // (see Document#change listener below).
- this.listenTo( editor.editing.view.document, 'clipboardInput', ( evt, data ) => {
- // Skip if non empty HTML data is included.
- // https://github.com/ckeditor/ckeditor5-upload/issues/68
- if ( isHtmlIncluded( data.dataTransfer ) ) {
- return;
- }
- const images = Array.from( data.dataTransfer.files ).filter( file => {
- // See https://github.com/ckeditor/ckeditor5-image/pull/254.
- if ( !file ) {
- return false;
- }
- return imageTypes.test( file.type );
- } );
- if ( !images.length ) {
- return;
- }
- evt.stop();
- editor.model.change( writer => {
- // Set selection to paste target.
- if ( data.targetRanges ) {
- writer.setSelection( data.targetRanges.map( viewRange => editor.editing.mapper.toModelRange( viewRange ) ) );
- }
- // Upload images after the selection has changed in order to ensure the command's state is refreshed.
- editor.model.enqueueChange( 'default', () => {
- editor.execute( 'uploadImage', { file: images } );
- } );
- } );
- } );
- // Handle HTML pasted with images with base64 or blob sources.
- // For every image file, a new file loader is created and a placeholder image is
- // inserted into the content. Then, those images are uploaded once they appear in the model
- // (see Document#change listener below).
- this.listenTo( editor.plugins.get( 'ClipboardPipeline' ), 'inputTransformation', ( evt, data ) => {
- const fetchableImages = Array.from( editor.editing.view.createRangeIn( data.content ) )
- .filter( value => Object(_src_imageupload_utils__WEBPACK_IMPORTED_MODULE_7__["isLocalImage"])( value.item ) && !value.item.getAttribute( 'uploadProcessed' ) )
- .map( value => { return { promise: Object(_src_imageupload_utils__WEBPACK_IMPORTED_MODULE_7__["fetchLocalImage"])( value.item ), imageElement: value.item }; } );
- if ( !fetchableImages.length ) {
- return;
- }
- const writer = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["UpcastWriter"]( editor.editing.view.document );
- for ( const fetchableImage of fetchableImages ) {
- // Set attribute marking that the image was processed already.
- writer.setAttribute( 'uploadProcessed', true, fetchableImage.imageElement );
- const loader = fileRepository.createLoader( fetchableImage.promise );
- if ( loader ) {
- writer.setAttribute( 'src', '', fetchableImage.imageElement );
- writer.setAttribute( 'uploadId', loader.id, fetchableImage.imageElement );
- }
- }
- } );
- // Prevents from the browser redirecting to the dropped image.
- editor.editing.view.document.on( 'dragover', ( evt, data ) => {
- data.preventDefault();
- } );
- // Upload placeholder images that appeared in the model.
- doc.on( 'change', () => {
- const changes = doc.differ.getChanges( { includeChangesInGraveyard: true } );
- for ( const entry of changes ) {
- if ( entry.type == 'insert' && entry.name != '$text' ) {
- const item = entry.position.nodeAfter;
- const isInGraveyard = entry.position.root.rootName == '$graveyard';
- for ( const image of getImagesFromChangeItem( editor, item ) ) {
- // Check if the image element still has upload id.
- const uploadId = image.getAttribute( 'uploadId' );
- if ( !uploadId ) {
- continue;
- }
- // Check if the image is loaded on this client.
- const loader = fileRepository.loaders.get( uploadId );
- if ( !loader ) {
- continue;
- }
- if ( isInGraveyard ) {
- // If the image was inserted to the graveyard - abort the loading process.
- loader.abort();
- } else if ( loader.status == 'idle' ) {
- // If the image was inserted into content and has not been loaded yet, start loading it.
- this._readAndUpload( loader, image );
- }
- }
- }
- }
- } );
- // Set the default handler for feeding the image element with `src` and `srcset` attributes.
- this.on( 'uploadComplete', ( evt, { imageElement, data } ) => {
- const urls = data.urls ? data.urls : data;
- this.editor.model.change( writer => {
- writer.setAttribute( 'src', urls.default, imageElement );
- this._parseAndSetSrcsetAttributeOnImage( urls, imageElement, writer );
- } );
- }, { priority: 'low' } );
- }
- /**
- * Reads and uploads an image.
- *
- * The image is read from the disk and as a Base64-encoded string it is set temporarily to
- * `image[src]`. When the image is successfully uploaded, the temporary data is replaced with the target
- * image's URL (the URL to the uploaded image on the server).
- *
- * @protected
- * @param {module:upload/filerepository~FileLoader} loader
- * @param {module:engine/model/element~Element} imageElement
- * @returns {Promise}
- */
- _readAndUpload( loader, imageElement ) {
- const editor = this.editor;
- const model = editor.model;
- const t = editor.locale.t;
- const fileRepository = editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_4__["FileRepository"] );
- const notification = editor.plugins.get( ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["Notification"] );
- model.enqueueChange( 'transparent', writer => {
- writer.setAttribute( 'uploadStatus', 'reading', imageElement );
- } );
- return loader.read()
- .then( () => {
- const promise = loader.upload();
- // Force re–paint in Safari. Without it, the image will display with a wrong size.
- // https://github.com/ckeditor/ckeditor5/issues/1975
- /* istanbul ignore next */
- if ( ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_5__["env"].isSafari ) {
- const viewFigure = editor.editing.mapper.toViewElement( imageElement );
- const viewImg = Object(_image_utils__WEBPACK_IMPORTED_MODULE_8__["getViewImgFromWidget"])( viewFigure );
- editor.editing.view.once( 'render', () => {
- // Early returns just to be safe. There might be some code ran
- // in between the outer scope and this callback.
- if ( !viewImg.parent ) {
- return;
- }
- const domFigure = editor.editing.view.domConverter.mapViewToDom( viewImg.parent );
- if ( !domFigure ) {
- return;
- }
- const originalDisplay = domFigure.style.display;
- domFigure.style.display = 'none';
- // Make sure this line will never be removed during minification for having "no effect".
- domFigure._ckHack = domFigure.offsetHeight;
- domFigure.style.display = originalDisplay;
- } );
- }
- model.enqueueChange( 'transparent', writer => {
- writer.setAttribute( 'uploadStatus', 'uploading', imageElement );
- } );
- return promise;
- } )
- .then( data => {
- model.enqueueChange( 'transparent', writer => {
- writer.setAttribute( 'uploadStatus', 'complete', imageElement );
- /**
- * An event fired when an image is uploaded. You can hook into this event to provide
- * custom attributes to the {@link module:engine/model/element~Element image element} based on the data from
- * the server.
- *
- * const imageUploadEditing = editor.plugins.get( 'ImageUploadEditing' );
- *
- * imageUploadEditing.on( 'uploadComplete', ( evt, { data, imageElement } ) => {
- * editor.model.change( writer => {
- * writer.setAttribute( 'someAttribute', 'foo', imageElement );
- * } );
- * } );
- *
- * You can also stop the default handler that sets the `src` and `srcset` attributes
- * if you want to provide custom values for these attributes.
- *
- * imageUploadEditing.on( 'uploadComplete', ( evt, { data, imageElement } ) => {
- * evt.stop();
- * } );
- *
- * **Note**: This event is fired by the {@link module:image/imageupload/imageuploadediting~ImageUploadEditing} plugin.
- *
- * @event uploadComplete
- * @param {Object} data The `uploadComplete` event data.
- * @param {Object} data.data The data coming from the upload adapter.
- * @param {module:engine/model/element~Element} data.imageElement The
- * model {@link module:engine/model/element~Element image element} that can be customized.
- */
- this.fire( 'uploadComplete', { data, imageElement } );
- } );
- clean();
- } )
- .catch( error => {
- // If status is not 'error' nor 'aborted' - throw error because it means that something else went wrong,
- // it might be generic error and it would be real pain to find what is going on.
- if ( loader.status !== 'error' && loader.status !== 'aborted' ) {
- throw error;
- }
- // Might be 'aborted'.
- if ( loader.status == 'error' && error ) {
- notification.showWarning( error, {
- title: t( 'Upload failed' ),
- namespace: 'upload'
- } );
- }
- clean();
- // Permanently remove image from insertion batch.
- model.enqueueChange( 'transparent', writer => {
- writer.remove( imageElement );
- } );
- } );
- function clean() {
- model.enqueueChange( 'transparent', writer => {
- writer.removeAttribute( 'uploadId', imageElement );
- writer.removeAttribute( 'uploadStatus', imageElement );
- } );
- fileRepository.destroyLoader( loader );
- }
- }
- /**
- * Creates the `srcset` attribute based on a given file upload response and sets it as an attribute to a specific image element.
- *
- * @protected
- * @param {Object} data Data object from which `srcset` will be created.
- * @param {module:engine/model/element~Element} image The image element on which the `srcset` attribute will be set.
- * @param {module:engine/model/writer~Writer} writer
- */
- _parseAndSetSrcsetAttributeOnImage( data, image, writer ) {
- // Srcset attribute for responsive images support.
- let maxWidth = 0;
- const srcsetAttribute = Object.keys( data )
- // Filter out keys that are not integers.
- .filter( key => {
- const width = parseInt( key, 10 );
- if ( !isNaN( width ) ) {
- maxWidth = Math.max( maxWidth, width );
- return true;
- }
- } )
- // Convert each key to srcset entry.
- .map( key => `${ data[ key ] } ${ key }w` )
- // Join all entries.
- .join( ', ' );
- if ( srcsetAttribute != '' ) {
- writer.setAttribute( 'srcset', {
- data: srcsetAttribute,
- width: maxWidth
- }, image );
- }
- }
- }
- // Returns `true` if non-empty `text/html` is included in the data transfer.
- //
- // @param {module:clipboard/datatransfer~DataTransfer} dataTransfer
- // @returns {Boolean}
- function isHtmlIncluded( dataTransfer ) {
- return Array.from( dataTransfer.types ).includes( 'text/html' ) && dataTransfer.getData( 'text/html' ) !== '';
- }
- function getImagesFromChangeItem( editor, item ) {
- return Array.from( editor.model.createRangeOn( item ) )
- .filter( value => value.item.is( 'element', 'image' ) )
- .map( value => value.item );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js ***!
- \***************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadProgress; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
- /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /* harmony import */ var _theme_icons_image_placeholder_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/icons/image_placeholder.svg */ "./node_modules/@ckeditor/ckeditor5-image/theme/icons/image_placeholder.svg");
- /* harmony import */ var _theme_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/imageuploadprogress.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css");
- /* harmony import */ var _theme_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _theme_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/imageuploadicon.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css");
- /* harmony import */ var _theme_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _theme_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/imageuploadloader.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css");
- /* harmony import */ var _theme_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_theme_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_6__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imageupload/imageuploadprogress
- */
- /* globals setTimeout */
- /**
- * The image upload progress plugin.
- * It shows a placeholder when the image is read from the disk and a progress bar while the image is uploading.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageUploadProgress extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageUploadProgress';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- /**
- * The image placeholder that is displayed before real image data can be accessed.
- *
- * @protected
- * @member {String} #placeholder
- */
- this.placeholder = 'data:image/svg+xml;utf8,' + encodeURIComponent( _theme_icons_image_placeholder_svg__WEBPACK_IMPORTED_MODULE_3__["default"] );
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Upload status change - update image's view according to that status.
- editor.editing.downcastDispatcher.on( 'attribute:uploadStatus:image', ( ...args ) => this.uploadStatusChange( ...args ) );
- }
- /**
- * This method is called each time the image `uploadStatus` attribute is changed.
- *
- * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
- * @param {Object} data Additional information about the change.
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
- */
- uploadStatusChange( evt, data, conversionApi ) {
- const editor = this.editor;
- const modelImage = data.item;
- const uploadId = modelImage.getAttribute( 'uploadId' );
- if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
- return;
- }
- const fileRepository = editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] );
- const status = uploadId ? data.attributeNewValue : null;
- const placeholder = this.placeholder;
- const viewFigure = editor.editing.mapper.toViewElement( modelImage );
- const viewWriter = conversionApi.writer;
- if ( status == 'reading' ) {
- // Start "appearing" effect and show placeholder with infinite progress bar on the top
- // while image is read from disk.
- _startAppearEffect( viewFigure, viewWriter );
- _showPlaceholder( placeholder, viewFigure, viewWriter );
- return;
- }
- // Show progress bar on the top of the image when image is uploading.
- if ( status == 'uploading' ) {
- const loader = fileRepository.loaders.get( uploadId );
- // Start appear effect if needed - see https://github.com/ckeditor/ckeditor5-image/issues/191.
- _startAppearEffect( viewFigure, viewWriter );
- if ( !loader ) {
- // There is no loader associated with uploadId - this means that image came from external changes.
- // In such cases we still want to show the placeholder until image is fully uploaded.
- // Show placeholder if needed - see https://github.com/ckeditor/ckeditor5-image/issues/191.
- _showPlaceholder( placeholder, viewFigure, viewWriter );
- } else {
- // Hide placeholder and initialize progress bar showing upload progress.
- _hidePlaceholder( viewFigure, viewWriter );
- _showProgressBar( viewFigure, viewWriter, loader, editor.editing.view );
- _displayLocalImage( viewFigure, viewWriter, loader );
- }
- return;
- }
- if ( status == 'complete' && fileRepository.loaders.get( uploadId ) ) {
- _showCompleteIcon( viewFigure, viewWriter, editor.editing.view );
- }
- // Clean up.
- _hideProgressBar( viewFigure, viewWriter );
- _hidePlaceholder( viewFigure, viewWriter );
- _stopAppearEffect( viewFigure, viewWriter );
- }
- }
- // Adds ck-appear class to the image figure if one is not already applied.
- //
- // @param {module:engine/view/containerelement~ContainerElement} viewFigure
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- function _startAppearEffect( viewFigure, writer ) {
- if ( !viewFigure.hasClass( 'ck-appear' ) ) {
- writer.addClass( 'ck-appear', viewFigure );
- }
- }
- // Removes ck-appear class to the image figure if one is not already removed.
- //
- // @param {module:engine/view/containerelement~ContainerElement} viewFigure
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- function _stopAppearEffect( viewFigure, writer ) {
- writer.removeClass( 'ck-appear', viewFigure );
- }
- // Shows placeholder together with infinite progress bar on given image figure.
- //
- // @param {String} Data-uri with a svg placeholder.
- // @param {module:engine/view/containerelement~ContainerElement} viewFigure
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- function _showPlaceholder( placeholder, viewFigure, writer ) {
- if ( !viewFigure.hasClass( 'ck-image-upload-placeholder' ) ) {
- writer.addClass( 'ck-image-upload-placeholder', viewFigure );
- }
- const viewImg = Object(_image_utils__WEBPACK_IMPORTED_MODULE_2__["getViewImgFromWidget"])( viewFigure );
- if ( viewImg.getAttribute( 'src' ) !== placeholder ) {
- writer.setAttribute( 'src', placeholder, viewImg );
- }
- if ( !_getUIElement( viewFigure, 'placeholder' ) ) {
- writer.insert( writer.createPositionAfter( viewImg ), _createPlaceholder( writer ) );
- }
- }
- // Removes placeholder together with infinite progress bar on given image figure.
- //
- // @param {module:engine/view/containerelement~ContainerElement} viewFigure
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- function _hidePlaceholder( viewFigure, writer ) {
- if ( viewFigure.hasClass( 'ck-image-upload-placeholder' ) ) {
- writer.removeClass( 'ck-image-upload-placeholder', viewFigure );
- }
- _removeUIElement( viewFigure, writer, 'placeholder' );
- }
- // Shows progress bar displaying upload progress.
- // Attaches it to the file loader to update when upload percentace is changed.
- //
- // @param {module:engine/view/containerelement~ContainerElement} viewFigure
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- // @param {module:upload/filerepository~FileLoader} loader
- // @param {module:engine/view/view~View} view
- function _showProgressBar( viewFigure, writer, loader, view ) {
- const progressBar = _createProgressBar( writer );
- writer.insert( writer.createPositionAt( viewFigure, 'end' ), progressBar );
- // Update progress bar width when uploadedPercent is changed.
- loader.on( 'change:uploadedPercent', ( evt, name, value ) => {
- view.change( writer => {
- writer.setStyle( 'width', value + '%', progressBar );
- } );
- } );
- }
- // Hides upload progress bar.
- //
- // @param {module:engine/view/containerelement~ContainerElement} viewFigure
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- function _hideProgressBar( viewFigure, writer ) {
- _removeUIElement( viewFigure, writer, 'progressBar' );
- }
- // Shows complete icon and hides after a certain amount of time.
- //
- // @param {module:engine/view/containerelement~ContainerElement} viewFigure
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- // @param {module:engine/view/view~View} view
- function _showCompleteIcon( viewFigure, writer, view ) {
- const completeIcon = writer.createUIElement( 'div', { class: 'ck-image-upload-complete-icon' } );
- writer.insert( writer.createPositionAt( viewFigure, 'end' ), completeIcon );
- setTimeout( () => {
- view.change( writer => writer.remove( writer.createRangeOn( completeIcon ) ) );
- }, 3000 );
- }
- // Create progress bar element using {@link module:engine/view/uielement~UIElement}.
- //
- // @private
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- // @returns {module:engine/view/uielement~UIElement}
- function _createProgressBar( writer ) {
- const progressBar = writer.createUIElement( 'div', { class: 'ck-progress-bar' } );
- writer.setCustomProperty( 'progressBar', true, progressBar );
- return progressBar;
- }
- // Create placeholder element using {@link module:engine/view/uielement~UIElement}.
- //
- // @private
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- // @returns {module:engine/view/uielement~UIElement}
- function _createPlaceholder( writer ) {
- const placeholder = writer.createUIElement( 'div', { class: 'ck-upload-placeholder-loader' } );
- writer.setCustomProperty( 'placeholder', true, placeholder );
- return placeholder;
- }
- // Returns {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.
- // Returns `undefined` if element is not found.
- //
- // @private
- // @param {module:engine/view/element~Element} imageFigure
- // @param {String} uniqueProperty
- // @returns {module:engine/view/uielement~UIElement|undefined}
- function _getUIElement( imageFigure, uniqueProperty ) {
- for ( const child of imageFigure.getChildren() ) {
- if ( child.getCustomProperty( uniqueProperty ) ) {
- return child;
- }
- }
- }
- // Removes {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.
- //
- // @private
- // @param {module:engine/view/element~Element} imageFigure
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- // @param {String} uniqueProperty
- function _removeUIElement( viewFigure, writer, uniqueProperty ) {
- const element = _getUIElement( viewFigure, uniqueProperty );
- if ( element ) {
- writer.remove( writer.createRangeOn( element ) );
- }
- }
- // Displays local data from file loader.
- //
- // @param {module:engine/view/element~Element} imageFigure
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- // @param {module:upload/filerepository~FileLoader} loader
- function _displayLocalImage( viewFigure, writer, loader ) {
- if ( loader.data ) {
- const viewImg = Object(_image_utils__WEBPACK_IMPORTED_MODULE_2__["getViewImgFromWidget"])( viewFigure );
- writer.setAttribute( 'src', loader.data, viewImg );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imageupload/imageuploadui
- */
- /**
- * The image upload button plugin.
- *
- * For a detailed overview, check the {@glink features/image-upload/image-upload Image upload feature} documentation.
- *
- * Adds the `'uploadImage'` button to the {@link module:ui/componentfactory~ComponentFactory UI component factory}
- * and also the `imageUpload` button as an alias for backward compatibility.
- *
- * @extends module:core/plugin~Plugin
- */
- class ImageUploadUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ImageUploadUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const t = editor.t;
- const componentCreator = locale => {
- const view = new ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileDialogButtonView"]( locale );
- const command = editor.commands.get( 'uploadImage' );
- const imageTypes = editor.config.get( 'image.upload.types' );
- const imageTypesRegExp = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["createImageTypeRegExp"])( imageTypes );
- view.set( {
- acceptedType: imageTypes.map( type => `image/${ type }` ).join( ',' ),
- allowMultipleFiles: true
- } );
- view.buttonView.set( {
- label: t( 'Insert image' ),
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].image,
- tooltip: true
- } );
- view.buttonView.bind( 'isEnabled' ).to( command );
- view.on( 'done', ( evt, files ) => {
- const imagesToUpload = Array.from( files ).filter( file => imageTypesRegExp.test( file.type ) );
- if ( imagesToUpload.length ) {
- editor.execute( 'uploadImage', { file: imagesToUpload } );
- }
- } );
- return view;
- };
- // Setup `uploadImage` button and add `imageUpload` button as an alias for backward compatibility.
- editor.ui.componentFactory.add( 'uploadImage', componentCreator );
- editor.ui.componentFactory.add( 'imageUpload', componentCreator );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.js ***!
- \**************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UploadImageCommand; });
- /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imageupload/uploadimagecommand
- */
- /**
- * The upload image command.
- *
- * The command is registered by the {@link module:image/imageupload/imageuploadediting~ImageUploadEditing} plugin as `uploadImage`
- * and it is also available via aliased `imageUpload` name.
- *
- * In order to upload an image at the current selection position
- * (according to the {@link module:widget/utils~findOptimalInsertionPosition} algorithm),
- * execute the command and pass the native image file instance:
- *
- * this.listenTo( editor.editing.view.document, 'clipboardInput', ( evt, data ) => {
- * // Assuming that only images were pasted:
- * const images = Array.from( data.dataTransfer.files );
- *
- * // Upload the first image:
- * editor.execute( 'uploadImage', { file: images[ 0 ] } );
- * } );
- *
- * It is also possible to insert multiple images at once:
- *
- * editor.execute( 'uploadImage', {
- * file: [
- * file1,
- * file2
- * ]
- * } );
- *
- * @extends module:core/command~Command
- */
- class UploadImageCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const imageElement = this.editor.model.document.selection.getSelectedElement();
- const isImage = imageElement && imageElement.name === 'image' || false;
- this.isEnabled = Object(_image_utils__WEBPACK_IMPORTED_MODULE_3__["isImageAllowed"])( this.editor.model ) || isImage;
- }
- /**
- * Executes the command.
- *
- * @fires execute
- * @param {Object} options Options for the executed command.
- * @param {File|Array.<File>} options.file The image file or an array of image files to upload.
- */
- execute( options ) {
- const editor = this.editor;
- const model = editor.model;
- const fileRepository = editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_0__["FileRepository"] );
- for ( const file of Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toArray"])( options.file ) ) {
- uploadImage( model, fileRepository, file );
- }
- }
- }
- // Handles uploading single file.
- //
- // @param {module:engine/model/model~Model} model
- // @param {File} file
- function uploadImage( model, fileRepository, file ) {
- const loader = fileRepository.createLoader( file );
- // Do not throw when upload adapter is not set. FileRepository will log an error anyway.
- if ( !loader ) {
- return;
- }
- Object(_image_utils__WEBPACK_IMPORTED_MODULE_3__["insertImage"])( model, { uploadId: loader.id } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js ***!
- \*************************************************************************/
- /*! exports provided: createImageTypeRegExp, fetchLocalImage, isLocalImage */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createImageTypeRegExp", function() { return createImageTypeRegExp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetchLocalImage", function() { return fetchLocalImage; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLocalImage", function() { return isLocalImage; });
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module image/imageupload/utils
- */
- /* global fetch, File */
- /**
- * Creates a regular expression used to test for image files.
- *
- * const imageType = createImageTypeRegExp( [ 'png', 'jpeg', 'svg+xml', 'vnd.microsoft.icon' ] );
- *
- * console.log( 'is supported image', imageType.test( file.type ) );
- *
- * @param {Array.<String>} types
- * @returns {RegExp}
- */
- function createImageTypeRegExp( types ) {
- // Sanitize the MIME type name which may include: "+", "-" or ".".
- const regExpSafeNames = types.map( type => type.replace( '+', '\\+' ) );
- return new RegExp( `^image\\/(${ regExpSafeNames.join( '|' ) })$` );
- }
- /**
- * Creates a promise that fetches the image local source (Base64 or blob) and resolves with a `File` object.
- *
- * @param {module:engine/view/element~Element} image Image whose source to fetch.
- * @returns {Promise.<File>} A promise which resolves when an image source is fetched and converted to a `File` instance.
- * It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.
- */
- function fetchLocalImage( image ) {
- return new Promise( ( resolve, reject ) => {
- const imageSrc = image.getAttribute( 'src' );
- // Fetch works asynchronously and so does not block browser UI when processing data.
- fetch( imageSrc )
- .then( resource => resource.blob() )
- .then( blob => {
- const mimeType = getImageMimeType( blob, imageSrc );
- const ext = mimeType.replace( 'image/', '' );
- const filename = `image.${ ext }`;
- const file = new File( [ blob ], filename, { type: mimeType } );
- resolve( file );
- } )
- .catch( err => {
- // Fetch fails only, if it can't make a request due to a network failure or if anything prevented the request
- // from completing, i.e. the Content Security Policy rules. It is not possible to detect the exact cause of failure,
- // so we are just trying the fallback solution, if general TypeError is thrown.
- return err && err.name === 'TypeError' ?
- convertLocalImageOnCanvas( imageSrc ).then( resolve ).catch( reject ) :
- reject( err );
- } );
- } );
- }
- /**
- * Checks whether a given node is an image element with a local source (Base64 or blob).
- *
- * @param {module:engine/view/node~Node} node The node to check.
- * @returns {Boolean}
- */
- function isLocalImage( node ) {
- if ( !node.is( 'element', 'img' ) || !node.getAttribute( 'src' ) ) {
- return false;
- }
- return node.getAttribute( 'src' ).match( /^data:image\/\w+;base64,/g ) ||
- node.getAttribute( 'src' ).match( /^blob:/g );
- }
- // Extracts an image type based on its blob representation or its source.
- //
- // @param {String} src Image `src` attribute value.
- // @param {Blob} blob Image blob representation.
- // @returns {String}
- function getImageMimeType( blob, src ) {
- if ( blob.type ) {
- return blob.type;
- } else if ( src.match( /data:(image\/\w+);base64/ ) ) {
- return src.match( /data:(image\/\w+);base64/ )[ 1 ].toLowerCase();
- } else {
- // Fallback to 'jpeg' as common extension.
- return 'image/jpeg';
- }
- }
- // Creates a promise that converts the image local source (Base64 or blob) to a blob using canvas and resolves
- // with a `File` object.
- //
- // @param {String} imageSrc Image `src` attribute value.
- // @returns {Promise.<File>} A promise which resolves when an image source is converted to a `File` instance.
- // It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.
- function convertLocalImageOnCanvas( imageSrc ) {
- return getBlobFromCanvas( imageSrc ).then( blob => {
- const mimeType = getImageMimeType( blob, imageSrc );
- const ext = mimeType.replace( 'image/', '' );
- const filename = `image.${ ext }`;
- return new File( [ blob ], filename, { type: mimeType } );
- } );
- }
- // Creates a promise that resolves with a `Blob` object converted from the image source (Base64 or blob).
- //
- // @param {String} imageSrc Image `src` attribute value.
- // @returns {Promise.<Blob>}
- function getBlobFromCanvas( imageSrc ) {
- return new Promise( ( resolve, reject ) => {
- const image = ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["global"].document.createElement( 'img' );
- image.addEventListener( 'load', () => {
- const canvas = ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["global"].document.createElement( 'canvas' );
- canvas.width = image.width;
- canvas.height = image.height;
- const ctx = canvas.getContext( '2d' );
- ctx.drawImage( image, 0, 0 );
- canvas.toBlob( blob => blob ? resolve( blob ) : reject() );
- } );
- image.addEventListener( 'error', () => reject() );
- image.src = imageSrc;
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/icons/image_placeholder.svg":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/theme/icons/image_placeholder.svg ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 700 250\"><rect rx=\"4\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/image.css":
- /*!****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/theme/image.css ***!
- \****************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./image.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/image.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css ***!
- \***********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./imagecaption.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css ***!
- \**********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./imageresize.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css ***!
- \*********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./imagestyle.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css ***!
- \**************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./imageuploadicon.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./imageuploadloader.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css ***!
- \******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./imageuploadprogress.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css ***!
- \******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./textalternativeform.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-indent/src/indent.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-indent/src/indent.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Indent; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _indentediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./indentediting */ "./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js");
- /* harmony import */ var _indentui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./indentui */ "./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module indent/indent
- */
- /**
- * The indent feature.
- *
- * This plugin acts as a single entry point plugin for other features that implement indentation of elements like lists or paragraphs.
- *
- * The compatible features are:
- *
- * * The {@link module:list/list~List} or {@link module:list/listediting~ListEditing} feature for list indentation.
- * * The {@link module:indent/indentblock~IndentBlock} feature for block indentation.
- *
- * This is a "glue" plugin that loads the following plugins:
- *
- * * The {@link module:indent/indentediting~IndentEditing indent editing feature}.
- * * The {@link module:indent/indentui~IndentUI indent UI feature}.
- *
- * The dependent plugins register the `'indent'` and `'outdent'` commands and introduce the `'indent'` and `'outdent'` buttons
- * that allow to increase or decrease text indentation of supported elements.
- *
- * **Note**: In order for the commands and buttons to work, at least one of compatible features is required.
- *
- * @extends module:core/plugin~Plugin
- */
- class Indent extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Indent';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _indentediting__WEBPACK_IMPORTED_MODULE_1__["default"], _indentui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IndentEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module indent/indentediting
- */
- /**
- * The indent editing feature.
- *
- * This plugin registers the `'indent'` and `'outdent'` commands.
- *
- * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in the
- * {@link module:indent/indent~Indent indent feature} API documentation.
- *
- * @extends module:core/plugin~Plugin
- */
- class IndentEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'IndentEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- editor.commands.add( 'indent', new ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["MultiCommand"]( editor ) );
- editor.commands.add( 'outdent', new ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["MultiCommand"]( editor ) );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IndentUI; });
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _theme_icons_indent_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/indent.svg */ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/indent.svg");
- /* harmony import */ var _theme_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/icons/outdent.svg */ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/outdent.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module indent/indentui
- */
- /**
- * The indent UI feature.
- *
- * This plugin registers the `'indent'` and `'outdent'` buttons.
- *
- * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in
- * the {@link module:indent/indent~Indent indent feature} API documentation.
- *
- * @extends module:core/plugin~Plugin
- */
- class IndentUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'IndentUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const locale = editor.locale;
- const t = editor.t;
- const localizedIndentIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_indent_svg__WEBPACK_IMPORTED_MODULE_2__["default"] : _theme_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_3__["default"];
- const localizedOutdentIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_3__["default"] : _theme_icons_indent_svg__WEBPACK_IMPORTED_MODULE_2__["default"];
- this._defineButton( 'indent', t( 'Increase indent' ), localizedIndentIcon );
- this._defineButton( 'outdent', t( 'Decrease indent' ), localizedOutdentIcon );
- }
- /**
- * Defines a UI button.
- *
- * @param {String} commandName
- * @param {String} label
- * @param {String} icon
- * @private
- */
- _defineButton( commandName, label, icon ) {
- const editor = this.editor;
- editor.ui.componentFactory.add( commandName, locale => {
- const command = editor.commands.get( commandName );
- const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( locale );
- view.set( {
- label,
- icon,
- tooltip: true
- } );
- view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
- this.listenTo( view, 'execute', () => {
- editor.execute( commandName );
- editor.editing.view.focus();
- } );
- return view;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/indent.svg":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-indent/theme/icons/indent.svg ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/outdent.svg":
- /*!*************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-indent/theme/icons/outdent.svg ***!
- \*************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/autolink.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/autolink.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AutoLink; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/autolink
- */
- const MIN_LINK_LENGTH_WITH_SPACE_AT_END = 4; // Ie: "t.co " (length 5).
- // This was a tweak from https://gist.github.com/dperini/729294.
- const URL_REG_EXP = new RegExp(
- // Group 1: Line start or after a space.
- '(^|\\s)' +
- // Group 2: Detected URL (or e-mail).
- '(' +
- // Protocol identifier or short syntax "//"
- // a. Full form http://user@foo.bar.baz:8080/foo/bar.html#baz?foo=bar
- '(' +
- '(?:(?:(?:https?|ftp):)?\\/\\/)' +
- // BasicAuth using user:pass (optional)
- '(?:\\S+(?::\\S*)?@)?' +
- '(?:' +
- // IP address dotted notation octets
- // excludes loopback network 0.0.0.0
- // excludes reserved space >= 224.0.0.0
- // excludes network & broadcast addresses
- // (first & last IP address of each class)
- '(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])' +
- '(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}' +
- '(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))' +
- '|' +
- '(' +
- // Do not allow `www.foo` - see https://github.com/ckeditor/ckeditor5/issues/8050.
- '((?!www\\.)|(www\\.))' +
- // Host & domain names.
- '(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+' +
- // TLD identifier name.
- '(?:[a-z\\u00a1-\\uffff]{2,63})' +
- ')' +
- ')' +
- // port number (optional)
- '(?::\\d{2,5})?' +
- // resource path (optional)
- '(?:[/?#]\\S*)?' +
- ')' +
- '|' +
- // b. Short form (either www.example.com or example@example.com)
- '(' +
- '(www.|(\\S+@))' +
- // Host & domain names.
- '((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+' +
- // TLD identifier name.
- '(?:[a-z\\u00a1-\\uffff]{2,63})' +
- ')' +
- ')$', 'i' );
- const URL_GROUP_IN_MATCH = 2;
- /**
- * The autolink plugin.
- *
- * @extends module:core/plugin~Plugin
- */
- class AutoLink extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'AutoLink';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const selection = editor.model.document.selection;
- selection.on( 'change:range', () => {
- // Disable plugin when selection is inside a code block.
- this.isEnabled = !selection.anchor.parent.is( 'element', 'codeBlock' );
- } );
- this._enableTypingHandling();
- }
- /**
- * @inheritDoc
- */
- afterInit() {
- this._enableEnterHandling();
- this._enableShiftEnterHandling();
- }
- /**
- * Enables autolinking on typing.
- *
- * @private
- */
- _enableTypingHandling() {
- const editor = this.editor;
- const watcher = new ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["TextWatcher"]( editor.model, text => {
- // 1. Detect <kbd>Space</kbd> after a text with a potential link.
- if ( !isSingleSpaceAtTheEnd( text ) ) {
- return;
- }
- // 2. Check text before last typed <kbd>Space</kbd>.
- const url = getUrlAtTextEnd( text.substr( 0, text.length - 1 ) );
- if ( url ) {
- return { url };
- }
- } );
- const input = editor.plugins.get( 'Input' );
- watcher.on( 'matched:data', ( evt, data ) => {
- const { batch, range, url } = data;
- if ( !input.isInput( batch ) ) {
- return;
- }
- const linkEnd = range.end.getShiftedBy( -1 ); // Executed after a space character.
- const linkStart = linkEnd.getShiftedBy( -url.length );
- const linkRange = editor.model.createRange( linkStart, linkEnd );
- this._applyAutoLink( url, linkRange );
- } );
- watcher.bind( 'isEnabled' ).to( this );
- }
- /**
- * Enables autolinking on the <kbd>Enter</kbd> key.
- *
- * @private
- */
- _enableEnterHandling() {
- const editor = this.editor;
- const model = editor.model;
- const enterCommand = editor.commands.get( 'enter' );
- if ( !enterCommand ) {
- return;
- }
- enterCommand.on( 'execute', () => {
- const position = model.document.selection.getFirstPosition();
- if ( !position.parent.previousSibling ) {
- return;
- }
- const rangeToCheck = model.createRangeIn( position.parent.previousSibling );
- this._checkAndApplyAutoLinkOnRange( rangeToCheck );
- } );
- }
- /**
- * Enables autolinking on the <kbd>Shift</kbd>+<kbd>Enter</kbd> keyboard shortcut.
- *
- * @private
- */
- _enableShiftEnterHandling() {
- const editor = this.editor;
- const model = editor.model;
- const shiftEnterCommand = editor.commands.get( 'shiftEnter' );
- if ( !shiftEnterCommand ) {
- return;
- }
- shiftEnterCommand.on( 'execute', () => {
- const position = model.document.selection.getFirstPosition();
- const rangeToCheck = model.createRange(
- model.createPositionAt( position.parent, 0 ),
- position.getShiftedBy( -1 )
- );
- this._checkAndApplyAutoLinkOnRange( rangeToCheck );
- } );
- }
- /**
- * Checks if the passed range contains a linkable text.
- *
- * @param {module:engine/model/range~Range} rangeToCheck
- * @private
- */
- _checkAndApplyAutoLinkOnRange( rangeToCheck ) {
- const model = this.editor.model;
- const { text, range } = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["getLastTextLine"])( rangeToCheck, model );
- const url = getUrlAtTextEnd( text );
- if ( url ) {
- const linkRange = model.createRange(
- range.end.getShiftedBy( -url.length ),
- range.end
- );
- this._applyAutoLink( url, linkRange );
- }
- }
- /**
- * Applies a link on a given range.
- *
- * @param {String} url The URL to link.
- * @param {module:engine/model/range~Range} range The text range to apply the link attribute to.
- * @private
- */
- _applyAutoLink( link, range ) {
- const model = this.editor.model;
- if ( !this.isEnabled || !isLinkAllowedOnRange( range, model ) ) {
- return;
- }
- // Enqueue change to make undo step.
- model.enqueueChange( writer => {
- const defaultProtocol = this.editor.config.get( 'link.defaultProtocol' );
- const parsedUrl = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["addLinkProtocolIfApplicable"])( link, defaultProtocol );
- writer.setAttribute( 'linkHref', parsedUrl, range );
- } );
- }
- }
- // Check if text should be evaluated by the plugin in order to reduce number of RegExp checks on whole text.
- function isSingleSpaceAtTheEnd( text ) {
- return text.length > MIN_LINK_LENGTH_WITH_SPACE_AT_END && text[ text.length - 1 ] === ' ' && text[ text.length - 2 ] !== ' ';
- }
- function getUrlAtTextEnd( text ) {
- const match = URL_REG_EXP.exec( text );
- return match ? match[ URL_GROUP_IN_MATCH ] : null;
- }
- function isLinkAllowedOnRange( range, model ) {
- return model.schema.checkAttributeInSelection( model.createSelection( range ), 'linkHref' );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/link.js":
- /*!***********************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/link.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Link; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _linkediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
- /* harmony import */ var _linkui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkui */ "./node_modules/@ckeditor/ckeditor5-link/src/linkui.js");
- /* harmony import */ var _autolink__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./autolink */ "./node_modules/@ckeditor/ckeditor5-link/src/autolink.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/link
- */
- /**
- * The link plugin.
- *
- * This is a "glue" plugin that loads the {@link module:link/linkediting~LinkEditing link editing feature}
- * and {@link module:link/linkui~LinkUI link UI feature}.
- *
- * @extends module:core/plugin~Plugin
- */
- class Link extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _linkediting__WEBPACK_IMPORTED_MODULE_1__["default"], _linkui__WEBPACK_IMPORTED_MODULE_2__["default"], _autolink__WEBPACK_IMPORTED_MODULE_3__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Link';
- }
- }
- /**
- * The configuration of the {@link module:link/link~Link} feature.
- *
- * Read more in {@link module:link/link~LinkConfig}.
- *
- * @member {module:link/link~LinkConfig} module:core/editor/editorconfig~EditorConfig#link
- */
- /**
- * The configuration of the {@link module:link/link~Link link feature}.
- *
- * ClassicEditor
- * .create( editorElement, {
- * link: ... // Link feature configuration.
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- * @interface LinkConfig
- */
- /**
- * When set, the editor will add the given protocol to the link when the user creates a link without one.
- * For example, when the user is creating a link and types `ckeditor.com` in the link form input, during link submission
- * the editor will automatically add the `http://` protocol, so the link will look as follows: `http://ckeditor.com`.
- *
- * The feature also provides email address auto-detection. When you submit `hello@example.com`,
- * the plugin will automatically change it to `mailto:hello@example.com`.
- *
- * ClassicEditor
- * .create( editorElement, {
- * link: {
- * defaultProtocol: 'http://'
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * **NOTE:** If no configuration is provided, the editor will not auto-fix the links.
- *
- * @member {String} module:link/link~LinkConfig#defaultProtocol
- */
- /**
- * When set to `true`, the `target="blank"` and `rel="noopener noreferrer"` attributes are automatically added to all external links
- * in the editor. "External links" are all links in the editor content starting with `http`, `https`, or `//`.
- *
- * ClassicEditor
- * .create( editorElement, {
- * link: {
- * addTargetToExternalLinks: true
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * Internally, this option activates a predefined {@link module:link/link~LinkConfig#decorators automatic link decorator}
- * that extends all external links with the `target` and `rel` attributes.
- *
- * **Note**: To control the `target` and `rel` attributes of specific links in the edited content, a dedicated
- * {@link module:link/link~LinkDecoratorManualDefinition manual} decorator must be defined in the
- * {@link module:link/link~LinkConfig#decorators `config.link.decorators`} array. In such scenario,
- * the `config.link.addTargetToExternalLinks` option should remain `undefined` or `false` to not interfere with the manual decorator.
- *
- * It is possible to add other {@link module:link/link~LinkDecoratorAutomaticDefinition automatic}
- * or {@link module:link/link~LinkDecoratorManualDefinition manual} link decorators when this option is active.
- *
- * More information about decorators can be found in the {@link module:link/link~LinkConfig#decorators decorators configuration}
- * reference.
- *
- * @default false
- * @member {Boolean} module:link/link~LinkConfig#addTargetToExternalLinks
- */
- /**
- * Decorators provide an easy way to configure and manage additional link attributes in the editor content. There are
- * two types of link decorators:
- *
- * * {@link module:link/link~LinkDecoratorAutomaticDefinition Automatic} – They match links against pre–defined rules and
- * manage their attributes based on the results.
- * * {@link module:link/link~LinkDecoratorManualDefinition Manual} – They allow users to control link attributes individually,
- * using the editor UI.
- *
- * Link decorators are defined as objects with key-value pairs, where the key is the name provided for a given decorator and the
- * value is the decorator definition.
- *
- * The name of the decorator also corresponds to the {@glink framework/guides/architecture/editing-engine#text-attributes text attribute}
- * in the model. For instance, the `isExternal` decorator below is represented as a `linkIsExternal` attribute in the model.
- *
- * ClassicEditor
- * .create( editorElement, {
- * link: {
- * decorators: {
- * isExternal: {
- * mode: 'automatic',
- * callback: url => url.startsWith( 'http://' ),
- * attributes: {
- * target: '_blank',
- * rel: 'noopener noreferrer'
- * }
- * },
- * isDownloadable: {
- * mode: 'manual',
- * label: 'Downloadable',
- * attributes: {
- * download: 'file.png',
- * }
- * },
- * // ...
- * }
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * To learn more about the configuration syntax, check out the {@link module:link/link~LinkDecoratorAutomaticDefinition automatic}
- * and {@link module:link/link~LinkDecoratorManualDefinition manual} decorator option reference.
- *
- * **Warning:** Currently, link decorators work independently of one another and no conflict resolution mechanism exists.
- * For example, configuring the `target` attribute using both an automatic and a manual decorator at the same time could end up with
- * quirky results. The same applies if multiple manual or automatic decorators were defined for the same attribute.
- *
- * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator
- * dedicated for that purpose which can be enabled by turning a single option on. Check out the
- * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}
- * configuration description to learn more.
- *
- * See also the {@glink features/link#custom-link-attributes-decorators link feature guide} for more information.
- *
- * @member {Object.<String, module:link/link~LinkDecoratorDefinition>} module:link/link~LinkConfig#decorators
- */
- /**
- * A link decorator definition. Two types implement this defition:
- *
- * * {@link module:link/link~LinkDecoratorManualDefinition}
- * * {@link module:link/link~LinkDecoratorAutomaticDefinition}
- *
- * Refer to their document for more information about available options or to the
- * {@glink features/link#custom-link-attributes-decorators link feature guide} for general information.
- *
- * @interface LinkDecoratorDefinition
- */
- /**
- * Link decorator type.
- *
- * Check out the {@glink features/link#custom-link-attributes-decorators link feature guide} for more information.
- *
- * @member {'manual'|'automatic'} module:link/link~LinkDecoratorDefinition#mode
- */
- /**
- * Describes an automatic {@link module:link/link~LinkConfig#decorators link decorator}. This decorator type matches
- * all links in the editor content against a function that decides whether the link should receive a pre–defined set of attributes.
- *
- * It takes an object with key-value pairs of attributes and a callback function that must return a Boolean value based on the link's
- * `href` (URL). When the callback returns `true`, attributes are applied to the link.
- *
- * For example, to add the `target="_blank"` attribute to all links in the editor starting with `http://`, the
- * configuration could look like this:
- *
- * {
- * mode: 'automatic',
- * callback: url => url.startsWith( 'http://' ),
- * attributes: {
- * target: '_blank'
- * }
- * }
- *
- * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator
- * dedicated for that purpose that can be enabled by turning a single option on. Check out the
- * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}
- * configuration description to learn more.
- *
- * @typedef {Object} module:link/link~LinkDecoratorAutomaticDefinition
- * @property {'automatic'} mode Link decorator type. It is `'automatic'` for all automatic decorators.
- * @property {Function} callback Takes a `url` as a parameter and returns `true` if the `attributes` should be applied to the link.
- * @property {Object} attributes Key-value pairs used as link attributes added to the output during the
- * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.
- * Attributes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.
- */
- /**
- * Describes a manual {@link module:link/link~LinkConfig#decorators link decorator}. This decorator type is represented in
- * the link feature's {@link module:link/linkui user interface} as a switch that the user can use to control the presence
- * of a predefined set of attributes.
- *
- * For instance, to allow the users to manually control the presence of the `target="_blank"` and
- * `rel="noopener noreferrer"` attributes on specific links, the decorator could look as follows:
- *
- * {
- * mode: 'manual',
- * label: 'Open in a new tab',
- * defaultValue: true,
- * attributes: {
- * target: '_blank',
- * rel: 'noopener noreferrer'
- * }
- * }
- *
- * @typedef {Object} module:link/link~LinkDecoratorManualDefinition
- * @property {'manual'} mode Link decorator type. It is `'manual'` for all manual decorators.
- * @property {String} label The label of the UI button that the user can use to control the presence of link attributes.
- * @property {Object} attributes Key-value pairs used as link attributes added to the output during the
- * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.
- * Attributes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.
- * @property {Boolean} [defaultValue] Controls whether the decorator is "on" by default.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _utils_automaticdecorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/automaticdecorators */ "./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/linkcommand
- */
- /**
- * The link command. It is used by the {@link module:link/link~Link link feature}.
- *
- * @extends module:core/command~Command
- */
- class LinkCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * The value of the `'linkHref'` attribute if the start of the selection is located in a node with this attribute.
- *
- * @observable
- * @readonly
- * @member {Object|undefined} #value
- */
- constructor( editor ) {
- super( editor );
- /**
- * A collection of {@link module:link/utils~ManualDecorator manual decorators}
- * corresponding to the {@link module:link/link~LinkConfig#decorators decorator configuration}.
- *
- * You can consider it a model with states of manual decorators added to the currently selected link.
- *
- * @readonly
- * @type {module:utils/collection~Collection}
- */
- this.manualDecorators = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["Collection"]();
- /**
- * An instance of the helper that ties together all {@link module:link/link~LinkDecoratorAutomaticDefinition}
- * that are used by the {@glink features/link link} and the {@glink features/image#linking-images linking images} features.
- *
- * @readonly
- * @type {module:link/utils~AutomaticDecorators}
- */
- this.automaticDecorators = new _utils_automaticdecorators__WEBPACK_IMPORTED_MODULE_3__["default"]();
- }
- /**
- * Synchronizes the state of {@link #manualDecorators} with the currently present elements in the model.
- */
- restoreManualDecoratorStates() {
- for ( const manualDecorator of this.manualDecorators ) {
- manualDecorator.value = this._getDecoratorStateFromModel( manualDecorator.id );
- }
- }
- /**
- * @inheritDoc
- */
- refresh() {
- const model = this.editor.model;
- const doc = model.document;
- const selectedElement = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["first"])( doc.selection.getSelectedBlocks() );
- // A check for the `LinkImage` plugin. If the selection contains an element, get values from the element.
- // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isImageAllowed"])( selectedElement, model.schema ) ) {
- this.value = selectedElement.getAttribute( 'linkHref' );
- this.isEnabled = model.schema.checkAttribute( selectedElement, 'linkHref' );
- } else {
- this.value = doc.selection.getAttribute( 'linkHref' );
- this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, 'linkHref' );
- }
- for ( const manualDecorator of this.manualDecorators ) {
- manualDecorator.value = this._getDecoratorStateFromModel( manualDecorator.id );
- }
- }
- /**
- * Executes the command.
- *
- * When the selection is non-collapsed, the `linkHref` attribute will be applied to nodes inside the selection, but only to
- * those nodes where the `linkHref` attribute is allowed (disallowed nodes will be omitted).
- *
- * When the selection is collapsed and is not inside the text with the `linkHref` attribute, a
- * new {@link module:engine/model/text~Text text node} with the `linkHref` attribute will be inserted in place of the caret, but
- * only if such element is allowed in this place. The `_data` of the inserted text will equal the `href` parameter.
- * The selection will be updated to wrap the just inserted text node.
- *
- * When the selection is collapsed and inside the text with the `linkHref` attribute, the attribute value will be updated.
- *
- * # Decorators and model attribute management
- *
- * There is an optional argument to this command that applies or removes model
- * {@glink framework/guides/architecture/editing-engine#text-attributes text attributes} brought by
- * {@link module:link/utils~ManualDecorator manual link decorators}.
- *
- * Text attribute names in the model correspond to the entries in the {@link module:link/link~LinkConfig#decorators configuration}.
- * For every decorator configured, a model text attribute exists with the "link" prefix. For example, a `'linkMyDecorator'` attribute
- * corresponds to `'myDecorator'` in the configuration.
- *
- * To learn more about link decorators, check out the {@link module:link/link~LinkConfig#decorators `config.link.decorators`}
- * documentation.
- *
- * Here is how to manage decorator attributes with the link command:
- *
- * const linkCommand = editor.commands.get( 'link' );
- *
- * // Adding a new decorator attribute.
- * linkCommand.execute( 'http://example.com', {
- * linkIsExternal: true
- * } );
- *
- * // Removing a decorator attribute from the selection.
- * linkCommand.execute( 'http://example.com', {
- * linkIsExternal: false
- * } );
- *
- * // Adding multiple decorator attributes at the same time.
- * linkCommand.execute( 'http://example.com', {
- * linkIsExternal: true,
- * linkIsDownloadable: true,
- * } );
- *
- * // Removing and adding decorator attributes at the same time.
- * linkCommand.execute( 'http://example.com', {
- * linkIsExternal: false,
- * linkFoo: true,
- * linkIsDownloadable: false,
- * } );
- *
- * **Note**: If the decorator attribute name is not specified, its state remains untouched.
- *
- * **Note**: {@link module:link/unlinkcommand~UnlinkCommand#execute `UnlinkCommand#execute()`} removes all
- * decorator attributes.
- *
- * @fires execute
- * @param {String} href Link destination.
- * @param {Object} [manualDecoratorIds={}] The information about manual decorator attributes to be applied or removed upon execution.
- */
- execute( href, manualDecoratorIds = {} ) {
- const model = this.editor.model;
- const selection = model.document.selection;
- // Stores information about manual decorators to turn them on/off when command is applied.
- const truthyManualDecorators = [];
- const falsyManualDecorators = [];
- for ( const name in manualDecoratorIds ) {
- if ( manualDecoratorIds[ name ] ) {
- truthyManualDecorators.push( name );
- } else {
- falsyManualDecorators.push( name );
- }
- }
- model.change( writer => {
- // If selection is collapsed then update selected link or insert new one at the place of caret.
- if ( selection.isCollapsed ) {
- const position = selection.getFirstPosition();
- // When selection is inside text with `linkHref` attribute.
- if ( selection.hasAttribute( 'linkHref' ) ) {
- // Then update `linkHref` value.
- const linkRange = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["findAttributeRange"])( position, 'linkHref', selection.getAttribute( 'linkHref' ), model );
- writer.setAttribute( 'linkHref', href, linkRange );
- truthyManualDecorators.forEach( item => {
- writer.setAttribute( item, true, linkRange );
- } );
- falsyManualDecorators.forEach( item => {
- writer.removeAttribute( item, linkRange );
- } );
- // Put the selection at the end of the updated link.
- writer.setSelection( writer.createPositionAfter( linkRange.end.nodeBefore ) );
- }
- // If not then insert text node with `linkHref` attribute in place of caret.
- // However, since selection is collapsed, attribute value will be used as data for text node.
- // So, if `href` is empty, do not create text node.
- else if ( href !== '' ) {
- const attributes = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toMap"])( selection.getAttributes() );
- attributes.set( 'linkHref', href );
- truthyManualDecorators.forEach( item => {
- attributes.set( item, true );
- } );
- const { end: positionAfter } = model.insertContent( writer.createText( href, attributes ), position );
- // Put the selection at the end of the inserted link.
- // Using end of range returned from insertContent in case nodes with the same attributes got merged.
- writer.setSelection( positionAfter );
- }
- // Remove the `linkHref` attribute and all link decorators from the selection.
- // It stops adding a new content into the link element.
- [ 'linkHref', ...truthyManualDecorators, ...falsyManualDecorators ].forEach( item => {
- writer.removeSelectionAttribute( item );
- } );
- } else {
- // If selection has non-collapsed ranges, we change attribute on nodes inside those ranges
- // omitting nodes where the `linkHref` attribute is disallowed.
- const ranges = model.schema.getValidRanges( selection.getRanges(), 'linkHref' );
- // But for the first, check whether the `linkHref` attribute is allowed on selected blocks (e.g. the "image" element).
- const allowedRanges = [];
- for ( const element of selection.getSelectedBlocks() ) {
- if ( model.schema.checkAttribute( element, 'linkHref' ) ) {
- allowedRanges.push( writer.createRangeOn( element ) );
- }
- }
- // Ranges that accept the `linkHref` attribute. Since we will iterate over `allowedRanges`, let's clone it.
- const rangesToUpdate = allowedRanges.slice();
- // For all selection ranges we want to check whether given range is inside an element that accepts the `linkHref` attribute.
- // If so, we don't want to propagate applying the attribute to its children.
- for ( const range of ranges ) {
- if ( this._isRangeToUpdate( range, allowedRanges ) ) {
- rangesToUpdate.push( range );
- }
- }
- for ( const range of rangesToUpdate ) {
- writer.setAttribute( 'linkHref', href, range );
- truthyManualDecorators.forEach( item => {
- writer.setAttribute( item, true, range );
- } );
- falsyManualDecorators.forEach( item => {
- writer.removeAttribute( item, range );
- } );
- }
- }
- } );
- }
- /**
- * Provides information whether a decorator with a given name is present in the currently processed selection.
- *
- * @private
- * @param {String} decoratorName The name of the manual decorator used in the model
- * @returns {Boolean} The information whether a given decorator is currently present in the selection.
- */
- _getDecoratorStateFromModel( decoratorName ) {
- const model = this.editor.model;
- const doc = model.document;
- const selectedElement = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["first"])( doc.selection.getSelectedBlocks() );
- // A check for the `LinkImage` plugin. If the selection contains an element, get values from the element.
- // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isImageAllowed"])( selectedElement, model.schema ) ) {
- return selectedElement.getAttribute( decoratorName );
- }
- return doc.selection.getAttribute( decoratorName );
- }
- /**
- * Checks whether specified `range` is inside an element that accepts the `linkHref` attribute.
- *
- * @private
- * @param {module:engine/view/range~Range} range A range to check.
- * @param {Array.<module:engine/view/range~Range>} allowedRanges An array of ranges created on elements where the attribute is accepted.
- * @returns {Boolean}
- */
- _isRangeToUpdate( range, allowedRanges ) {
- for ( const allowedRange of allowedRanges ) {
- // A range is inside an element that will have the `linkHref` attribute. Do not modify its nodes.
- if ( allowedRange.containsRange( range ) ) {
- return false;
- }
- }
- return true;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
- /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _linkcommand__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./linkcommand */ "./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js");
- /* harmony import */ var _unlinkcommand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./unlinkcommand */ "./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js");
- /* harmony import */ var _utils_manualdecorator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/manualdecorator */ "./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
- /* harmony import */ var _theme_link_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../theme/link.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/link.css");
- /* harmony import */ var _theme_link_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_theme_link_css__WEBPACK_IMPORTED_MODULE_9__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/linkediting
- */
- const HIGHLIGHT_CLASS = 'ck-link_selected';
- const DECORATOR_AUTOMATIC = 'automatic';
- const DECORATOR_MANUAL = 'manual';
- const EXTERNAL_LINKS_REGEXP = /^(https?:)?\/\//;
- /**
- * The link engine feature.
- *
- * It introduces the `linkHref="url"` attribute in the model which renders to the view as a `<a href="url">` element
- * as well as `'link'` and `'unlink'` commands.
- *
- * @extends module:core/plugin~Plugin
- */
- class LinkEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'LinkEditing';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- // Clipboard is required for handling cut and paste events while typing over the link.
- return [ ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["TwoStepCaretMovement"], ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["Input"], ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_3__["ClipboardPipeline"] ];
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- editor.config.define( 'link', {
- addTargetToExternalLinks: false
- } );
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Allow link attribute on all inline nodes.
- editor.model.schema.extend( '$text', { allowAttributes: 'linkHref' } );
- editor.conversion.for( 'dataDowncast' )
- .attributeToElement( { model: 'linkHref', view: _utils__WEBPACK_IMPORTED_MODULE_8__["createLinkElement"] } );
- editor.conversion.for( 'editingDowncast' )
- .attributeToElement( { model: 'linkHref', view: ( href, conversionApi ) => {
- return Object(_utils__WEBPACK_IMPORTED_MODULE_8__["createLinkElement"])( Object(_utils__WEBPACK_IMPORTED_MODULE_8__["ensureSafeUrl"])( href ), conversionApi );
- } } );
- editor.conversion.for( 'upcast' )
- .elementToAttribute( {
- view: {
- name: 'a',
- attributes: {
- href: true
- }
- },
- model: {
- key: 'linkHref',
- value: viewElement => viewElement.getAttribute( 'href' )
- }
- } );
- // Create linking commands.
- editor.commands.add( 'link', new _linkcommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor ) );
- editor.commands.add( 'unlink', new _unlinkcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor ) );
- const linkDecorators = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["getLocalizedDecorators"])( editor.t, Object(_utils__WEBPACK_IMPORTED_MODULE_8__["normalizeDecorators"])( editor.config.get( 'link.decorators' ) ) );
- this._enableAutomaticDecorators( linkDecorators.filter( item => item.mode === DECORATOR_AUTOMATIC ) );
- this._enableManualDecorators( linkDecorators.filter( item => item.mode === DECORATOR_MANUAL ) );
- // Enable two-step caret movement for `linkHref` attribute.
- const twoStepCaretMovementPlugin = editor.plugins.get( ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["TwoStepCaretMovement"] );
- twoStepCaretMovementPlugin.registerAttribute( 'linkHref' );
- // Setup highlight over selected link.
- Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["inlineHighlight"])( editor, 'linkHref', 'a', HIGHLIGHT_CLASS );
- // Change the attributes of the selection in certain situations after the link was inserted into the document.
- this._enableInsertContentSelectionAttributesFixer();
- // Handle a click at the beginning/end of a link element.
- this._enableClickingAfterLink();
- // Handle typing over the link.
- this._enableTypingOverLink();
- // Handle removing the content after the link element.
- this._handleDeleteContentAfterLink();
- }
- /**
- * Processes an array of configured {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators}
- * and registers a {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast dispatcher}
- * for each one of them. Downcast dispatchers are obtained using the
- * {@link module:link/utils~AutomaticDecorators#getDispatcher} method.
- *
- * **Note**: This method also activates the automatic external link decorator if enabled with
- * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}.
- *
- * @private
- * @param {Array.<module:link/link~LinkDecoratorAutomaticDefinition>} automaticDecoratorDefinitions
- */
- _enableAutomaticDecorators( automaticDecoratorDefinitions ) {
- const editor = this.editor;
- // Store automatic decorators in the command instance as we do the same with manual decorators.
- // Thanks to that, `LinkImageEditing` plugin can re-use the same definitions.
- const command = editor.commands.get( 'link' );
- const automaticDecorators = command.automaticDecorators;
- // Adds a default decorator for external links.
- if ( editor.config.get( 'link.addTargetToExternalLinks' ) ) {
- automaticDecorators.add( {
- id: 'linkIsExternal',
- mode: DECORATOR_AUTOMATIC,
- callback: url => EXTERNAL_LINKS_REGEXP.test( url ),
- attributes: {
- target: '_blank',
- rel: 'noopener noreferrer'
- }
- } );
- }
- automaticDecorators.add( automaticDecoratorDefinitions );
- if ( automaticDecorators.length ) {
- editor.conversion.for( 'downcast' ).add( automaticDecorators.getDispatcher() );
- }
- }
- /**
- * Processes an array of configured {@link module:link/link~LinkDecoratorManualDefinition manual decorators},
- * transforms them into {@link module:link/utils~ManualDecorator} instances and stores them in the
- * {@link module:link/linkcommand~LinkCommand#manualDecorators} collection (a model for manual decorators state).
- *
- * Also registers an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attribute-to-element}
- * converter for each manual decorator and extends the {@link module:engine/model/schema~Schema model's schema}
- * with adequate model attributes.
- *
- * @private
- * @param {Array.<module:link/link~LinkDecoratorManualDefinition>} manualDecoratorDefinitions
- */
- _enableManualDecorators( manualDecoratorDefinitions ) {
- if ( !manualDecoratorDefinitions.length ) {
- return;
- }
- const editor = this.editor;
- const command = editor.commands.get( 'link' );
- const manualDecorators = command.manualDecorators;
- manualDecoratorDefinitions.forEach( decorator => {
- editor.model.schema.extend( '$text', { allowAttributes: decorator.id } );
- // Keeps reference to manual decorator to decode its name to attributes during downcast.
- manualDecorators.add( new _utils_manualdecorator__WEBPACK_IMPORTED_MODULE_7__["default"]( decorator ) );
- editor.conversion.for( 'downcast' ).attributeToElement( {
- model: decorator.id,
- view: ( manualDecoratorName, { writer } ) => {
- if ( manualDecoratorName ) {
- const attributes = manualDecorators.get( decorator.id ).attributes;
- const element = writer.createAttributeElement( 'a', attributes, { priority: 5 } );
- writer.setCustomProperty( 'link', true, element );
- return element;
- }
- } } );
- editor.conversion.for( 'upcast' ).elementToAttribute( {
- view: {
- name: 'a',
- attributes: manualDecorators.get( decorator.id ).attributes
- },
- model: {
- key: decorator.id
- }
- } );
- } );
- }
- /**
- * Starts listening to {@link module:engine/model/model~Model#event:insertContent} and corrects the model
- * selection attributes if the selection is at the end of a link after inserting the content.
- *
- * The purpose of this action is to improve the overall UX because the user is no longer "trapped" by the
- * `linkHref` attribute of the selection and they can type a "clean" (`linkHref`–less) text right away.
- *
- * See https://github.com/ckeditor/ckeditor5/issues/6053.
- *
- * @private
- */
- _enableInsertContentSelectionAttributesFixer() {
- const editor = this.editor;
- const model = editor.model;
- const selection = model.document.selection;
- this.listenTo( model, 'insertContent', () => {
- const nodeBefore = selection.anchor.nodeBefore;
- const nodeAfter = selection.anchor.nodeAfter;
- // NOTE: ↰ and ↱ represent the gravity of the selection.
- // The only truly valid case is:
- //
- // ↰
- // ...<$text linkHref="foo">INSERTED[]</$text>
- //
- // If the selection is not "trapped" by the `linkHref` attribute after inserting, there's nothing
- // to fix there.
- if ( !selection.hasAttribute( 'linkHref' ) ) {
- return;
- }
- // Filter out the following case where a link with the same href (e.g. <a href="foo">INSERTED</a>) is inserted
- // in the middle of an existing link:
- //
- // Before insertion:
- // ↰
- // <$text linkHref="foo">l[]ink</$text>
- //
- // Expected after insertion:
- // ↰
- // <$text linkHref="foo">lINSERTED[]ink</$text>
- //
- if ( !nodeBefore ) {
- return;
- }
- // Filter out the following case where the selection has the "linkHref" attribute because the
- // gravity is overridden and some text with another attribute (e.g. <b>INSERTED</b>) is inserted:
- //
- // Before insertion:
- //
- // ↱
- // <$text linkHref="foo">[]link</$text>
- //
- // Expected after insertion:
- //
- // ↱
- // <$text bold="true">INSERTED</$text><$text linkHref="foo">[]link</$text>
- //
- if ( !nodeBefore.hasAttribute( 'linkHref' ) ) {
- return;
- }
- // Filter out the following case where a link is a inserted in the middle (or before) another link
- // (different URLs, so they will not merge). In this (let's say weird) case, we can leave the selection
- // attributes as they are because the user will end up writing in one link or another anyway.
- //
- // Before insertion:
- //
- // ↰
- // <$text linkHref="foo">l[]ink</$text>
- //
- // Expected after insertion:
- //
- // ↰
- // <$text linkHref="foo">l</$text><$text linkHref="bar">INSERTED[]</$text><$text linkHref="foo">ink</$text>
- //
- if ( nodeAfter && nodeAfter.hasAttribute( 'linkHref' ) ) {
- return;
- }
- model.change( writer => {
- removeLinkAttributesFromSelection( writer, getLinkAttributesAllowedOnText( model.schema ) );
- } );
- }, { priority: 'low' } );
- }
- /**
- * Starts listening to {@link module:engine/view/document~Document#event:mousedown} and
- * {@link module:engine/view/document~Document#event:selectionChange} and puts the selection before/after a link node
- * if clicked at the beginning/ending of the link.
- *
- * The purpose of this action is to allow typing around the link node directly after a click.
- *
- * See https://github.com/ckeditor/ckeditor5/issues/1016.
- *
- * @private
- */
- _enableClickingAfterLink() {
- const editor = this.editor;
- const model = editor.model;
- editor.editing.view.addObserver( ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["MouseObserver"] );
- let clicked = false;
- // Detect the click.
- this.listenTo( editor.editing.view.document, 'mousedown', () => {
- clicked = true;
- } );
- // When the selection has changed...
- this.listenTo( editor.editing.view.document, 'selectionChange', () => {
- if ( !clicked ) {
- return;
- }
- // ...and it was caused by the click...
- clicked = false;
- const selection = model.document.selection;
- // ...and no text is selected...
- if ( !selection.isCollapsed ) {
- return;
- }
- // ...and clicked text is the link...
- if ( !selection.hasAttribute( 'linkHref' ) ) {
- return;
- }
- const position = selection.getFirstPosition();
- const linkRange = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["findAttributeRange"])( position, 'linkHref', selection.getAttribute( 'linkHref' ), model );
- // ...check whether clicked start/end boundary of the link.
- // If so, remove the `linkHref` attribute.
- if ( position.isTouching( linkRange.start ) || position.isTouching( linkRange.end ) ) {
- model.change( writer => {
- removeLinkAttributesFromSelection( writer, getLinkAttributesAllowedOnText( model.schema ) );
- } );
- }
- } );
- }
- /**
- * Starts listening to {@link module:engine/model/model~Model#deleteContent} and {@link module:engine/model/model~Model#insertContent}
- * and checks whether typing over the link. If so, attributes of removed text are preserved and applied to the inserted text.
- *
- * The purpose of this action is to allow modifying a text without loosing the `linkHref` attribute (and other).
- *
- * See https://github.com/ckeditor/ckeditor5/issues/4762.
- *
- * @private
- */
- _enableTypingOverLink() {
- const editor = this.editor;
- const view = editor.editing.view;
- // Selection attributes when started typing over the link.
- let selectionAttributes;
- // Whether pressed `Backspace` or `Delete`. If so, attributes should not be preserved.
- let deletedContent;
- // Detect pressing `Backspace` / `Delete`.
- this.listenTo( view.document, 'delete', () => {
- deletedContent = true;
- }, { priority: 'high' } );
- // Listening to `model#deleteContent` allows detecting whether selected content was a link.
- // If so, before removing the element, we will copy its attributes.
- this.listenTo( editor.model, 'deleteContent', () => {
- const selection = editor.model.document.selection;
- // Copy attributes only if anything is selected.
- if ( selection.isCollapsed ) {
- return;
- }
- // When the content was deleted, do not preserve attributes.
- if ( deletedContent ) {
- deletedContent = false;
- return;
- }
- // Enabled only when typing.
- if ( !isTyping( editor ) ) {
- return;
- }
- if ( shouldCopyAttributes( editor.model ) ) {
- selectionAttributes = selection.getAttributes();
- }
- }, { priority: 'high' } );
- // Listening to `model#insertContent` allows detecting the content insertion.
- // We want to apply attributes that were removed while typing over the link.
- this.listenTo( editor.model, 'insertContent', ( evt, [ element ] ) => {
- deletedContent = false;
- // Enabled only when typing.
- if ( !isTyping( editor ) ) {
- return;
- }
- if ( !selectionAttributes ) {
- return;
- }
- editor.model.change( writer => {
- for ( const [ attribute, value ] of selectionAttributes ) {
- writer.setAttribute( attribute, value, element );
- }
- } );
- selectionAttributes = null;
- }, { priority: 'high' } );
- }
- /**
- * Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether
- * removing a content right after the "linkHref" attribute.
- *
- * If so, the selection should not preserve the `linkHref` attribute. However, if
- * the {@link module:typing/twostepcaretmovement~TwoStepCaretMovement} plugin is active and
- * the selection has the "linkHref" attribute due to overriden gravity (at the end), the `linkHref` attribute should stay untouched.
- *
- * The purpose of this action is to allow removing the link text and keep the selection outside the link.
- *
- * See https://github.com/ckeditor/ckeditor5/issues/7521.
- *
- * @private
- */
- _handleDeleteContentAfterLink() {
- const editor = this.editor;
- const model = editor.model;
- const selection = model.document.selection;
- const view = editor.editing.view;
- // A flag whether attributes `linkHref` attribute should be preserved.
- let shouldPreserveAttributes = false;
- // A flag whether the `Backspace` key was pressed.
- let hasBackspacePressed = false;
- // Detect pressing `Backspace`.
- this.listenTo( view.document, 'delete', ( evt, data ) => {
- hasBackspacePressed = data.domEvent.keyCode === ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].backspace;
- }, { priority: 'high' } );
- // Before removing the content, check whether the selection is inside a link or at the end of link but with 2-SCM enabled.
- // If so, we want to preserve link attributes.
- this.listenTo( model, 'deleteContent', () => {
- // Reset the state.
- shouldPreserveAttributes = false;
- const position = selection.getFirstPosition();
- const linkHref = selection.getAttribute( 'linkHref' );
- if ( !linkHref ) {
- return;
- }
- const linkRange = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["findAttributeRange"])( position, 'linkHref', linkHref, model );
- // Preserve `linkHref` attribute if the selection is in the middle of the link or
- // the selection is at the end of the link and 2-SCM is activated.
- shouldPreserveAttributes = linkRange.containsPosition( position ) || linkRange.end.isEqual( position );
- }, { priority: 'high' } );
- // After removing the content, check whether the current selection should preserve the `linkHref` attribute.
- this.listenTo( model, 'deleteContent', () => {
- // If didn't press `Backspace`.
- if ( !hasBackspacePressed ) {
- return;
- }
- hasBackspacePressed = false;
- // Disable the mechanism if inside a link (`<$text url="foo">F[]oo</$text>` or <$text url="foo">Foo[]</$text>`).
- if ( shouldPreserveAttributes ) {
- return;
- }
- // Use `model.enqueueChange()` in order to execute the callback at the end of the changes process.
- editor.model.enqueueChange( writer => {
- removeLinkAttributesFromSelection( writer, getLinkAttributesAllowedOnText( model.schema ) );
- } );
- }, { priority: 'low' } );
- }
- }
- // Make the selection free of link-related model attributes.
- // All link-related model attributes start with "link". That includes not only "linkHref"
- // but also all decorator attributes (they have dynamic names), or even custom plugins.
- //
- // @param {module:engine/model/writer~Writer} writer
- // @param {Array.<String>} linkAttributes
- function removeLinkAttributesFromSelection( writer, linkAttributes ) {
- writer.removeSelectionAttribute( 'linkHref' );
- for ( const attribute of linkAttributes ) {
- writer.removeSelectionAttribute( attribute );
- }
- }
- // Checks whether selection's attributes should be copied to the new inserted text.
- //
- // @param {module:engine/model/model~Model} model
- // @returns {Boolean}
- function shouldCopyAttributes( model ) {
- const selection = model.document.selection;
- const firstPosition = selection.getFirstPosition();
- const lastPosition = selection.getLastPosition();
- const nodeAtFirstPosition = firstPosition.nodeAfter;
- // The text link node does not exist...
- if ( !nodeAtFirstPosition ) {
- return false;
- }
- // ...or it isn't the text node...
- if ( !nodeAtFirstPosition.is( '$text' ) ) {
- return false;
- }
- // ...or isn't the link.
- if ( !nodeAtFirstPosition.hasAttribute( 'linkHref' ) ) {
- return false;
- }
- // `textNode` = the position is inside the link element.
- // `nodeBefore` = the position is at the end of the link element.
- const nodeAtLastPosition = lastPosition.textNode || lastPosition.nodeBefore;
- // If both references the same node selection contains a single text node.
- if ( nodeAtFirstPosition === nodeAtLastPosition ) {
- return true;
- }
- // If nodes are not equal, maybe the link nodes has defined additional attributes inside.
- // First, we need to find the entire link range.
- const linkRange = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["findAttributeRange"])( firstPosition, 'linkHref', nodeAtFirstPosition.getAttribute( 'linkHref' ), model );
- // Then we can check whether selected range is inside the found link range. If so, attributes should be preserved.
- return linkRange.containsRange( model.createRange( firstPosition, lastPosition ), true );
- }
- // Checks whether provided changes were caused by typing.
- //
- // @params {module:core/editor/editor~Editor} editor
- // @returns {Boolean}
- function isTyping( editor ) {
- const input = editor.plugins.get( 'Input' );
- return input.isInput( editor.model.change( writer => writer.batch ) );
- }
- // Returns an array containing names of attributes allowed on `$text` that describes the link item.
- //
- // @param {module:engine/model/schema~Schema} schema
- // @returns {Array.<String>}
- function getLinkAttributesAllowedOnText( schema ) {
- const textAttributes = schema.getDefinition( '$text' ).allowAttributes;
- return textAttributes.filter( attribute => attribute.startsWith( 'link' ) );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js":
- /*!****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkImage; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _linkimageediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./linkimageediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js");
- /* harmony import */ var _linkimageui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkimageui */ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js");
- /* harmony import */ var _theme_linkimage_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/linkimage.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css");
- /* harmony import */ var _theme_linkimage_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_linkimage_css__WEBPACK_IMPORTED_MODULE_3__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/linkimage
- */
- /**
- * The `LinkImage` plugin.
- *
- * This is a "glue" plugin that loads the {@link module:link/linkimageediting~LinkImageEditing link image editing feature}
- * and {@link module:link/linkimageui~LinkImageUI link image UI feature}.
- *
- * @extends module:core/plugin~Plugin
- */
- class LinkImage extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _linkimageediting__WEBPACK_IMPORTED_MODULE_1__["default"], _linkimageui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'LinkImage';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkImageEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _linkediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
- /* harmony import */ var _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/icons/link.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/linkimageediting
- */
- /**
- * The link image engine feature.
- *
- * It accepts the `linkHref="url"` attribute in the model for the {@link module:image/image~Image `<image>`} element
- * which allows linking images.
- *
- * @extends module:core/plugin~Plugin
- */
- class LinkImageEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ 'ImageEditing', _linkediting__WEBPACK_IMPORTED_MODULE_3__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'LinkImageEditing';
- }
- init() {
- const editor = this.editor;
- editor.model.schema.extend( 'image', { allowAttributes: [ 'linkHref' ] } );
- editor.conversion.for( 'upcast' ).add( upcastLink() );
- editor.conversion.for( 'editingDowncast' ).add( downcastImageLink( { attachIconIndicator: true } ) );
- editor.conversion.for( 'dataDowncast' ).add( downcastImageLink( { attachIconIndicator: false } ) );
- // Definitions for decorators are provided by the `link` command and the `LinkEditing` plugin.
- this._enableAutomaticDecorators();
- this._enableManualDecorators();
- }
- /**
- * Processes {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators} definitions and
- * attaches proper converters that will work when linking an image.`
- *
- * @private
- */
- _enableAutomaticDecorators() {
- const editor = this.editor;
- const command = editor.commands.get( 'link' );
- const automaticDecorators = command.automaticDecorators;
- if ( automaticDecorators.length ) {
- editor.conversion.for( 'downcast' ).add( automaticDecorators.getDispatcherForLinkedImage() );
- }
- }
- /**
- * Processes transformed {@link module:link/utils~ManualDecorator} instances and attaches proper converters
- * that will work when linking an image.
- *
- * @private
- */
- _enableManualDecorators() {
- const editor = this.editor;
- const command = editor.commands.get( 'link' );
- const manualDecorators = command.manualDecorators;
- for ( const decorator of command.manualDecorators ) {
- editor.model.schema.extend( 'image', { allowAttributes: decorator.id } );
- editor.conversion.for( 'downcast' ).add( downcastImageLinkManualDecorator( manualDecorators, decorator ) );
- editor.conversion.for( 'upcast' ).add( upcastImageLinkManualDecorator( manualDecorators, decorator ) );
- }
- }
- }
- // Returns a converter that consumes the 'href' attribute if a link contains an image.
- //
- // @private
- // @returns {Function}
- function upcastLink() {
- return dispatcher => {
- dispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
- const viewLink = data.viewItem;
- const imageInLink = getFirstImage( viewLink );
- if ( !imageInLink ) {
- return;
- }
- // There's an image inside an <a> element - we consume it so it won't be picked up by the Link plugin.
- const consumableAttributes = { attributes: [ 'href' ] };
- // Consume the `href` attribute so the default one will not convert it to $text attribute.
- if ( !conversionApi.consumable.consume( viewLink, consumableAttributes ) ) {
- // Might be consumed by something else - i.e. other converter with priority=highest - a standard check.
- return;
- }
- const linkHref = viewLink.getAttribute( 'href' );
- // Missing the 'href' attribute.
- if ( !linkHref ) {
- return;
- }
- // A full definition of the image feature.
- // figure > a > img: parent of the view link element is an image element (figure).
- let modelElement = data.modelCursor.parent;
- if ( !modelElement.is( 'element', 'image' ) ) {
- // a > img: parent of the view link is not the image (figure) element. We need to convert it manually.
- const conversionResult = conversionApi.convertItem( imageInLink, data.modelCursor );
- // Set image range as conversion result.
- data.modelRange = conversionResult.modelRange;
- // Continue conversion where image conversion ends.
- data.modelCursor = conversionResult.modelCursor;
- modelElement = data.modelCursor.nodeBefore;
- }
- if ( modelElement && modelElement.is( 'element', 'image' ) ) {
- // Set the linkHref attribute from link element on model image element.
- conversionApi.writer.setAttribute( 'linkHref', linkHref, modelElement );
- }
- }, { priority: 'high' } );
- // Using the same priority that `upcastImageLinkManualDecorator()` converter guarantees
- // that manual decorators will decorate the proper element.
- };
- }
- // Return a converter that adds the `<a>` element to data.
- //
- // @private
- // @params {Object} options
- // @params {Boolean} options.attachIconIndicator=false If set to `true`, an icon that informs about the linked image will be added.
- // @returns {Function}
- function downcastImageLink( options ) {
- return dispatcher => {
- dispatcher.on( 'attribute:linkHref:image', ( evt, data, conversionApi ) => {
- // The image will be already converted - so it will be present in the view.
- const viewFigure = conversionApi.mapper.toViewElement( data.item );
- const writer = conversionApi.writer;
- // But we need to check whether the link element exists.
- const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
- let linkIconIndicator;
- if ( options.attachIconIndicator ) {
- // Create an icon indicator for a linked image.
- linkIconIndicator = writer.createUIElement( 'span', { class: 'ck ck-link-image_icon' }, function( domDocument ) {
- const domElement = this.toDomElement( domDocument );
- domElement.innerHTML = _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_4__["default"];
- return domElement;
- } );
- }
- // If so, update the attribute if it's defined or remove the entire link if the attribute is empty.
- if ( linkInImage ) {
- if ( data.attributeNewValue ) {
- writer.setAttribute( 'href', data.attributeNewValue, linkInImage );
- } else {
- const viewImage = Array.from( linkInImage.getChildren() ).find( child => child.name === 'img' );
- writer.move( writer.createRangeOn( viewImage ), writer.createPositionAt( viewFigure, 0 ) );
- writer.remove( linkInImage );
- }
- } else {
- // But if it does not exist. Let's wrap already converted image by newly created link element.
- // 1. Create an empty link element.
- const linkElement = writer.createContainerElement( 'a', { href: data.attributeNewValue } );
- // 2. Insert link inside the associated image.
- writer.insert( writer.createPositionAt( viewFigure, 0 ), linkElement );
- // 3. Move the image to the link.
- writer.move( writer.createRangeOn( viewFigure.getChild( 1 ) ), writer.createPositionAt( linkElement, 0 ) );
- // 4. Inset the linked image icon indicator while downcast to editing.
- if ( linkIconIndicator ) {
- writer.insert( writer.createPositionAt( linkElement, 'end' ), linkIconIndicator );
- }
- }
- } );
- };
- }
- // Returns a converter that decorates the `<a>` element when the image is the link label.
- //
- // @private
- // @returns {Function}
- function downcastImageLinkManualDecorator( manualDecorators, decorator ) {
- return dispatcher => {
- dispatcher.on( `attribute:${ decorator.id }:image`, ( evt, data, conversionApi ) => {
- const attributes = manualDecorators.get( decorator.id ).attributes;
- const viewFigure = conversionApi.mapper.toViewElement( data.item );
- const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
- // The <a> element was removed by the time this converter is executed.
- // It may happen when the base `linkHref` and decorator attributes are removed
- // at the same time (see #8401).
- if ( !linkInImage ) {
- return;
- }
- for ( const [ key, val ] of Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toMap"])( attributes ) ) {
- conversionApi.writer.setAttribute( key, val, linkInImage );
- }
- } );
- };
- }
- // Returns a converter that checks whether manual decorators should be applied to the link.
- //
- // @private
- // @returns {Function}
- function upcastImageLinkManualDecorator( manualDecorators, decorator ) {
- return dispatcher => {
- dispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
- const viewLink = data.viewItem;
- const imageInLink = getFirstImage( viewLink );
- // We need to check whether an image is inside a link because the converter handles
- // only manual decorators for linked images. See #7975.
- if ( !imageInLink ) {
- return;
- }
- const consumableAttributes = {
- attributes: manualDecorators.get( decorator.id ).attributes
- };
- const matcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["Matcher"]( consumableAttributes );
- const result = matcher.match( viewLink );
- // The link element does not have required attributes or/and proper values.
- if ( !result ) {
- return;
- }
- // Check whether we can consume those attributes.
- if ( !conversionApi.consumable.consume( viewLink, result.match ) ) {
- return;
- }
- // At this stage we can assume that we have the `<image>` element.
- // `nodeBefore` comes after conversion: `<a><img></a>`.
- // `parent` comes with full image definition: `<figure><a><img></a></figure>.
- // See the body of the `upcastLink()` function.
- const modelElement = data.modelCursor.nodeBefore || data.modelCursor.parent;
- conversionApi.writer.setAttribute( decorator.id, true, modelElement );
- }, { priority: 'high' } );
- // Using the same priority that `upcastLink()` converter guarantees that the linked image was properly converted.
- };
- }
- // Returns the first image in a given view element.
- //
- // @private
- // @param {module:engine/view/element~Element}
- // @returns {module:engine/view/element~Element|undefined}
- function getFirstImage( viewElement ) {
- return Array.from( viewElement.getChildren() ).find( child => child.name === 'img' );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkImageUI; });
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _linkui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkui */ "./node_modules/@ckeditor/ckeditor5-link/src/linkui.js");
- /* harmony import */ var _linkediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
- /* harmony import */ var _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme/icons/link.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/linkimageui
- */
- /**
- * The link image UI plugin.
- *
- * This plugin provides the `'linkImage'` button that can be displayed in the {@link module:image/imagetoolbar~ImageToolbar}.
- * It can be used to wrap images in links.
- *
- * @extends module:core/plugin~Plugin
- */
- class LinkImageUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _linkediting__WEBPACK_IMPORTED_MODULE_3__["default"], _linkui__WEBPACK_IMPORTED_MODULE_2__["default"], 'Image' ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'LinkImageUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const viewDocument = editor.editing.view.document;
- this.listenTo( viewDocument, 'click', ( evt, data ) => {
- const hasLink = isImageLinked( viewDocument.selection.getSelectedElement(), editor.plugins.get( 'Image' ) );
- if ( hasLink ) {
- data.preventDefault();
- }
- } );
- this._createToolbarLinkImageButton();
- }
- /**
- * Creates a `LinkImageUI` button view.
- *
- * Clicking this button shows a {@link module:link/linkui~LinkUI#_balloon} attached to the selection.
- * When an image is already linked, the view shows {@link module:link/linkui~LinkUI#actionsView} or
- * {@link module:link/linkui~LinkUI#formView} if it is not.
- *
- * @private
- */
- _createToolbarLinkImageButton() {
- const editor = this.editor;
- const t = editor.t;
- editor.ui.componentFactory.add( 'linkImage', locale => {
- const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( locale );
- const plugin = editor.plugins.get( 'LinkUI' );
- const linkCommand = editor.commands.get( 'link' );
- button.set( {
- isEnabled: true,
- label: t( 'Link image' ),
- icon: _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_5__["default"],
- keystroke: _utils__WEBPACK_IMPORTED_MODULE_4__["LINK_KEYSTROKE"],
- tooltip: true,
- isToggleable: true
- } );
- // Bind button to the command.
- button.bind( 'isEnabled' ).to( linkCommand, 'isEnabled' );
- button.bind( 'isOn' ).to( linkCommand, 'value', value => !!value );
- // Show the actionsView or formView (both from LinkUI) on button click depending on whether the image is linked already.
- this.listenTo( button, 'execute', () => {
- const hasLink = isImageLinked( editor.editing.view.document.selection.getSelectedElement(), editor.plugins.get( 'Image' ) );
- if ( hasLink ) {
- plugin._addActionsView();
- } else {
- plugin._showUI( true );
- }
- } );
- return button;
- } );
- }
- }
- // A helper function that checks whether the element is a linked image.
- //
- // @param {module:engine/model/element~Element} element
- // @returns {Boolean}
- function isImageLinked( element, image ) {
- const isImage = element && image.isImageWidget( element );
- if ( !isImage ) {
- return false;
- }
- return element.getChild( 0 ).is( 'element', 'a' );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkui.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkui.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _ui_linkformview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ui/linkformview */ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js");
- /* harmony import */ var _ui_linkactionsview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ui/linkactionsview */ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
- /* harmony import */ var _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../theme/icons/link.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/linkui
- */
- const VISUAL_SELECTION_MARKER_NAME = 'link-ui';
- /**
- * The link UI plugin. It introduces the `'link'` and `'unlink'` buttons and support for the <kbd>Ctrl+K</kbd> keystroke.
- *
- * It uses the
- * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
- *
- * @extends module:core/plugin~Plugin
- */
- class LinkUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["ContextualBalloon"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'LinkUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- editor.editing.view.addObserver( ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["ClickObserver"] );
- /**
- * The actions view displayed inside of the balloon.
- *
- * @member {module:link/ui/linkactionsview~LinkActionsView}
- */
- this.actionsView = this._createActionsView();
- /**
- * The form view displayed inside the balloon.
- *
- * @member {module:link/ui/linkformview~LinkFormView}
- */
- this.formView = this._createFormView();
- /**
- * The contextual balloon plugin instance.
- *
- * @private
- * @member {module:ui/panel/balloon/contextualballoon~ContextualBalloon}
- */
- this._balloon = editor.plugins.get( ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["ContextualBalloon"] );
- // Create toolbar buttons.
- this._createToolbarLinkButton();
- // Attach lifecycle actions to the the balloon.
- this._enableUserBalloonInteractions();
- // Renders a fake visual selection marker on an expanded selection.
- editor.conversion.for( 'editingDowncast' ).markerToHighlight( {
- model: VISUAL_SELECTION_MARKER_NAME,
- view: {
- classes: [ 'ck-fake-link-selection' ]
- }
- } );
- // Renders a fake visual selection marker on a collapsed selection.
- editor.conversion.for( 'editingDowncast' ).markerToElement( {
- model: VISUAL_SELECTION_MARKER_NAME,
- view: {
- name: 'span',
- classes: [ 'ck-fake-link-selection', 'ck-fake-link-selection_collapsed' ]
- }
- } );
- }
- /**
- * @inheritDoc
- */
- destroy() {
- super.destroy();
- // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
- this.formView.destroy();
- }
- /**
- * Creates the {@link module:link/ui/linkactionsview~LinkActionsView} instance.
- *
- * @private
- * @returns {module:link/ui/linkactionsview~LinkActionsView} The link actions view instance.
- */
- _createActionsView() {
- const editor = this.editor;
- const actionsView = new _ui_linkactionsview__WEBPACK_IMPORTED_MODULE_4__["default"]( editor.locale );
- const linkCommand = editor.commands.get( 'link' );
- const unlinkCommand = editor.commands.get( 'unlink' );
- actionsView.bind( 'href' ).to( linkCommand, 'value' );
- actionsView.editButtonView.bind( 'isEnabled' ).to( linkCommand );
- actionsView.unlinkButtonView.bind( 'isEnabled' ).to( unlinkCommand );
- // Execute unlink command after clicking on the "Edit" button.
- this.listenTo( actionsView, 'edit', () => {
- this._addFormView();
- } );
- // Execute unlink command after clicking on the "Unlink" button.
- this.listenTo( actionsView, 'unlink', () => {
- editor.execute( 'unlink' );
- this._hideUI();
- } );
- // Close the panel on esc key press when the **actions have focus**.
- actionsView.keystrokes.set( 'Esc', ( data, cancel ) => {
- this._hideUI();
- cancel();
- } );
- // Open the form view on Ctrl+K when the **actions have focus**..
- actionsView.keystrokes.set( _utils__WEBPACK_IMPORTED_MODULE_5__["LINK_KEYSTROKE"], ( data, cancel ) => {
- this._addFormView();
- cancel();
- } );
- return actionsView;
- }
- /**
- * Creates the {@link module:link/ui/linkformview~LinkFormView} instance.
- *
- * @private
- * @returns {module:link/ui/linkformview~LinkFormView} The link form view instance.
- */
- _createFormView() {
- const editor = this.editor;
- const linkCommand = editor.commands.get( 'link' );
- const defaultProtocol = editor.config.get( 'link.defaultProtocol' );
- const formView = new _ui_linkformview__WEBPACK_IMPORTED_MODULE_3__["default"]( editor.locale, linkCommand );
- formView.urlInputView.fieldView.bind( 'value' ).to( linkCommand, 'value' );
- // Form elements should be read-only when corresponding commands are disabled.
- formView.urlInputView.bind( 'isReadOnly' ).to( linkCommand, 'isEnabled', value => !value );
- formView.saveButtonView.bind( 'isEnabled' ).to( linkCommand );
- // Execute link command after clicking the "Save" button.
- this.listenTo( formView, 'submit', () => {
- const { value } = formView.urlInputView.fieldView.element;
- const parsedUrl = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["addLinkProtocolIfApplicable"])( value, defaultProtocol );
- editor.execute( 'link', parsedUrl, formView.getDecoratorSwitchesState() );
- this._closeFormView();
- } );
- // Hide the panel after clicking the "Cancel" button.
- this.listenTo( formView, 'cancel', () => {
- this._closeFormView();
- } );
- // Close the panel on esc key press when the **form has focus**.
- formView.keystrokes.set( 'Esc', ( data, cancel ) => {
- this._closeFormView();
- cancel();
- } );
- return formView;
- }
- /**
- * Creates a toolbar Link button. Clicking this button will show
- * a {@link #_balloon} attached to the selection.
- *
- * @private
- */
- _createToolbarLinkButton() {
- const editor = this.editor;
- const linkCommand = editor.commands.get( 'link' );
- const t = editor.t;
- // Handle the `Ctrl+K` keystroke and show the panel.
- editor.keystrokes.set( _utils__WEBPACK_IMPORTED_MODULE_5__["LINK_KEYSTROKE"], ( keyEvtData, cancel ) => {
- // Prevent focusing the search bar in FF, Chrome and Edge. See https://github.com/ckeditor/ckeditor5/issues/4811.
- cancel();
- if ( linkCommand.isEnabled ) {
- this._showUI( true );
- }
- } );
- editor.ui.componentFactory.add( 'link', locale => {
- const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["ButtonView"]( locale );
- button.isEnabled = true;
- button.label = t( 'Link' );
- button.icon = _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_6__["default"];
- button.keystroke = _utils__WEBPACK_IMPORTED_MODULE_5__["LINK_KEYSTROKE"];
- button.tooltip = true;
- button.isToggleable = true;
- // Bind button to the command.
- button.bind( 'isEnabled' ).to( linkCommand, 'isEnabled' );
- button.bind( 'isOn' ).to( linkCommand, 'value', value => !!value );
- // Show the panel on button click.
- this.listenTo( button, 'execute', () => this._showUI( true ) );
- return button;
- } );
- }
- /**
- * Attaches actions that control whether the balloon panel containing the
- * {@link #formView} is visible or not.
- *
- * @private
- */
- _enableUserBalloonInteractions() {
- const viewDocument = this.editor.editing.view.document;
- // Handle click on view document and show panel when selection is placed inside the link element.
- // Keep panel open until selection will be inside the same link element.
- this.listenTo( viewDocument, 'click', () => {
- const parentLink = this._getSelectedLinkElement();
- if ( parentLink ) {
- // Then show panel but keep focus inside editor editable.
- this._showUI();
- }
- } );
- // Focus the form if the balloon is visible and the Tab key has been pressed.
- this.editor.keystrokes.set( 'Tab', ( data, cancel ) => {
- if ( this._areActionsVisible && !this.actionsView.focusTracker.isFocused ) {
- this.actionsView.focus();
- cancel();
- }
- }, {
- // Use the high priority because the link UI navigation is more important
- // than other feature's actions, e.g. list indentation.
- // https://github.com/ckeditor/ckeditor5-link/issues/146
- priority: 'high'
- } );
- // Close the panel on the Esc key press when the editable has focus and the balloon is visible.
- this.editor.keystrokes.set( 'Esc', ( data, cancel ) => {
- if ( this._isUIVisible ) {
- this._hideUI();
- cancel();
- }
- } );
- // Close on click outside of balloon panel element.
- Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["clickOutsideHandler"])( {
- emitter: this.formView,
- activator: () => this._isUIInPanel,
- contextElements: [ this._balloon.view.element ],
- callback: () => this._hideUI()
- } );
- }
- /**
- * Adds the {@link #actionsView} to the {@link #_balloon}.
- *
- * @protected
- */
- _addActionsView() {
- if ( this._areActionsInPanel ) {
- return;
- }
- this._balloon.add( {
- view: this.actionsView,
- position: this._getBalloonPositionData()
- } );
- }
- /**
- * Adds the {@link #formView} to the {@link #_balloon}.
- *
- * @protected
- */
- _addFormView() {
- if ( this._isFormInPanel ) {
- return;
- }
- const editor = this.editor;
- const linkCommand = editor.commands.get( 'link' );
- this.formView.disableCssTransitions();
- this._balloon.add( {
- view: this.formView,
- position: this._getBalloonPositionData()
- } );
- // Select input when form view is currently visible.
- if ( this._balloon.visibleView === this.formView ) {
- this.formView.urlInputView.fieldView.select();
- }
- this.formView.enableCssTransitions();
- // Make sure that each time the panel shows up, the URL field remains in sync with the value of
- // the command. If the user typed in the input, then canceled the balloon (`urlInputView.fieldView#value` stays
- // unaltered) and re-opened it without changing the value of the link command (e.g. because they
- // clicked the same link), they would see the old value instead of the actual value of the command.
- // https://github.com/ckeditor/ckeditor5-link/issues/78
- // https://github.com/ckeditor/ckeditor5-link/issues/123
- this.formView.urlInputView.fieldView.element.value = linkCommand.value || '';
- }
- /**
- * Closes the form view. Decides whether the balloon should be hidden completely or if the action view should be shown. This is
- * decided upon the link command value (which has a value if the document selection is in the link).
- *
- * Additionally, if any {@link module:link/link~LinkConfig#decorators} are defined in the editor configuration, the state of
- * switch buttons responsible for manual decorator handling is restored.
- *
- * @private
- */
- _closeFormView() {
- const linkCommand = this.editor.commands.get( 'link' );
- // Restore manual decorator states to represent the current model state. This case is important to reset the switch buttons
- // when the user cancels the editing form.
- linkCommand.restoreManualDecoratorStates();
- if ( linkCommand.value !== undefined ) {
- this._removeFormView();
- } else {
- this._hideUI();
- }
- }
- /**
- * Removes the {@link #formView} from the {@link #_balloon}.
- *
- * @protected
- */
- _removeFormView() {
- if ( this._isFormInPanel ) {
- // Blur the input element before removing it from DOM to prevent issues in some browsers.
- // See https://github.com/ckeditor/ckeditor5/issues/1501.
- this.formView.saveButtonView.focus();
- this._balloon.remove( this.formView );
- // Because the form has an input which has focus, the focus must be brought back
- // to the editor. Otherwise, it would be lost.
- this.editor.editing.view.focus();
- this._hideFakeVisualSelection();
- }
- }
- /**
- * Shows the correct UI type. It is either {@link #formView} or {@link #actionsView}.
- *
- * @param {Boolean} forceVisible
- * @private
- */
- _showUI( forceVisible = false ) {
- // When there's no link under the selection, go straight to the editing UI.
- if ( !this._getSelectedLinkElement() ) {
- // Show visual selection on a text without a link when the contextual balloon is displayed.
- // See https://github.com/ckeditor/ckeditor5/issues/4721.
- this._showFakeVisualSelection();
- this._addActionsView();
- // Be sure panel with link is visible.
- if ( forceVisible ) {
- this._balloon.showStack( 'main' );
- }
- this._addFormView();
- }
- // If there's a link under the selection...
- else {
- // Go to the editing UI if actions are already visible.
- if ( this._areActionsVisible ) {
- this._addFormView();
- }
- // Otherwise display just the actions UI.
- else {
- this._addActionsView();
- }
- // Be sure panel with link is visible.
- if ( forceVisible ) {
- this._balloon.showStack( 'main' );
- }
- }
- // Begin responding to ui#update once the UI is added.
- this._startUpdatingUI();
- }
- /**
- * Removes the {@link #formView} from the {@link #_balloon}.
- *
- * See {@link #_addFormView}, {@link #_addActionsView}.
- *
- * @protected
- */
- _hideUI() {
- if ( !this._isUIInPanel ) {
- return;
- }
- const editor = this.editor;
- this.stopListening( editor.ui, 'update' );
- this.stopListening( this._balloon, 'change:visibleView' );
- // Make sure the focus always gets back to the editable _before_ removing the focused form view.
- // Doing otherwise causes issues in some browsers. See https://github.com/ckeditor/ckeditor5-link/issues/193.
- editor.editing.view.focus();
- // Remove form first because it's on top of the stack.
- this._removeFormView();
- // Then remove the actions view because it's beneath the form.
- this._balloon.remove( this.actionsView );
- this._hideFakeVisualSelection();
- }
- /**
- * Makes the UI react to the {@link module:core/editor/editorui~EditorUI#event:update} event to
- * reposition itself when the editor UI should be refreshed.
- *
- * See: {@link #_hideUI} to learn when the UI stops reacting to the `update` event.
- *
- * @protected
- */
- _startUpdatingUI() {
- const editor = this.editor;
- const viewDocument = editor.editing.view.document;
- let prevSelectedLink = this._getSelectedLinkElement();
- let prevSelectionParent = getSelectionParent();
- const update = () => {
- const selectedLink = this._getSelectedLinkElement();
- const selectionParent = getSelectionParent();
- // Hide the panel if:
- //
- // * the selection went out of the EXISTING link element. E.g. user moved the caret out
- // of the link,
- // * the selection went to a different parent when creating a NEW link. E.g. someone
- // else modified the document.
- // * the selection has expanded (e.g. displaying link actions then pressing SHIFT+Right arrow).
- //
- // Note: #_getSelectedLinkElement will return a link for a non-collapsed selection only
- // when fully selected.
- if ( ( prevSelectedLink && !selectedLink ) ||
- ( !prevSelectedLink && selectionParent !== prevSelectionParent ) ) {
- this._hideUI();
- }
- // Update the position of the panel when:
- // * link panel is in the visible stack
- // * the selection remains in the original link element,
- // * there was no link element in the first place, i.e. creating a new link
- else if ( this._isUIVisible ) {
- // If still in a link element, simply update the position of the balloon.
- // If there was no link (e.g. inserting one), the balloon must be moved
- // to the new position in the editing view (a new native DOM range).
- this._balloon.updatePosition( this._getBalloonPositionData() );
- }
- prevSelectedLink = selectedLink;
- prevSelectionParent = selectionParent;
- };
- function getSelectionParent() {
- return viewDocument.selection.focus.getAncestors()
- .reverse()
- .find( node => node.is( 'element' ) );
- }
- this.listenTo( editor.ui, 'update', update );
- this.listenTo( this._balloon, 'change:visibleView', update );
- }
- /**
- * Returns `true` when {@link #formView} is in the {@link #_balloon}.
- *
- * @readonly
- * @protected
- * @type {Boolean}
- */
- get _isFormInPanel() {
- return this._balloon.hasView( this.formView );
- }
- /**
- * Returns `true` when {@link #actionsView} is in the {@link #_balloon}.
- *
- * @readonly
- * @protected
- * @type {Boolean}
- */
- get _areActionsInPanel() {
- return this._balloon.hasView( this.actionsView );
- }
- /**
- * Returns `true` when {@link #actionsView} is in the {@link #_balloon} and it is
- * currently visible.
- *
- * @readonly
- * @protected
- * @type {Boolean}
- */
- get _areActionsVisible() {
- return this._balloon.visibleView === this.actionsView;
- }
- /**
- * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon}.
- *
- * @readonly
- * @protected
- * @type {Boolean}
- */
- get _isUIInPanel() {
- return this._isFormInPanel || this._areActionsInPanel;
- }
- /**
- * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon} and it is
- * currently visible.
- *
- * @readonly
- * @protected
- * @type {Boolean}
- */
- get _isUIVisible() {
- const visibleView = this._balloon.visibleView;
- return visibleView == this.formView || this._areActionsVisible;
- }
- /**
- * Returns positioning options for the {@link #_balloon}. They control the way the balloon is attached
- * to the target element or selection.
- *
- * If the selection is collapsed and inside a link element, the panel will be attached to the
- * entire link element. Otherwise, it will be attached to the selection.
- *
- * @private
- * @returns {module:utils/dom/position~Options}
- */
- _getBalloonPositionData() {
- const view = this.editor.editing.view;
- const model = this.editor.model;
- const viewDocument = view.document;
- let target = null;
- if ( model.markers.has( VISUAL_SELECTION_MARKER_NAME ) ) {
- // There are cases when we highlight selection using a marker (#7705, #4721).
- const markerViewElements = Array.from( this.editor.editing.mapper.markerNameToElements( VISUAL_SELECTION_MARKER_NAME ) );
- const newRange = view.createRange(
- view.createPositionBefore( markerViewElements[ 0 ] ),
- view.createPositionAfter( markerViewElements[ markerViewElements.length - 1 ] )
- );
- target = view.domConverter.viewRangeToDom( newRange );
- } else {
- const targetLink = this._getSelectedLinkElement();
- const range = viewDocument.selection.getFirstRange();
- target = targetLink ?
- // When selection is inside link element, then attach panel to this element.
- view.domConverter.mapViewToDom( targetLink ) :
- // Otherwise attach panel to the selection.
- view.domConverter.viewRangeToDom( range );
- }
- return { target };
- }
- /**
- * Returns the link {@link module:engine/view/attributeelement~AttributeElement} under
- * the {@link module:engine/view/document~Document editing view's} selection or `null`
- * if there is none.
- *
- * **Note**: For a non–collapsed selection, the link element is only returned when **fully**
- * selected and the **only** element within the selection boundaries.
- *
- * @private
- * @returns {module:engine/view/attributeelement~AttributeElement|null}
- */
- _getSelectedLinkElement() {
- const view = this.editor.editing.view;
- const selection = view.document.selection;
- if ( selection.isCollapsed ) {
- return findLinkElementAncestor( selection.getFirstPosition() );
- } else {
- // The range for fully selected link is usually anchored in adjacent text nodes.
- // Trim it to get closer to the actual link element.
- const range = selection.getFirstRange().getTrimmed();
- const startLink = findLinkElementAncestor( range.start );
- const endLink = findLinkElementAncestor( range.end );
- if ( !startLink || startLink != endLink ) {
- return null;
- }
- // Check if the link element is fully selected.
- if ( view.createRangeIn( startLink ).getTrimmed().isEqual( range ) ) {
- return startLink;
- } else {
- return null;
- }
- }
- }
- /**
- * Displays a fake visual selection when the contextual balloon is displayed.
- *
- * This adds a 'link-ui' marker into the document that is rendered as a highlight on selected text fragment.
- *
- * @private
- */
- _showFakeVisualSelection() {
- const model = this.editor.model;
- model.change( writer => {
- const range = model.document.selection.getFirstRange();
- if ( model.markers.has( VISUAL_SELECTION_MARKER_NAME ) ) {
- writer.updateMarker( VISUAL_SELECTION_MARKER_NAME, { range } );
- } else {
- if ( range.start.isAtEnd ) {
- const startPosition = range.start.getLastMatchingPosition(
- ( { item } ) => !model.schema.isContent( item ),
- { boundaries: range }
- );
- writer.addMarker( VISUAL_SELECTION_MARKER_NAME, {
- usingOperation: false,
- affectsData: false,
- range: writer.createRange( startPosition, range.end )
- } );
- } else {
- writer.addMarker( VISUAL_SELECTION_MARKER_NAME, {
- usingOperation: false,
- affectsData: false,
- range
- } );
- }
- }
- } );
- }
- /**
- * Hides the fake visual selection created in {@link #_showFakeVisualSelection}.
- *
- * @private
- */
- _hideFakeVisualSelection() {
- const model = this.editor.model;
- if ( model.markers.has( VISUAL_SELECTION_MARKER_NAME ) ) {
- model.change( writer => {
- writer.removeMarker( VISUAL_SELECTION_MARKER_NAME );
- } );
- }
- }
- }
- // Returns a link element if there's one among the ancestors of the provided `Position`.
- //
- // @private
- // @param {module:engine/view/position~Position} View position to analyze.
- // @returns {module:engine/view/attributeelement~AttributeElement|null} Link element at the position or null.
- function findLinkElementAncestor( position ) {
- return position.getAncestors().find( ancestor => Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isLinkElement"])( ancestor ) );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js ***!
- \*************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkActionsView; });
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
- /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
- /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _theme_linkactions_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/linkactions.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css");
- /* harmony import */ var _theme_linkactions_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_linkactions_css__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _theme_icons_unlink_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/icons/unlink.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/ui/linkactionsview
- */
- // See: #8833.
- // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
- /**
- * The link actions view class. This view displays the link preview, allows
- * unlinking or editing the link.
- *
- * @extends module:ui/view~View
- */
- class LinkActionsView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- const t = locale.t;
- /**
- * Tracks information about DOM focus in the actions.
- *
- * @readonly
- * @member {module:utils/focustracker~FocusTracker}
- */
- this.focusTracker = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["FocusTracker"]();
- /**
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
- *
- * @readonly
- * @member {module:utils/keystrokehandler~KeystrokeHandler}
- */
- this.keystrokes = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["KeystrokeHandler"]();
- /**
- * The href preview view.
- *
- * @member {module:ui/view~View}
- */
- this.previewButtonView = this._createPreviewButton();
- /**
- * The unlink button view.
- *
- * @member {module:ui/button/buttonview~ButtonView}
- */
- this.unlinkButtonView = this._createButton( t( 'Unlink' ), _theme_icons_unlink_svg__WEBPACK_IMPORTED_MODULE_6__["default"], 'unlink' );
- /**
- * The edit link button view.
- *
- * @member {module:ui/button/buttonview~ButtonView}
- */
- this.editButtonView = this._createButton( t( 'Edit link' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].pencil, 'edit' );
- /**
- * The value of the "href" attribute of the link to use in the {@link #previewButtonView}.
- *
- * @observable
- * @member {String}
- */
- this.set( 'href' );
- /**
- * A collection of views that can be focused in the view.
- *
- * @readonly
- * @protected
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this._focusables = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ViewCollection"]();
- /**
- * Helps cycling over {@link #_focusables} in the view.
- *
- * @readonly
- * @protected
- * @member {module:ui/focuscycler~FocusCycler}
- */
- this._focusCycler = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["FocusCycler"]( {
- focusables: this._focusables,
- focusTracker: this.focusTracker,
- keystrokeHandler: this.keystrokes,
- actions: {
- // Navigate fields backwards using the Shift + Tab keystroke.
- focusPrevious: 'shift + tab',
- // Navigate fields forwards using the Tab key.
- focusNext: 'tab'
- }
- } );
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-link-actions',
- 'ck-responsive-form'
- ],
- // https://github.com/ckeditor/ckeditor5-link/issues/90
- tabindex: '-1'
- },
- children: [
- this.previewButtonView,
- this.editButtonView,
- this.unlinkButtonView
- ]
- } );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- const childViews = [
- this.previewButtonView,
- this.editButtonView,
- this.unlinkButtonView
- ];
- childViews.forEach( v => {
- // Register the view as focusable.
- this._focusables.add( v );
- // Register the view in the focus tracker.
- this.focusTracker.add( v.element );
- } );
- // Start listening for the keystrokes coming from #element.
- this.keystrokes.listenTo( this.element );
- }
- /**
- * Focuses the fist {@link #_focusables} in the actions.
- */
- focus() {
- this._focusCycler.focusFirst();
- }
- /**
- * Creates a button view.
- *
- * @private
- * @param {String} label The button label.
- * @param {String} icon The button icon.
- * @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to.
- * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
- */
- _createButton( label, icon, eventName ) {
- const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( this.locale );
- button.set( {
- label,
- icon,
- tooltip: true
- } );
- button.delegate( 'execute' ).to( this, eventName );
- return button;
- }
- /**
- * Creates a link href preview button.
- *
- * @private
- * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
- */
- _createPreviewButton() {
- const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( this.locale );
- const bind = this.bindTemplate;
- const t = this.t;
- button.set( {
- withText: true,
- tooltip: t( 'Open link in new tab' )
- } );
- button.extendTemplate( {
- attributes: {
- class: [
- 'ck',
- 'ck-link-actions__preview'
- ],
- href: bind.to( 'href', href => href && Object(_utils__WEBPACK_IMPORTED_MODULE_3__["ensureSafeUrl"])( href ) ),
- target: '_blank',
- rel: 'noopener noreferrer'
- }
- } );
- button.bind( 'label' ).to( this, 'href', href => {
- return href || t( 'This link has no URL' );
- } );
- button.bind( 'isEnabled' ).to( this, 'href', href => !!href );
- button.template.tag = 'a';
- button.template.eventListeners = {};
- return button;
- }
- }
- /**
- * Fired when the {@link #editButtonView} is clicked.
- *
- * @event edit
- */
- /**
- * Fired when the {@link #unlinkButtonView} is clicked.
- *
- * @event unlink
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkFormView; });
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
- /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _theme_linkform_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/linkform.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css");
- /* harmony import */ var _theme_linkform_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_linkform_css__WEBPACK_IMPORTED_MODULE_4__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/ui/linkformview
- */
- // See: #8833.
- // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
- /**
- * The link form view controller class.
- *
- * See {@link module:link/ui/linkformview~LinkFormView}.
- *
- * @extends module:ui/view~View
- */
- class LinkFormView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
- /**
- * Creates an instance of the {@link module:link/ui/linkformview~LinkFormView} class.
- *
- * Also see {@link #render}.
- *
- * @param {module:utils/locale~Locale} [locale] The localization services instance.
- * @param {module:link/linkcommand~LinkCommand} linkCommand Reference to {@link module:link/linkcommand~LinkCommand}.
- * @param {String} [protocol] A value of a protocol to be displayed in the input's placeholder.
- */
- constructor( locale, linkCommand ) {
- super( locale );
- const t = locale.t;
- /**
- * Tracks information about DOM focus in the form.
- *
- * @readonly
- * @member {module:utils/focustracker~FocusTracker}
- */
- this.focusTracker = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["FocusTracker"]();
- /**
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
- *
- * @readonly
- * @member {module:utils/keystrokehandler~KeystrokeHandler}
- */
- this.keystrokes = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["KeystrokeHandler"]();
- /**
- * The URL input view.
- *
- * @member {module:ui/labeledfield/labeledfieldview~LabeledFieldView}
- */
- this.urlInputView = this._createUrlInput();
- /**
- * The Save button view.
- *
- * @member {module:ui/button/buttonview~ButtonView}
- */
- this.saveButtonView = this._createButton( t( 'Save' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].check, 'ck-button-save' );
- this.saveButtonView.type = 'submit';
- /**
- * The Cancel button view.
- *
- * @member {module:ui/button/buttonview~ButtonView}
- */
- this.cancelButtonView = this._createButton( t( 'Cancel' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].cancel, 'ck-button-cancel', 'cancel' );
- /**
- * A collection of {@link module:ui/button/switchbuttonview~SwitchButtonView},
- * which corresponds to {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators}
- * configured in the editor.
- *
- * @private
- * @readonly
- * @type {module:ui/viewcollection~ViewCollection}
- */
- this._manualDecoratorSwitches = this._createManualDecoratorSwitches( linkCommand );
- /**
- * A collection of child views in the form.
- *
- * @readonly
- * @type {module:ui/viewcollection~ViewCollection}
- */
- this.children = this._createFormChildren( linkCommand.manualDecorators );
- /**
- * A collection of views that can be focused in the form.
- *
- * @readonly
- * @protected
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this._focusables = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ViewCollection"]();
- /**
- * Helps cycling over {@link #_focusables} in the form.
- *
- * @readonly
- * @protected
- * @member {module:ui/focuscycler~FocusCycler}
- */
- this._focusCycler = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["FocusCycler"]( {
- focusables: this._focusables,
- focusTracker: this.focusTracker,
- keystrokeHandler: this.keystrokes,
- actions: {
- // Navigate form fields backwards using the Shift + Tab keystroke.
- focusPrevious: 'shift + tab',
- // Navigate form fields forwards using the Tab key.
- focusNext: 'tab'
- }
- } );
- const classList = [ 'ck', 'ck-link-form', 'ck-responsive-form' ];
- if ( linkCommand.manualDecorators.length ) {
- classList.push( 'ck-link-form_layout-vertical', 'ck-vertical-form' );
- }
- this.setTemplate( {
- tag: 'form',
- attributes: {
- class: classList,
- // https://github.com/ckeditor/ckeditor5-link/issues/90
- tabindex: '-1'
- },
- children: this.children
- } );
- Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["injectCssTransitionDisabler"])( this );
- }
- /**
- * Obtains the state of the {@link module:ui/button/switchbuttonview~SwitchButtonView switch buttons} representing
- * {@link module:link/linkcommand~LinkCommand#manualDecorators manual link decorators}
- * in the {@link module:link/ui/linkformview~LinkFormView}.
- *
- * @returns {Object.<String,Boolean>} Key-value pairs, where the key is the name of the decorator and the value is
- * its state.
- */
- getDecoratorSwitchesState() {
- return Array.from( this._manualDecoratorSwitches ).reduce( ( accumulator, switchButton ) => {
- accumulator[ switchButton.name ] = switchButton.isOn;
- return accumulator;
- }, {} );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["submitHandler"])( {
- view: this
- } );
- const childViews = [
- this.urlInputView,
- ...this._manualDecoratorSwitches,
- this.saveButtonView,
- this.cancelButtonView
- ];
- childViews.forEach( v => {
- // Register the view as focusable.
- this._focusables.add( v );
- // Register the view in the focus tracker.
- this.focusTracker.add( v.element );
- } );
- // Start listening for the keystrokes coming from #element.
- this.keystrokes.listenTo( this.element );
- }
- /**
- * Focuses the fist {@link #_focusables} in the form.
- */
- focus() {
- this._focusCycler.focusFirst();
- }
- /**
- * Creates a labeled input view.
- *
- * @private
- * @returns {module:ui/labeledfield/labeledfieldview~LabeledFieldView} Labeled field view instance.
- */
- _createUrlInput() {
- const t = this.locale.t;
- const labeledInput = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["LabeledFieldView"]( this.locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["createLabeledInputText"] );
- labeledInput.label = t( 'Link URL' );
- return labeledInput;
- }
- /**
- * Creates a button view.
- *
- * @private
- * @param {String} label The button label.
- * @param {String} icon The button icon.
- * @param {String} className The additional button CSS class name.
- * @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to.
- * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
- */
- _createButton( label, icon, className, eventName ) {
- const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( this.locale );
- button.set( {
- label,
- icon,
- tooltip: true
- } );
- button.extendTemplate( {
- attributes: {
- class: className
- }
- } );
- if ( eventName ) {
- button.delegate( 'execute' ).to( this, eventName );
- }
- return button;
- }
- /**
- * Populates {@link module:ui/viewcollection~ViewCollection} of {@link module:ui/button/switchbuttonview~SwitchButtonView}
- * made based on {@link module:link/linkcommand~LinkCommand#manualDecorators}.
- *
- * @private
- * @param {module:link/linkcommand~LinkCommand} linkCommand A reference to the link command.
- * @returns {module:ui/viewcollection~ViewCollection} of switch buttons.
- */
- _createManualDecoratorSwitches( linkCommand ) {
- const switches = this.createCollection();
- for ( const manualDecorator of linkCommand.manualDecorators ) {
- const switchButton = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["SwitchButtonView"]( this.locale );
- switchButton.set( {
- name: manualDecorator.id,
- label: manualDecorator.label,
- withText: true
- } );
- switchButton.bind( 'isOn' ).toMany( [ manualDecorator, linkCommand ], 'value', ( decoratorValue, commandValue ) => {
- return commandValue === undefined && decoratorValue === undefined ? manualDecorator.defaultValue : decoratorValue;
- } );
- switchButton.on( 'execute', () => {
- manualDecorator.set( 'value', !switchButton.isOn );
- } );
- switches.add( switchButton );
- }
- return switches;
- }
- /**
- * Populates the {@link #children} collection of the form.
- *
- * If {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators} are configured in the editor, it creates an
- * additional `View` wrapping all {@link #_manualDecoratorSwitches} switch buttons corresponding
- * to these decorators.
- *
- * @private
- * @param {module:utils/collection~Collection} manualDecorators A reference to
- * the collection of manual decorators stored in the link command.
- * @returns {module:ui/viewcollection~ViewCollection} The children of link form view.
- */
- _createFormChildren( manualDecorators ) {
- const children = this.createCollection();
- children.add( this.urlInputView );
- if ( manualDecorators.length ) {
- const additionalButtonsView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"]();
- additionalButtonsView.setTemplate( {
- tag: 'ul',
- children: this._manualDecoratorSwitches.map( switchButton => ( {
- tag: 'li',
- children: [ switchButton ],
- attributes: {
- class: [
- 'ck',
- 'ck-list__item'
- ]
- }
- } ) ),
- attributes: {
- class: [
- 'ck',
- 'ck-reset',
- 'ck-list'
- ]
- }
- } );
- children.add( additionalButtonsView );
- }
- children.add( this.saveButtonView );
- children.add( this.cancelButtonView );
- return children;
- }
- }
- /**
- * Fired when the form view is submitted (when one of the children triggered the submit event),
- * for example with a click on {@link #saveButtonView}.
- *
- * @event submit
- */
- /**
- * Fired when the form view is canceled, for example with a click on {@link #cancelButtonView}.
- *
- * @event cancel
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UnlinkCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/unlinkcommand
- */
- /**
- * The unlink command. It is used by the {@link module:link/link~Link link plugin}.
- *
- * @extends module:core/command~Command
- */
- class UnlinkCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const model = this.editor.model;
- const doc = model.document;
- const selectedElement = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["first"])( doc.selection.getSelectedBlocks() );
- // A check for the `LinkImage` plugin. If the selection contains an image element, get values from the element.
- // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_3__["isImageAllowed"])( selectedElement, model.schema ) ) {
- this.isEnabled = model.schema.checkAttribute( selectedElement, 'linkHref' );
- } else {
- this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, 'linkHref' );
- }
- }
- /**
- * Executes the command.
- *
- * When the selection is collapsed, it removes the `linkHref` attribute from each node with the same `linkHref` attribute value.
- * When the selection is non-collapsed, it removes the `linkHref` attribute from each node in selected ranges.
- *
- * # Decorators
- *
- * If {@link module:link/link~LinkConfig#decorators `config.link.decorators`} is specified,
- * all configured decorators are removed together with the `linkHref` attribute.
- *
- * @fires execute
- */
- execute() {
- const editor = this.editor;
- const model = this.editor.model;
- const selection = model.document.selection;
- const linkCommand = editor.commands.get( 'link' );
- model.change( writer => {
- // Get ranges to unlink.
- const rangesToUnlink = selection.isCollapsed ?
- [ Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["findAttributeRange"])(
- selection.getFirstPosition(),
- 'linkHref',
- selection.getAttribute( 'linkHref' ),
- model
- ) ] :
- model.schema.getValidRanges( selection.getRanges(), 'linkHref' );
- // Remove `linkHref` attribute from specified ranges.
- for ( const range of rangesToUnlink ) {
- writer.removeAttribute( 'linkHref', range );
- // If there are registered custom attributes, then remove them during unlink.
- if ( linkCommand ) {
- for ( const manualDecorator of linkCommand.manualDecorators ) {
- writer.removeAttribute( manualDecorator.id, range );
- }
- }
- }
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js":
- /*!************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/utils.js ***!
- \************************************************************/
- /*! exports provided: LINK_KEYSTROKE, isLinkElement, createLinkElement, ensureSafeUrl, getLocalizedDecorators, normalizeDecorators, isImageAllowed, isEmail, addLinkProtocolIfApplicable */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LINK_KEYSTROKE", function() { return LINK_KEYSTROKE; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinkElement", function() { return isLinkElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLinkElement", function() { return createLinkElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureSafeUrl", function() { return ensureSafeUrl; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedDecorators", function() { return getLocalizedDecorators; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeDecorators", function() { return normalizeDecorators; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isImageAllowed", function() { return isImageAllowed; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmail", function() { return isEmail; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addLinkProtocolIfApplicable", function() { return addLinkProtocolIfApplicable; });
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/utils
- */
- const ATTRIBUTE_WHITESPACES = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g; // eslint-disable-line no-control-regex
- const SAFE_URL = /^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;
- // Simplified email test - should be run over previously found URL.
- const EMAIL_REG_EXP = /^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i;
- // The regex checks for the protocol syntax ('xxxx://' or 'xxxx:')
- // or non-word characters at the beginning of the link ('/', '#' etc.).
- const PROTOCOL_REG_EXP = /^((\w+:(\/{2,})?)|(\W))/i;
- /**
- * A keystroke used by the {@link module:link/linkui~LinkUI link UI feature}.
- */
- const LINK_KEYSTROKE = 'Ctrl+K';
- /**
- * Returns `true` if a given view node is the link element.
- *
- * @param {module:engine/view/node~Node} node
- * @returns {Boolean}
- */
- function isLinkElement( node ) {
- return node.is( 'attributeElement' ) && !!node.getCustomProperty( 'link' );
- }
- /**
- * Creates a link {@link module:engine/view/attributeelement~AttributeElement} with the provided `href` attribute.
- *
- * @param {String} href
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
- * @returns {module:engine/view/attributeelement~AttributeElement}
- */
- function createLinkElement( href, { writer } ) {
- // Priority 5 - https://github.com/ckeditor/ckeditor5-link/issues/121.
- const linkElement = writer.createAttributeElement( 'a', { href }, { priority: 5 } );
- writer.setCustomProperty( 'link', true, linkElement );
- return linkElement;
- }
- /**
- * Returns a safe URL based on a given value.
- *
- * A URL is considered safe if it is safe for the user (does not contain any malicious code).
- *
- * If a URL is considered unsafe, a simple `"#"` is returned.
- *
- * @protected
- * @param {*} url
- * @returns {String} Safe URL.
- */
- function ensureSafeUrl( url ) {
- url = String( url );
- return isSafeUrl( url ) ? url : '#';
- }
- // Checks whether the given URL is safe for the user (does not contain any malicious code).
- //
- // @param {String} url URL to check.
- function isSafeUrl( url ) {
- const normalizedUrl = url.replace( ATTRIBUTE_WHITESPACES, '' );
- return normalizedUrl.match( SAFE_URL );
- }
- /**
- * Returns the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration processed
- * to respect the locale of the editor, i.e. to display the {@link module:link/link~LinkDecoratorManualDefinition label}
- * in the correct language.
- *
- * **Note**: Only the few most commonly used labels are translated automatically. Other labels should be manually
- * translated in the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration.
- *
- * @param {module:utils/locale~Locale#t} t shorthand for {@link module:utils/locale~Locale#t Locale#t}
- * @param {Array.<module:link/link~LinkDecoratorDefinition>} The decorator reference
- * where the label values should be localized.
- * @returns {Array.<module:link/link~LinkDecoratorDefinition>}
- */
- function getLocalizedDecorators( t, decorators ) {
- const localizedDecoratorsLabels = {
- 'Open in a new tab': t( 'Open in a new tab' ),
- 'Downloadable': t( 'Downloadable' )
- };
- decorators.forEach( decorator => {
- if ( decorator.label && localizedDecoratorsLabels[ decorator.label ] ) {
- decorator.label = localizedDecoratorsLabels[ decorator.label ];
- }
- return decorator;
- } );
- return decorators;
- }
- /**
- * Converts an object with defined decorators to a normalized array of decorators. The `id` key is added for each decorator and
- * is used as the attribute's name in the model.
- *
- * @param {Object.<String, module:link/link~LinkDecoratorDefinition>} decorators
- * @returns {Array.<module:link/link~LinkDecoratorDefinition>}
- */
- function normalizeDecorators( decorators ) {
- const retArray = [];
- if ( decorators ) {
- for ( const [ key, value ] of Object.entries( decorators ) ) {
- const decorator = Object.assign(
- {},
- value,
- { id: `link${ Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["upperFirst"])( key ) }` }
- );
- retArray.push( decorator );
- }
- }
- return retArray;
- }
- /**
- * Returns `true` if the specified `element` is an image and it can be linked (the element allows having the `linkHref` attribute).
- *
- * @params {module:engine/model/element~Element|null} element
- * @params {module:engine/model/schema~Schema} schema
- * @returns {Boolean}
- */
- function isImageAllowed( element, schema ) {
- if ( !element ) {
- return false;
- }
- return element.is( 'element', 'image' ) && schema.checkAttribute( 'image', 'linkHref' );
- }
- /**
- * Returns `true` if the specified `value` is an email.
- *
- * @params {String} value
- * @returns {Boolean}
- */
- function isEmail( value ) {
- return EMAIL_REG_EXP.test( value );
- }
- /**
- * Adds the protocol prefix to the specified `link` when:
- *
- * * it does not contain it already, and there is a {@link module:link/link~LinkConfig#defaultProtocol `defaultProtocol` }
- * configuration value provided,
- * * or the link is an email address.
- *
- *
- * @params {String} link
- * @params {String} defaultProtocol
- * @returns {Boolean}
- */
- function addLinkProtocolIfApplicable( link, defaultProtocol ) {
- const protocol = isEmail( link ) ? 'mailto:' : defaultProtocol;
- const isProtocolNeeded = !!protocol && !PROTOCOL_REG_EXP.test( link );
- return link && isProtocolNeeded ? protocol + link : link;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AutomaticDecorators; });
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
- /**
- * @module link/utils
- */
- /**
- * Helper class that ties together all {@link module:link/link~LinkDecoratorAutomaticDefinition} and provides
- * the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement downcast dispatchers} for them.
- */
- class AutomaticDecorators {
- constructor() {
- /**
- * Stores the definition of {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators}.
- * This data is used as a source for a downcast dispatcher to create a proper conversion to output data.
- *
- * @private
- * @type {Set}
- */
- this._definitions = new Set();
- }
- /**
- * Gives information about the number of decorators stored in the {@link module:link/utils~AutomaticDecorators} instance.
- *
- * @readonly
- * @protected
- * @type {Number}
- */
- get length() {
- return this._definitions.size;
- }
- /**
- * Adds automatic decorator objects or an array with them to be used during downcasting.
- *
- * @param {module:link/link~LinkDecoratorAutomaticDefinition|Array.<module:link/link~LinkDecoratorAutomaticDefinition>} item
- * A configuration object of automatic rules for decorating links. It might also be an array of such objects.
- */
- add( item ) {
- if ( Array.isArray( item ) ) {
- item.forEach( item => this._definitions.add( item ) );
- } else {
- this._definitions.add( item );
- }
- }
- /**
- * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method.
- *
- * @returns {Function} A dispatcher function used as conversion helper
- * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.
- */
- getDispatcher() {
- return dispatcher => {
- dispatcher.on( 'attribute:linkHref', ( evt, data, conversionApi ) => {
- // There is only test as this behavior decorates links and
- // it is run before dispatcher which actually consumes this node.
- // This allows on writing own dispatcher with highest priority,
- // which blocks both native converter and this additional decoration.
- if ( !conversionApi.consumable.test( data.item, 'attribute:linkHref' ) ) {
- return;
- }
- const viewWriter = conversionApi.writer;
- const viewSelection = viewWriter.document.selection;
- for ( const item of this._definitions ) {
- const viewElement = viewWriter.createAttributeElement( 'a', item.attributes, {
- priority: 5
- } );
- viewWriter.setCustomProperty( 'link', true, viewElement );
- if ( item.callback( data.attributeNewValue ) ) {
- if ( data.item.is( 'selection' ) ) {
- viewWriter.wrap( viewSelection.getFirstRange(), viewElement );
- } else {
- viewWriter.wrap( conversionApi.mapper.toViewRange( data.range ), viewElement );
- }
- } else {
- viewWriter.unwrap( conversionApi.mapper.toViewRange( data.range ), viewElement );
- }
- }
- }, { priority: 'high' } );
- };
- }
- /**
- * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method
- * when linking images.
- *
- * @returns {Function} A dispatcher function used as conversion helper
- * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.
- */
- getDispatcherForLinkedImage() {
- return dispatcher => {
- dispatcher.on( 'attribute:linkHref:image', ( evt, data, conversionApi ) => {
- const viewFigure = conversionApi.mapper.toViewElement( data.item );
- const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
- for ( const item of this._definitions ) {
- const attributes = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["toMap"])( item.attributes );
- if ( item.callback( data.attributeNewValue ) ) {
- for ( const [ key, val ] of attributes ) {
- if ( key === 'class' ) {
- conversionApi.writer.addClass( val, linkInImage );
- } else {
- conversionApi.writer.setAttribute( key, val, linkInImage );
- }
- }
- } else {
- for ( const [ key, val ] of attributes ) {
- if ( key === 'class' ) {
- conversionApi.writer.removeClass( val, linkInImage );
- } else {
- conversionApi.writer.removeAttribute( key, linkInImage );
- }
- }
- }
- }
- } );
- };
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ManualDecorator; });
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module link/utils
- */
- /**
- * Helper class that stores manual decorators with observable {@link module:link/utils~ManualDecorator#value}
- * to support integration with the UI state. An instance of this class is a model with the state of individual manual decorators.
- * These decorators are kept as collections in {@link module:link/linkcommand~LinkCommand#manualDecorators}.
- *
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class ManualDecorator {
- /**
- * Creates a new instance of {@link module:link/utils~ManualDecorator}.
- *
- * @param {Object} config
- * @param {String} config.id The name of the attribute used in the model that represents a given manual decorator.
- * For example: `'linkIsExternal'`.
- * @param {String} config.label The label used in the user interface to toggle the manual decorator.
- * @param {Object} config.attributes A set of attributes added to output data when the decorator is active for a specific link.
- * Attributes should keep the format of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
- * @param {Boolean} [config.defaultValue] Controls whether the decorator is "on" by default.
- */
- constructor( { id, label, attributes, defaultValue } ) {
- /**
- * An ID of a manual decorator which is the name of the attribute in the model, for example: 'linkManualDecorator0'.
- *
- * @type {String}
- */
- this.id = id;
- /**
- * The value of the current manual decorator. It reflects its state from the UI.
- *
- * @observable
- * @member {Boolean} module:link/utils~ManualDecorator#value
- */
- this.set( 'value' );
- /**
- * The default value of manual decorator.
- *
- * @type {Boolean}
- */
- this.defaultValue = defaultValue;
- /**
- * The label used in the user interface to toggle the manual decorator.
- *
- * @type {String}
- */
- this.label = label;
- /**
- * A set of attributes added to downcasted data when the decorator is activated for a specific link.
- * Attributes should be added in a form of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
- *
- * @type {Object}
- */
- this.attributes = attributes;
- }
- }
- Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["mix"])( ManualDecorator, ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["ObservableMixin"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/link.css":
- /*!**************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/theme/link.css ***!
- \**************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./link.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/link.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css ***!
- \*********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./linkactions.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css ***!
- \******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./linkform.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css ***!
- \*******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./linkimage.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-list/src/converters.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-list/src/converters.js ***!
- \*****************************************************************/
- /*! exports provided: modelViewInsertion, modelViewRemove, modelViewChangeType, modelViewMergeAfterChangeType, modelViewChangeIndent, modelViewSplitOnInsert, modelViewMergeAfter, viewModelConverter, cleanList, cleanListItem, modelToViewPosition, viewToModelPosition, modelChangePostFixer, modelIndentPasteFixer */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewInsertion", function() { return modelViewInsertion; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewRemove", function() { return modelViewRemove; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewChangeType", function() { return modelViewChangeType; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewMergeAfterChangeType", function() { return modelViewMergeAfterChangeType; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewChangeIndent", function() { return modelViewChangeIndent; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewSplitOnInsert", function() { return modelViewSplitOnInsert; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewMergeAfter", function() { return modelViewMergeAfter; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewModelConverter", function() { return viewModelConverter; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanList", function() { return cleanList; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanListItem", function() { return cleanListItem; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelToViewPosition", function() { return modelToViewPosition; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewToModelPosition", function() { return viewToModelPosition; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelChangePostFixer", function() { return modelChangePostFixer; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelIndentPasteFixer", function() { return modelIndentPasteFixer; });
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-list/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module list/converters
- */
- /**
- * A model-to-view converter for the `listItem` model element insertion.
- *
- * It creates a `<ul><li></li><ul>` (or `<ol>`) view structure out of a `listItem` model element, inserts it at the correct
- * position, and merges the list with surrounding lists (if available).
- *
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
- * @param {module:engine/model/model~Model} model Model instance.
- * @returns {Function} Returns a conversion callback.
- */
- function modelViewInsertion( model ) {
- return ( evt, data, conversionApi ) => {
- const consumable = conversionApi.consumable;
- if ( !consumable.test( data.item, 'insert' ) ||
- !consumable.test( data.item, 'attribute:listType' ) ||
- !consumable.test( data.item, 'attribute:listIndent' )
- ) {
- return;
- }
- consumable.consume( data.item, 'insert' );
- consumable.consume( data.item, 'attribute:listType' );
- consumable.consume( data.item, 'attribute:listIndent' );
- const modelItem = data.item;
- const viewItem = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["generateLiInUl"])( modelItem, conversionApi );
- Object(_utils__WEBPACK_IMPORTED_MODULE_1__["injectViewList"])( modelItem, viewItem, conversionApi, model );
- };
- }
- /**
- * A model-to-view converter for the `listItem` model element removal.
- *
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove
- * @param {module:engine/model/model~Model} model Model instance.
- * @returns {Function} Returns a conversion callback.
- */
- function modelViewRemove( model ) {
- return ( evt, data, conversionApi ) => {
- const viewPosition = conversionApi.mapper.toViewPosition( data.position );
- const viewStart = viewPosition.getLastMatchingPosition( value => !value.item.is( 'element', 'li' ) );
- const viewItem = viewStart.nodeAfter;
- const viewWriter = conversionApi.writer;
- // 1. Break the container after and before the list item.
- // This will create a view list with one view list item - the one to remove.
- viewWriter.breakContainer( viewWriter.createPositionBefore( viewItem ) );
- viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
- // 2. Remove the list with the item to remove.
- const viewList = viewItem.parent;
- const viewListPrev = viewList.previousSibling;
- const removeRange = viewWriter.createRangeOn( viewList );
- const removed = viewWriter.remove( removeRange );
- // 3. Merge the whole created by breaking and removing the list.
- if ( viewListPrev && viewListPrev.nextSibling ) {
- Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewListPrev, viewListPrev.nextSibling );
- }
- // 4. Bring back nested list that was in the removed <li>.
- const modelItem = conversionApi.mapper.toModelElement( viewItem );
- hoistNestedLists( modelItem.getAttribute( 'listIndent' ) + 1, data.position, removeRange.start, viewItem, conversionApi, model );
- // 5. Unbind removed view item and all children.
- for ( const child of viewWriter.createRangeIn( removed ).getItems() ) {
- conversionApi.mapper.unbindViewElement( child );
- }
- evt.stop();
- };
- }
- /**
- * A model-to-view converter for the `type` attribute change on the `listItem` model element.
- *
- * This change means that the `<li>` element parent changes from `<ul>` to `<ol>` (or vice versa). This is accomplished
- * by breaking view elements and changing their name. The next {@link module:list/converters~modelViewMergeAfterChangeType}
- * converter will attempt to merge split nodes.
- *
- * Splitting this conversion into 2 steps makes it possible to add an additional conversion in the middle.
- * Check {@link module:list/todolistconverters~modelViewChangeType} to see an example of it.
- *
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
- * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
- * @param {Object} data Additional information about the change.
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
- */
- function modelViewChangeType( evt, data, conversionApi ) {
- if ( !conversionApi.consumable.consume( data.item, 'attribute:listType' ) ) {
- return;
- }
- const viewItem = conversionApi.mapper.toViewElement( data.item );
- const viewWriter = conversionApi.writer;
- // Break the container after and before the list item.
- // This will create a view list with one view list item -- the one that changed type.
- viewWriter.breakContainer( viewWriter.createPositionBefore( viewItem ) );
- viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
- // Change name of the view list that holds the changed view item.
- // We cannot just change name property, because that would not render properly.
- const viewList = viewItem.parent;
- const listName = data.attributeNewValue == 'numbered' ? 'ol' : 'ul';
- viewWriter.rename( listName, viewList );
- }
- /**
- * A model-to-view converter that attempts to merge nodes split by {@link module:list/converters~modelViewChangeType}.
- *
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
- * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
- * @param {Object} data Additional information about the change.
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
- */
- function modelViewMergeAfterChangeType( evt, data, conversionApi ) {
- const viewItem = conversionApi.mapper.toViewElement( data.item );
- const viewList = viewItem.parent;
- const viewWriter = conversionApi.writer;
- // Merge the changed view list with other lists, if possible.
- Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewList, viewList.nextSibling );
- Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewList.previousSibling, viewList );
- // Consumable insertion of children inside the item. They are already handled by re-building the item in view.
- for ( const child of data.item.getChildren() ) {
- conversionApi.consumable.consume( child, 'insert' );
- }
- }
- /**
- * A model-to-view converter for the `listIndent` attribute change on the `listItem` model element.
- *
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
- * @param {module:engine/model/model~Model} model Model instance.
- * @returns {Function} Returns a conversion callback.
- */
- function modelViewChangeIndent( model ) {
- return ( evt, data, conversionApi ) => {
- if ( !conversionApi.consumable.consume( data.item, 'attribute:listIndent' ) ) {
- return;
- }
- const viewItem = conversionApi.mapper.toViewElement( data.item );
- const viewWriter = conversionApi.writer;
- // 1. Break the container after and before the list item.
- // This will create a view list with one view list item -- the one that changed type.
- viewWriter.breakContainer( viewWriter.createPositionBefore( viewItem ) );
- viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
- // 2. Extract view list with changed view list item and merge "hole" possibly created by breaking and removing elements.
- const viewList = viewItem.parent;
- const viewListPrev = viewList.previousSibling;
- const removeRange = viewWriter.createRangeOn( viewList );
- viewWriter.remove( removeRange );
- if ( viewListPrev && viewListPrev.nextSibling ) {
- Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewListPrev, viewListPrev.nextSibling );
- }
- // 3. Bring back nested list that was in the removed <li>.
- hoistNestedLists( data.attributeOldValue + 1, data.range.start, removeRange.start, viewItem, conversionApi, model );
- // 4. Inject view list like it is newly inserted.
- Object(_utils__WEBPACK_IMPORTED_MODULE_1__["injectViewList"])( data.item, viewItem, conversionApi, model );
- // 5. Consume insertion of children inside the item. They are already handled by re-building the item in view.
- for ( const child of data.item.getChildren() ) {
- conversionApi.consumable.consume( child, 'insert' );
- }
- };
- }
- /**
- * A special model-to-view converter introduced by the {@link module:list/list~List list feature}. This converter is fired for
- * insert change of every model item, and should be fired before the actual converter. The converter checks whether the inserted
- * model item is a non-`listItem` element. If it is, and it is inserted inside a view list, the converter breaks the
- * list so the model element is inserted to the view parent element corresponding to its model parent element.
- *
- * The converter prevents such situations:
- *
- * // Model: // View:
- * <listItem>foo</listItem> <ul>
- * <listItem>bar</listItem> <li>foo</li>
- * <li>bar</li>
- * </ul>
- *
- * // After change: // Correct view guaranteed by this converter:
- * <listItem>foo</listItem> <ul><li>foo</li></ul><p>xxx</p><ul><li>bar</li></ul>
- * <paragraph>xxx</paragraph> // Instead of this wrong view state:
- * <listItem>bar</listItem> <ul><li>foo</li><p>xxx</p><li>bar</li></ul>
- *
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
- * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
- * @param {Object} data Additional information about the change.
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
- */
- function modelViewSplitOnInsert( evt, data, conversionApi ) {
- if ( data.item.name != 'listItem' ) {
- let viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
- const viewWriter = conversionApi.writer;
- const lists = [];
- // Break multiple ULs/OLs if there are.
- //
- // Imagine following list:
- //
- // 1 --------
- // 1.1 --------
- // 1.1.1 --------
- // 1.1.2 --------
- // 1.1.3 --------
- // 1.1.3.1 --------
- // 1.2 --------
- // 1.2.1 --------
- // 2 --------
- //
- // Insert paragraph after item 1.1.1:
- //
- // 1 --------
- // 1.1 --------
- // 1.1.1 --------
- //
- // Lorem ipsum.
- //
- // 1.1.2 --------
- // 1.1.3 --------
- // 1.1.3.1 --------
- // 1.2 --------
- // 1.2.1 --------
- // 2 --------
- //
- // In this case 1.1.2 has to become beginning of a new list.
- // We need to break list before 1.1.2 (obvious), then we need to break list also before 1.2.
- // Then we need to move those broken pieces one after another and merge:
- //
- // 1 --------
- // 1.1 --------
- // 1.1.1 --------
- //
- // Lorem ipsum.
- //
- // 1.1.2 --------
- // 1.1.3 --------
- // 1.1.3.1 --------
- // 1.2 --------
- // 1.2.1 --------
- // 2 --------
- //
- while ( viewPosition.parent.name == 'ul' || viewPosition.parent.name == 'ol' ) {
- viewPosition = viewWriter.breakContainer( viewPosition );
- if ( viewPosition.parent.name != 'li' ) {
- break;
- }
- // Remove lists that are after inserted element.
- // They will be brought back later, below the inserted element.
- const removeStart = viewPosition;
- const removeEnd = viewWriter.createPositionAt( viewPosition.parent, 'end' );
- // Don't remove if there is nothing to remove.
- if ( !removeStart.isEqual( removeEnd ) ) {
- const removed = viewWriter.remove( viewWriter.createRange( removeStart, removeEnd ) );
- lists.push( removed );
- }
- viewPosition = viewWriter.createPositionAfter( viewPosition.parent );
- }
- // Bring back removed lists.
- if ( lists.length > 0 ) {
- for ( let i = 0; i < lists.length; i++ ) {
- const previousList = viewPosition.nodeBefore;
- const insertedRange = viewWriter.insert( viewPosition, lists[ i ] );
- viewPosition = insertedRange.end;
- // Don't merge first list! We want a split in that place (this is why this converter is introduced).
- if ( i > 0 ) {
- const mergePos = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, previousList, previousList.nextSibling );
- // If `mergePos` is in `previousList` it means that the lists got merged.
- // In this case, we need to fix insert position.
- if ( mergePos && mergePos.parent == previousList ) {
- viewPosition.offset--;
- }
- }
- }
- // Merge last inserted list with element after it.
- Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewPosition.nodeBefore, viewPosition.nodeAfter );
- }
- }
- }
- /**
- * A special model-to-view converter introduced by the {@link module:list/list~List list feature}. This converter takes care of
- * merging view lists after something is removed or moved from near them.
- *
- * Example:
- *
- * // Model: // View:
- * <listItem>foo</listItem> <ul><li>foo</li></ul>
- * <paragraph>xxx</paragraph> <p>xxx</p>
- * <listItem>bar</listItem> <ul><li>bar</li></ul>
- *
- * // After change: // Correct view guaranteed by this converter:
- * <listItem>foo</listItem> <ul>
- * <listItem>bar</listItem> <li>foo</li>
- * <li>bar</li>
- * </ul>
- *
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove
- * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
- * @param {Object} data Additional information about the change.
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
- */
- function modelViewMergeAfter( evt, data, conversionApi ) {
- const viewPosition = conversionApi.mapper.toViewPosition( data.position );
- const viewItemPrev = viewPosition.nodeBefore;
- const viewItemNext = viewPosition.nodeAfter;
- // Merge lists if something (remove, move) was done from inside of list.
- // Merging will be done only if both items are view lists of the same type.
- // The check is done inside the helper function.
- Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( conversionApi.writer, viewItemPrev, viewItemNext );
- }
- /**
- * A view-to-model converter that converts the `<li>` view elements into the `listItem` model elements.
- *
- * To set correct values of the `listType` and `listIndent` attributes the converter:
- * * checks `<li>`'s parent,
- * * stores and increases the `conversionApi.store.indent` value when `<li>`'s sub-items are converted.
- *
- * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
- * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
- * @param {Object} data An object containing conversion input and a placeholder for conversion output and possibly other values.
- * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
- */
- function viewModelConverter( evt, data, conversionApi ) {
- if ( conversionApi.consumable.consume( data.viewItem, { name: true } ) ) {
- const writer = conversionApi.writer;
- // 1. Create `listItem` model element.
- const listItem = writer.createElement( 'listItem' );
- // 2. Handle `listItem` model element attributes.
- const indent = getIndent( data.viewItem );
- writer.setAttribute( 'listIndent', indent, listItem );
- // Set 'bulleted' as default. If this item is pasted into a context,
- const type = data.viewItem.parent && data.viewItem.parent.name == 'ol' ? 'numbered' : 'bulleted';
- writer.setAttribute( 'listType', type, listItem );
- if ( !conversionApi.safeInsert( listItem, data.modelCursor ) ) {
- return;
- }
- const nextPosition = viewToModelListItemChildrenConverter( listItem, data.viewItem.getChildren(), conversionApi );
- // Result range starts before the first item and ends after the last.
- data.modelRange = writer.createRange( data.modelCursor, nextPosition );
- conversionApi.updateConversionResult( listItem, data );
- }
- }
- /**
- * A view-to-model converter for the `<ul>` and `<ol>` view elements that cleans the input view of garbage.
- * This is mostly to clean whitespaces from between the `<li>` view elements inside the view list element, however, also
- * incorrect data can be cleared if the view was incorrect.
- *
- * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
- * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
- * @param {Object} data An object containing conversion input and a placeholder for conversion output and possibly other values.
- * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
- */
- function cleanList( evt, data, conversionApi ) {
- if ( conversionApi.consumable.test( data.viewItem, { name: true } ) ) {
- // Caching children because when we start removing them iterating fails.
- const children = Array.from( data.viewItem.getChildren() );
- for ( const child of children ) {
- const isWrongElement = !( child.is( 'element', 'li' ) || isList( child ) );
- if ( isWrongElement ) {
- child._remove();
- }
- }
- }
- }
- /**
- * A view-to-model converter for the `<li>` elements that cleans whitespace formatting from the input view.
- *
- * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
- * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
- * @param {Object} data An object containing conversion input and a placeholder for conversion output and possibly other values.
- * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
- */
- function cleanListItem( evt, data, conversionApi ) {
- if ( conversionApi.consumable.test( data.viewItem, { name: true } ) ) {
- if ( data.viewItem.childCount === 0 ) {
- return;
- }
- const children = [ ...data.viewItem.getChildren() ];
- let foundList = false;
- let firstNode = true;
- for ( const child of children ) {
- if ( foundList && !isList( child ) ) {
- child._remove();
- }
- if ( child.is( '$text' ) ) {
- // If this is the first node and it's a text node, left-trim it.
- if ( firstNode ) {
- child._data = child.data.trimStart();
- }
- // If this is the last text node before <ul> or <ol>, right-trim it.
- if ( !child.nextSibling || isList( child.nextSibling ) ) {
- child._data = child.data.trimEnd();
- }
- } else if ( isList( child ) ) {
- // If this is a <ul> or <ol>, do not process it, just mark that we already visited list element.
- foundList = true;
- }
- firstNode = false;
- }
- }
- }
- /**
- * Returns a callback for model position to view position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes
- * positions between the `listItem` elements that would be incorrectly mapped because of how list items are represented in the model
- * and in the view.
- *
- * @see module:engine/conversion/mapper~Mapper#event:modelToViewPosition
- * @param {module:engine/view/view~View} view A view instance.
- * @returns {Function}
- */
- function modelToViewPosition( view ) {
- return ( evt, data ) => {
- if ( data.isPhantom ) {
- return;
- }
- const modelItem = data.modelPosition.nodeBefore;
- if ( modelItem && modelItem.is( 'element', 'listItem' ) ) {
- const viewItem = data.mapper.toViewElement( modelItem );
- const topmostViewList = viewItem.getAncestors().find( isList );
- const walker = view.createPositionAt( viewItem, 0 ).getWalker();
- for ( const value of walker ) {
- if ( value.type == 'elementStart' && value.item.is( 'element', 'li' ) ) {
- data.viewPosition = value.previousPosition;
- break;
- } else if ( value.type == 'elementEnd' && value.item == topmostViewList ) {
- data.viewPosition = value.nextPosition;
- break;
- }
- }
- }
- };
- }
- /**
- * The callback for view position to model position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes
- * positions between the `<li>` elements that would be incorrectly mapped because of how list items are represented in the model
- * and in the view.
- *
- * @see module:engine/conversion/mapper~Mapper#event:viewToModelPosition
- * @param {module:engine/model/model~Model} model Model instance.
- * @returns {Function} Returns a conversion callback.
- */
- function viewToModelPosition( model ) {
- return ( evt, data ) => {
- const viewPos = data.viewPosition;
- const viewParent = viewPos.parent;
- const mapper = data.mapper;
- if ( viewParent.name == 'ul' || viewParent.name == 'ol' ) {
- // Position is directly in <ul> or <ol>.
- if ( !viewPos.isAtEnd ) {
- // If position is not at the end, it must be before <li>.
- // Get that <li>, map it to `listItem` and set model position before that `listItem`.
- const modelNode = mapper.toModelElement( viewPos.nodeAfter );
- data.modelPosition = model.createPositionBefore( modelNode );
- } else {
- // Position is at the end of <ul> or <ol>, so there is no <li> after it to be mapped.
- // There is <li> before the position, but we cannot just map it to `listItem` and set model position after it,
- // because that <li> may contain nested items.
- // We will check "model length" of that <li>, in other words - how many `listItem`s are in that <li>.
- const modelNode = mapper.toModelElement( viewPos.nodeBefore );
- const modelLength = mapper.getModelLength( viewPos.nodeBefore );
- // Then we get model position before mapped `listItem` and shift it accordingly.
- data.modelPosition = model.createPositionBefore( modelNode ).getShiftedBy( modelLength );
- }
- evt.stop();
- } else if (
- viewParent.name == 'li' &&
- viewPos.nodeBefore &&
- ( viewPos.nodeBefore.name == 'ul' || viewPos.nodeBefore.name == 'ol' )
- ) {
- // In most cases when view position is in <li> it is in text and this is a correct position.
- // However, if position is after <ul> or <ol> we have to fix it -- because in model <ul>/<ol> are not in the `listItem`.
- const modelNode = mapper.toModelElement( viewParent );
- // Check all <ul>s and <ol>s that are in the <li> but before mapped position.
- // Get model length of those elements and then add it to the offset of `listItem` mapped to the original <li>.
- let modelLength = 1; // Starts from 1 because the original <li> has to be counted in too.
- let viewList = viewPos.nodeBefore;
- while ( viewList && isList( viewList ) ) {
- modelLength += mapper.getModelLength( viewList );
- viewList = viewList.previousSibling;
- }
- data.modelPosition = model.createPositionBefore( modelNode ).getShiftedBy( modelLength );
- evt.stop();
- }
- };
- }
- /**
- * Post-fixer that reacts to changes on document and fixes incorrect model states.
- *
- * In the example below, there is a correct list structure.
- * Then the middle element is removed so the list structure will become incorrect:
- *
- * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
- * <listItem listType="bulleted" listIndent=1>Item 2</listItem> <--- this is removed.
- * <listItem listType="bulleted" listIndent=2>Item 3</listItem>
- *
- * The list structure after the middle element is removed:
- *
- * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
- * <listItem listType="bulleted" listIndent=2>Item 3</listItem>
- *
- * Should become:
- *
- * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
- * <listItem listType="bulleted" listIndent=1>Item 3</listItem> <--- note that indent got post-fixed.
- *
- * @param {module:engine/model/model~Model} model The data model.
- * @param {module:engine/model/writer~Writer} writer The writer to do changes with.
- * @returns {Boolean} `true` if any change has been applied, `false` otherwise.
- */
- function modelChangePostFixer( model, writer ) {
- const changes = model.document.differ.getChanges();
- const itemToListHead = new Map();
- let applied = false;
- for ( const entry of changes ) {
- if ( entry.type == 'insert' && entry.name == 'listItem' ) {
- _addListToFix( entry.position );
- } else if ( entry.type == 'insert' && entry.name != 'listItem' ) {
- if ( entry.name != '$text' ) {
- // In case of renamed element.
- const item = entry.position.nodeAfter;
- if ( item.hasAttribute( 'listIndent' ) ) {
- writer.removeAttribute( 'listIndent', item );
- applied = true;
- }
- if ( item.hasAttribute( 'listType' ) ) {
- writer.removeAttribute( 'listType', item );
- applied = true;
- }
- if ( item.hasAttribute( 'listStyle' ) ) {
- writer.removeAttribute( 'listStyle', item );
- applied = true;
- }
- for ( const innerItem of Array.from( model.createRangeIn( item ) ).filter( e => e.item.is( 'element', 'listItem' ) ) ) {
- _addListToFix( innerItem.previousPosition );
- }
- }
- const posAfter = entry.position.getShiftedBy( entry.length );
- _addListToFix( posAfter );
- } else if ( entry.type == 'remove' && entry.name == 'listItem' ) {
- _addListToFix( entry.position );
- } else if ( entry.type == 'attribute' && entry.attributeKey == 'listIndent' ) {
- _addListToFix( entry.range.start );
- } else if ( entry.type == 'attribute' && entry.attributeKey == 'listType' ) {
- _addListToFix( entry.range.start );
- }
- }
- for ( const listHead of itemToListHead.values() ) {
- _fixListIndents( listHead );
- _fixListTypes( listHead );
- }
- return applied;
- function _addListToFix( position ) {
- const previousNode = position.nodeBefore;
- if ( !previousNode || !previousNode.is( 'element', 'listItem' ) ) {
- const item = position.nodeAfter;
- if ( item && item.is( 'element', 'listItem' ) ) {
- itemToListHead.set( item, item );
- }
- } else {
- let listHead = previousNode;
- if ( itemToListHead.has( listHead ) ) {
- return;
- }
- for (
- // Cache previousSibling and reuse for performance reasons. See #6581.
- let previousSibling = listHead.previousSibling;
- previousSibling && previousSibling.is( 'element', 'listItem' );
- previousSibling = listHead.previousSibling
- ) {
- listHead = previousSibling;
- if ( itemToListHead.has( listHead ) ) {
- return;
- }
- }
- itemToListHead.set( previousNode, listHead );
- }
- }
- function _fixListIndents( item ) {
- let maxIndent = 0;
- let fixBy = null;
- while ( item && item.is( 'element', 'listItem' ) ) {
- const itemIndent = item.getAttribute( 'listIndent' );
- if ( itemIndent > maxIndent ) {
- let newIndent;
- if ( fixBy === null ) {
- fixBy = itemIndent - maxIndent;
- newIndent = maxIndent;
- } else {
- if ( fixBy > itemIndent ) {
- fixBy = itemIndent;
- }
- newIndent = itemIndent - fixBy;
- }
- writer.setAttribute( 'listIndent', newIndent, item );
- applied = true;
- } else {
- fixBy = null;
- maxIndent = item.getAttribute( 'listIndent' ) + 1;
- }
- item = item.nextSibling;
- }
- }
- function _fixListTypes( item ) {
- let typesStack = [];
- let prev = null;
- while ( item && item.is( 'element', 'listItem' ) ) {
- const itemIndent = item.getAttribute( 'listIndent' );
- if ( prev && prev.getAttribute( 'listIndent' ) > itemIndent ) {
- typesStack = typesStack.slice( 0, itemIndent + 1 );
- }
- if ( itemIndent != 0 ) {
- if ( typesStack[ itemIndent ] ) {
- const type = typesStack[ itemIndent ];
- if ( item.getAttribute( 'listType' ) != type ) {
- writer.setAttribute( 'listType', type, item );
- applied = true;
- }
- } else {
- typesStack[ itemIndent ] = item.getAttribute( 'listType' );
- }
- }
- prev = item;
- item = item.nextSibling;
- }
- }
- }
- /**
- * A fixer for pasted content that includes list items.
- *
- * It fixes indentation of pasted list items so the pasted items match correctly to the context they are pasted into.
- *
- * Example:
- *
- * <listItem listType="bulleted" listIndent=0>A</listItem>
- * <listItem listType="bulleted" listIndent=1>B^</listItem>
- * // At ^ paste: <listItem listType="bulleted" listIndent=4>X</listItem>
- * // <listItem listType="bulleted" listIndent=5>Y</listItem>
- * <listItem listType="bulleted" listIndent=2>C</listItem>
- *
- * Should become:
- *
- * <listItem listType="bulleted" listIndent=0>A</listItem>
- * <listItem listType="bulleted" listIndent=1>BX</listItem>
- * <listItem listType="bulleted" listIndent=2>Y/listItem>
- * <listItem listType="bulleted" listIndent=2>C</listItem>
- *
- * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
- * @param {Array} args Arguments of {@link module:engine/model/model~Model#insertContent}.
- */
- function modelIndentPasteFixer( evt, [ content, selectable ] ) {
- // Check whether inserted content starts from a `listItem`. If it does not, it means that there are some other
- // elements before it and there is no need to fix indents, because even if we insert that content into a list,
- // that list will be broken.
- // Note: we also need to handle singular elements because inserting item with indent 0 into 0,1,[],2
- // would create incorrect model.
- let item = content.is( 'documentFragment' ) ? content.getChild( 0 ) : content;
- let selection;
- if ( !selectable ) {
- selection = this.document.selection;
- } else {
- selection = this.createSelection( selectable );
- }
- if ( item && item.is( 'element', 'listItem' ) ) {
- // Get a reference list item. Inserted list items will be fixed according to that item.
- const pos = selection.getFirstPosition();
- let refItem = null;
- if ( pos.parent.is( 'element', 'listItem' ) ) {
- refItem = pos.parent;
- } else if ( pos.nodeBefore && pos.nodeBefore.is( 'element', 'listItem' ) ) {
- refItem = pos.nodeBefore;
- }
- // If there is `refItem` it means that we do insert list items into an existing list.
- if ( refItem ) {
- // First list item in `data` has indent equal to 0 (it is a first list item). It should have indent equal
- // to the indent of reference item. We have to fix the first item and all of it's children and following siblings.
- // Indent of all those items has to be adjusted to reference item.
- const indentChange = refItem.getAttribute( 'listIndent' );
- // Fix only if there is anything to fix.
- if ( indentChange > 0 ) {
- // Adjust indent of all "first" list items in inserted data.
- while ( item && item.is( 'element', 'listItem' ) ) {
- item._setAttribute( 'listIndent', item.getAttribute( 'listIndent' ) + indentChange );
- item = item.nextSibling;
- }
- }
- }
- }
- }
- // Helper function that converts children of a given `<li>` view element into corresponding model elements.
- // The function maintains proper order of elements if model `listItem` is split during the conversion
- // due to block children conversion.
- //
- // @param {module:engine/model/element~Element} listItemModel List item model element to which converted children will be inserted.
- // @param {Iterable.<module:engine/view/node~Node>} viewChildren View elements which will be converted.
- // @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
- // @returns {module:engine/model/position~Position} Position on which next elements should be inserted after children conversion.
- function viewToModelListItemChildrenConverter( listItemModel, viewChildren, conversionApi ) {
- const { writer, schema } = conversionApi;
- // A position after the last inserted `listItem`.
- let nextPosition = writer.createPositionAfter( listItemModel );
- // Check all children of the converted `<li>`. At this point we assume there are no "whitespace" view text nodes
- // in view list, between view list items. This should be handled by `<ul>` and `<ol>` converters.
- for ( const child of viewChildren ) {
- if ( child.name == 'ul' || child.name == 'ol' ) {
- // If the children is a list, we will insert its conversion result after currently handled `listItem`.
- // Then, next insertion position will be set after all the new list items (and maybe other elements if
- // something split list item).
- //
- // If this is a list, we expect that some `listItem`s and possibly other blocks will be inserted, however `.modelCursor`
- // should be set after last `listItem` (or block). This is why it feels safe to use it as `nextPosition`
- nextPosition = conversionApi.convertItem( child, nextPosition ).modelCursor;
- } else {
- // If this is not a list, try inserting content at the end of the currently handled `listItem`.
- const result = conversionApi.convertItem( child, writer.createPositionAt( listItemModel, 'end' ) );
- // It may end up that the current `listItem` becomes split (if that content cannot be inside `listItem`). For example:
- //
- // <li><p>Foo</p></li>
- //
- // will be converted to:
- //
- // <listItem></listItem><paragraph>Foo</paragraph><listItem></listItem>
- //
- const convertedChild = result.modelRange.start.nodeAfter;
- const wasSplit = convertedChild && convertedChild.is( 'element' ) && !schema.checkChild( listItemModel, convertedChild.name );
- if ( wasSplit ) {
- // As `lastListItem` got split, we need to update it to the second part of the split `listItem` element.
- //
- // `modelCursor` should be set to a position where the conversion should continue. There are multiple possible scenarios
- // that may happen. Usually, `modelCursor` (marked as `#` below) would point to the second list item after conversion:
- //
- // `<li><p>Foo</p></li>` -> `<listItem></listItem><paragraph>Foo</paragraph><listItem>#</listItem>`
- //
- // However, in some cases, like auto-paragraphing, the position is placed at the end of the block element:
- //
- // `<li><div>Foo</div></li>` -> `<listItem></listItem><paragraph>Foo#</paragraph><listItem></listItem>`
- //
- // or after an element if another element broken auto-paragraphed element:
- //
- // `<li><div><h2>Foo</h2></div></li>` -> `<listItem></listItem><heading1>Foo</heading1>#<listItem></listItem>`
- //
- // We need to check for such cases and use proper list item and position based on it.
- //
- if ( result.modelCursor.parent.is( 'element', 'listItem' ) ) {
- // (1).
- listItemModel = result.modelCursor.parent;
- } else {
- // (2), (3).
- listItemModel = findNextListItem( result.modelCursor );
- }
- nextPosition = writer.createPositionAfter( listItemModel );
- }
- }
- }
- return nextPosition;
- }
- // Helper function that seeks for a next list item starting from given `startPosition`.
- function findNextListItem( startPosition ) {
- const treeWalker = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["TreeWalker"]( { startPosition } );
- let value;
- do {
- value = treeWalker.next();
- } while ( !value.value.item.is( 'element', 'listItem' ) );
- return value.value.item;
- }
- // Helper function that takes all children of given `viewRemovedItem` and moves them in a correct place, according
- // to other given parameters.
- function hoistNestedLists( nextIndent, modelRemoveStartPosition, viewRemoveStartPosition, viewRemovedItem, conversionApi, model ) {
- // Find correct previous model list item element.
- // The element has to have either same or smaller indent than given reference indent.
- // This will be the model element which will get nested items (if it has smaller indent) or sibling items (if it has same indent).
- // Keep in mind that such element might not be found, if removed item was the first item.
- const prevModelItem = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getSiblingListItem"])( modelRemoveStartPosition.nodeBefore, {
- sameIndent: true,
- smallerIndent: true,
- listIndent: nextIndent,
- foo: 'b'
- } );
- const mapper = conversionApi.mapper;
- const viewWriter = conversionApi.writer;
- // Indent of found element or `null` if the element has not been found.
- const prevIndent = prevModelItem ? prevModelItem.getAttribute( 'listIndent' ) : null;
- let insertPosition;
- if ( !prevModelItem ) {
- // If element has not been found, simply insert lists at the position where the removed item was:
- //
- // Lorem ipsum.
- // 1 -------- <--- this is removed, no previous list item, put nested items in place of removed item.
- // 1.1 -------- <--- this is reference indent.
- // 1.1.1 --------
- // 1.1.2 --------
- // 1.2 --------
- //
- // Becomes:
- //
- // Lorem ipsum.
- // 1.1 --------
- // 1.1.1 --------
- // 1.1.2 --------
- // 1.2 --------
- insertPosition = viewRemoveStartPosition;
- } else if ( prevIndent == nextIndent ) {
- // If element has been found and has same indent as reference indent it means that nested items should
- // become siblings of found element:
- //
- // 1 --------
- // 1.1 --------
- // 1.2 -------- <--- this is `prevModelItem`.
- // 2 -------- <--- this is removed, previous list item has indent same as reference indent.
- // 2.1 -------- <--- this is reference indent, this and 2.2 should become siblings of 1.2.
- // 2.2 --------
- //
- // Becomes:
- //
- // 1 --------
- // 1.1 --------
- // 1.2 --------
- // 2.1 --------
- // 2.2 --------
- const prevViewList = mapper.toViewElement( prevModelItem ).parent;
- insertPosition = viewWriter.createPositionAfter( prevViewList );
- } else {
- // If element has been found and has smaller indent as reference indent it means that nested items
- // should become nested items of found item:
- //
- // 1 -------- <--- this is `prevModelItem`.
- // 1.1 -------- <--- this is removed, previous list item has indent smaller than reference indent.
- // 1.1.1 -------- <--- this is reference indent, this and 1.1.1 should become nested items of 1.
- // 1.1.2 --------
- // 1.2 --------
- //
- // Becomes:
- //
- // 1 --------
- // 1.1.1 --------
- // 1.1.2 --------
- // 1.2 --------
- //
- // Note: in this case 1.1.1 have indent 2 while 1 have indent 0. In model that should not be possible,
- // because following item may have indent bigger only by one. But this is fixed by postfixer.
- const modelPosition = model.createPositionAt( prevModelItem, 'end' );
- insertPosition = mapper.toViewPosition( modelPosition );
- }
- insertPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["positionAfterUiElements"])( insertPosition );
- // Handle multiple lists. This happens if list item has nested numbered and bulleted lists. Following lists
- // are inserted after the first list (no need to recalculate insertion position for them).
- for ( const child of [ ...viewRemovedItem.getChildren() ] ) {
- if ( isList( child ) ) {
- insertPosition = viewWriter.move( viewWriter.createRangeOn( child ), insertPosition ).end;
- Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, child, child.nextSibling );
- Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, child.previousSibling, child );
- }
- }
- }
- // Checks if view element is a list type (ul or ol).
- //
- // @param {module:engine/view/element~Element} viewElement
- // @returns {Boolean}
- function isList( viewElement ) {
- return viewElement.is( 'element', 'ol' ) || viewElement.is( 'element', 'ul' );
- }
- // Calculates the indent value for a list item. Handles HTML compliant and non-compliant lists.
- //
- // Also, fixes non HTML compliant lists indents:
- //
- // before: fixed list:
- // OL OL
- // |-> LI (parent LIs: 0) |-> LI (indent: 0)
- // |-> OL |-> OL
- // |-> OL |
- // | |-> OL |
- // | |-> OL |
- // | |-> LI (parent LIs: 1) |-> LI (indent: 1)
- // |-> LI (parent LIs: 1) |-> LI (indent: 1)
- //
- // before: fixed list:
- // OL OL
- // |-> OL |
- // |-> OL |
- // |-> OL |
- // |-> LI (parent LIs: 0) |-> LI (indent: 0)
- //
- // before: fixed list:
- // OL OL
- // |-> LI (parent LIs: 0) |-> LI (indent: 0)
- // |-> OL |-> OL
- // |-> LI (parent LIs: 0) |-> LI (indent: 1)
- //
- // @param {module:engine/view/element~Element} listItem
- // @param {Object} conversionStore
- // @returns {Number}
- function getIndent( listItem ) {
- let indent = 0;
- let parent = listItem.parent;
- while ( parent ) {
- // Each LI in the tree will result in an increased indent for HTML compliant lists.
- if ( parent.is( 'element', 'li' ) ) {
- indent++;
- } else {
- // If however the list is nested in other list we should check previous sibling of any of the list elements...
- const previousSibling = parent.previousSibling;
- // ...because the we might need increase its indent:
- // before: fixed list:
- // OL OL
- // |-> LI (parent LIs: 0) |-> LI (indent: 0)
- // |-> OL |-> OL
- // |-> LI (parent LIs: 0) |-> LI (indent: 1)
- if ( previousSibling && previousSibling.is( 'element', 'li' ) ) {
- indent++;
- }
- }
- parent = parent.parent;
- }
- return indent;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-list/src/indentcommand.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-list/src/indentcommand.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IndentCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module list/indentcommand
- */
- /**
- * The list indent command. It is used by the {@link module:list/list~List list feature}.
- *
- * @extends module:core/command~Command
- */
- class IndentCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * Creates an instance of the command.
- *
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- * @param {'forward'|'backward'} indentDirection The direction of indent. If it is equal to `backward`, the command
- * will outdent a list item.
- */
- constructor( editor, indentDirection ) {
- super( editor );
- /**
- * Determines by how much the command will change the list item's indent attribute.
- *
- * @readonly
- * @private
- * @member {Number}
- */
- this._indentBy = indentDirection == 'forward' ? 1 : -1;
- }
- /**
- * @inheritDoc
- */
- refresh() {
- this.isEnabled = this._checkEnabled();
- }
- /**
- * Indents or outdents (depending on the {@link #constructor}'s `indentDirection` parameter) selected list items.
- *
- * @fires execute
- * @fires _executeCleanup
- */
- execute() {
- const model = this.editor.model;
- const doc = model.document;
- let itemsToChange = Array.from( doc.selection.getSelectedBlocks() );
- model.change( writer => {
- const lastItem = itemsToChange[ itemsToChange.length - 1 ];
- // Indenting a list item should also indent all the items that are already sub-items of indented item.
- let next = lastItem.nextSibling;
- // Check all items after last indented item, as long as their indent is bigger than indent of that item.
- while ( next && next.name == 'listItem' && next.getAttribute( 'listIndent' ) > lastItem.getAttribute( 'listIndent' ) ) {
- itemsToChange.push( next );
- next = next.nextSibling;
- }
- // We need to be sure to keep model in correct state after each small change, because converters
- // bases on that state and assumes that model is correct.
- // Because of that, if the command outdents items, we will outdent them starting from the last item, as
- // it is safer.
- if ( this._indentBy < 0 ) {
- itemsToChange = itemsToChange.reverse();
- }
- for ( const item of itemsToChange ) {
- const indent = item.getAttribute( 'listIndent' ) + this._indentBy;
- // If indent is lower than 0, it means that the item got outdented when it was not indented.
- // This means that we need to convert that list item to paragraph.
- if ( indent < 0 ) {
- // To keep the model as correct as possible, first rename listItem, then remove attributes,
- // as listItem without attributes is very incorrect and will cause problems in converters.
- // No need to remove attributes, will be removed by post fixer.
- writer.rename( item, 'paragraph' );
- }
- // If indent is >= 0, change the attribute value.
- else {
- writer.setAttribute( 'listIndent', indent, item );
- }
- }
- /**
- * Event fired by the {@link #execute} method.
- *
- * It allows to execute an action after executing the {@link ~IndentCommand#execute} method, for example adjusting
- * attributes of changed list items.
- *
- * @protected
- * @event _executeCleanup
- */
- this.fire( '_executeCleanup', itemsToChange );
- } );
- }
- /**
- * Checks whether the command can be enabled in the current context.
- *
- * @private
- * @returns {Boolean} Whether the command should be enabled.
- */
- _checkEnabled() {
- // Check whether any of position's ancestor is a list item.
- const listItem = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this.editor.model.document.selection.getSelectedBlocks() );
- // If selection is not in a list item, the command is disabled.
- if ( !listItem || !listItem.is( 'element', 'listItem' ) ) {
- return false;
- }
- if ( this._indentBy > 0 ) {
- // Cannot indent first item in it's list. Check if before `listItem` is a list item that is in same list.
- // To be in the same list, the item has to have same attributes and cannot be "split" by an item with lower indent.
- const indent = listItem.getAttribute( 'listIndent' );
- const type = listItem.getAttribute( 'listType' );
- let prev = listItem.previousSibling;
- while ( prev && prev.is( 'element', 'listItem' ) && prev.getAttribute( 'listIndent' ) >= indent ) {
- if ( prev.getAttribute( 'listIndent' ) == indent ) {
- // The item is on the same level.
- // If it has same type, it means that we found a preceding sibling from the same list.
- // If it does not have same type, it means that `listItem` is on different list (this can happen only
- // on top level lists, though).
- return prev.getAttribute( 'listType' ) == type;
- }
- prev = prev.previousSibling;
- }
- // Could not find similar list item, this means that `listItem` is first in its list.
- return false;
- }
- // If we are outdenting it is enough to be in list item. Every list item can always be outdented.
- return true;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-list/src/list.js":
- /*!***********************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-list/src/list.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return List; });
- /* harmony import */ var _listediting__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./listediting */ "./node_modules/@ckeditor/ckeditor5-list/src/listediting.js");
- /* harmony import */ var _listui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./listui */ "./node_modules/@ckeditor/ckeditor5-list/src/listui.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module list/list
- */
- /**
- * The list feature.
- *
- * This is a "glue" plugin that loads the {@link module:list/listediting~ListEditing list editing feature}
- * and {@link module:list/listui~ListUI list UI feature}.
- *
- * @extends module:core/plugin~Plugin
- */
- class List extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _listediting__WEBPACK_IMPORTED_MODULE_0__["default"], _listui__WEBPACK_IMPORTED_MODULE_1__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'List';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-list/src/listcommand.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-list/src/listcommand.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module list/listcommand
- */
- /**
- * The list command. It is used by the {@link module:list/list~List list feature}.
- *
- * @extends module:core/command~Command
- */
- class ListCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * Creates an instance of the command.
- *
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- * @param {'numbered'|'bulleted'} type List type that will be handled by this command.
- */
- constructor( editor, type ) {
- super( editor );
- /**
- * The type of the list created by the command.
- *
- * @readonly
- * @member {'numbered'|'bulleted'|'todo'}
- */
- this.type = type;
- /**
- * A flag indicating whether the command is active, which means that the selection starts in a list of the same type.
- *
- * @observable
- * @readonly
- * @member {Boolean} #value
- */
- }
- /**
- * @inheritDoc
- */
- refresh() {
- this.value = this._getValue();
- this.isEnabled = this._checkEnabled();
- }
- /**
- * Executes the list command.
- *
- * @fires execute
- * @param {Object} [options] Command options.
- * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will try to convert the
- * selected items and potentially the neighbor elements to the proper list items. If set to `false` it will convert selected elements
- * to paragraphs. If not set, the command will toggle selected elements to list items or paragraphs, depending on the selection.
- */
- execute( options = {} ) {
- const model = this.editor.model;
- const document = model.document;
- const blocks = Array.from( document.selection.getSelectedBlocks() )
- .filter( block => checkCanBecomeListItem( block, model.schema ) );
- // Whether we are turning off some items.
- const turnOff = options.forceValue !== undefined ? !options.forceValue : this.value;
- // If we are turning off items, we are going to rename them to paragraphs.
- model.change( writer => {
- // If part of a list got turned off, we need to handle (outdent) all of sub-items of the last turned-off item.
- // To be sure that model is all the time in a good state, we first fix items below turned-off item.
- if ( turnOff ) {
- // Start from the model item that is just after the last turned-off item.
- let next = blocks[ blocks.length - 1 ].nextSibling;
- let currentIndent = Number.POSITIVE_INFINITY;
- let changes = [];
- // Correct indent of all items after the last turned off item.
- // Rules that should be followed:
- // 1. All direct sub-items of turned-off item should become indent 0, because the first item after it
- // will be the first item of a new list. Other items are at the same level, so should have same 0 index.
- // 2. All items with indent lower than indent of turned-off item should become indent 0, because they
- // should not end up as a child of any of list items that they were not children of before.
- // 3. All other items should have their indent changed relatively to it's parent.
- //
- // For example:
- // 1 * --------
- // 2 * --------
- // 3 * -------- <-- this is turned off.
- // 4 * -------- <-- this has to become indent = 0, because it will be first item on a new list.
- // 5 * -------- <-- this should be still be a child of item above, so indent = 1.
- // 6 * -------- <-- this has to become indent = 0, because it should not be a child of any of items above.
- // 7 * -------- <-- this should be still be a child of item above, so indent = 1.
- // 8 * -------- <-- this has to become indent = 0.
- // 9 * -------- <-- this should still be a child of item above, so indent = 1.
- // 10 * -------- <-- this should still be a child of item above, so indent = 2.
- // 11 * -------- <-- this should still be at the same level as item above, so indent = 2.
- // 12 * -------- <-- this and all below are left unchanged.
- // 13 * --------
- // 14 * --------
- //
- // After turning off 3 the list becomes:
- //
- // 1 * --------
- // 2 * --------
- //
- // 3 --------
- //
- // 4 * --------
- // 5 * --------
- // 6 * --------
- // 7 * --------
- // 8 * --------
- // 9 * --------
- // 10 * --------
- // 11 * --------
- // 12 * --------
- // 13 * --------
- // 14 * --------
- //
- // Thanks to this algorithm no lists are mismatched and no items get unexpected children/parent, while
- // those parent-child connection which are possible to maintain are still maintained. It's worth noting
- // that this is the same effect that we would be get by multiple use of outdent command. However doing
- // it like this is much more efficient because it's less operation (less memory usage, easier OT) and
- // less conversion (faster).
- while ( next && next.name == 'listItem' && next.getAttribute( 'listIndent' ) !== 0 ) {
- // Check each next list item, as long as its indent is bigger than 0.
- // If the indent is 0 we are not going to change anything anyway.
- const indent = next.getAttribute( 'listIndent' );
- // We check if that's item indent is lower as current relative indent.
- if ( indent < currentIndent ) {
- // If it is, current relative indent becomes that indent.
- currentIndent = indent;
- }
- // Fix indent relatively to current relative indent.
- // Note, that if we just changed the current relative indent, the newIndent will be equal to 0.
- const newIndent = indent - currentIndent;
- // Save the entry in changes array. We do not apply it at the moment, because we will need to
- // reverse the changes so the last item is changed first.
- // This is to keep model in correct state all the time.
- changes.push( { element: next, listIndent: newIndent } );
- // Find next item.
- next = next.nextSibling;
- }
- changes = changes.reverse();
- for ( const item of changes ) {
- writer.setAttribute( 'listIndent', item.listIndent, item.element );
- }
- }
- // If we are turning on, we might change some items that are already `listItem`s but with different type.
- // Changing one nested list item to other type should also trigger changing all its siblings so the
- // whole nested list is of the same type.
- // Example (assume changing to numbered list):
- // * ------ <-- do not fix, top level item
- // * ------ <-- fix, because latter list item of this item's list is changed
- // * ------ <-- do not fix, item is not affected (different list)
- // * ------ <-- fix, because latter list item of this item's list is changed
- // * ------ <-- fix, because latter list item of this item's list is changed
- // * ---[-- <-- already in selection
- // * ------ <-- already in selection
- // * ------ <-- already in selection
- // * ------ <-- already in selection, but does not cause other list items to change because is top-level
- // * ---]-- <-- already in selection
- // * ------ <-- fix, because preceding list item of this item's list is changed
- // * ------ <-- do not fix, item is not affected (different list)
- // * ------ <-- do not fix, top level item
- if ( !turnOff ) {
- // Find lowest indent among selected items. This will be indicator what is the indent of
- // top-most list affected by the command.
- let lowestIndent = Number.POSITIVE_INFINITY;
- for ( const item of blocks ) {
- if ( item.is( 'element', 'listItem' ) && item.getAttribute( 'listIndent' ) < lowestIndent ) {
- lowestIndent = item.getAttribute( 'listIndent' );
- }
- }
- // Do not execute the fix for top-level lists.
- lowestIndent = lowestIndent === 0 ? 1 : lowestIndent;
- // Fix types of list items that are "before" the selected blocks.
- _fixType( blocks, true, lowestIndent );
- // Fix types of list items that are "after" the selected blocks.
- _fixType( blocks, false, lowestIndent );
- }
- // Phew! Now it will be easier :).
- // For each block element that was in the selection, we will either: turn it to list item,
- // turn it to paragraph, or change it's type. Or leave it as it is.
- // Do it in reverse as there might be multiple blocks (same as with changing indents).
- for ( const element of blocks.reverse() ) {
- if ( turnOff && element.name == 'listItem' ) {
- // We are turning off and the element is a `listItem` - it should be converted to `paragraph`.
- // List item specific attributes are removed by post fixer.
- writer.rename( element, 'paragraph' );
- } else if ( !turnOff && element.name != 'listItem' ) {
- // We are turning on and the element is not a `listItem` - it should be converted to `listItem`.
- // The order of operations is important to keep model in correct state.
- writer.setAttributes( { listType: this.type, listIndent: 0 }, element );
- writer.rename( element, 'listItem' );
- } else if ( !turnOff && element.name == 'listItem' && element.getAttribute( 'listType' ) != this.type ) {
- // We are turning on and the element is a `listItem` but has different type - change it's type and
- // type of it's all siblings that have same indent.
- writer.setAttribute( 'listType', this.type, element );
- }
- }
- /**
- * Event fired by the {@link #execute} method.
- *
- * It allows to execute an action after executing the {@link ~ListCommand#execute} method, for example adjusting
- * attributes of changed blocks.
- *
- * @protected
- * @event _executeCleanup
- */
- this.fire( '_executeCleanup', blocks );
- } );
- }
- /**
- * Checks the command's {@link #value}.
- *
- * @private
- * @returns {Boolean} The current value.
- */
- _getValue() {
- // Check whether closest `listItem` ancestor of the position has a correct type.
- const listItem = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this.editor.model.document.selection.getSelectedBlocks() );
- return !!listItem && listItem.is( 'element', 'listItem' ) && listItem.getAttribute( 'listType' ) == this.type;
- }
- /**
- * Checks whether the command can be enabled in the current context.
- *
- * @private
- * @returns {Boolean} Whether the command should be enabled.
- */
- _checkEnabled() {
- // If command value is true it means that we are in list item, so the command should be enabled.
- if ( this.value ) {
- return true;
- }
- const selection = this.editor.model.document.selection;
- const schema = this.editor.model.schema;
- const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( selection.getSelectedBlocks() );
- if ( !firstBlock ) {
- return false;
- }
- // Otherwise, check if list item can be inserted at the position start.
- return checkCanBecomeListItem( firstBlock, schema );
- }
- }
- // Helper function used when one or more list item have their type changed. Fixes type of other list items
- // that are affected by the change (are in same lists) but are not directly in selection. The function got extracted
- // not to duplicated code, as same fix has to be performed before and after selection.
- //
- // @param {Array.<module:engine/model/node~Node>} blocks Blocks that are in selection.
- // @param {Boolean} isBackward Specified whether fix will be applied for blocks before first selected block (`true`)
- // or blocks after last selected block (`false`).
- // @param {Number} lowestIndent Lowest indent among selected blocks.
- function _fixType( blocks, isBackward, lowestIndent ) {
- // We need to check previous sibling of first changed item and next siblings of last changed item.
- const startingItem = isBackward ? blocks[ 0 ] : blocks[ blocks.length - 1 ];
- if ( startingItem.is( 'element', 'listItem' ) ) {
- let item = startingItem[ isBackward ? 'previousSibling' : 'nextSibling' ];
- // During processing items, keeps the lowest indent of already processed items.
- // This saves us from changing too many items.
- // Following example is for going forward as it is easier to read, however same applies to going backward.
- // * ------
- // * ------
- // * --[---
- // * ------ <-- `lowestIndent` should be 1
- // * --]--- <-- `startingItem`, `currentIndent` = 2, `lowestIndent` == 1
- // * ------ <-- should be fixed, `indent` == 2 == `currentIndent`
- // * ------ <-- should be fixed, set `currentIndent` to 1, `indent` == 1 == `currentIndent`
- // * ------ <-- should not be fixed, item is in different list, `indent` = 2, `indent` != `currentIndent`
- // * ------ <-- should be fixed, `indent` == 1 == `currentIndent`
- // * ------ <-- break loop (`indent` < `lowestIndent`)
- let currentIndent = startingItem.getAttribute( 'listIndent' );
- // Look back until a list item with indent lower than reference `lowestIndent`.
- // That would be the parent of nested sublist which contains item having `lowestIndent`.
- while ( item && item.is( 'element', 'listItem' ) && item.getAttribute( 'listIndent' ) >= lowestIndent ) {
- if ( currentIndent > item.getAttribute( 'listIndent' ) ) {
- currentIndent = item.getAttribute( 'listIndent' );
- }
- // Found an item that is in the same nested sublist.
- if ( item.getAttribute( 'listIndent' ) == currentIndent ) {
- // Just add the item to selected blocks like it was selected by the user.
- blocks[ isBackward ? 'unshift' : 'push' ]( item );
- }
- item = item[ isBackward ? 'previousSibling' : 'nextSibling' ];
- }
- }
- }
- // Checks whether the given block can be replaced by a listItem.
- //
- // @private
- // @param {module:engine/model/element~Element} block A block to be tested.
- // @param {module:engine/model/schema~Schema} schema The schema of the document.
- // @returns {Boolean}
- function checkCanBecomeListItem( block, schema ) {
- return schema.checkChild( block.parent, 'listItem' ) && !schema.isObject( block );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-list/src/listediting.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-list/src/listediting.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListEditing; });
- /* harmony import */ var _listcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./listcommand */ "./node_modules/@ckeditor/ckeditor5-list/src/listcommand.js");
- /* harmony import */ var _indentcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./indentcommand */ "./node_modules/@ckeditor/ckeditor5-list/src/indentcommand.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/enter */ "./node_modules/ckeditor5/src/enter.js");
- /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
- /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-list/src/converters.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module list/listediting
- */
- /**
- * The engine of the list feature. It handles creating, editing and removing lists and list items.
- *
- * It registers the `'numberedList'`, `'bulletedList'`, `'indentList'` and `'outdentList'` commands.
- *
- * @extends module:core/plugin~Plugin
- */
- class ListEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ListEditing';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_3__["Enter"], ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_4__["Delete"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Schema.
- // Note: in case `$block` will ever be allowed in `listItem`, keep in mind that this feature
- // uses `Selection#getSelectedBlocks()` without any additional processing to obtain all selected list items.
- // If there are blocks allowed inside list item, algorithms using `getSelectedBlocks()` will have to be modified.
- editor.model.schema.register( 'listItem', {
- inheritAllFrom: '$block',
- allowAttributes: [ 'listType', 'listIndent' ]
- } );
- // Converters.
- const data = editor.data;
- const editing = editor.editing;
- editor.model.document.registerPostFixer( writer => Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelChangePostFixer"])( editor.model, writer ) );
- editing.mapper.registerViewToModelLength( 'li', getViewListItemLength );
- data.mapper.registerViewToModelLength( 'li', getViewListItemLength );
- editing.mapper.on( 'modelToViewPosition', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelToViewPosition"])( editing.view ) );
- editing.mapper.on( 'viewToModelPosition', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["viewToModelPosition"])( editor.model ) );
- data.mapper.on( 'modelToViewPosition', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelToViewPosition"])( editing.view ) );
- editor.conversion.for( 'editingDowncast' )
- .add( dispatcher => {
- dispatcher.on( 'insert', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewSplitOnInsert"], { priority: 'high' } );
- dispatcher.on( 'insert:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelViewInsertion"])( editor.model ) );
- dispatcher.on( 'attribute:listType:listItem', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewChangeType"], { priority: 'high' } );
- dispatcher.on( 'attribute:listType:listItem', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewMergeAfterChangeType"], { priority: 'low' } );
- dispatcher.on( 'attribute:listIndent:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelViewChangeIndent"])( editor.model ) );
- dispatcher.on( 'remove:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelViewRemove"])( editor.model ) );
- dispatcher.on( 'remove', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewMergeAfter"], { priority: 'low' } );
- } );
- editor.conversion.for( 'dataDowncast' )
- .add( dispatcher => {
- dispatcher.on( 'insert', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewSplitOnInsert"], { priority: 'high' } );
- dispatcher.on( 'insert:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelViewInsertion"])( editor.model ) );
- } );
- editor.conversion.for( 'upcast' )
- .add( dispatcher => {
- dispatcher.on( 'element:ul', _converters__WEBPACK_IMPORTED_MODULE_5__["cleanList"], { priority: 'high' } );
- dispatcher.on( 'element:ol', _converters__WEBPACK_IMPORTED_MODULE_5__["cleanList"], { priority: 'high' } );
- dispatcher.on( 'element:li', _converters__WEBPACK_IMPORTED_MODULE_5__["cleanListItem"], { priority: 'high' } );
- dispatcher.on( 'element:li', _converters__WEBPACK_IMPORTED_MODULE_5__["viewModelConverter"] );
- } );
- // Fix indentation of pasted items.
- editor.model.on( 'insertContent', _converters__WEBPACK_IMPORTED_MODULE_5__["modelIndentPasteFixer"], { priority: 'high' } );
- // Register commands for numbered and bulleted list.
- editor.commands.add( 'numberedList', new _listcommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor, 'numbered' ) );
- editor.commands.add( 'bulletedList', new _listcommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor, 'bulleted' ) );
- // Register commands for indenting.
- editor.commands.add( 'indentList', new _indentcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'forward' ) );
- editor.commands.add( 'outdentList', new _indentcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'backward' ) );
- const viewDocument = editing.view.document;
- // Overwrite default Enter key behavior.
- // If Enter key is pressed with selection collapsed in empty list item, outdent it instead of breaking it.
- this.listenTo( viewDocument, 'enter', ( evt, data ) => {
- const doc = this.editor.model.document;
- const positionParent = doc.selection.getLastPosition().parent;
- if ( doc.selection.isCollapsed && positionParent.name == 'listItem' && positionParent.isEmpty ) {
- this.editor.execute( 'outdentList' );
- data.preventDefault();
- evt.stop();
- }
- }, { context: 'li' } );
- // Overwrite default Backspace key behavior.
- // If Backspace key is pressed with selection collapsed on first position in first list item, outdent it. #83
- this.listenTo( viewDocument, 'delete', ( evt, data ) => {
- // Check conditions from those that require less computations like those immediately available.
- if ( data.direction !== 'backward' ) {
- return;
- }
- const selection = this.editor.model.document.selection;
- if ( !selection.isCollapsed ) {
- return;
- }
- const firstPosition = selection.getFirstPosition();
- if ( !firstPosition.isAtStart ) {
- return;
- }
- const positionParent = firstPosition.parent;
- if ( positionParent.name !== 'listItem' ) {
- return;
- }
- const previousIsAListItem = positionParent.previousSibling && positionParent.previousSibling.name === 'listItem';
- if ( previousIsAListItem ) {
- return;
- }
- this.editor.execute( 'outdentList' );
- data.preventDefault();
- evt.stop();
- }, { context: 'li' } );
- const getCommandExecuter = commandName => {
- return ( data, cancel ) => {
- const command = this.editor.commands.get( commandName );
- if ( command.isEnabled ) {
- this.editor.execute( commandName );
- cancel();
- }
- };
- };
- editor.keystrokes.set( 'Tab', getCommandExecuter( 'indentList' ) );
- editor.keystrokes.set( 'Shift+Tab', getCommandExecuter( 'outdentList' ) );
- }
- /**
- * @inheritDoc
- */
- afterInit() {
- const commands = this.editor.commands;
- const indent = commands.get( 'indent' );
- const outdent = commands.get( 'outdent' );
- if ( indent ) {
- indent.registerChildCommand( commands.get( 'indentList' ) );
- }
- if ( outdent ) {
- outdent.registerChildCommand( commands.get( 'outdentList' ) );
- }
- }
- }
- function getViewListItemLength( element ) {
- let length = 1;
- for ( const child of element.getChildren() ) {
- if ( child.name == 'ul' || child.name == 'ol' ) {
- for ( const item of child.getChildren() ) {
- length += getViewListItemLength( item );
- }
- }
- }
- return length;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-list/src/listui.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-list/src/listui.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListUI; });
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-list/src/utils.js");
- /* harmony import */ var _theme_icons_numberedlist_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../theme/icons/numberedlist.svg */ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg");
- /* harmony import */ var _theme_icons_bulletedlist_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/bulletedlist.svg */ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module list/listui
- */
- /**
- * The list UI feature. It introduces the `'numberedList'` and `'bulletedList'` buttons that
- * allow to convert paragraphs to and from list items and indent or outdent them.
- *
- * @extends module:core/plugin~Plugin
- */
- class ListUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_3__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ListUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const t = this.editor.t;
- // Create two buttons and link them with numberedList and bulletedList commands.
- Object(_utils__WEBPACK_IMPORTED_MODULE_0__["createUIComponent"])( this.editor, 'numberedList', t( 'Numbered List' ), _theme_icons_numberedlist_svg__WEBPACK_IMPORTED_MODULE_1__["default"] );
- Object(_utils__WEBPACK_IMPORTED_MODULE_0__["createUIComponent"])( this.editor, 'bulletedList', t( 'Bulleted List' ), _theme_icons_bulletedlist_svg__WEBPACK_IMPORTED_MODULE_2__["default"] );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-list/src/utils.js":
- /*!************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-list/src/utils.js ***!
- \************************************************************/
- /*! exports provided: createViewListItemElement, generateLiInUl, injectViewList, mergeViewLists, positionAfterUiElements, getSiblingListItem, createUIComponent, findNestedList, getSiblingNodes */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createViewListItemElement", function() { return createViewListItemElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generateLiInUl", function() { return generateLiInUl; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectViewList", function() { return injectViewList; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeViewLists", function() { return mergeViewLists; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionAfterUiElements", function() { return positionAfterUiElements; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSiblingListItem", function() { return getSiblingListItem; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUIComponent", function() { return createUIComponent; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNestedList", function() { return findNestedList; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSiblingNodes", function() { return getSiblingNodes; });
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module list/utils
- */
- /**
- * Creates a list item {@link module:engine/view/containerelement~ContainerElement}.
- *
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer The writer instance.
- * @returns {module:engine/view/containerelement~ContainerElement}
- */
- function createViewListItemElement( writer ) {
- const viewItem = writer.createContainerElement( 'li' );
- viewItem.getFillerOffset = getListItemFillerOffset;
- return viewItem;
- }
- /**
- * Helper function that creates a `<ul><li></li></ul>` or (`<ol>`) structure out of the given `modelItem` model `listItem` element.
- * Then, it binds the created view list item (`<li>`) with the model `listItem` element.
- * The function then returns the created view list item (`<li>`).
- *
- * @param {module:engine/model/item~Item} modelItem Model list item.
- * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface.
- * @returns {module:engine/view/containerelement~ContainerElement} View list element.
- */
- function generateLiInUl( modelItem, conversionApi ) {
- const mapper = conversionApi.mapper;
- const viewWriter = conversionApi.writer;
- const listType = modelItem.getAttribute( 'listType' ) == 'numbered' ? 'ol' : 'ul';
- const viewItem = createViewListItemElement( viewWriter );
- const viewList = viewWriter.createContainerElement( listType, null );
- viewWriter.insert( viewWriter.createPositionAt( viewList, 0 ), viewItem );
- mapper.bindElements( modelItem, viewItem );
- return viewItem;
- }
- /**
- * Helper function that inserts a view list at a correct place and merges it with its siblings.
- * It takes a model list item element (`modelItem`) and a corresponding view list item element (`injectedItem`). The view list item
- * should be in a view list element (`<ul>` or `<ol>`) and should be its only child.
- * See comments below to better understand the algorithm.
- *
- * @param {module:engine/view/item~Item} modelItem Model list item.
- * @param {module:engine/view/containerelement~ContainerElement} injectedItem
- * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface.
- * @param {module:engine/model/model~Model} model The model instance.
- */
- function injectViewList( modelItem, injectedItem, conversionApi, model ) {
- const injectedList = injectedItem.parent;
- const mapper = conversionApi.mapper;
- const viewWriter = conversionApi.writer;
- // The position where the view list will be inserted.
- let insertPosition = mapper.toViewPosition( model.createPositionBefore( modelItem ) );
- // 1. Find the previous list item that has the same or smaller indent. Basically we are looking for the first model item
- // that is a "parent" or "sibling" of the injected model item.
- // If there is no such list item, it means that the injected list item is the first item in "its list".
- const refItem = getSiblingListItem( modelItem.previousSibling, {
- sameIndent: true,
- smallerIndent: true,
- listIndent: modelItem.getAttribute( 'listIndent' )
- } );
- const prevItem = modelItem.previousSibling;
- if ( refItem && refItem.getAttribute( 'listIndent' ) == modelItem.getAttribute( 'listIndent' ) ) {
- // There is a list item with the same indent - we found the same-level sibling.
- // Break the list after it. The inserted view item will be added in the broken space.
- const viewItem = mapper.toViewElement( refItem );
- insertPosition = viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
- } else {
- // There is no list item with the same indent. Check the previous model item.
- if ( prevItem && prevItem.name == 'listItem' ) {
- // If it is a list item, it has to have a lower indent.
- // It means that the inserted item should be added to it as its nested item.
- insertPosition = mapper.toViewPosition( model.createPositionAt( prevItem, 'end' ) );
- // There could be some not mapped elements (eg. span in to-do list) but we need to insert
- // a nested list directly inside the li element.
- const mappedViewAncestor = mapper.findMappedViewAncestor( insertPosition );
- const nestedList = findNestedList( mappedViewAncestor );
- // If there already is some nested list, then use it's position.
- if ( nestedList ) {
- insertPosition = viewWriter.createPositionBefore( nestedList );
- } else {
- // Else just put new list on the end of list item content.
- insertPosition = viewWriter.createPositionAt( mappedViewAncestor, 'end' );
- }
- } else {
- // The previous item is not a list item (or does not exist at all).
- // Just map the position and insert the view item at the mapped position.
- insertPosition = mapper.toViewPosition( model.createPositionBefore( modelItem ) );
- }
- }
- insertPosition = positionAfterUiElements( insertPosition );
- // Insert the view item.
- viewWriter.insert( insertPosition, injectedList );
- // 2. Handle possible children of the injected model item.
- if ( prevItem && prevItem.name == 'listItem' ) {
- const prevView = mapper.toViewElement( prevItem );
- const walkerBoundaries = viewWriter.createRange( viewWriter.createPositionAt( prevView, 0 ), insertPosition );
- const walker = walkerBoundaries.getWalker( { ignoreElementEnd: true } );
- for ( const value of walker ) {
- if ( value.item.is( 'element', 'li' ) ) {
- const breakPosition = viewWriter.breakContainer( viewWriter.createPositionBefore( value.item ) );
- const viewList = value.item.parent;
- const targetPosition = viewWriter.createPositionAt( injectedItem, 'end' );
- mergeViewLists( viewWriter, targetPosition.nodeBefore, targetPosition.nodeAfter );
- viewWriter.move( viewWriter.createRangeOn( viewList ), targetPosition );
- walker.position = breakPosition;
- }
- }
- } else {
- const nextViewList = injectedList.nextSibling;
- if ( nextViewList && ( nextViewList.is( 'element', 'ul' ) || nextViewList.is( 'element', 'ol' ) ) ) {
- let lastSubChild = null;
- for ( const child of nextViewList.getChildren() ) {
- const modelChild = mapper.toModelElement( child );
- if ( modelChild && modelChild.getAttribute( 'listIndent' ) > modelItem.getAttribute( 'listIndent' ) ) {
- lastSubChild = child;
- } else {
- break;
- }
- }
- if ( lastSubChild ) {
- viewWriter.breakContainer( viewWriter.createPositionAfter( lastSubChild ) );
- viewWriter.move( viewWriter.createRangeOn( lastSubChild.parent ), viewWriter.createPositionAt( injectedItem, 'end' ) );
- }
- }
- }
- // Merge the inserted view list with its possible neighbor lists.
- mergeViewLists( viewWriter, injectedList, injectedList.nextSibling );
- mergeViewLists( viewWriter, injectedList.previousSibling, injectedList );
- }
- /**
- * Helper function that takes two parameters that are expected to be view list elements, and merges them.
- * The merge happens only if both parameters are list elements of the same type (the same element name and the same class attributes).
- *
- * @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter The writer instance.
- * @param {module:engine/view/item~Item} firstList The first element to compare.
- * @param {module:engine/view/item~Item} secondList The second element to compare.
- * @returns {module:engine/view/position~Position|null} The position after merge or `null` when there was no merge.
- */
- function mergeViewLists( viewWriter, firstList, secondList ) {
- // Check if two lists are going to be merged.
- if ( !firstList || !secondList || ( firstList.name != 'ul' && firstList.name != 'ol' ) ) {
- return null;
- }
- // Both parameters are list elements, so compare types now.
- if ( firstList.name != secondList.name || firstList.getAttribute( 'class' ) !== secondList.getAttribute( 'class' ) ) {
- return null;
- }
- return viewWriter.mergeContainers( viewWriter.createPositionAfter( firstList ) );
- }
- /**
- * Helper function that for a given `view.Position`, returns a `view.Position` that is after all `view.UIElement`s that
- * are after the given position.
- *
- * For example:
- * `<container:p>foo^<ui:span></ui:span><ui:span></ui:span>bar</container:p>`
- * For position ^, the position before "bar" will be returned.
- *
- * @param {module:engine/view/position~Position} viewPosition
- * @returns {module:engine/view/position~Position}
- */
- function positionAfterUiElements( viewPosition ) {
- return viewPosition.getLastMatchingPosition( value => value.item.is( 'uiElement' ) );
- }
- /**
- * Helper function that searches for a previous list item sibling of a given model item that meets the given criteria
- * passed by the options object.
- *
- * @param {module:engine/model/item~Item} modelItem
- * @param {Object} options Search criteria.
- * @param {Boolean} [options.sameIndent=false] Whether the sought sibling should have the same indentation.
- * @param {Boolean} [options.smallerIndent=false] Whether the sought sibling should have a smaller indentation.
- * @param {Number} [options.listIndent] The reference indentation.
- * @param {'forward'|'backward'} [options.direction='backward'] Walking direction.
- * @returns {module:engine/model/item~Item|null}
- */
- function getSiblingListItem( modelItem, options ) {
- const sameIndent = !!options.sameIndent;
- const smallerIndent = !!options.smallerIndent;
- const indent = options.listIndent;
- let item = modelItem;
- while ( item && item.name == 'listItem' ) {
- const itemIndent = item.getAttribute( 'listIndent' );
- if ( ( sameIndent && indent == itemIndent ) || ( smallerIndent && indent > itemIndent ) ) {
- return item;
- }
- if ( options.direction === 'forward' ) {
- item = item.nextSibling;
- } else {
- item = item.previousSibling;
- }
- }
- return null;
- }
- /**
- * Helper method for creating a UI button and linking it with an appropriate command.
- *
- * @private
- * @param {module:core/editor/editor~Editor} editor The editor instance to which the UI component will be added.
- * @param {String} commandName The name of the command.
- * @param {Object} label The button label.
- * @param {String} icon The source of the icon.
- */
- function createUIComponent( editor, commandName, label, icon ) {
- editor.ui.componentFactory.add( commandName, locale => {
- const command = editor.commands.get( commandName );
- const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- buttonView.set( {
- label,
- icon,
- tooltip: true,
- isToggleable: true
- } );
- // Bind button model to command.
- buttonView.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
- // Execute command.
- buttonView.on( 'execute', () => {
- editor.execute( commandName );
- editor.editing.view.focus();
- } );
- return buttonView;
- } );
- }
- /**
- * Returns a first list view element that is direct child of the given view element.
- *
- * @param {module:engine/view/element~Element} viewElement
- * @return {module:engine/view/element~Element|null}
- */
- function findNestedList( viewElement ) {
- for ( const node of viewElement.getChildren() ) {
- if ( node.name == 'ul' || node.name == 'ol' ) {
- return node;
- }
- }
- return null;
- }
- /**
- * Returns an array with all `listItem` elements that represents the same list.
- *
- * It means that values for `listIndent`, `listType`, and `listStyle` for all items are equal.
- *
- * @param {module:engine/model/position~Position} position Starting position.
- * @param {'forward'|'backward'} direction Walking direction.
- * @returns {Array.<module:engine/model/element~Element>}
- */
- function getSiblingNodes( position, direction ) {
- const items = [];
- const listItem = position.parent;
- const walkerOptions = {
- ignoreElementEnd: true,
- startPosition: position,
- shallow: true,
- direction
- };
- const limitIndent = listItem.getAttribute( 'listIndent' );
- const nodes = [ ...new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["TreeWalker"]( walkerOptions ) ]
- .filter( value => value.item.is( 'element' ) )
- .map( value => value.item );
- for ( const element of nodes ) {
- // If found something else than `listItem`, we're out of the list scope.
- if ( !element.is( 'element', 'listItem' ) ) {
- break;
- }
- // If current parsed item has lower indent that element that the element that was a starting point,
- // it means we left a nested list. Abort searching items.
- //
- // ■ List item 1. [listIndent=0]
- // ○ List item 2.[] [listIndent=1], limitIndent = 1,
- // ○ List item 3. [listIndent=1]
- // ■ List item 4. [listIndent=0]
- //
- // Abort searching when leave nested list.
- if ( element.getAttribute( 'listIndent' ) < limitIndent ) {
- break;
- }
- // ■ List item 1.[] [listIndent=0] limitIndent = 0,
- // ○ List item 2. [listIndent=1]
- // ○ List item 3. [listIndent=1]
- // ■ List item 4. [listIndent=0]
- //
- // Ignore nested lists.
- if ( element.getAttribute( 'listIndent' ) > limitIndent ) {
- continue;
- }
- // ■ List item 1.[] [listType=bulleted]
- // 1. List item 2. [listType=numbered]
- // 2.List item 3. [listType=numbered]
- //
- // Abort searching when found a different kind of a list.
- if ( element.getAttribute( 'listType' ) !== listItem.getAttribute( 'listType' ) ) {
- break;
- }
- // ■ List item 1.[] [listType=bulleted]
- // ■ List item 2. [listType=bulleted]
- // ○ List item 3. [listType=bulleted]
- // ○ List item 4. [listType=bulleted]
- //
- // Abort searching when found a different list style.
- if ( element.getAttribute( 'listStyle' ) !== listItem.getAttribute( 'listStyle' ) ) {
- break;
- }
- if ( direction === 'backward' ) {
- items.unshift( element );
- } else {
- items.push( element );
- }
- }
- return items;
- }
- // Implementation of getFillerOffset for view list item element.
- //
- // @returns {Number|null} Block filler offset or `null` if block filler is not needed.
- function getListItemFillerOffset() {
- const hasOnlyLists = !this.isEmpty && ( this.getChild( 0 ).name == 'ul' || this.getChild( 0 ).name == 'ol' );
- if ( this.isEmpty || hasOnlyLists ) {
- return 0;
- }
- return ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["getFillerOffset"].call( this );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/index.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/index.js ***!
- \*****************************************************************/
- /*! exports provided: Paragraph, ParagraphButtonUI */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _paragraph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Paragraph", function() { return _paragraph__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _paragraphbuttonui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./paragraphbuttonui */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ParagraphButtonUI", function() { return _paragraphbuttonui__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paragraph
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertParagraphCommand; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paragraph/insertparagraphcommand
- */
- /**
- * The insert paragraph command. It inserts a new paragraph at a specific
- * {@link module:engine/model/position~Position document position}.
- *
- * // Insert a new paragraph before an element in the document.
- * editor.execute( 'insertParagraph', {
- * position: editor.model.createPositionBefore( element )
- * } );
- *
- * If a paragraph is disallowed in the context of the specific position, the command
- * will attempt to split position ancestors to find a place where it is possible
- * to insert a paragraph.
- *
- * **Note**: This command moves the selection to the inserted paragraph.
- *
- * @extends module:core/command~Command
- */
- class InsertParagraphCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Executes the command.
- *
- * @param {Object} options Options for the executed command.
- * @param {module:engine/model/position~Position} options.position The model position at which
- * the new paragraph will be inserted.
- * @fires execute
- */
- execute( options ) {
- const model = this.editor.model;
- let position = options.position;
- model.change( writer => {
- const paragraph = writer.createElement( 'paragraph' );
- if ( !model.schema.checkChild( position.parent, paragraph ) ) {
- const allowedParent = model.schema.findAllowedParent( position, paragraph );
- // It could be there's no ancestor limit that would allow paragraph.
- // In theory, "paragraph" could be disallowed even in the "$root".
- if ( !allowedParent ) {
- return;
- }
- position = writer.split( position, allowedParent ).position;
- }
- model.insertContent( paragraph, position );
- writer.setSelection( paragraph, 'in' );
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Paragraph; });
- /* harmony import */ var _paragraphcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./paragraphcommand */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js");
- /* harmony import */ var _insertparagraphcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./insertparagraphcommand */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js");
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paragraph/paragraph
- */
- /**
- * The paragraph feature for the editor.
- *
- * It introduces the `<paragraph>` element in the model which renders as a `<p>` element in the DOM and data.
- *
- * It also brings two editors commands:
- *
- * * The {@link module:paragraph/paragraphcommand~ParagraphCommand `'paragraph'`} command that converts all
- * blocks in the model selection into paragraphs.
- * * The {@link module:paragraph/insertparagraphcommand~InsertParagraphCommand `'insertParagraph'`} command
- * that inserts a new paragraph at a specified location in the model.
- *
- * @extends module:core/plugin~Plugin
- */
- class Paragraph extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Paragraph';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const model = editor.model;
- editor.commands.add( 'paragraph', new _paragraphcommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor ) );
- editor.commands.add( 'insertParagraph', new _insertparagraphcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
- // Schema.
- model.schema.register( 'paragraph', { inheritAllFrom: '$block' } );
- editor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );
- // Conversion for paragraph-like elements which has not been converted by any plugin.
- editor.conversion.for( 'upcast' ).elementToElement( {
- model: ( viewElement, { writer } ) => {
- if ( !Paragraph.paragraphLikeElements.has( viewElement.name ) ) {
- return null;
- }
- // Do not auto-paragraph empty elements.
- if ( viewElement.isEmpty ) {
- return null;
- }
- return writer.createElement( 'paragraph' );
- },
- view: /.+/,
- converterPriority: 'low'
- } );
- }
- }
- /**
- * A list of element names which should be treated by the autoparagraphing algorithms as
- * paragraph-like. This means that e.g. the following content:
- *
- * <h1>Foo</h1>
- * <table>
- * <tr>
- * <td>X</td>
- * <td>
- * <ul>
- * <li>Y</li>
- * <li>Z</li>
- * </ul>
- * </td>
- * </tr>
- * </table>
- *
- * contains five paragraph-like elements: `<h1>`, two `<td>`s and two `<li>`s.
- * Hence, if none of the features is going to convert those elements the above content will be automatically handled
- * by the paragraph feature and converted to:
- *
- * <p>Foo</p>
- * <p>X</p>
- * <p>Y</p>
- * <p>Z</p>
- *
- * Note: The `<td>` containing two `<li>` elements was ignored as the innermost paragraph-like elements
- * have a priority upon conversion.
- *
- * @member {Set.<String>} module:paragraph/paragraph~Paragraph.paragraphLikeElements
- */
- Paragraph.paragraphLikeElements = new Set( [
- 'blockquote',
- 'dd',
- 'div',
- 'dt',
- 'h1',
- 'h2',
- 'h3',
- 'h4',
- 'h5',
- 'h6',
- 'li',
- 'p',
- 'td',
- 'th'
- ] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ParagraphButtonUI; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
- /* harmony import */ var _theme_icons_paragraph_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/paragraph.svg */ "./node_modules/@ckeditor/ckeditor5-paragraph/theme/icons/paragraph.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paragraph/paragraphbuttonui
- */
- /**
- * This plugin defines the `'paragraph'` button. It can be used together with
- * {@link module:heading/headingbuttonsui~HeadingButtonsUI} to replace the standard heading dropdown.
- *
- * This plugin is not loaded automatically by the {@link module:paragraph/paragraph~Paragraph} plugin. It must
- * be added manually.
- *
- * ClassicEditor
- * .create( {
- * plugins: [ ..., Heading, Paragraph, HeadingButtonsUI, ParagraphButtonUI ]
- * toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3' ]
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * @extends module:core/plugin~Plugin
- */
- class ParagraphButtonUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- init() {
- const editor = this.editor;
- const t = editor.t;
- editor.ui.componentFactory.add( 'paragraph', locale => {
- const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
- const command = editor.commands.get( 'paragraph' );
- view.label = t( 'Paragraph' );
- view.icon = _theme_icons_paragraph_svg__WEBPACK_IMPORTED_MODULE_2__["default"];
- view.tooltip = true;
- view.isToggleable = true;
- view.bind( 'isEnabled' ).to( command );
- view.bind( 'isOn' ).to( command, 'value' );
- view.on( 'execute', () => {
- editor.execute( 'paragraph' );
- } );
- return view;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ParagraphCommand; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paragraph/paragraphcommand
- */
- /**
- * The paragraph command.
- *
- * @extends module:core/command~Command
- */
- class ParagraphCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * The value of the command. Indicates whether the selection start is placed in a paragraph.
- *
- * @readonly
- * @observable
- * @member {Boolean} #value
- */
- /**
- * @inheritDoc
- */
- refresh() {
- const model = this.editor.model;
- const document = model.document;
- const block = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( document.selection.getSelectedBlocks() );
- this.value = !!block && block.is( 'element', 'paragraph' );
- this.isEnabled = !!block && checkCanBecomeParagraph( block, model.schema );
- }
- /**
- * Executes the command. All the blocks (see {@link module:engine/model/schema~Schema}) in the selection
- * will be turned to paragraphs.
- *
- * @fires execute
- * @param {Object} [options] Options for the executed command.
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} [options.selection]
- * The selection that the command should be applied to.
- * By default, if not provided, the command is applied to the {@link module:engine/model/document~Document#selection}.
- */
- execute( options = {} ) {
- const model = this.editor.model;
- const document = model.document;
- model.change( writer => {
- const blocks = ( options.selection || document.selection ).getSelectedBlocks();
- for ( const block of blocks ) {
- if ( !block.is( 'element', 'paragraph' ) && checkCanBecomeParagraph( block, model.schema ) ) {
- writer.rename( block, 'paragraph' );
- }
- }
- } );
- }
- }
- // Checks whether the given block can be replaced by a paragraph.
- //
- // @private
- // @param {module:engine/model/element~Element} block A block to be tested.
- // @param {module:engine/model/schema~Schema} schema The schema of the document.
- // @returns {Boolean}
- function checkCanBecomeParagraph( block, schema ) {
- return schema.checkChild( block.parent, 'paragraph' ) && !schema.isObject( block );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/theme/icons/paragraph.svg":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paragraph/theme/icons/paragraph.svg ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10.5 5.5H7v5h3.5a2.5 2.5 0 1 0 0-5zM5 3h6.5v.025a5 5 0 0 1 0 9.95V13H7v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js ***!
- \*********************************************************************************/
- /*! exports provided: replaceImagesSourceWithBase64, _convertHexToBase64 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replaceImagesSourceWithBase64", function() { return replaceImagesSourceWithBase64; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_convertHexToBase64", function() { return _convertHexToBase64; });
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paste-from-office/filters/image
- */
- /* globals btoa */
- /**
- * Replaces source attribute of all `<img>` elements representing regular
- * images (not the Word shapes) with inlined base64 image representation extracted from RTF or Blob data.
- *
- * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment on which transform images.
- * @param {String} rtfData The RTF data from which images representation will be used.
- */
- function replaceImagesSourceWithBase64( documentFragment, rtfData ) {
- if ( !documentFragment.childCount ) {
- return;
- }
- const upcastWriter = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["UpcastWriter"]();
- const shapesIds = findAllShapesIds( documentFragment, upcastWriter );
- removeAllImgElementsRepresentingShapes( shapesIds, documentFragment, upcastWriter );
- removeAllShapeElements( documentFragment, upcastWriter );
- const images = findAllImageElementsWithLocalSource( documentFragment, upcastWriter );
- if ( images.length ) {
- replaceImagesFileSourceWithInlineRepresentation( images, extractImageDataFromRtf( rtfData ), upcastWriter );
- }
- }
- /**
- * Converts given HEX string to base64 representation.
- *
- * @protected
- * @param {String} hexString The HEX string to be converted.
- * @returns {String} Base64 representation of a given HEX string.
- */
- function _convertHexToBase64( hexString ) {
- return btoa( hexString.match( /\w{2}/g ).map( char => {
- return String.fromCharCode( parseInt( char, 16 ) );
- } ).join( '' ) );
- }
- // Finds all shapes (`<v:*>...</v:*>`) ids. Shapes can represent images (canvas)
- // or Word shapes (which does not have RTF or Blob representation).
- //
- // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment
- // from which to extract shape ids.
- // @param {module:engine/view/upcastwriter~UpcastWriter} writer
- // @returns {Array.<String>} Array of shape ids.
- function findAllShapesIds( documentFragment, writer ) {
- const range = writer.createRangeIn( documentFragment );
- const shapeElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
- name: /v:(.+)/
- } );
- const shapesIds = [];
- for ( const value of range ) {
- const el = value.item;
- const prevSiblingName = el.previousSibling && el.previousSibling.name || null;
- // If shape element have 'o:gfxdata' attribute and is not directly before `<v:shapetype>` element it means it represent Word shape.
- if ( shapeElementsMatcher.match( el ) && el.getAttribute( 'o:gfxdata' ) && prevSiblingName !== 'v:shapetype' ) {
- shapesIds.push( value.item.getAttribute( 'id' ) );
- }
- }
- return shapesIds;
- }
- // Removes all `<img>` elements which represents Word shapes and not regular images.
- //
- // @param {Array.<String>} shapesIds Shape ids which will be checked against `<img>` elements.
- // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment from which to remove `<img>` elements.
- // @param {module:engine/view/upcastwriter~UpcastWriter} writer
- function removeAllImgElementsRepresentingShapes( shapesIds, documentFragment, writer ) {
- const range = writer.createRangeIn( documentFragment );
- const imageElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
- name: 'img'
- } );
- const imgs = [];
- for ( const value of range ) {
- if ( imageElementsMatcher.match( value.item ) ) {
- const el = value.item;
- const shapes = el.getAttribute( 'v:shapes' ) ? el.getAttribute( 'v:shapes' ).split( ' ' ) : [];
- if ( shapes.length && shapes.every( shape => shapesIds.indexOf( shape ) > -1 ) ) {
- imgs.push( el );
- // Shapes may also have empty source while content is paste in some browsers (Safari).
- } else if ( !el.getAttribute( 'src' ) ) {
- imgs.push( el );
- }
- }
- }
- for ( const img of imgs ) {
- writer.remove( img );
- }
- }
- // Removes all shape elements (`<v:*>...</v:*>`) so they do not pollute the output structure.
- //
- // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment from which to remove shape elements.
- // @param {module:engine/view/upcastwriter~UpcastWriter} writer
- function removeAllShapeElements( documentFragment, writer ) {
- const range = writer.createRangeIn( documentFragment );
- const shapeElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
- name: /v:(.+)/
- } );
- const shapes = [];
- for ( const value of range ) {
- if ( shapeElementsMatcher.match( value.item ) ) {
- shapes.push( value.item );
- }
- }
- for ( const shape of shapes ) {
- writer.remove( shape );
- }
- }
- // Finds all `<img>` elements in a given document fragment which have source pointing to local `file://` resource.
- //
- // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment in which to look for `<img>` elements.
- // @param {module:engine/view/upcastwriter~UpcastWriter} writer
- // @returns {Object} result All found images grouped by source type.
- // @returns {Array.<module:engine/view/element~Element>} result.file Array of found `<img>` elements with `file://` source.
- // @returns {Array.<module:engine/view/element~Element>} result.blob Array of found `<img>` elements with `blob:` source.
- function findAllImageElementsWithLocalSource( documentFragment, writer ) {
- const range = writer.createRangeIn( documentFragment );
- const imageElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
- name: 'img'
- } );
- const imgs = [];
- for ( const value of range ) {
- if ( imageElementsMatcher.match( value.item ) ) {
- if ( value.item.getAttribute( 'src' ).startsWith( 'file://' ) ) {
- imgs.push( value.item );
- }
- }
- }
- return imgs;
- }
- // Extracts all images HEX representations from a given RTF data.
- //
- // @param {String} rtfData The RTF data from which to extract images HEX representation.
- // @returns {Array.<Object>} Array of found HEX representations. Each array item is an object containing:
- //
- // * {String} hex Image representation in HEX format.
- // * {string} type Type of image, `image/png` or `image/jpeg`.
- function extractImageDataFromRtf( rtfData ) {
- if ( !rtfData ) {
- return [];
- }
- const regexPictureHeader = /{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/;
- const regexPicture = new RegExp( '(?:(' + regexPictureHeader.source + '))([\\da-fA-F\\s]+)\\}', 'g' );
- const images = rtfData.match( regexPicture );
- const result = [];
- if ( images ) {
- for ( const image of images ) {
- let imageType = false;
- if ( image.includes( '\\pngblip' ) ) {
- imageType = 'image/png';
- } else if ( image.includes( '\\jpegblip' ) ) {
- imageType = 'image/jpeg';
- }
- if ( imageType ) {
- result.push( {
- hex: image.replace( regexPictureHeader, '' ).replace( /[^\da-fA-F]/g, '' ),
- type: imageType
- } );
- }
- }
- }
- return result;
- }
- // Replaces `src` attribute value of all given images with the corresponding base64 image representation.
- //
- // @param {Array.<module:engine/view/element~Element>} imageElements Array of image elements which will have its source replaced.
- // @param {Array.<Object>} imagesHexSources Array of images hex sources (usually the result of `extractImageDataFromRtf()` function).
- // The array should be the same length as `imageElements` parameter.
- // @param {module:engine/view/upcastwriter~UpcastWriter} writer
- function replaceImagesFileSourceWithInlineRepresentation( imageElements, imagesHexSources, writer ) {
- // Assume there is an equal amount of image elements and images HEX sources so they can be matched accordingly based on existing order.
- if ( imageElements.length === imagesHexSources.length ) {
- for ( let i = 0; i < imageElements.length; i++ ) {
- const newSrc = `data:${ imagesHexSources[ i ].type };base64,${ _convertHexToBase64( imagesHexSources[ i ].hex ) }`;
- writer.setAttribute( 'src', newSrc, imageElements[ i ] );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js ***!
- \********************************************************************************/
- /*! exports provided: transformListItemLikeElementsIntoLists, unwrapParagraphInListItem */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformListItemLikeElementsIntoLists", function() { return transformListItemLikeElementsIntoLists; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrapParagraphInListItem", function() { return unwrapParagraphInListItem; });
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paste-from-office/filters/list
- */
- /**
- * Transforms Word specific list-like elements to the semantic HTML lists.
- *
- * Lists in Word are represented by block elements with special attributes like:
- *
- * <p class=MsoListParagraphCxSpFirst style='mso-list:l1 level1 lfo1'>...</p> // Paragraph based list.
- * <h1 style='mso-list:l0 level1 lfo1'>...</h1> // Heading 1 based list.
- *
- * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment The view structure to be transformed.
- * @param {String} stylesString Styles from which list-like elements styling will be extracted.
- */
- function transformListItemLikeElementsIntoLists( documentFragment, stylesString ) {
- if ( !documentFragment.childCount ) {
- return;
- }
- const writer = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["UpcastWriter"]( documentFragment.document );
- const itemLikeElements = findAllItemLikeElements( documentFragment, writer );
- if ( !itemLikeElements.length ) {
- return;
- }
- let currentList = null;
- let currentIndentation = 1;
- itemLikeElements.forEach( ( itemLikeElement, i ) => {
- const isDifferentList = isNewListNeeded( itemLikeElements[ i - 1 ], itemLikeElement );
- const previousItemLikeElement = isDifferentList ? null : itemLikeElements[ i - 1 ];
- const indentationDifference = getIndentationDifference( previousItemLikeElement, itemLikeElement );
- if ( isDifferentList ) {
- currentList = null;
- currentIndentation = 1;
- }
- if ( !currentList || indentationDifference !== 0 ) {
- const listStyle = detectListStyle( itemLikeElement, stylesString );
- if ( !currentList ) {
- currentList = insertNewEmptyList( listStyle, itemLikeElement.element, writer );
- } else if ( itemLikeElement.indent > currentIndentation ) {
- const lastListItem = currentList.getChild( currentList.childCount - 1 );
- const lastListItemChild = lastListItem.getChild( lastListItem.childCount - 1 );
- currentList = insertNewEmptyList( listStyle, lastListItemChild, writer );
- currentIndentation += 1;
- } else if ( itemLikeElement.indent < currentIndentation ) {
- const differentIndentation = currentIndentation - itemLikeElement.indent;
- currentList = findParentListAtLevel( currentList, differentIndentation );
- currentIndentation = parseInt( itemLikeElement.indent );
- }
- if ( itemLikeElement.indent <= currentIndentation ) {
- if ( !currentList.is( 'element', listStyle.type ) ) {
- currentList = writer.rename( listStyle.type, currentList );
- }
- }
- }
- const listItem = transformElementIntoListItem( itemLikeElement.element, writer );
- writer.appendChild( listItem, currentList );
- } );
- }
- /**
- * Removes paragraph wrapping content inside a list item.
- *
- * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment
- * @param {module:engine/view/upcastwriter~UpcastWriter} writer
- */
- function unwrapParagraphInListItem( documentFragment, writer ) {
- for ( const value of writer.createRangeIn( documentFragment ) ) {
- const element = value.item;
- if ( element.is( 'element', 'li' ) ) {
- // Google Docs allows on single paragraph inside LI.
- const firstChild = element.getChild( 0 );
- if ( firstChild && firstChild.is( 'element', 'p' ) ) {
- writer.unwrapElement( firstChild );
- }
- }
- }
- }
- // Finds all list-like elements in a given document fragment.
- //
- // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment
- // in which to look for list-like nodes.
- // @param {module:engine/view/upcastwriter~UpcastWriter} writer
- // @returns {Array.<Object>} Array of found list-like items. Each item is an object containing:
- //
- // * {module:engine/src/view/element~Element} element List-like element.
- // * {Number} id List item id parsed from `mso-list` style (see `getListItemData()` function).
- // * {Number} order List item creation order parsed from `mso-list` style (see `getListItemData()` function).
- // * {Number} indent List item indentation level parsed from `mso-list` style (see `getListItemData()` function).
- function findAllItemLikeElements( documentFragment, writer ) {
- const range = writer.createRangeIn( documentFragment );
- // Matcher for finding list-like elements.
- const itemLikeElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
- name: /^p|h\d+$/,
- styles: {
- 'mso-list': /.*/
- }
- } );
- const itemLikeElements = [];
- for ( const value of range ) {
- if ( value.type === 'elementStart' && itemLikeElementsMatcher.match( value.item ) ) {
- const itemData = getListItemData( value.item );
- itemLikeElements.push( {
- element: value.item,
- id: itemData.id,
- order: itemData.order,
- indent: itemData.indent
- } );
- }
- }
- return itemLikeElements;
- }
- // Extracts list item style from the provided CSS.
- //
- // List item style is extracted from the CSS stylesheet. Each list with its specific style attribute
- // value (`mso-list:l1 level1 lfo1`) has its dedicated properties in a CSS stylesheet defined with a selector like:
- //
- // @list l1:level1 { ... }
- //
- // It contains `mso-level-number-format` property which defines list numbering/bullet style. If this property
- // is not defined it means default `decimal` numbering.
- //
- // Here CSS string representation is used as `mso-level-number-format` property is an invalid CSS property
- // and will be removed during CSS parsing.
- //
- // @param {Object} listLikeItem List-like item for which list style will be searched for. Usually
- // a result of `findAllItemLikeElements()` function.
- // @param {String} stylesString CSS stylesheet.
- // @returns {Object} result
- // @returns {String} result.type List type, could be `ul` or `ol`.
- // @returns {String|null} result.style List style, for example: `decimal`, `lower-roman`, etc. It is extracted
- // directly from Word stylesheet and adjusted to represent proper values for the CSS `list-style-type` property.
- // If it cannot be adjusted, the `null` value is returned.
- function detectListStyle( listLikeItem, stylesString ) {
- const listStyleRegexp = new RegExp( `@list l${ listLikeItem.id }:level${ listLikeItem.indent }\\s*({[^}]*)`, 'gi' );
- const listStyleTypeRegex = /mso-level-number-format:([^;]{0,100});/gi;
- const listStyleMatch = listStyleRegexp.exec( stylesString );
- let listStyleType = 'decimal'; // Decimal is default one.
- let type = 'ol'; // <ol> is default list.
- if ( listStyleMatch && listStyleMatch[ 1 ] ) {
- const listStyleTypeMatch = listStyleTypeRegex.exec( listStyleMatch[ 1 ] );
- if ( listStyleTypeMatch && listStyleTypeMatch[ 1 ] ) {
- listStyleType = listStyleTypeMatch[ 1 ].trim();
- type = listStyleType !== 'bullet' && listStyleType !== 'image' ? 'ol' : 'ul';
- }
- // Styles for the numbered lists are always defined in the Word CSS stylesheet.
- // Unordered lists MAY contain a value for the Word CSS definition `mso-level-text` but sometimes
- // this tag is missing. And because of that, we cannot depend on that. We need to predict the list style value
- // based on the list style marker element.
- if ( listStyleType === 'bullet' ) {
- const bulletedStyle = findBulletedListStyle( listLikeItem.element );
- if ( bulletedStyle ) {
- listStyleType = bulletedStyle;
- }
- }
- }
- return {
- type,
- style: mapListStyleDefinition( listStyleType )
- };
- }
- // Tries to extract the `list-style-type` value based on the marker element for bulleted list.
- //
- // @param {module:engine/view/element~Element} element
- // @returns {module:engine/view/element~Element|null}
- function findBulletedListStyle( element ) {
- const listMarkerElement = findListMarkerNode( element );
- if ( !listMarkerElement ) {
- return null;
- }
- const listMarker = listMarkerElement._data;
- if ( listMarker === 'o' ) {
- return 'circle';
- } else if ( listMarker === '·' ) {
- return 'disc';
- }
- // Word returns '§' instead of '■' for the square list style.
- else if ( listMarker === '§' ) {
- return 'square';
- }
- return null;
- }
- // Tries to find a text node that represents the marker element (list-style-type).
- //
- // @param {module:engine/view/element~Element} element
- // @returns {module:engine/view/text~Text|null}
- function findListMarkerNode( element ) {
- // If the first child is a text node, it is a value for the element.
- if ( element.getChild( 0 ).is( '$text' ) ) {
- return null;
- }
- const textNodeOrElement = element.getChild( 0 ).getChild( 0 );
- if ( textNodeOrElement.is( '$text' ) ) {
- return textNodeOrElement;
- }
- return textNodeOrElement.getChild( 0 );
- }
- // Parses the `list-style-type` value extracted directly from the Word CSS stylesheet and returns proper CSS definition.
- //
- // @param {String|null} value
- // @returns {String|null}
- function mapListStyleDefinition( value ) {
- switch ( value ) {
- case 'arabic-leading-zero':
- return 'decimal-leading-zero';
- case 'alpha-upper':
- return 'upper-alpha';
- case 'alpha-lower':
- return 'lower-alpha';
- case 'roman-upper':
- return 'upper-roman';
- case 'roman-lower':
- return 'lower-roman';
- case 'circle':
- case 'disc':
- case 'square':
- return value;
- default:
- return null;
- }
- }
- // Creates empty list of a given type and inserts it after a specified element.
- //
- // @param {Object} listStyle List style object which determines the type of newly created list.
- // Usually a result of `detectListStyle()` function.
- // @param {module:engine/view/element~Element} element Element after which list is inserted.
- // @param {module:engine/view/upcastwriter~UpcastWriter} writer
- // @returns {module:engine/view/element~Element} Newly created list element.
- function insertNewEmptyList( listStyle, element, writer ) {
- const parent = element.parent;
- const list = writer.createElement( listStyle.type );
- const position = parent.getChildIndex( element ) + 1;
- writer.insertChild( position, list, parent );
- // We do not support modifying the marker for a particular list item.
- // Set the value for the `list-style-type` property directly to the list container.
- if ( listStyle.style ) {
- writer.setStyle( 'list-style-type', listStyle.style, list );
- }
- return list;
- }
- // Transforms a given element into a semantic list item. As the function operates on a provided
- // {module:engine/src/view/element~Element element} it will modify the view structure to which this element belongs.
- //
- // @param {module:engine/view/element~Element} element Element which will be transformed into a list item.
- // @param {module:engine/view/upcastwriter~UpcastWriter} writer
- // @returns {module:engine/view/element~Element} New element to which the given one was transformed. It is
- // inserted in place of the old element (the reference to the old element is lost due to renaming).
- function transformElementIntoListItem( element, writer ) {
- removeBulletElement( element, writer );
- return writer.rename( 'li', element );
- }
- // Extracts list item information from Word specific list-like element style:
- //
- // `style="mso-list:l1 level1 lfo1"`
- //
- // where:
- //
- // * `l1` is a list id (however it does not mean this is a continuous list - see #43),
- // * `level1` is a list item indentation level,
- // * `lfo1` is a list insertion order in a document.
- //
- // @param {module:engine/view/element~Element} element Element from which style data is extracted.
- // @returns {Object} result
- // @returns {Number} result.id Parent list id.
- // @returns {Number} result.order List item creation order.
- // @returns {Number} result.indent List item indentation level.
- function getListItemData( element ) {
- const data = {};
- const listStyle = element.getStyle( 'mso-list' );
- if ( listStyle ) {
- const idMatch = listStyle.match( /(^|\s{1,100})l(\d+)/i );
- const orderMatch = listStyle.match( /\s{0,100}lfo(\d+)/i );
- const indentMatch = listStyle.match( /\s{0,100}level(\d+)/i );
- if ( idMatch && orderMatch && indentMatch ) {
- data.id = idMatch[ 2 ];
- data.order = orderMatch[ 1 ];
- data.indent = indentMatch[ 1 ];
- }
- }
- return data;
- }
- // Removes span with a numbering/bullet from a given element.
- //
- // @param {module:engine/view/element~Element} element
- // @param {module:engine/view/upcastwriter~UpcastWriter} writer
- function removeBulletElement( element, writer ) {
- // Matcher for finding `span` elements holding lists numbering/bullets.
- const bulletMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
- name: 'span',
- styles: {
- 'mso-list': 'Ignore'
- }
- } );
- const range = writer.createRangeIn( element );
- for ( const value of range ) {
- if ( value.type === 'elementStart' && bulletMatcher.match( value.item ) ) {
- writer.remove( value.item );
- }
- }
- }
- // Whether the previous and current items belong to the same list. It is determined based on `item.id`
- // (extracted from `mso-list` style, see #getListItemData) and a previous sibling of the current item.
- //
- // However, it's quite easy to change the `id` attribute for nested lists in Word. It will break the list feature while pasting.
- // Let's check also the `indent` attribute. If the difference between those two elements is equal to 1, we can assume that
- // the `currentItem` is a beginning of the nested list because lists in CKEditor 5 always start with the `indent=0` attribute.
- // See: https://github.com/ckeditor/ckeditor5/issues/7805.
- //
- // @param {Object} previousItem
- // @param {Object} currentItem
- // @returns {Boolean}
- function isNewListNeeded( previousItem, currentItem ) {
- if ( !previousItem ) {
- return true;
- }
- if ( previousItem.id !== currentItem.id ) {
- // See: https://github.com/ckeditor/ckeditor5/issues/7805.
- //
- // * List item 1.
- // - Nested list item 1.
- if ( currentItem.indent - previousItem.indent === 1 ) {
- return false;
- }
- return true;
- }
- const previousSibling = currentItem.element.previousSibling;
- if ( !previousSibling ) {
- return true;
- }
- // Even with the same id the list does not have to be continuous (#43).
- return !isList( previousSibling );
- }
- function isList( element ) {
- return element.is( 'element', 'ol' ) || element.is( 'element', 'ul' );
- }
- // Calculates the indentation difference between two given list items (based on the indent attribute
- // extracted from the `mso-list` style, see #getListItemData).
- //
- // @param {Object} previousItem
- // @param {Object} currentItem
- // @returns {Number}
- function getIndentationDifference( previousItem, currentItem ) {
- return previousItem ? currentItem.indent - previousItem.indent : currentItem.indent - 1;
- }
- // Finds the parent list element (ul/ol) of a given list element with indentation level lower by a given value.
- //
- // @param {module:engine/view/element~Element} listElement List element from which to start looking for a parent list.
- // @param {Number} indentationDifference Indentation difference between lists.
- // @returns {module:engine/view/element~Element} Found list element with indentation level lower by a given value.
- function findParentListAtLevel( listElement, indentationDifference ) {
- const ancestors = listElement.getAncestors( { parentFirst: true } );
- let parentList = null;
- let levelChange = 0;
- for ( const ancestor of ancestors ) {
- if ( ancestor.name === 'ul' || ancestor.name === 'ol' ) {
- levelChange++;
- }
- if ( levelChange === indentationDifference ) {
- parentList = ancestor;
- break;
- }
- }
- return parentList;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js ***!
- \*********************************************************************************/
- /*! exports provided: parseHtml */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseHtml", function() { return parseHtml; });
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /* harmony import */ var _space__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./space */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paste-from-office/filters/parse
- */
- /* globals DOMParser */
- /**
- * Parses provided HTML extracting contents of `<body>` and `<style>` tags.
- *
- * @param {String} htmlString HTML string to be parsed.
- * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
- * @returns {Object} result
- * @returns {module:engine/view/documentfragment~DocumentFragment} result.body Parsed body
- * content as a traversable structure.
- * @returns {String} result.bodyString Entire body content as a string.
- * @returns {Array.<CSSStyleSheet>} result.styles Array of native `CSSStyleSheet` objects, each representing
- * separate `style` tag from the source HTML.
- * @returns {String} result.stylesString All `style` tags contents combined in the order of occurrence into one string.
- */
- function parseHtml( htmlString, stylesProcessor ) {
- const domParser = new DOMParser();
- // Remove Word specific "if comments" so content inside is not omitted by the parser.
- htmlString = htmlString.replace( /<!--\[if gte vml 1]>/g, '' );
- const normalizedHtml = Object(_space__WEBPACK_IMPORTED_MODULE_1__["normalizeSpacing"])( cleanContentAfterBody( htmlString ) );
- // Parse htmlString as native Document object.
- const htmlDocument = domParser.parseFromString( normalizedHtml, 'text/html' );
- Object(_space__WEBPACK_IMPORTED_MODULE_1__["normalizeSpacerunSpans"])( htmlDocument );
- // Get `innerHTML` first as transforming to View modifies the source document.
- const bodyString = htmlDocument.body.innerHTML;
- // Transform document.body to View.
- const bodyView = documentToView( htmlDocument, stylesProcessor );
- // Extract stylesheets.
- const stylesObject = extractStyles( htmlDocument );
- return {
- body: bodyView,
- bodyString,
- styles: stylesObject.styles,
- stylesString: stylesObject.stylesString
- };
- }
- // Transforms native `Document` object into {@link module:engine/view/documentfragment~DocumentFragment}.
- //
- // @param {Document} htmlDocument Native `Document` object to be transformed.
- // @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
- // @returns {module:engine/view/documentfragment~DocumentFragment}
- function documentToView( htmlDocument, stylesProcessor ) {
- const viewDocument = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["ViewDocument"]( stylesProcessor );
- const domConverter = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["DomConverter"]( viewDocument, { blockFillerMode: 'nbsp' } );
- const fragment = htmlDocument.createDocumentFragment();
- const nodes = htmlDocument.body.childNodes;
- while ( nodes.length > 0 ) {
- fragment.appendChild( nodes[ 0 ] );
- }
- return domConverter.domToView( fragment );
- }
- // Extracts both `CSSStyleSheet` and string representation from all `style` elements available in a provided `htmlDocument`.
- //
- // @param {Document} htmlDocument Native `Document` object from which styles will be extracted.
- // @returns {Object} result
- // @returns {Array.<CSSStyleSheet>} result.styles Array of native `CSSStyleSheet` object, each representing
- // separate `style` tag from the source object.
- // @returns {String} result.stylesString All `style` tags contents combined in the order of occurrence as one string.
- function extractStyles( htmlDocument ) {
- const styles = [];
- const stylesString = [];
- const styleTags = Array.from( htmlDocument.getElementsByTagName( 'style' ) );
- for ( const style of styleTags ) {
- if ( style.sheet && style.sheet.cssRules && style.sheet.cssRules.length ) {
- styles.push( style.sheet );
- stylesString.push( style.innerHTML );
- }
- }
- return {
- styles,
- stylesString: stylesString.join( ' ' )
- };
- }
- // Removes leftover content from between closing </body> and closing </html> tag:
- //
- // <html><body><p>Foo Bar</p></body><span>Fo</span></html> -> <html><body><p>Foo Bar</p></body></html>
- //
- // This function is used as specific browsers (Edge) add some random content after `body` tag when pasting from Word.
- // @param {String} htmlString The HTML string to be cleaned.
- // @returns {String} The HTML string with leftover content removed.
- function cleanContentAfterBody( htmlString ) {
- const bodyCloseTag = '</body>';
- const htmlCloseTag = '</html>';
- const bodyCloseIndex = htmlString.indexOf( bodyCloseTag );
- if ( bodyCloseIndex < 0 ) {
- return htmlString;
- }
- const htmlCloseIndex = htmlString.indexOf( htmlCloseTag, bodyCloseIndex + bodyCloseTag.length );
- return htmlString.substring( 0, bodyCloseIndex + bodyCloseTag.length ) +
- ( htmlCloseIndex >= 0 ? htmlString.substring( htmlCloseIndex ) : '' );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js":
- /*!*********************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js ***!
- \*********************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return removeBoldWrapper; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paste-from-office/filters/removeboldwrapper
- */
- /**
- * Removes `<b>` tag wrapper added by Google Docs to a copied content.
- *
- * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment element `data.content` obtained from clipboard
- * @param {module:engine/view/upcastwriter~UpcastWriter} writer
- */
- function removeBoldWrapper( documentFragment, writer ) {
- for ( const child of documentFragment.getChildren() ) {
- if ( child.is( 'element', 'b' ) && child.getStyle( 'font-weight' ) === 'normal' ) {
- const childIndex = documentFragment.getChildIndex( child );
- writer.remove( child );
- writer.insertChild( childIndex, child.getChildren(), documentFragment );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js ***!
- \*********************************************************************************/
- /*! exports provided: normalizeSpacing, normalizeSpacerunSpans */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSpacing", function() { return normalizeSpacing; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSpacerunSpans", function() { return normalizeSpacerunSpans; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paste-from-office/filters/space
- */
- /**
- * Replaces last space preceding elements closing tag with ` `. Such operation prevents spaces from being removed
- * during further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).
- * This method also takes into account Word specific `<o:p></o:p>` empty tags.
- * Additionally multiline sequences of spaces and new lines between tags are removed (see #39 and #40).
- *
- * @param {String} htmlString HTML string in which spacing should be normalized.
- * @returns {String} Input HTML with spaces normalized.
- */
- function normalizeSpacing( htmlString ) {
- // Run normalizeSafariSpaceSpans() two times to cover nested spans.
- return normalizeSafariSpaceSpans( normalizeSafariSpaceSpans( htmlString ) )
- // Remove all \r\n from "spacerun spans" so the last replace line doesn't strip all whitespaces.
- .replace( /(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g, '$1$2' )
- .replace( /<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g, '' )
- .replace( / <\//g, '\u00A0</' )
- .replace( / <o:p><\/o:p>/g, '\u00A0<o:p></o:p>' )
- // Remove <o:p> block filler from empty paragraph. Safari uses \u00A0 instead of .
- .replace( /<o:p>( |\u00A0)<\/o:p>/g, '' )
- // Remove all whitespaces when they contain any \r or \n.
- .replace( />([^\S\r\n]*[\r\n]\s*)</g, '><' );
- }
- /**
- * Normalizes spacing in special Word `spacerun spans` (`<span style='mso-spacerun:yes'>\s+</span>`) by replacing
- * all spaces with ` ` pairs. This prevents spaces from being removed during further DOM/View processing
- * (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).
- *
- * @param {Document} htmlDocument Native `Document` object in which spacing should be normalized.
- */
- function normalizeSpacerunSpans( htmlDocument ) {
- htmlDocument.querySelectorAll( 'span[style*=spacerun]' ).forEach( el => {
- const innerTextLength = el.innerText.length || 0;
- el.innerHTML = Array( innerTextLength + 1 ).join( '\u00A0 ' ).substr( 0, innerTextLength );
- } );
- }
- // Normalizes specific spacing generated by Safari when content pasted from Word (`<span class="Apple-converted-space"> </span>`)
- // by replacing all spaces sequences longer than 1 space with ` ` pairs. This prevents spaces from being removed during
- // further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).
- //
- // This function is similar to {@link module:clipboard/utils/normalizeclipboarddata normalizeClipboardData util} but uses
- // regular spaces / sequence for replacement.
- //
- // @param {String} htmlString HTML string in which spacing should be normalized
- // @returns {String} Input HTML with spaces normalized.
- function normalizeSafariSpaceSpans( htmlString ) {
- return htmlString.replace( /<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g, ( fullMatch, spaces ) => {
- return spaces.length === 1 ? ' ' : Array( spaces.length + 1 ).join( '\u00A0 ' ).substr( 0, spaces.length );
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js":
- /*!****************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js ***!
- \****************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return GoogleDocsNormalizer; });
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /* harmony import */ var _filters_removeboldwrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filters/removeboldwrapper */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js");
- /* harmony import */ var _filters_list__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../filters/list */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paste-from-office/normalizers/googledocsnormalizer
- */
- const googleDocsMatch = /id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;
- /**
- * Normalizer for the content pasted from Google Docs.
- *
- * @implements module:paste-from-office/normalizer~Normalizer
- */
- class GoogleDocsNormalizer {
- /**
- * Creates a new `GoogleDocsNormalizer` instance.
- *
- * @param {module:engine/view/document~Document} document View document.
- */
- constructor( document ) {
- /**
- * @readonly
- * @type {module:engine/view/document~Document}
- */
- this.document = document;
- }
- /**
- * @inheritDoc
- */
- isActive( htmlString ) {
- return googleDocsMatch.test( htmlString );
- }
- /**
- * @inheritDoc
- */
- execute( data ) {
- const writer = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["UpcastWriter"]( this.document );
- Object(_filters_removeboldwrapper__WEBPACK_IMPORTED_MODULE_1__["default"])( data.content, writer );
- Object(_filters_list__WEBPACK_IMPORTED_MODULE_2__["unwrapParagraphInListItem"])( data.content, writer );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js":
- /*!************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js ***!
- \************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MSWordNormalizer; });
- /* harmony import */ var _filters_parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../filters/parse */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js");
- /* harmony import */ var _filters_list__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filters/list */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js");
- /* harmony import */ var _filters_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../filters/image */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paste-from-office/normalizers/mswordnormalizer
- */
- const msWordMatch1 = /<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i;
- const msWordMatch2 = /xmlns:o="urn:schemas-microsoft-com/i;
- /**
- * Normalizer for the content pasted from Microsoft Word.
- *
- * @implements module:paste-from-office/normalizer~Normalizer
- */
- class MSWordNormalizer {
- /**
- * Creates a new `MSWordNormalizer` instance.
- *
- * @param {module:engine/view/document~Document} document View document.
- */
- constructor( document ) {
- /**
- * @readonly
- * @type {module:engine/view/document~Document}
- */
- this.document = document;
- }
- /**
- * @inheritDoc
- */
- isActive( htmlString ) {
- return msWordMatch1.test( htmlString ) || msWordMatch2.test( htmlString );
- }
- /**
- * @inheritDoc
- */
- execute( data ) {
- const { body, stylesString } = Object(_filters_parse__WEBPACK_IMPORTED_MODULE_0__["parseHtml"])( data.dataTransfer.getData( 'text/html' ), this.document.stylesProcessor );
- Object(_filters_list__WEBPACK_IMPORTED_MODULE_1__["transformListItemLikeElementsIntoLists"])( body, stylesString );
- Object(_filters_image__WEBPACK_IMPORTED_MODULE_2__["replaceImagesSourceWithBase64"])( body, data.dataTransfer.getData( 'text/rtf' ) );
- data.content = body;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PasteFromOffice; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
- /* harmony import */ var _normalizers_googledocsnormalizer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./normalizers/googledocsnormalizer */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js");
- /* harmony import */ var _normalizers_mswordnormalizer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./normalizers/mswordnormalizer */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module paste-from-office/pastefromoffice
- */
- /**
- * The Paste from Office plugin.
- *
- * This plugin handles content pasted from Office apps and transforms it (if necessary)
- * to a valid structure which can then be understood by the editor features.
- *
- * Transformation is made by a set of predefined {@link module:paste-from-office/normalizer~Normalizer normalizers}.
- * This plugin includes following normalizers:
- * * {@link module:paste-from-office/normalizers/mswordnormalizer~MSWordNormalizer Microsoft Word normalizer}
- * * {@link module:paste-from-office/normalizers/googledocsnormalizer~GoogleDocsNormalizer Google Docs normalizer}
- *
- * For more information about this feature check the {@glink api/paste-from-office package page}.
- *
- * @extends module:core/plugin~Plugin
- */
- class PasteFromOffice extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'PasteFromOffice';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__["ClipboardPipeline"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const viewDocument = editor.editing.view.document;
- const normalizers = [];
- normalizers.push( new _normalizers_mswordnormalizer__WEBPACK_IMPORTED_MODULE_3__["default"]( viewDocument ) );
- normalizers.push( new _normalizers_googledocsnormalizer__WEBPACK_IMPORTED_MODULE_2__["default"]( viewDocument ) );
- editor.plugins.get( 'ClipboardPipeline' ).on(
- 'inputTransformation',
- ( evt, data ) => {
- if ( data.isTransformedWithPasteFromOffice ) {
- return;
- }
- const htmlString = data.dataTransfer.getData( 'text/html' );
- const activeNormalizer = normalizers.find( normalizer => normalizer.isActive( htmlString ) );
- if ( activeNormalizer ) {
- activeNormalizer.execute( data );
- data.isTransformedWithPasteFromOffice = true;
- }
- },
- { priority: 'high' }
- );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformat.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformat.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveFormat; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _removeformatui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./removeformatui */ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatui.js");
- /* harmony import */ var _removeformatediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./removeformatediting */ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatediting.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module remove-format/removeformat
- */
- /**
- * The remove format plugin.
- *
- * This is a "glue" plugin which loads the {@link module:remove-format/removeformatediting~RemoveFormatEditing}
- * and {@link module:remove-format/removeformatui~RemoveFormatUI} plugins.
- *
- * For a detailed overview, check out the {@glink features/remove-format remove format} feature documentation.
- *
- * @extends module:core/plugin~Plugin
- */
- class RemoveFormat extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _removeformatediting__WEBPACK_IMPORTED_MODULE_2__["default"], _removeformatui__WEBPACK_IMPORTED_MODULE_1__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'RemoveFormat';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatcommand.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatcommand.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveFormatCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module remove-format/removeformatcommand
- */
- /**
- * The remove format command.
- *
- * It is used by the {@link module:remove-format/removeformat~RemoveFormat remove format feature}
- * to clear the formatting in the selection.
- *
- * editor.execute( 'removeFormat' );
- *
- * @extends module:core/command~Command
- */
- class RemoveFormatCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const model = this.editor.model;
- this.isEnabled = !!Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this._getFormattingItems( model.document.selection, model.schema ) );
- }
- /**
- * @inheritDoc
- */
- execute() {
- const model = this.editor.model;
- const schema = model.schema;
- model.change( writer => {
- for ( const item of this._getFormattingItems( model.document.selection, schema ) ) {
- if ( item.is( 'selection' ) ) {
- for ( const attributeName of this._getFormattingAttributes( item, schema ) ) {
- writer.removeSelectionAttribute( attributeName );
- }
- } else {
- // Workaround for items with multiple removable attributes. See
- // https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609
- const itemRange = writer.createRangeOn( item );
- for ( const attributeName of this._getFormattingAttributes( item, schema ) ) {
- writer.removeAttribute( attributeName, itemRange );
- }
- }
- }
- } );
- }
- /**
- * Returns an iterable of items in a selection (including the selection itself) that have formatting model
- * attributes to be removed by the feature.
- *
- * @protected
- * @param {module:engine/model/documentselection~DocumentSelection} selection
- * @param {module:engine/model/schema~Schema} schema The schema describing the item.
- * @returns {Iterable.<module:engine/model/item~Item>|Iterable.<module:engine/model/documentselection~DocumentSelection>}
- */
- * _getFormattingItems( selection, schema ) {
- const itemHasRemovableFormatting = item => {
- return !!Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this._getFormattingAttributes( item, schema ) );
- };
- // Check formatting on selected items that are not blocks.
- for ( const curRange of selection.getRanges() ) {
- for ( const item of curRange.getItems() ) {
- if ( !schema.isBlock( item ) && itemHasRemovableFormatting( item ) ) {
- yield item;
- }
- }
- }
- // Check formatting from selected blocks.
- for ( const block of selection.getSelectedBlocks() ) {
- if ( itemHasRemovableFormatting( block ) ) {
- yield block;
- }
- }
- // Finally the selection might be formatted as well, so make sure to check it.
- if ( itemHasRemovableFormatting( selection ) ) {
- yield selection;
- }
- }
- /**
- * Returns an iterable of formatting attributes of a given model item.
- *
- * **Note:** Formatting items have the `isFormatting` property set to `true`.
- *
- * @protected
- * @param {module:engine/model/item~Item|module:engine/model/documentselection~DocumentSelection} item
- * @param {module:engine/model/schema~Schema} schema The schema describing the item.
- * @returns {Iterable.<String>} The names of formatting attributes found in a given item.
- */
- * _getFormattingAttributes( item, schema ) {
- for ( const [ attributeName ] of item.getAttributes() ) {
- const attributeProperties = schema.getAttributeProperties( attributeName );
- if ( attributeProperties && attributeProperties.isFormatting ) {
- yield attributeName;
- }
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatediting.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatediting.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveFormatEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _removeformatcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./removeformatcommand */ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatcommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module remove-format/removeformatediting
- */
- /**
- * The remove format editing plugin.
- *
- * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.
- *
- * @extends module:core/plugin~Plugin
- */
- class RemoveFormatEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'RemoveFormatEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- editor.commands.add( 'removeFormat', new _removeformatcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatui.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatui.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveFormatUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _theme_icons_remove_format_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/remove-format.svg */ "./node_modules/@ckeditor/ckeditor5-remove-format/theme/icons/remove-format.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module remove-format/removeformatui
- */
- const REMOVE_FORMAT = 'removeFormat';
- /**
- * The remove format UI plugin. It registers the `'removeFormat'` button which can be
- * used in the toolbar.
- *
- * @extends module:core/plugin~Plugin
- */
- class RemoveFormatUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'RemoveFormatUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const t = editor.t;
- editor.ui.componentFactory.add( REMOVE_FORMAT, locale => {
- const command = editor.commands.get( REMOVE_FORMAT );
- const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
- view.set( {
- label: t( 'Remove Format' ),
- icon: _theme_icons_remove_format_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
- tooltip: true
- } );
- view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
- // Execute the command.
- this.listenTo( view, 'execute', () => {
- editor.execute( REMOVE_FORMAT );
- editor.editing.view.focus();
- } );
- return view;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/theme/icons/remove-format.svg":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-remove-format/theme/icons/remove-format.svg ***!
- \**************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.69 14.915c.053.052.173.083.36.093a.366.366 0 0 1 .345.485l-.003.01a.738.738 0 0 1-.697.497h-2.67a.374.374 0 0 1-.353-.496l.013-.038a.681.681 0 0 1 .644-.458c.197-.012.325-.043.386-.093a.28.28 0 0 0 .072-.11L9.592 4.5H6.269c-.359-.017-.609.013-.75.09-.142.078-.289.265-.442.563-.192.29-.516.464-.864.464H4.17a.43.43 0 0 1-.407-.569L4.46 3h13.08l-.62 2.043a.81.81 0 0 1-.775.574h-.114a.486.486 0 0 1-.486-.486c.001-.284-.054-.464-.167-.54-.112-.076-.367-.106-.766-.091h-3.28l-2.68 10.257c-.006.074.007.127.038.158zM3 17h8a.5.5 0 1 1 0 1H3a.5.5 0 1 1 0-1zm11.299 1.17a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.06-1.06l1.415 1.414 1.414-1.415a.75.75 0 1 1 1.06 1.06l-1.413 1.415 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414-1.414 1.414z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/index.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/index.js ***!
- \******************************************************************/
- /*! exports provided: SelectAll, SelectAllEditing, SelectAllUI */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _selectall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selectall */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAll", function() { return _selectall__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _selectallediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectallediting */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAllEditing", function() { return _selectallediting__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _selectallui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectallui */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAllUI", function() { return _selectallui__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module select-all
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAll; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _selectallediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectallediting */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js");
- /* harmony import */ var _selectallui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectallui */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module select-all/selectall
- */
- /**
- * The select all feature.
- *
- * This is a "glue" plugin which loads the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature}
- * and the {@link module:select-all/selectallui~SelectAllUI select all UI feature}.
- *
- * Please refer to the documentation of individual features to learn more.
- *
- * @extends module:core/plugin~Plugin
- */
- class SelectAll extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _selectallediting__WEBPACK_IMPORTED_MODULE_1__["default"], _selectallui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'SelectAll';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAllCommand; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module select-all/selectallcommand
- */
- /**
- * The select all command.
- *
- * It is used by the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature} to handle
- * the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke.
- *
- * Executing this command changes the {@glink framework/guides/architecture/editing-engine#model model}
- * selection so it contains the entire content of the editable root of the editor the selection is
- * {@link module:engine/model/selection~Selection#anchor anchored} in.
- *
- * If the selection was anchored in a {@glink framework/guides/tutorials/implementing-a-block-widget nested editable}
- * (e.g. a caption of an image), the new selection will contain its entire content. Successive executions of this command
- * will expand the selection to encompass more and more content up to the entire editable root of the editor.
- *
- * @extends module:core/command~Command
- */
- class SelectAllCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- execute() {
- const model = this.editor.model;
- const selection = model.document.selection;
- let scopeElement = model.schema.getLimitElement( selection );
- // If an entire scope is selected, or the selection's ancestor is not a scope yet,
- // browse through ancestors to find the enclosing parent scope.
- if ( selection.containsEntireContent( scopeElement ) || !isSelectAllScope( model.schema, scopeElement ) ) {
- do {
- scopeElement = scopeElement.parent;
- // Do nothing, if the entire `root` is already selected.
- if ( !scopeElement ) {
- return;
- }
- } while ( !isSelectAllScope( model.schema, scopeElement ) );
- }
- model.change( writer => {
- writer.setSelection( scopeElement, 'in' );
- } );
- }
- }
- // Checks whether the element is a valid select-all scope.
- // Returns true, if the element is a {@link module:engine/model/schema~Schema#isLimit limit},
- // and can contain any text or paragraph.
- //
- // @param {module:engine/model/schema~Schema} schema The schema to check against.
- // @param {module:engine/model/element~Element} element
- // @return {Boolean}
- function isSelectAllScope( schema, element ) {
- return schema.isLimit( element ) && ( schema.checkChild( element, '$text' ) || schema.checkChild( element, 'paragraph' ) );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAllEditing; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /* harmony import */ var _selectallcommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectallcommand */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module select-all/selectallediting
- */
- const SELECT_ALL_KEYSTROKE = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["parseKeystroke"])( 'Ctrl+A' );
- /**
- * The select all editing feature.
- *
- * It registers the `'selectAll'` {@link module:select-all/selectallcommand~SelectAllCommand command}
- * and the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke listener which executes it.
- *
- * @extends module:core/plugin~Plugin
- */
- class SelectAllEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'SelectAllEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const view = editor.editing.view;
- const viewDocument = view.document;
- editor.commands.add( 'selectAll', new _selectallcommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor ) );
- this.listenTo( viewDocument, 'keydown', ( eventInfo, domEventData ) => {
- if ( Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( domEventData ) === SELECT_ALL_KEYSTROKE ) {
- editor.execute( 'selectAll' );
- domEventData.preventDefault();
- }
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAllUI; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
- /* harmony import */ var _theme_icons_select_all_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/select-all.svg */ "./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module select-all/selectallui
- */
- /**
- * The select all UI feature.
- *
- * It registers the `'selectAll'` UI button in the editor's
- * {@link module:ui/componentfactory~ComponentFactory component factory}. When clicked, the button
- * executes the {@link module:select-all/selectallcommand~SelectAllCommand select all command}.
- *
- * @extends module:core/plugin~Plugin
- */
- class SelectAllUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'SelectAllUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- editor.ui.componentFactory.add( 'selectAll', locale => {
- const command = editor.commands.get( 'selectAll' );
- const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
- const t = locale.t;
- view.set( {
- label: t( 'Select all' ),
- icon: _theme_icons_select_all_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
- keystroke: 'Ctrl+A',
- tooltip: true
- } );
- view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
- // Execute the command.
- this.listenTo( view, 'execute', () => {
- editor.execute( 'selectAll' );
- editor.editing.view.focus();
- } );
- return view;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertColumnCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/commands/insertcolumncommand
- */
- /**
- * The insert column command.
- *
- * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableColumnLeft'` and
- * `'insertTableColumnRight'` editor commands.
- *
- * To insert a column to the left of the selected cell, execute the following command:
- *
- * editor.execute( 'insertTableColumnLeft' );
- *
- * To insert a column to the right of the selected cell, execute the following command:
- *
- * editor.execute( 'insertTableColumnRight' );
- *
- * @extends module:core/command~Command
- */
- class InsertColumnCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * Creates a new `InsertColumnCommand` instance.
- *
- * @param {module:core/editor/editor~Editor} editor An editor on which this command will be used.
- * @param {Object} options
- * @param {String} [options.order="right"] The order of insertion relative to the column in which the caret is located.
- * Possible values: `"left"` and `"right"`.
- */
- constructor( editor, options = {} ) {
- super( editor );
- /**
- * The order of insertion relative to the column in which the caret is located.
- *
- * @readonly
- * @member {String} module:table/commands/insertcolumncommand~InsertColumnCommand#order
- */
- this.order = options.order || 'right';
- }
- /**
- * @inheritDoc
- */
- refresh() {
- const selection = this.editor.model.document.selection;
- const isAnyCellSelected = !!Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection ).length;
- this.isEnabled = isAnyCellSelected;
- }
- /**
- * Executes the command.
- *
- * Depending on the command's {@link #order} value, it inserts a column to the `'left'` or `'right'` of the column
- * in which the selection is set.
- *
- * @fires execute
- */
- execute() {
- const editor = this.editor;
- const selection = editor.model.document.selection;
- const tableUtils = editor.plugins.get( 'TableUtils' );
- const insertBefore = this.order === 'left';
- const affectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection );
- const columnIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getColumnIndexes"])( affectedTableCells );
- const column = insertBefore ? columnIndexes.first : columnIndexes.last;
- const table = affectedTableCells[ 0 ].findAncestor( 'table' );
- tableUtils.insertColumns( table, { columns: 1, at: insertBefore ? column : column + 1 } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertRowCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/commands/insertrowcommand
- */
- /**
- * The insert row command.
- *
- * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableRowBelow'` and
- * `'insertTableRowAbove'` editor commands.
- *
- * To insert a row below the selected cell, execute the following command:
- *
- * editor.execute( 'insertTableRowBelow' );
- *
- * To insert a row above the selected cell, execute the following command:
- *
- * editor.execute( 'insertTableRowAbove' );
- *
- * @extends module:core/command~Command
- */
- class InsertRowCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * Creates a new `InsertRowCommand` instance.
- *
- * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
- * @param {Object} options
- * @param {String} [options.order="below"] The order of insertion relative to the row in which the caret is located.
- * Possible values: `"above"` and `"below"`.
- */
- constructor( editor, options = {} ) {
- super( editor );
- /**
- * The order of insertion relative to the row in which the caret is located.
- *
- * @readonly
- * @member {String} module:table/commands/insertrowcommand~InsertRowCommand#order
- */
- this.order = options.order || 'below';
- }
- /**
- * @inheritDoc
- */
- refresh() {
- const selection = this.editor.model.document.selection;
- const isAnyCellSelected = !!Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection ).length;
- this.isEnabled = isAnyCellSelected;
- }
- /**
- * Executes the command.
- *
- * Depending on the command's {@link #order} value, it inserts a row `'below'` or `'above'` the row in which selection is set.
- *
- * @fires execute
- */
- execute() {
- const editor = this.editor;
- const selection = editor.model.document.selection;
- const tableUtils = editor.plugins.get( 'TableUtils' );
- const insertAbove = this.order === 'above';
- const affectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection );
- const rowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( affectedTableCells );
- const row = insertAbove ? rowIndexes.first : rowIndexes.last;
- const table = affectedTableCells[ 0 ].findAncestor( 'table' );
- tableUtils.insertRows( table, { at: insertAbove ? row : row + 1, copyStructureFromAbove: !insertAbove } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertTableCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/commands/inserttablecommand
- */
- /**
- * The insert table command.
- *
- * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTable'` editor command.
- *
- * To insert a table at the current selection, execute the command and specify the dimensions:
- *
- * editor.execute( 'insertTable', { rows: 20, columns: 5 } );
- *
- * @extends module:core/command~Command
- */
- class InsertTableCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const model = this.editor.model;
- const selection = model.document.selection;
- const schema = model.schema;
- this.isEnabled = isAllowedInParent( selection, schema ) &&
- !Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["checkSelectionOnObject"])( selection, schema );
- }
- /**
- * Executes the command.
- *
- * Inserts a table with the given number of rows and columns into the editor.
- *
- * @param {Object} options
- * @param {Number} [options.rows=2] The number of rows to create in the inserted table.
- * @param {Number} [options.columns=2] The number of columns to create in the inserted table.
- * @param {Number} [options.headingRows=0] The number of heading rows.
- * @param {Number} [options.headingColumns=0] The number of heading columns.
- * @fires execute
- */
- execute( options = {} ) {
- const model = this.editor.model;
- const selection = model.document.selection;
- const tableUtils = this.editor.plugins.get( 'TableUtils' );
- const insertPosition = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["findOptimalInsertionPosition"])( selection, model );
- model.change( writer => {
- const table = tableUtils.createTable( writer, options );
- model.insertContent( table, insertPosition );
- writer.setSelection( writer.createPositionAt( table.getNodeByPath( [ 0, 0, 0 ] ), 0 ) );
- } );
- }
- }
- // Checks if the table is allowed in the parent.
- //
- // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- // @param {module:engine/model/schema~Schema} schema
- // @returns {Boolean}
- function isAllowedInParent( selection, schema ) {
- const positionParent = selection.getFirstPosition().parent;
- const validParent = positionParent === positionParent.root ? positionParent : positionParent.parent;
- return schema.checkChild( validParent, 'table' );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MergeCellCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
- /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/commands/mergecellcommand
- */
- /**
- * The merge cell command.
- *
- * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCellRight'`, `'mergeTableCellLeft'`,
- * `'mergeTableCellUp'` and `'mergeTableCellDown'` editor commands.
- *
- * To merge a table cell at the current selection with another cell, execute the command corresponding with the preferred direction.
- *
- * For example, to merge with a cell to the right:
- *
- * editor.execute( 'mergeTableCellRight' );
- *
- * **Note**: If a table cell has a different [`rowspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-rowspan)
- * (for `'mergeTableCellRight'` and `'mergeTableCellLeft'`) or [`colspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-colspan)
- * (for `'mergeTableCellUp'` and `'mergeTableCellDown'`), the command will be disabled.
- *
- * @extends module:core/command~Command
- */
- class MergeCellCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * Creates a new `MergeCellCommand` instance.
- *
- * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
- * @param {Object} options
- * @param {String} options.direction Indicates which cell to merge with the currently selected one.
- * Possible values are: `'left'`, `'right'`, `'up'` and `'down'`.
- */
- constructor( editor, options ) {
- super( editor );
- /**
- * The direction that indicates which cell will be merged with the currently selected one.
- *
- * @readonly
- * @member {String} #direction
- */
- this.direction = options.direction;
- /**
- * Whether the merge is horizontal (left/right) or vertical (up/down).
- *
- * @readonly
- * @member {Boolean} #isHorizontal
- */
- this.isHorizontal = this.direction == 'right' || this.direction == 'left';
- }
- /**
- * @inheritDoc
- */
- refresh() {
- const cellToMerge = this._getMergeableCell();
- this.value = cellToMerge;
- this.isEnabled = !!cellToMerge;
- }
- /**
- * Executes the command.
- *
- * Depending on the command's {@link #direction} value, it will merge the cell that is to the `'left'`, `'right'`, `'up'` or `'down'`.
- *
- * @fires execute
- */
- execute() {
- const model = this.editor.model;
- const doc = model.document;
- const tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getTableCellsContainingSelection"])( doc.selection )[ 0 ];
- const cellToMerge = this.value;
- const direction = this.direction;
- model.change( writer => {
- const isMergeNext = direction == 'right' || direction == 'down';
- // The merge mechanism is always the same so sort cells to be merged.
- const cellToExpand = isMergeNext ? tableCell : cellToMerge;
- const cellToRemove = isMergeNext ? cellToMerge : tableCell;
- // Cache the parent of cell to remove for later check.
- const removedTableCellRow = cellToRemove.parent;
- mergeTableCells( cellToRemove, cellToExpand, writer );
- const spanAttribute = this.isHorizontal ? 'colspan' : 'rowspan';
- const cellSpan = parseInt( tableCell.getAttribute( spanAttribute ) || 1 );
- const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 );
- // Update table cell span attribute and merge set selection on merged contents.
- writer.setAttribute( spanAttribute, cellSpan + cellToMergeSpan, cellToExpand );
- writer.setSelection( writer.createRangeIn( cellToExpand ) );
- const tableUtils = this.editor.plugins.get( 'TableUtils' );
- const table = removedTableCellRow.findAncestor( 'table' );
- // Remove empty rows and columns after merging.
- Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRowsColumns"])( table, tableUtils );
- } );
- }
- /**
- * Returns a cell that can be merged with the current cell depending on the command's direction.
- *
- * @returns {module:engine/model/element~Element|undefined}
- * @private
- */
- _getMergeableCell() {
- const model = this.editor.model;
- const doc = model.document;
- const tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getTableCellsContainingSelection"])( doc.selection )[ 0 ];
- if ( !tableCell ) {
- return;
- }
- const tableUtils = this.editor.plugins.get( 'TableUtils' );
- // First get the cell on proper direction.
- const cellToMerge = this.isHorizontal ?
- getHorizontalCell( tableCell, this.direction, tableUtils ) :
- getVerticalCell( tableCell, this.direction, tableUtils );
- if ( !cellToMerge ) {
- return;
- }
- // If found check if the span perpendicular to merge direction is equal on both cells.
- const spanAttribute = this.isHorizontal ? 'rowspan' : 'colspan';
- const span = parseInt( tableCell.getAttribute( spanAttribute ) || 1 );
- const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 );
- if ( cellToMergeSpan === span ) {
- return cellToMerge;
- }
- }
- }
- // Returns the cell that can be merged horizontally.
- //
- // @param {module:engine/model/element~Element} tableCell
- // @param {String} direction
- // @param {module:table/tableutils~TableUtils} tableUtils
- // @returns {module:engine/model/node~Node|null}
- function getHorizontalCell( tableCell, direction, tableUtils ) {
- const tableRow = tableCell.parent;
- const table = tableRow.parent;
- const horizontalCell = direction == 'right' ? tableCell.nextSibling : tableCell.previousSibling;
- const hasHeadingColumns = ( table.getAttribute( 'headingColumns' ) || 0 ) > 0;
- if ( !horizontalCell ) {
- return;
- }
- // Sort cells:
- const cellOnLeft = direction == 'right' ? tableCell : horizontalCell;
- const cellOnRight = direction == 'right' ? horizontalCell : tableCell;
- // Get their column indexes:
- const { column: leftCellColumn } = tableUtils.getCellLocation( cellOnLeft );
- const { column: rightCellColumn } = tableUtils.getCellLocation( cellOnRight );
- const leftCellSpan = parseInt( cellOnLeft.getAttribute( 'colspan' ) || 1 );
- const isCellOnLeftInHeadingColumn = Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["isHeadingColumnCell"])( tableUtils, cellOnLeft, table );
- const isCellOnRightInHeadingColumn = Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["isHeadingColumnCell"])( tableUtils, cellOnRight, table );
- // We cannot merge heading columns cells with regular cells.
- if ( hasHeadingColumns && isCellOnLeftInHeadingColumn != isCellOnRightInHeadingColumn ) {
- return;
- }
- // The cell on the right must have index that is distant to the cell on the left by the left cell's width (colspan).
- const cellsAreTouching = leftCellColumn + leftCellSpan === rightCellColumn;
- // If the right cell's column index is different it means that there are rowspanned cells between them.
- return cellsAreTouching ? horizontalCell : undefined;
- }
- // Returns the cell that can be merged vertically.
- //
- // @param {module:engine/model/element~Element} tableCell
- // @param {String} direction
- // @param {module:table/tableutils~TableUtils} tableUtils
- // @returns {module:engine/model/node~Node|null}
- function getVerticalCell( tableCell, direction, tableUtils ) {
- const tableRow = tableCell.parent;
- const table = tableRow.parent;
- const rowIndex = table.getChildIndex( tableRow );
- // Don't search for mergeable cell if direction points out of the table.
- if ( ( direction == 'down' && rowIndex === tableUtils.getRows( table ) - 1 ) || ( direction == 'up' && rowIndex === 0 ) ) {
- return;
- }
- const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
- const headingRows = table.getAttribute( 'headingRows' ) || 0;
- const isMergeWithBodyCell = direction == 'down' && ( rowIndex + rowspan ) === headingRows;
- const isMergeWithHeadCell = direction == 'up' && rowIndex === headingRows;
- // Don't search for mergeable cell if direction points out of the current table section.
- if ( headingRows && ( isMergeWithBodyCell || isMergeWithHeadCell ) ) {
- return;
- }
- const currentCellRowSpan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
- const rowOfCellToMerge = direction == 'down' ? rowIndex + currentCellRowSpan : rowIndex;
- const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { endRow: rowOfCellToMerge } ) ];
- const currentCellData = tableMap.find( value => value.cell === tableCell );
- const mergeColumn = currentCellData.column;
- const cellToMergeData = tableMap.find( ( { row, cellHeight, column } ) => {
- if ( column !== mergeColumn ) {
- return false;
- }
- if ( direction == 'down' ) {
- // If merging a cell below the mergeRow is already calculated.
- return row === rowOfCellToMerge;
- } else {
- // If merging a cell above calculate if it spans to mergeRow.
- return rowOfCellToMerge === row + cellHeight;
- }
- } );
- return cellToMergeData && cellToMergeData.cell;
- }
- // Merges two table cells. It will ensure that after merging cells with an empty paragraph, the resulting table cell will only have one
- // paragraph. If one of the merged table cells is empty, the merged table cell will have the contents of the non-empty table cell.
- // If both are empty, the merged table cell will have only one empty paragraph.
- //
- // @param {module:engine/model/element~Element} cellToRemove
- // @param {module:engine/model/element~Element} cellToExpand
- // @param {module:engine/model/writer~Writer} writer
- function mergeTableCells( cellToRemove, cellToExpand, writer ) {
- if ( !isEmpty( cellToRemove ) ) {
- if ( isEmpty( cellToExpand ) ) {
- writer.remove( writer.createRangeIn( cellToExpand ) );
- }
- writer.move( writer.createRangeIn( cellToRemove ), writer.createPositionAt( cellToExpand, 'end' ) );
- }
- // Remove merged table cell.
- writer.remove( cellToRemove );
- }
- // Checks if the passed table cell contains an empty paragraph.
- //
- // @param {module:engine/model/element~Element} tableCell
- // @returns {Boolean}
- function isEmpty( tableCell ) {
- return tableCell.childCount == 1 && tableCell.getChild( 0 ).is( 'element', 'paragraph' ) && tableCell.getChild( 0 ).isEmpty;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MergeCellsCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _tableutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
- /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/commands/mergecellscommand
- */
- /**
- * The merge cells command.
- *
- * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCells'` editor command.
- *
- * For example, to merge selected table cells:
- *
- * editor.execute( 'mergeTableCells' );
- *
- * @extends module:core/command~Command
- */
- class MergeCellsCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectedTableCells"])( this.editor.model.document.selection );
- this.isEnabled = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["isSelectionRectangular"])( selectedTableCells, this.editor.plugins.get( _tableutils__WEBPACK_IMPORTED_MODULE_1__["default"] ) );
- }
- /**
- * Executes the command.
- *
- * @fires execute
- */
- execute() {
- const model = this.editor.model;
- const tableUtils = this.editor.plugins.get( _tableutils__WEBPACK_IMPORTED_MODULE_1__["default"] );
- model.change( writer => {
- const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectedTableCells"])( model.document.selection );
- // All cells will be merged into the first one.
- const firstTableCell = selectedTableCells.shift();
- // Update target cell dimensions.
- const { mergeWidth, mergeHeight } = getMergeDimensions( firstTableCell, selectedTableCells, tableUtils );
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'colspan', mergeWidth, firstTableCell, writer );
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', mergeHeight, firstTableCell, writer );
- for ( const tableCell of selectedTableCells ) {
- mergeTableCells( tableCell, firstTableCell, writer );
- }
- const table = firstTableCell.findAncestor( 'table' );
- // Remove rows and columns that become empty (have no anchored cells).
- Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRowsColumns"])( table, tableUtils );
- writer.setSelection( firstTableCell, 'in' );
- } );
- }
- }
- // Merges two table cells. It will ensure that after merging cells with empty paragraphs the resulting table cell will only have one
- // paragraph. If one of the merged table cells is empty, the merged table cell will have contents of the non-empty table cell.
- // If both are empty, the merged table cell will have only one empty paragraph.
- //
- // @param {module:engine/model/element~Element} cellBeingMerged
- // @param {module:engine/model/element~Element} targetCell
- // @param {module:engine/model/writer~Writer} writer
- function mergeTableCells( cellBeingMerged, targetCell, writer ) {
- if ( !isEmpty( cellBeingMerged ) ) {
- if ( isEmpty( targetCell ) ) {
- writer.remove( writer.createRangeIn( targetCell ) );
- }
- writer.move( writer.createRangeIn( cellBeingMerged ), writer.createPositionAt( targetCell, 'end' ) );
- }
- // Remove merged table cell.
- writer.remove( cellBeingMerged );
- }
- // Checks if the passed table cell contains an empty paragraph.
- //
- // @param {module:engine/model/element~Element} tableCell
- // @returns {Boolean}
- function isEmpty( tableCell ) {
- return tableCell.childCount == 1 && tableCell.getChild( 0 ).is( 'element', 'paragraph' ) && tableCell.getChild( 0 ).isEmpty;
- }
- function getMergeDimensions( firstTableCell, selectedTableCells, tableUtils ) {
- let maxWidthOffset = 0;
- let maxHeightOffset = 0;
- for ( const tableCell of selectedTableCells ) {
- const { row, column } = tableUtils.getCellLocation( tableCell );
- maxWidthOffset = getMaxOffset( tableCell, column, maxWidthOffset, 'colspan' );
- maxHeightOffset = getMaxOffset( tableCell, row, maxHeightOffset, 'rowspan' );
- }
- // Update table cell span attribute and merge set selection on a merged contents.
- const { row: firstCellRow, column: firstCellColumn } = tableUtils.getCellLocation( firstTableCell );
- const mergeWidth = maxWidthOffset - firstCellColumn;
- const mergeHeight = maxHeightOffset - firstCellRow;
- return { mergeWidth, mergeHeight };
- }
- function getMaxOffset( tableCell, start, currentMaxOffset, which ) {
- const dimensionValue = parseInt( tableCell.getAttribute( which ) || 1 );
- return Math.max( currentMaxOffset, start + dimensionValue );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveColumnCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/commands/removecolumncommand
- */
- /**
- * The remove column command.
- *
- * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableColumn'` editor command.
- *
- * To remove the column containing the selected cell, execute the command:
- *
- * editor.execute( 'removeTableColumn' );
- *
- * @extends module:core/command~Command
- */
- class RemoveColumnCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
- const firstCell = selectedCells[ 0 ];
- if ( firstCell ) {
- const table = firstCell.findAncestor( 'table' );
- const tableColumnCount = this.editor.plugins.get( 'TableUtils' ).getColumns( table );
- const { first, last } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getColumnIndexes"])( selectedCells );
- this.isEnabled = last - first < ( tableColumnCount - 1 );
- } else {
- this.isEnabled = false;
- }
- }
- /**
- * @inheritDoc
- */
- execute() {
- const [ firstCell, lastCell ] = getBoundaryCells( this.editor.model.document.selection );
- const table = firstCell.parent.parent;
- // Cache the table before removing or updating colspans.
- const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table ) ];
- // Store column indexes of removed columns.
- const removedColumnIndexes = {
- first: tableMap.find( value => value.cell === firstCell ).column,
- last: tableMap.find( value => value.cell === lastCell ).column
- };
- const cellToFocus = getCellToFocus( tableMap, firstCell, lastCell, removedColumnIndexes );
- this.editor.model.change( writer => {
- const columnsToRemove = removedColumnIndexes.last - removedColumnIndexes.first + 1;
- this.editor.plugins.get( 'TableUtils' ).removeColumns( table, {
- at: removedColumnIndexes.first,
- columns: columnsToRemove
- } );
- writer.setSelection( writer.createPositionAt( cellToFocus, 0 ) );
- } );
- }
- }
- // Returns a proper table cell to focus after removing a column.
- // - selection is on last table cell it will return previous cell.
- function getCellToFocus( tableMap, firstCell, lastCell, removedColumnIndexes ) {
- const colspan = parseInt( lastCell.getAttribute( 'colspan' ) || 1 );
- // If the table cell is spanned over 2+ columns - it will be truncated so the selection should
- // stay in that cell.
- if ( colspan > 1 ) {
- return lastCell;
- }
- // Normally, look for the cell in the same row that precedes the first cell to put selection there ("column on the left").
- // If the deleted column is the first column of the table, there will be no predecessor: use the cell
- // from the column that follows then (also in the same row).
- else if ( firstCell.previousSibling || lastCell.nextSibling ) {
- return lastCell.nextSibling || firstCell.previousSibling;
- }
- // It can happen that table cells have no siblings in a row, for instance, when there are row spans
- // in the table (in the previous row). Then just look for the closest cell that is in a column
- // that will not be removed to put the selection there.
- else {
- // Look for any cell in a column that precedes the first removed column.
- if ( removedColumnIndexes.first ) {
- return tableMap.reverse().find( ( { column } ) => {
- return column < removedColumnIndexes.first;
- } ).cell;
- }
- // If the first removed column is the first column of the table, then
- // look for any cell that is in a column that follows the last removed column.
- else {
- return tableMap.reverse().find( ( { column } ) => {
- return column > removedColumnIndexes.last;
- } ).cell;
- }
- }
- }
- // Returns helper object returning the first and the last cell contained in given selection, based on DOM order.
- function getBoundaryCells( selection ) {
- const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( selection );
- const firstCell = referenceCells[ 0 ];
- const lastCell = referenceCells.pop();
- const returnValue = [ firstCell, lastCell ];
- return firstCell.isBefore( lastCell ) ? returnValue : returnValue.reverse();
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveRowCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/commands/removerowcommand
- */
- /**
- * The remove row command.
- *
- * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableRow'` editor command.
- *
- * To remove the row containing the selected cell, execute the command:
- *
- * editor.execute( 'removeTableRow' );
- *
- * @extends module:core/command~Command
- */
- class RemoveRowCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
- const firstCell = selectedCells[ 0 ];
- if ( firstCell ) {
- const table = firstCell.findAncestor( 'table' );
- const tableRowCount = this.editor.plugins.get( 'TableUtils' ).getRows( table );
- const lastRowIndex = tableRowCount - 1;
- const selectedRowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( selectedCells );
- const areAllRowsSelected = selectedRowIndexes.first === 0 && selectedRowIndexes.last === lastRowIndex;
- // Disallow selecting whole table -> delete whole table should be used instead.
- this.isEnabled = !areAllRowsSelected;
- } else {
- this.isEnabled = false;
- }
- }
- /**
- * @inheritDoc
- */
- execute() {
- const model = this.editor.model;
- const tableUtils = this.editor.plugins.get( 'TableUtils' );
- const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( model.document.selection );
- const removedRowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( referenceCells );
- const firstCell = referenceCells[ 0 ];
- const table = firstCell.findAncestor( 'table' );
- const columnIndexToFocus = tableUtils.getCellLocation( firstCell ).column;
- model.change( writer => {
- const rowsToRemove = removedRowIndexes.last - removedRowIndexes.first + 1;
- tableUtils.removeRows( table, {
- at: removedRowIndexes.first,
- rows: rowsToRemove
- } );
- const cellToFocus = getCellToFocus( table, removedRowIndexes.first, columnIndexToFocus, tableUtils.getRows( table ) );
- writer.setSelection( writer.createPositionAt( cellToFocus, 0 ) );
- } );
- }
- }
- // Returns a cell that should be focused before removing the row, belonging to the same column as the currently focused cell.
- // * If the row was not the last one, the cell to focus will be in the row that followed it (before removal).
- // * If the row was the last one, the cell to focus will be in the row that preceded it (before removal).
- function getCellToFocus( table, removedRowIndex, columnToFocus, tableRowCount ) {
- // Don't go beyond last row's index.
- const row = table.getChild( Math.min( removedRowIndex, tableRowCount - 1 ) );
- // Default to first table cell.
- let cellToFocus = row.getChild( 0 );
- let column = 0;
- for ( const tableCell of row.getChildren() ) {
- if ( column > columnToFocus ) {
- return cellToFocus;
- }
- cellToFocus = tableCell;
- column += parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
- }
- return cellToFocus;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectColumnCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/commands/selectcolumncommand
- */
- /**
- * The select column command.
- *
- * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableColumn'` editor command.
- *
- * To select the columns containing the selected cells, execute the command:
- *
- * editor.execute( 'selectTableColumn' );
- *
- * @extends module:core/command~Command
- */
- class SelectColumnCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
- this.isEnabled = selectedCells.length > 0;
- }
- /**
- * @inheritDoc
- */
- execute() {
- const model = this.editor.model;
- const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
- const firstCell = referenceCells[ 0 ];
- const lastCell = referenceCells.pop();
- const table = firstCell.findAncestor( 'table' );
- const tableUtils = this.editor.plugins.get( 'TableUtils' );
- const startLocation = tableUtils.getCellLocation( firstCell );
- const endLocation = tableUtils.getCellLocation( lastCell );
- const startColumn = Math.min( startLocation.column, endLocation.column );
- const endColumn = Math.max( startLocation.column, endLocation.column );
- const rangesToSelect = [];
- for ( const cellInfo of new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { startColumn, endColumn } ) ) {
- rangesToSelect.push( model.createRangeOn( cellInfo.cell ) );
- }
- model.change( writer => {
- writer.setSelection( rangesToSelect );
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectRowCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/commands/selectrowcommand
- */
- /**
- * The select row command.
- *
- * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableRow'` editor command.
- *
- * To select the rows containing the selected cells, execute the command:
- *
- * editor.execute( 'selectTableRow' );
- *
- * @extends module:core/command~Command
- */
- class SelectRowCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
- this.isEnabled = selectedCells.length > 0;
- }
- /**
- * @inheritDoc
- */
- execute() {
- const model = this.editor.model;
- const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( model.document.selection );
- const rowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( referenceCells );
- const table = referenceCells[ 0 ].findAncestor( 'table' );
- const rangesToSelect = [];
- for ( let rowIndex = rowIndexes.first; rowIndex <= rowIndexes.last; rowIndex++ ) {
- for ( const cell of table.getChild( rowIndex ).getChildren() ) {
- rangesToSelect.push( model.createRangeOn( cell ) );
- }
- }
- model.change( writer => {
- writer.setSelection( rangesToSelect );
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js ***!
- \***************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SetHeaderColumnCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/commands/setheadercolumncommand
- */
- /**
- * The header column command.
- *
- * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
- *
- * You can make the column containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element)
- * by executing:
- *
- * editor.execute( 'setTableColumnHeader' );
- *
- * **Note:** All preceding columns will also become headers. If the current column is already a header, executing this command
- * will make it a regular column back again (including the following columns).
- *
- * @extends module:core/command~Command
- */
- class SetHeaderColumnCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const model = this.editor.model;
- const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
- const tableUtils = this.editor.plugins.get( 'TableUtils' );
- const isInTable = selectedCells.length > 0;
- this.isEnabled = isInTable;
- /**
- * Flag indicating whether the command is active. The command is active when the
- * {@link module:engine/model/selection~Selection} is in a header column.
- *
- * @observable
- * @readonly
- * @member {Boolean} #value
- */
- this.value = isInTable && selectedCells.every( cell => Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["isHeadingColumnCell"])( tableUtils, cell ) );
- }
- /**
- * Executes the command.
- *
- * When the selection is in a non-header column, the command will set the `headingColumns` table attribute to cover that column.
- *
- * When the selection is already in a header column, it will set `headingColumns` so the heading section will end before that column.
- *
- * @fires execute
- * @param {Object} [options]
- * @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) the header columns according to
- * the `forceValue` parameter instead of the current model state.
- */
- execute( options = {} ) {
- if ( options.forceValue === this.value ) {
- return;
- }
- const model = this.editor.model;
- const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
- const table = selectedCells[ 0 ].findAncestor( 'table' );
- const { first, last } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getColumnIndexes"])( selectedCells );
- const headingColumnsToSet = this.value ? first : last + 1;
- model.change( writer => {
- if ( headingColumnsToSet ) {
- // Changing heading columns requires to check if any of a heading cell is overlapping horizontally the table head.
- // Any table cell that has a colspan attribute > 1 will not exceed the table head so we need to fix it in columns before.
- const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["getHorizontallyOverlappingCells"])( table, headingColumnsToSet );
- for ( const { cell, column } of overlappingCells ) {
- Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["splitVertically"])( cell, column, headingColumnsToSet, writer );
- }
- }
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingColumns', headingColumnsToSet, table, writer, 0 );
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SetHeaderRowCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/commands/setheaderrowcommand
- */
- /**
- * The header row command.
- *
- * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
- *
- * You can make the row containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element) by executing:
- *
- * editor.execute( 'setTableRowHeader' );
- *
- * **Note:** All preceding rows will also become headers. If the current row is already a header, executing this command
- * will make it a regular row back again (including the following rows).
- *
- * @extends module:core/command~Command
- */
- class SetHeaderRowCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * @inheritDoc
- */
- refresh() {
- const model = this.editor.model;
- const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
- const isInTable = selectedCells.length > 0;
- this.isEnabled = isInTable;
- /**
- * Flag indicating whether the command is active. The command is active when the
- * {@link module:engine/model/selection~Selection} is in a header row.
- *
- * @observable
- * @readonly
- * @member {Boolean} #value
- */
- this.value = isInTable && selectedCells.every( cell => this._isInHeading( cell, cell.parent.parent ) );
- }
- /**
- * Executes the command.
- *
- * When the selection is in a non-header row, the command will set the `headingRows` table attribute to cover that row.
- *
- * When the selection is already in a header row, it will set `headingRows` so the heading section will end before that row.
- *
- * @fires execute
- * @param {Object} options
- * @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) the header rows according to
- * the `forceValue` parameter instead of the current model state.
- */
- execute( options = {} ) {
- if ( options.forceValue === this.value ) {
- return;
- }
- const model = this.editor.model;
- const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
- const table = selectedCells[ 0 ].findAncestor( 'table' );
- const { first, last } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getRowIndexes"])( selectedCells );
- const headingRowsToSet = this.value ? first : last + 1;
- const currentHeadingRows = table.getAttribute( 'headingRows' ) || 0;
- model.change( writer => {
- if ( headingRowsToSet ) {
- // Changing heading rows requires to check if any of a heading cell is overlapping vertically the table head.
- // Any table cell that has a rowspan attribute > 1 will not exceed the table head so we need to fix it in rows below.
- const startRow = headingRowsToSet > currentHeadingRows ? currentHeadingRows : 0;
- const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["getVerticallyOverlappingCells"])( table, headingRowsToSet, startRow );
- for ( const { cell } of overlappingCells ) {
- Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["splitHorizontally"])( cell, headingRowsToSet, writer );
- }
- }
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingRows', headingRowsToSet, table, writer, 0 );
- } );
- }
- /**
- * Checks if a table cell is in the heading section.
- *
- * @param {module:engine/model/element~Element} tableCell
- * @param {module:engine/model/element~Element} table
- * @returns {Boolean}
- * @private
- */
- _isInHeading( tableCell, table ) {
- const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
- return !!headingRows && tableCell.parent.index < headingRows;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SplitCellCommand; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/commands/splitcellcommand
- */
- /**
- * The split cell command.
- *
- * The command is registered by {@link module:table/tableediting~TableEditing} as the `'splitTableCellVertically'`
- * and `'splitTableCellHorizontally'` editor commands.
- *
- * You can split any cell vertically or horizontally by executing this command. For example, to split the selected table cell vertically:
- *
- * editor.execute( 'splitTableCellVertically' );
- *
- * @extends module:core/command~Command
- */
- class SplitCellCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
- /**
- * Creates a new `SplitCellCommand` instance.
- *
- * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
- * @param {Object} options
- * @param {String} options.direction Indicates whether the command should split cells `'horizontally'` or `'vertically'`.
- */
- constructor( editor, options = {} ) {
- super( editor );
- /**
- * The direction that indicates which cell will be split.
- *
- * @readonly
- * @member {String} #direction
- */
- this.direction = options.direction || 'horizontally';
- }
- /**
- * @inheritDoc
- */
- refresh() {
- const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
- this.isEnabled = selectedCells.length === 1;
- }
- /**
- * @inheritDoc
- */
- execute() {
- const tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection )[ 0 ];
- const isHorizontal = this.direction === 'horizontally';
- const tableUtils = this.editor.plugins.get( 'TableUtils' );
- if ( isHorizontal ) {
- tableUtils.splitCellHorizontally( tableCell, 2 );
- } else {
- tableUtils.splitCellVertically( tableCell, 2 );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js ***!
- \***************************************************************************/
- /*! exports provided: downcastInsertTable, downcastInsertRow, downcastInsertCell, downcastTableHeadingColumnsChange, downcastRemoveRow, convertParagraphInTableCell, isSingleParagraphWithoutAttributes */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastInsertTable", function() { return downcastInsertTable; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastInsertRow", function() { return downcastInsertRow; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastInsertCell", function() { return downcastInsertCell; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastTableHeadingColumnsChange", function() { return downcastTableHeadingColumnsChange; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastRemoveRow", function() { return downcastRemoveRow; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertParagraphInTableCell", function() { return convertParagraphInTableCell; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSingleParagraphWithoutAttributes", function() { return isSingleParagraphWithoutAttributes; });
- /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/converters/downcast
- */
- /**
- * Model table element to view table element conversion helper.
- *
- * This conversion helper creates the whole table element with child elements.
- *
- * @param {Object} options
- * @param {Boolean} options.asWidget If set to `true`, the downcast conversion will produce a widget.
- * @returns {Function} Conversion helper.
- */
- function downcastInsertTable( options = {} ) {
- return dispatcher => dispatcher.on( 'insert:table', ( evt, data, conversionApi ) => {
- const table = data.item;
- if ( !conversionApi.consumable.consume( table, 'insert' ) ) {
- return;
- }
- // Consume attributes if present to not fire attribute change downcast
- conversionApi.consumable.consume( table, 'attribute:headingRows:table' );
- conversionApi.consumable.consume( table, 'attribute:headingColumns:table' );
- const asWidget = options && options.asWidget;
- const figureElement = conversionApi.writer.createContainerElement( 'figure', { class: 'table' } );
- const tableElement = conversionApi.writer.createContainerElement( 'table' );
- conversionApi.writer.insert( conversionApi.writer.createPositionAt( figureElement, 0 ), tableElement );
- let tableWidget;
- if ( asWidget ) {
- tableWidget = toTableWidget( figureElement, conversionApi.writer );
- }
- const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table );
- const tableAttributes = {
- headingRows: table.getAttribute( 'headingRows' ) || 0,
- headingColumns: table.getAttribute( 'headingColumns' ) || 0
- };
- // Cache for created table rows.
- const viewRows = new Map();
- for ( const tableSlot of tableWalker ) {
- const { row, cell } = tableSlot;
- const tableRow = table.getChild( row );
- const trElement = viewRows.get( row ) || createTr( tableElement, tableRow, row, tableAttributes, conversionApi );
- viewRows.set( row, trElement );
- // Consume table cell - it will be always consumed as we convert whole table at once.
- conversionApi.consumable.consume( cell, 'insert' );
- const insertPosition = conversionApi.writer.createPositionAt( trElement, 'end' );
- createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, options );
- }
- // Insert empty TR elements if there are any rows without anchored cells. Since the model is always normalized
- // this can happen only in the document fragment that only part of the table is down-casted.
- for ( const tableRow of table.getChildren() ) {
- const rowIndex = tableRow.index;
- // Make sure that this is a table row and not some other element (i.e., caption).
- if ( tableRow.is( 'element', 'tableRow' ) && !viewRows.has( rowIndex ) ) {
- viewRows.set( rowIndex, createTr( tableElement, tableRow, rowIndex, tableAttributes, conversionApi ) );
- }
- }
- const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
- conversionApi.mapper.bindElements( table, asWidget ? tableWidget : figureElement );
- conversionApi.writer.insert( viewPosition, asWidget ? tableWidget : figureElement );
- } );
- }
- /**
- * Model row element to view `<tr>` element conversion helper.
- *
- * This conversion helper creates the whole `<tr>` element with child elements.
- *
- * @returns {Function} Conversion helper.
- */
- function downcastInsertRow() {
- return dispatcher => dispatcher.on( 'insert:tableRow', ( evt, data, conversionApi ) => {
- const tableRow = data.item;
- if ( !conversionApi.consumable.consume( tableRow, 'insert' ) ) {
- return;
- }
- const table = tableRow.parent;
- const figureElement = conversionApi.mapper.toViewElement( table );
- const tableElement = getViewTable( figureElement );
- const row = table.getChildIndex( tableRow );
- const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { row } );
- const tableAttributes = {
- headingRows: table.getAttribute( 'headingRows' ) || 0,
- headingColumns: table.getAttribute( 'headingColumns' ) || 0
- };
- // Cache for created table rows.
- const viewRows = new Map();
- for ( const tableSlot of tableWalker ) {
- const trElement = viewRows.get( row ) || createTr( tableElement, tableRow, row, tableAttributes, conversionApi );
- viewRows.set( row, trElement );
- // Consume table cell - it will be always consumed as we convert whole row at once.
- conversionApi.consumable.consume( tableSlot.cell, 'insert' );
- const insertPosition = conversionApi.writer.createPositionAt( trElement, 'end' );
- createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, { asWidget: true } );
- }
- } );
- }
- /**
- * Model table cell element to view `<td>` or `<th>` element conversion helper.
- *
- * This conversion helper will create proper `<th>` elements for table cells that are in the heading section (heading row or column)
- * and `<td>` otherwise.
- *
- * @returns {Function} Conversion helper.
- */
- function downcastInsertCell() {
- return dispatcher => dispatcher.on( 'insert:tableCell', ( evt, data, conversionApi ) => {
- const tableCell = data.item;
- if ( !conversionApi.consumable.consume( tableCell, 'insert' ) ) {
- return;
- }
- const tableRow = tableCell.parent;
- const table = tableRow.parent;
- const rowIndex = table.getChildIndex( tableRow );
- const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { row: rowIndex } );
- const tableAttributes = {
- headingRows: table.getAttribute( 'headingRows' ) || 0,
- headingColumns: table.getAttribute( 'headingColumns' ) || 0
- };
- // We need to iterate over a table in order to get proper row & column values from a walker
- for ( const tableSlot of tableWalker ) {
- if ( tableSlot.cell === tableCell ) {
- const trElement = conversionApi.mapper.toViewElement( tableRow );
- const insertPosition = conversionApi.writer.createPositionAt( trElement, tableRow.getChildIndex( tableCell ) );
- createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, { asWidget: true } );
- // No need to iterate further.
- return;
- }
- }
- } );
- }
- /**
- * Conversion helper that acts on heading column table attribute change.
- *
- * Depending on changed attributes this converter will rename `<td` to `<th>` elements or vice versa depending on the cell column index.
- *
- * @returns {Function} Conversion helper.
- */
- function downcastTableHeadingColumnsChange() {
- return dispatcher => dispatcher.on( 'attribute:headingColumns:table', ( evt, data, conversionApi ) => {
- const table = data.item;
- if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
- return;
- }
- const tableAttributes = {
- headingRows: table.getAttribute( 'headingRows' ) || 0,
- headingColumns: table.getAttribute( 'headingColumns' ) || 0
- };
- const oldColumns = data.attributeOldValue;
- const newColumns = data.attributeNewValue;
- const lastColumnToCheck = ( oldColumns > newColumns ? oldColumns : newColumns ) - 1;
- for ( const tableSlot of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { endColumn: lastColumnToCheck } ) ) {
- renameViewTableCellIfRequired( tableSlot, tableAttributes, conversionApi );
- }
- } );
- }
- /**
- * Conversion helper that acts on a removed row.
- *
- * @returns {Function} Conversion helper.
- */
- function downcastRemoveRow() {
- return dispatcher => dispatcher.on( 'remove:tableRow', ( evt, data, conversionApi ) => {
- // Prevent default remove converter.
- evt.stop();
- const viewWriter = conversionApi.writer;
- const mapper = conversionApi.mapper;
- const viewStart = mapper.toViewPosition( data.position ).getLastMatchingPosition( value => !value.item.is( 'element', 'tr' ) );
- const viewItem = viewStart.nodeAfter;
- const tableSection = viewItem.parent;
- const viewTable = tableSection.parent;
- // Remove associated <tr> from the view.
- const removeRange = viewWriter.createRangeOn( viewItem );
- const removed = viewWriter.remove( removeRange );
- for ( const child of viewWriter.createRangeIn( removed ).getItems() ) {
- mapper.unbindViewElement( child );
- }
- // Cleanup: Ensure that thead & tbody sections are removed if left empty after removing rows. See #6437, #6391.
- removeTableSectionIfEmpty( 'thead', viewTable, conversionApi );
- removeTableSectionIfEmpty( 'tbody', viewTable, conversionApi );
- }, { priority: 'higher' } );
- }
- /**
- * Overrides paragraph inside table cell conversion.
- *
- * This converter:
- * * should be used to override default paragraph conversion in the editing view.
- * * It will only convert <paragraph> placed directly inside <tableCell>.
- * * For a single paragraph without attributes it returns `<span>` to simulate data table.
- * * For all other cases it returns `<p>` element.
- *
- * @param {module:engine/model/element~Element} modelElement
- * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
- * @returns {module:engine/view/containerelement~ContainerElement|undefined}
- */
- function convertParagraphInTableCell( modelElement, conversionApi ) {
- const { writer } = conversionApi;
- if ( !modelElement.parent.is( 'element', 'tableCell' ) ) {
- return;
- }
- if ( isSingleParagraphWithoutAttributes( modelElement ) ) {
- // Use display:inline-block to force Chrome/Safari to limit text mutations to this element.
- // See #6062.
- return writer.createContainerElement( 'span', { style: 'display:inline-block' } );
- } else {
- return writer.createContainerElement( 'p' );
- }
- }
- /**
- * Checks if given model `<paragraph>` is an only child of a parent (`<tableCell>`) and if it has any attribute set.
- *
- * The paragraph should be converted in the editing view to:
- *
- * * If returned `true` - to a `<span style="display:inline-block">`
- * * If returned `false` - to a `<p>`
- *
- * @param {module:engine/model/element~Element} modelElement
- * @returns {Boolean}
- */
- function isSingleParagraphWithoutAttributes( modelElement ) {
- const tableCell = modelElement.parent;
- const isSingleParagraph = tableCell.childCount === 1;
- return isSingleParagraph && !hasAnyAttribute( modelElement );
- }
- // Converts a given {@link module:engine/view/element~Element} to a table widget:
- // * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the table widget element.
- // * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
- //
- // @param {module:engine/view/element~Element} viewElement
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer An instance of the view writer.
- // @param {String} label The element's label. It will be concatenated with the table `alt` attribute if one is present.
- // @returns {module:engine/view/element~Element}
- function toTableWidget( viewElement, writer ) {
- writer.setCustomProperty( 'table', true, viewElement );
- return Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["toWidget"])( viewElement, writer, { hasSelectionHandle: true } );
- }
- // Renames an existing table cell in the view to a given element name.
- //
- // **Note** This method will not do anything if a view table cell has not been converted yet.
- //
- // @param {module:engine/model/element~Element} tableCell
- // @param {String} desiredCellElementName
- // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
- function renameViewTableCell( tableCell, desiredCellElementName, conversionApi ) {
- const viewWriter = conversionApi.writer;
- const viewCell = conversionApi.mapper.toViewElement( tableCell );
- const editable = viewWriter.createEditableElement( desiredCellElementName, viewCell.getAttributes() );
- const renamedCell = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["toWidgetEditable"])( editable, viewWriter );
- Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["setHighlightHandling"])(
- renamedCell,
- viewWriter,
- ( element, descriptor, writer ) => writer.addClass( Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toArray"])( descriptor.classes ), element ),
- ( element, descriptor, writer ) => writer.removeClass( Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toArray"])( descriptor.classes ), element )
- );
- viewWriter.insert( viewWriter.createPositionAfter( viewCell ), renamedCell );
- viewWriter.move( viewWriter.createRangeIn( viewCell ), viewWriter.createPositionAt( renamedCell, 0 ) );
- viewWriter.remove( viewWriter.createRangeOn( viewCell ) );
- conversionApi.mapper.unbindViewElement( viewCell );
- conversionApi.mapper.bindElements( tableCell, renamedCell );
- }
- // Renames a table cell element in the view according to its location in the table.
- //
- // @param {module:table/tablewalker~TableSlot} tableSlot
- // @param {{headingColumns, headingRows}} tableAttributes
- // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
- function renameViewTableCellIfRequired( tableSlot, tableAttributes, conversionApi ) {
- const { cell } = tableSlot;
- // Check whether current columnIndex is overlapped by table cells from previous rows.
- const desiredCellElementName = getCellElementName( tableSlot, tableAttributes );
- const viewCell = conversionApi.mapper.toViewElement( cell );
- // If in single change we're converting attribute changes and inserting cell the table cell might not be inserted into view
- // because of child conversion is done after parent.
- if ( viewCell && viewCell.name !== desiredCellElementName ) {
- renameViewTableCell( cell, desiredCellElementName, conversionApi );
- }
- }
- // Creates a table cell element in the view.
- //
- // @param {module:table/tablewalker~TableSlot} tableSlot
- // @param {module:engine/view/position~Position} insertPosition
- // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
- function createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, options ) {
- const asWidget = options && options.asWidget;
- const cellElementName = getCellElementName( tableSlot, tableAttributes );
- const cellElement = asWidget ?
- Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["toWidgetEditable"])( conversionApi.writer.createEditableElement( cellElementName ), conversionApi.writer ) :
- conversionApi.writer.createContainerElement( cellElementName );
- if ( asWidget ) {
- Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["setHighlightHandling"])(
- cellElement,
- conversionApi.writer,
- ( element, descriptor, writer ) => writer.addClass( Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toArray"])( descriptor.classes ), element ),
- ( element, descriptor, writer ) => writer.removeClass( Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toArray"])( descriptor.classes ), element )
- );
- }
- const tableCell = tableSlot.cell;
- const firstChild = tableCell.getChild( 0 );
- const isSingleParagraph = tableCell.childCount === 1 && firstChild.name === 'paragraph';
- conversionApi.writer.insert( insertPosition, cellElement );
- conversionApi.mapper.bindElements( tableCell, cellElement );
- // Additional requirement for data pipeline to have backward compatible data tables.
- if ( !asWidget && isSingleParagraph && !hasAnyAttribute( firstChild ) ) {
- const innerParagraph = tableCell.getChild( 0 );
- conversionApi.consumable.consume( innerParagraph, 'insert' );
- conversionApi.mapper.bindElements( innerParagraph, cellElement );
- }
- }
- // Creates a `<tr>` view element.
- //
- // @param {module:engine/view/element~Element} tableElement
- // @param {module:engine/model/element~Element} tableRow
- // @param {Number} rowIndex
- // @param {{headingColumns, headingRows}} tableAttributes
- // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
- // @returns {module:engine/view/element~Element}
- function createTr( tableElement, tableRow, rowIndex, tableAttributes, conversionApi ) {
- // Will always consume since we're converting <tableRow> element from a parent <table>.
- conversionApi.consumable.consume( tableRow, 'insert' );
- const trElement = tableRow.isEmpty ?
- conversionApi.writer.createEmptyElement( 'tr' ) :
- conversionApi.writer.createContainerElement( 'tr' );
- conversionApi.mapper.bindElements( tableRow, trElement );
- const headingRows = tableAttributes.headingRows;
- const tableSection = getOrCreateTableSection( getSectionName( rowIndex, tableAttributes ), tableElement, conversionApi );
- const offset = headingRows > 0 && rowIndex >= headingRows ? rowIndex - headingRows : rowIndex;
- const position = conversionApi.writer.createPositionAt( tableSection, offset );
- conversionApi.writer.insert( position, trElement );
- return trElement;
- }
- // Returns `th` for heading cells and `td` for other cells for the current table walker value.
- //
- // @param {module:table/tablewalker~TableSlot} tableSlot
- // @param {{headingColumns, headingRows}} tableAttributes
- // @returns {String}
- function getCellElementName( tableSlot, tableAttributes ) {
- const { row, column } = tableSlot;
- const { headingColumns, headingRows } = tableAttributes;
- // Column heading are all tableCells in the first `columnHeading` rows.
- const isColumnHeading = headingRows && headingRows > row;
- // So a whole row gets <th> element.
- if ( isColumnHeading ) {
- return 'th';
- }
- // Row heading are tableCells which columnIndex is lower then headingColumns.
- const isRowHeading = headingColumns && headingColumns > column;
- return isRowHeading ? 'th' : 'td';
- }
- // Returns the table section name for the current table walker value.
- //
- // @param {Number} row
- // @param {{headingColumns, headingRows}} tableAttributes
- // @returns {String}
- function getSectionName( row, tableAttributes ) {
- return row < tableAttributes.headingRows ? 'thead' : 'tbody';
- }
- // Creates or returns an existing `<tbody>` or `<thead>` element with caching.
- //
- // @param {String} sectionName
- // @param {module:engine/view/element~Element} viewTable
- // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
- // @param {Object} cachedTableSection An object that stores cached elements.
- // @returns {module:engine/view/containerelement~ContainerElement}
- function getOrCreateTableSection( sectionName, viewTable, conversionApi ) {
- const viewTableSection = getExistingTableSectionElement( sectionName, viewTable );
- return viewTableSection ? viewTableSection : createTableSection( sectionName, viewTable, conversionApi );
- }
- // Finds an existing `<tbody>` or `<thead>` element or returns undefined.
- //
- // @param {String} sectionName
- // @param {module:engine/view/element~Element} tableElement
- // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
- function getExistingTableSectionElement( sectionName, tableElement ) {
- for ( const tableSection of tableElement.getChildren() ) {
- if ( tableSection.name == sectionName ) {
- return tableSection;
- }
- }
- }
- // Creates a table section at the end of the table.
- //
- // @param {String} sectionName
- // @param {module:engine/view/element~Element} tableElement
- // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
- // @returns {module:engine/view/containerelement~ContainerElement}
- function createTableSection( sectionName, tableElement, conversionApi ) {
- const tableChildElement = conversionApi.writer.createContainerElement( sectionName );
- const insertPosition = conversionApi.writer.createPositionAt( tableElement, sectionName == 'tbody' ? 'end' : 0 );
- conversionApi.writer.insert( insertPosition, tableChildElement );
- return tableChildElement;
- }
- // Removes an existing `<tbody>` or `<thead>` element if it is empty.
- //
- // @param {String} sectionName
- // @param {module:engine/view/element~Element} tableElement
- // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
- function removeTableSectionIfEmpty( sectionName, tableElement, conversionApi ) {
- const tableSection = getExistingTableSectionElement( sectionName, tableElement );
- if ( tableSection && tableSection.childCount === 0 ) {
- conversionApi.writer.remove( conversionApi.writer.createRangeOn( tableSection ) );
- }
- }
- // Finds a '<table>' element inside the `<figure>` widget.
- //
- // @param {module:engine/view/element~Element} viewFigure
- function getViewTable( viewFigure ) {
- for ( const child of viewFigure.getChildren() ) {
- if ( child.name === 'table' ) {
- return child;
- }
- }
- }
- // Checks if an element has any attributes set.
- //
- // @param {module:engine/model/element~Element element
- // @returns {Boolean}
- function hasAnyAttribute( element ) {
- return !![ ...element.getAttributeKeys() ].length;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js":
- /*!**************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js ***!
- \**************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableCellParagraphPostFixer; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/converters/table-cell-paragraph-post-fixer
- */
- /**
- * Injects a table cell post-fixer into the model which inserts a `paragraph` element into empty table cells.
- *
- * A table cell must contain at least one block element as a child. An empty table cell will have an empty `paragraph` as a child.
- *
- * <table>
- * <tableRow>
- * <tableCell></tableCell>
- * </tableRow>
- * </table>
- *
- * Will be fixed to:
- *
- * <table>
- * <tableRow>
- * <tableCell><paragraph></paragraph></tableCell>
- * </tableRow>
- * </table>
- *
- * @param {module:engine/model/model~Model} model
- */
- function injectTableCellParagraphPostFixer( model ) {
- model.document.registerPostFixer( writer => tableCellContentsPostFixer( writer, model ) );
- }
- // The table cell contents post-fixer.
- //
- // @param {module:engine/model/writer~Writer} writer
- // @param {module:engine/model/model~Model} model
- function tableCellContentsPostFixer( writer, model ) {
- const changes = model.document.differ.getChanges();
- let wasFixed = false;
- for ( const entry of changes ) {
- if ( entry.type == 'insert' && entry.name == 'table' ) {
- wasFixed = fixTable( entry.position.nodeAfter, writer ) || wasFixed;
- }
- if ( entry.type == 'insert' && entry.name == 'tableRow' ) {
- wasFixed = fixTableRow( entry.position.nodeAfter, writer ) || wasFixed;
- }
- if ( entry.type == 'insert' && entry.name == 'tableCell' ) {
- wasFixed = fixTableCellContent( entry.position.nodeAfter, writer ) || wasFixed;
- }
- if ( checkTableCellChange( entry ) ) {
- wasFixed = fixTableCellContent( entry.position.parent, writer ) || wasFixed;
- }
- }
- return wasFixed;
- }
- // Fixes all table cells in a table.
- //
- // @param {module:engine/model/element~Element} table
- // @param {module:engine/model/writer~Writer} writer
- function fixTable( table, writer ) {
- let wasFixed = false;
- for ( const row of table.getChildren() ) {
- if ( row.is( 'element', 'tableRow' ) ) {
- wasFixed = fixTableRow( row, writer ) || wasFixed;
- }
- }
- return wasFixed;
- }
- // Fixes all table cells in a table row.
- //
- // @param {module:engine/model/element~Element} tableRow
- // @param {module:engine/model/writer~Writer} writer
- function fixTableRow( tableRow, writer ) {
- let wasFixed = false;
- for ( const tableCell of tableRow.getChildren() ) {
- wasFixed = fixTableCellContent( tableCell, writer ) || wasFixed;
- }
- return wasFixed;
- }
- // Fixes all table cell content by:
- // - Adding a paragraph to a table cell without any child.
- // - Wrapping direct $text in a `<paragraph>`.
- //
- // @param {module:engine/model/element~Element} table
- // @param {module:engine/model/writer~Writer} writer
- // @returns {Boolean}
- function fixTableCellContent( tableCell, writer ) {
- // Insert paragraph to an empty table cell.
- if ( tableCell.childCount == 0 ) {
- // @if CK_DEBUG_TABLE // console.log( 'Post-fixing table: insert paragraph in empty cell.' );
- writer.insertElement( 'paragraph', tableCell );
- return true;
- }
- // Check table cell children for directly placed text nodes.
- // Temporary solution. See https://github.com/ckeditor/ckeditor5/issues/1464.
- const textNodes = Array.from( tableCell.getChildren() ).filter( child => child.is( '$text' ) );
- // @if CK_DEBUG_TABLE // textNodes.length && console.log( 'Post-fixing table: wrap cell content with paragraph.' );
- for ( const child of textNodes ) {
- writer.wrap( writer.createRangeOn( child ), 'paragraph' );
- }
- // Return true when there were text nodes to fix.
- return !!textNodes.length;
- }
- // Checks if a differ change should fix the table cell. This happens on:
- // - Removing content from the table cell (i.e. `tableCell` can be left empty).
- // - Adding a text node directly into a table cell.
- //
- // @param {Object} differ change entry
- // @returns {Boolean}
- function checkTableCellChange( entry ) {
- if ( !entry.position || !entry.position.parent.is( 'element', 'tableCell' ) ) {
- return false;
- }
- return entry.type == 'insert' && entry.name == '$text' || entry.type == 'remove';
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js":
- /*!************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js ***!
- \************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableCellRefreshPostFixer; });
- /* harmony import */ var _downcast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./downcast */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/converters/table-cell-refresh-post-fixer
- */
- /**
- * Injects a table cell post-fixer into the model which marks the table cell in the differ to have it re-rendered.
- *
- * Model `paragraph` inside a table cell can be rendered as `<span>` or `<p>`. It is rendered as `<span>` if this is the only block
- * element in that table cell and it does not have any attributes. It is rendered as `<p>` otherwise.
- *
- * When table cell content changes, for example a second `paragraph` element is added, we need to ensure that the first `paragraph` is
- * re-rendered so it changes from `<span>` to `<p>`. The easiest way to do it is to re-render the entire table cell.
- *
- * @param {module:engine/model/model~Model} model
- * @param {module:engine/conversion/mapper~Mapper} mapper
- */
- function injectTableCellRefreshPostFixer( model, mapper ) {
- model.document.registerPostFixer( () => tableCellRefreshPostFixer( model.document.differ, mapper ) );
- }
- function tableCellRefreshPostFixer( differ, mapper ) {
- // Stores cells to be refreshed, so the table cell will be refreshed once for multiple changes.
- // 1. Gather all changes inside table cell.
- const cellsToCheck = new Set();
- for ( const change of differ.getChanges() ) {
- const parent = change.type == 'attribute' ? change.range.start.parent : change.position.parent;
- if ( parent.is( 'element', 'tableCell' ) ) {
- cellsToCheck.add( parent );
- }
- }
- // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: Checking table cell to refresh (${ cellsToCheck.size }).` );
- // @if CK_DEBUG_TABLE // let paragraphsRefreshed = 0;
- for ( const tableCell of cellsToCheck.values() ) {
- for ( const paragraph of [ ...tableCell.getChildren() ].filter( child => shouldRefresh( child, mapper ) ) ) {
- // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: refreshing paragraph in table cell (${++paragraphsRefreshed}).` );
- differ.refreshItem( paragraph );
- }
- }
- // Always return false to prevent the refresh post-fixer from re-running on the same set of changes and going into an infinite loop.
- // This "post-fixer" does not change the model structure so there shouldn't be need to run other post-fixers again.
- // See https://github.com/ckeditor/ckeditor5/issues/1936 & https://github.com/ckeditor/ckeditor5/issues/8200.
- return false;
- }
- // Check if given model element needs refreshing.
- //
- // @param {module:engine/model/element~Element} modelElement
- // @param {module:engine/conversion/mapper~Mapper} mapper
- // @returns {Boolean}
- function shouldRefresh( child, mapper ) {
- if ( !child.is( 'element', 'paragraph' ) ) {
- return false;
- }
- const viewElement = mapper.toViewElement( child );
- if ( !viewElement ) {
- return false;
- }
- return Object(_downcast__WEBPACK_IMPORTED_MODULE_0__["isSingleParagraphWithoutAttributes"])( child ) !== viewElement.is( 'element', 'span' );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-heading-rows-refresh-post-fixer.js":
- /*!********************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-heading-rows-refresh-post-fixer.js ***!
- \********************************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableHeadingRowsRefreshPostFixer; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/converters/table-heading-rows-refresh-post-fixer
- */
- /**
- * Injects a table post-fixer into the model which marks the table in the differ to have it re-rendered.
- *
- * Table heading rows are represented in the model by a `headingRows` attribute. However, in the view, it's represented as separate
- * sections of the table (`<thead>` or `<tbody>`) and changing `headingRows` attribute requires moving table rows between two sections.
- * This causes problems with structural changes in a table (like adding and removing rows) thus atomic converters cannot be used.
- *
- * When table `headingRows` attribute changes, the entire table is re-rendered.
- *
- * @param {module:engine/model/model~Model} model
- */
- function injectTableHeadingRowsRefreshPostFixer( model ) {
- model.document.registerPostFixer( () => tableHeadingRowsRefreshPostFixer( model ) );
- }
- function tableHeadingRowsRefreshPostFixer( model ) {
- const differ = model.document.differ;
- // Stores tables to be refreshed so the table will be refreshed once for multiple changes.
- const tablesToRefresh = new Set();
- for ( const change of differ.getChanges() ) {
- if ( change.type != 'attribute' ) {
- continue;
- }
- const element = change.range.start.nodeAfter;
- if ( element && element.is( 'element', 'table' ) && change.attributeKey == 'headingRows' ) {
- tablesToRefresh.add( element );
- }
- }
- if ( tablesToRefresh.size ) {
- // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: refreshing heading rows (${ tablesToRefresh.size }).` );
- for ( const table of tablesToRefresh.values() ) {
- // Should be handled by a `triggerBy` configuration. See: https://github.com/ckeditor/ckeditor5/issues/8138.
- differ.refreshItem( table );
- }
- return true;
- }
- return false;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js":
- /*!******************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js ***!
- \******************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableLayoutPostFixer; });
- /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
- /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/converters/table-layout-post-fixer
- */
- /**
- * Injects a table layout post-fixer into the model.
- *
- * The role of the table layout post-fixer is to ensure that the table rows have the correct structure
- * after a {@link module:engine/model/model~Model#change `change()`} block was executed.
- *
- * The correct structure means that:
- *
- * * All table rows have the same size.
- * * None of the table cells extend vertically beyond their section (either header or body).
- * * A table cell has always at least one element as a child.
- *
- * If the table structure is not correct, the post-fixer will automatically correct it in two steps:
- *
- * 1. It will clip table cells that extend beyond their section.
- * 2. It will add empty table cells to the rows that are narrower than the widest table row.
- *
- * ## Clipping overlapping table cells
- *
- * Such situation may occur when pasting a table (or a part of a table) to the editor from external sources.
- *
- * For example, see the following table which has a cell (FOO) with the rowspan attribute (2):
- *
- * <table headingRows="1">
- * <tableRow>
- * <tableCell rowspan="2"><paragraph>FOO</paragraph></tableCell>
- * <tableCell colspan="2"><paragraph>BAR</paragraph></tableCell>
- * </tableRow>
- * <tableRow>
- * <tableCell><paragraph>BAZ</paragraph></tableCell>
- * <tableCell><paragraph>XYZ</paragraph></tableCell>
- * </tableRow>
- * </table>
- *
- * It will be rendered in the view as:
- *
- * <table>
- * <thead>
- * <tr>
- * <td rowspan="2">FOO</td>
- * <td colspan="2">BAR</td>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td>BAZ</td>
- * <td>XYZ</td>
- * </tr>
- * </tbody>
- * </table>
- *
- * In the above example the table will be rendered as a table with two rows: one in the header and second one in the body.
- * The table cell (FOO) cannot span over multiple rows as it would extend from the header to the body section.
- * The `rowspan` attribute must be changed to (1). The value (1) is the default value of the `rowspan` attribute
- * so the `rowspan` attribute will be removed from the model.
- *
- * The table cell with BAZ in the content will be in the first column of the table.
- *
- * ## Adding missing table cells
- *
- * The table post-fixer will insert empty table cells to equalize table row sizes (the number of columns).
- * The size of a table row is calculated by counting column spans of table cells, both horizontal (from the same row) and
- * vertical (from the rows above).
- *
- * In the above example, the table row in the body section of the table is narrower then the row from the header: it has two cells
- * with the default colspan (1). The header row has one cell with colspan (1) and the second with colspan (2).
- * The table cell (FOO) does not extend beyond the head section (and as such will be fixed in the first step of this post-fixer).
- * The post-fixer will add a missing table cell to the row in the body section of the table.
- *
- * The table from the above example will be fixed and rendered to the view as below:
- *
- * <table>
- * <thead>
- * <tr>
- * <td rowspan="2">FOO</td>
- * <td colspan="2">BAR</td>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td>BAZ</td>
- * <td>XYZ</td>
- * </tr>
- * </tbody>
- * </table>
- *
- * ## Collaboration and undo - Expectations vs post-fixer results
- *
- * The table post-fixer only ensures proper structure without a deeper analysis of the nature of the change. As such, it might lead
- * to a structure which was not intended by the user. In particular, it will also fix undo steps (in conjunction with collaboration)
- * in which the editor content might not return to the original state.
- *
- * This will usually happen when one or more users change the size of the table.
- *
- * As an example see the table below:
- *
- * <table>
- * <tbody>
- * <tr>
- * <td>11</td>
- * <td>12</td>
- * </tr>
- * <tr>
- * <td>21</td>
- * <td>22</td>
- * </tr>
- * </tbody>
- * </table>
- *
- * and the user actions:
- *
- * 1. Both users have a table with two rows and two columns.
- * 2. User A adds a column at the end of the table. This will insert empty table cells to two rows.
- * 3. User B adds a row at the end of the table. This will insert a row with two empty table cells.
- * 4. Both users will have a table as below:
- *
- *
- * <table>
- * <tbody>
- * <tr>
- * <td>11</td>
- * <td>12</td>
- * <td>(empty, inserted by A)</td>
- * </tr>
- * <tr>
- * <td>21</td>
- * <td>22</td>
- * <td>(empty, inserted by A)</td>
- * </tr>
- * <tr>
- * <td>(empty, inserted by B)</td>
- * <td>(empty, inserted by B)</td>
- * </tr>
- * </tbody>
- * </table>
- *
- * The last row is shorter then others so the table post-fixer will add an empty row to the last row:
- *
- * <table>
- * <tbody>
- * <tr>
- * <td>11</td>
- * <td>12</td>
- * <td>(empty, inserted by A)</td>
- * </tr>
- * <tr>
- * <td>21</td>
- * <td>22</td>
- * <td>(empty, inserted by A)</td>
- * </tr>
- * <tr>
- * <td>(empty, inserted by B)</td>
- * <td>(empty, inserted by B)</td>
- * <td>(empty, inserted by the post-fixer)</td>
- * </tr>
- * </tbody>
- * </table>
- *
- * Unfortunately undo does not know the nature of the changes and depending on which user applies the post-fixer changes, undoing them
- * might lead to a broken table. If User B undoes inserting the column to the table, the undo engine will undo only the operations of
- * inserting empty cells to rows from the initial table state (row 1 and 2) but the cell in the post-fixed row will remain:
- *
- * <table>
- * <tbody>
- * <tr>
- * <td>11</td>
- * <td>12</td>
- * </tr>
- * <tr>
- * <td>21</td>
- * <td>22</td>
- * </tr>
- * <tr>
- * <td>(empty, inserted by B)</td>
- * <td>(empty, inserted by B)</td>
- * <td>(empty, inserted by a post-fixer)</td>
- * </tr>
- * </tbody>
- * </table>
- *
- * After undo, the table post-fixer will detect that two rows are shorter than others and will fix the table to:
- *
- * <table>
- * <tbody>
- * <tr>
- * <td>11</td>
- * <td>12</td>
- * <td>(empty, inserted by a post-fixer after undo)</td>
- * </tr>
- * <tr>
- * <td>21</td>
- * <td>22</td>
- * <td>(empty, inserted by a post-fixer after undo)</td>
- * </tr>
- * <tr>
- * <td>(empty, inserted by B)</td>
- * <td>(empty, inserted by B)</td>
- * <td>(empty, inserted by a post-fixer)</td>
- * </tr>
- * </tbody>
- * </table>
- * @param {module:engine/model/model~Model} model
- */
- function injectTableLayoutPostFixer( model ) {
- model.document.registerPostFixer( writer => tableLayoutPostFixer( writer, model ) );
- }
- // The table layout post-fixer.
- //
- // @param {module:engine/model/writer~Writer} writer
- // @param {module:engine/model/model~Model} model
- function tableLayoutPostFixer( writer, model ) {
- const changes = model.document.differ.getChanges();
- let wasFixed = false;
- // Do not analyze the same table more then once - may happen for multiple changes in the same table.
- const analyzedTables = new Set();
- for ( const entry of changes ) {
- let table;
- if ( entry.name == 'table' && entry.type == 'insert' ) {
- table = entry.position.nodeAfter;
- }
- // Fix table on adding/removing table cells and rows.
- if ( entry.name == 'tableRow' || entry.name == 'tableCell' ) {
- table = entry.position.findAncestor( 'table' );
- }
- // Fix table on any table's attribute change - including attributes of table cells.
- if ( isTableAttributeEntry( entry ) ) {
- table = entry.range.start.findAncestor( 'table' );
- }
- if ( table && !analyzedTables.has( table ) ) {
- // Step 1: correct rowspans of table cells if necessary.
- // The wasFixed flag should be true if any of tables in batch was fixed - might be more then one.
- wasFixed = fixTableCellsRowspan( table, writer ) || wasFixed;
- // Step 2: fix table rows sizes.
- wasFixed = fixTableRowsSizes( table, writer ) || wasFixed;
- analyzedTables.add( table );
- }
- }
- return wasFixed;
- }
- // Fixes the invalid value of the `rowspan` attribute because a table cell cannot vertically extend beyond the table section it belongs to.
- //
- // @param {module:engine/model/element~Element} table
- // @param {module:engine/model/writer~Writer} writer
- // @returns {Boolean} Returns `true` if the table was fixed.
- function fixTableCellsRowspan( table, writer ) {
- let wasFixed = false;
- const cellsToTrim = findCellsToTrim( table );
- if ( cellsToTrim.length ) {
- // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: trimming cells row-spans (${ cellsToTrim.length }).` );
- wasFixed = true;
- for ( const data of cellsToTrim ) {
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'rowspan', data.rowspan, data.cell, writer, 1 );
- }
- }
- return wasFixed;
- }
- // Makes all table rows in a table the same size.
- //
- // @param {module:engine/model/element~Element} table
- // @param {module:engine/model/writer~Writer} writer
- // @returns {Boolean} Returns `true` if the table was fixed.
- function fixTableRowsSizes( table, writer ) {
- let wasFixed = false;
- const childrenLengths = getChildrenLengths( table );
- const rowsToRemove = [];
- // Find empty rows.
- for ( const [ rowIndex, size ] of childrenLengths.entries() ) {
- // Ignore all non-row models.
- if ( !size && table.getChild( rowIndex ).is( 'element', 'tableRow' ) ) {
- rowsToRemove.push( rowIndex );
- }
- }
- // Remove empty rows.
- if ( rowsToRemove.length ) {
- // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: remove empty rows (${ rowsToRemove.length }).` );
- wasFixed = true;
- for ( const rowIndex of rowsToRemove.reverse() ) {
- writer.remove( table.getChild( rowIndex ) );
- childrenLengths.splice( rowIndex, 1 );
- }
- }
- // Filter out everything that's not a table row.
- const rowsLengths = childrenLengths.filter( ( row, rowIndex ) => table.getChild( rowIndex ).is( 'element', 'tableRow' ) );
- // Verify if all the rows have the same number of columns.
- const tableSize = rowsLengths[ 0 ];
- const isValid = rowsLengths.every( length => length === tableSize );
- if ( !isValid ) {
- // @if CK_DEBUG_TABLE // console.log( 'Post-fixing table: adding missing cells.' );
- // Find the maximum number of columns.
- const maxColumns = rowsLengths.reduce( ( prev, current ) => current > prev ? current : prev, 0 );
- for ( const [ rowIndex, size ] of rowsLengths.entries() ) {
- const columnsToInsert = maxColumns - size;
- if ( columnsToInsert ) {
- for ( let i = 0; i < columnsToInsert; i++ ) {
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, writer.createPositionAt( table.getChild( rowIndex ), 'end' ) );
- }
- wasFixed = true;
- }
- }
- }
- return wasFixed;
- }
- // Searches for table cells that extend beyond the table section to which they belong to. It will return an array of objects
- // that stores table cells to be trimmed and the correct value of the `rowspan` attribute to set.
- //
- // @param {module:engine/model/element~Element} table
- // @returns {Array.<{{cell, rowspan}}>}
- function findCellsToTrim( table ) {
- const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
- const maxRows = Array.from( table.getChildren() )
- .reduce( ( count, row ) => row.is( 'element', 'tableRow' ) ? count + 1 : count, 0 );
- const cellsToTrim = [];
- for ( const { row, cell, cellHeight } of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table ) ) {
- // Skip cells that do not expand over its row.
- if ( cellHeight < 2 ) {
- continue;
- }
- const isInHeader = row < headingRows;
- // Row limit is either end of header section or whole table as table body is after the header.
- const rowLimit = isInHeader ? headingRows : maxRows;
- // If table cell expands over its limit reduce it height to proper value.
- if ( row + cellHeight > rowLimit ) {
- const newRowspan = rowLimit - row;
- cellsToTrim.push( { cell, rowspan: newRowspan } );
- }
- }
- return cellsToTrim;
- }
- // Returns an array with lengths of rows assigned to the corresponding row index.
- //
- // @param {module:engine/model/element~Element} table
- // @returns {Array.<Number>}
- function getChildrenLengths( table ) {
- // TableWalker will not provide items for the empty rows, we need to pre-fill this array.
- const lengths = new Array( table.childCount ).fill( 0 );
- for ( const { rowIndex } of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { includeAllSlots: true } ) ) {
- lengths[ rowIndex ]++;
- }
- return lengths;
- }
- // Checks if the differ entry for an attribute change is one of the table's attributes.
- //
- // @param entry
- // @returns {Boolean}
- function isTableAttributeEntry( entry ) {
- const isAttributeType = entry.type === 'attribute';
- const key = entry.attributeKey;
- return isAttributeType && ( key === 'headingRows' || key === 'colspan' || key === 'rowspan' );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js ***!
- \******************************************************************************/
- /*! exports provided: upcastTableFigure, default, skipEmptyTableRow, ensureParagraphInTableCell */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "upcastTableFigure", function() { return upcastTableFigure; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return upcastTable; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipEmptyTableRow", function() { return skipEmptyTableRow; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureParagraphInTableCell", function() { return ensureParagraphInTableCell; });
- /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/converters/upcasttable
- */
- /**
- * Returns a function that converts the table view representation:
- *
- * <figure class="table"><table>...</table></figure>
- *
- * to the model representation:
- *
- * <table></table>
- *
- * @returns {Function}
- */
- function upcastTableFigure() {
- return dispatcher => {
- dispatcher.on( 'element:figure', ( evt, data, conversionApi ) => {
- // Do not convert if this is not a "table figure".
- if ( !conversionApi.consumable.test( data.viewItem, { name: true, classes: 'table' } ) ) {
- return;
- }
- // Find an table element inside the figure element.
- const viewTable = getViewTableFromFigure( data.viewItem );
- // Do not convert if table element is absent or was already converted.
- if ( !viewTable || !conversionApi.consumable.test( viewTable, { name: true } ) ) {
- return;
- }
- // Convert view table to model table.
- const conversionResult = conversionApi.convertItem( viewTable, data.modelCursor );
- // Get table element from conversion result.
- const modelTable = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( conversionResult.modelRange.getItems() );
- // When table wasn't successfully converted then finish conversion.
- if ( !modelTable ) {
- return;
- }
- conversionApi.convertChildren( data.viewItem, conversionApi.writer.createPositionAt( modelTable, 'end' ) );
- conversionApi.updateConversionResult( modelTable, data );
- } );
- };
- }
- /**
- * View table element to model table element conversion helper.
- *
- * This conversion helper converts the table element as well as table rows.
- *
- * @returns {Function} Conversion helper.
- */
- function upcastTable() {
- return dispatcher => {
- dispatcher.on( 'element:table', ( evt, data, conversionApi ) => {
- const viewTable = data.viewItem;
- // When element was already consumed then skip it.
- if ( !conversionApi.consumable.test( viewTable, { name: true } ) ) {
- return;
- }
- const { rows, headingRows, headingColumns } = scanTable( viewTable );
- // Only set attributes if values is greater then 0.
- const attributes = {};
- if ( headingColumns ) {
- attributes.headingColumns = headingColumns;
- }
- if ( headingRows ) {
- attributes.headingRows = headingRows;
- }
- const table = conversionApi.writer.createElement( 'table', attributes );
- if ( !conversionApi.safeInsert( table, data.modelCursor ) ) {
- return;
- }
- conversionApi.consumable.consume( viewTable, { name: true } );
- // Upcast table rows in proper order (heading rows first).
- rows.forEach( row => conversionApi.convertItem( row, conversionApi.writer.createPositionAt( table, 'end' ) ) );
- // Convert everything else.
- conversionApi.convertChildren( viewTable, conversionApi.writer.createPositionAt( table, 'end' ) );
- // Create one row and one table cell for empty table.
- if ( table.isEmpty ) {
- const row = conversionApi.writer.createElement( 'tableRow' );
- conversionApi.writer.insert( row, conversionApi.writer.createPositionAt( table, 'end' ) );
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_0__["createEmptyTableCell"])( conversionApi.writer, conversionApi.writer.createPositionAt( row, 'end' ) );
- }
- conversionApi.updateConversionResult( table, data );
- } );
- };
- }
- /**
- * A conversion helper that skips empty <tr> elements from upcasting at the beginning of the table.
- *
- * An empty row is considered a table model error but when handling clipboard data there could be rows that contain only row-spanned cells
- * and empty TR-s are used to maintain the table structure (also {@link module:table/tablewalker~TableWalker} assumes that there are only
- * rows that have related `tableRow` elements).
- *
- * *Note:* Only the first empty rows are removed because they have no meaning and it solves the issue
- * of an improper table with all empty rows.
- *
- * @returns {Function} Conversion helper.
- */
- function skipEmptyTableRow() {
- return dispatcher => {
- dispatcher.on( 'element:tr', ( evt, data ) => {
- if ( data.viewItem.isEmpty && data.modelCursor.index == 0 ) {
- evt.stop();
- }
- }, { priority: 'high' } );
- };
- }
- /**
- * A converter that ensures an empty paragraph is inserted in a table cell if no other content was converted.
- *
- * @returns {Function} Conversion helper.
- */
- function ensureParagraphInTableCell( elementName ) {
- return dispatcher => {
- dispatcher.on( `element:${ elementName }`, ( evt, data, conversionApi ) => {
- // The default converter will create a model range on converted table cell.
- if ( !data.modelRange ) {
- return;
- }
- // Ensure a paragraph in the model for empty table cells for converted table cells.
- if ( data.viewItem.isEmpty ) {
- const tableCell = data.modelRange.start.nodeAfter;
- const modelCursor = conversionApi.writer.createPositionAt( tableCell, 0 );
- conversionApi.writer.insertElement( 'paragraph', modelCursor );
- }
- }, { priority: 'low' } );
- };
- }
- // Get view `<table>` element from the view widget (`<figure>`).
- //
- // @private
- // @param {module:engine/view/element~Element} figureView
- // @returns {module:engine/view/element~Element}
- function getViewTableFromFigure( figureView ) {
- for ( const figureChild of figureView.getChildren() ) {
- if ( figureChild.is( 'element', 'table' ) ) {
- return figureChild;
- }
- }
- }
- // Scans table rows and extracts required metadata from the table:
- //
- // headingRows - The number of rows that go as table headers.
- // headingColumns - The maximum number of row headings.
- // rows - Sorted `<tr>` elements as they should go into the model - ie. if `<thead>` is inserted after `<tbody>` in the view.
- //
- // @private
- // @param {module:engine/view/element~Element} viewTable
- // @returns {{headingRows, headingColumns, rows}}
- function scanTable( viewTable ) {
- const tableMeta = {
- headingRows: 0,
- headingColumns: 0
- };
- // The `<tbody>` and `<thead>` sections in the DOM do not have to be in order `<thead>` -> `<tbody>` and there might be more than one
- // of them.
- // As the model does not have these sections, rows from different sections must be sorted.
- // For example, below is a valid HTML table:
- //
- // <table>
- // <tbody><tr><td>2</td></tr></tbody>
- // <thead><tr><td>1</td></tr></thead>
- // <tbody><tr><td>3</td></tr></tbody>
- // </table>
- //
- // But browsers will render rows in order as: 1 as the heading and 2 and 3 as the body.
- const headRows = [];
- const bodyRows = [];
- // Currently the editor does not support more then one <thead> section.
- // Only the first <thead> from the view will be used as a heading row and the others will be converted to body rows.
- let firstTheadElement;
- for ( const tableChild of Array.from( viewTable.getChildren() ) ) {
- // Only `<thead>`, `<tbody>` & `<tfoot>` from allowed table children can have `<tr>`s.
- // The else is for future purposes (mainly `<caption>`).
- if ( tableChild.name === 'tbody' || tableChild.name === 'thead' || tableChild.name === 'tfoot' ) {
- // Save the first `<thead>` in the table as table header - all other ones will be converted to table body rows.
- if ( tableChild.name === 'thead' && !firstTheadElement ) {
- firstTheadElement = tableChild;
- }
- // There might be some extra empty text nodes between the `<tr>`s.
- // Make sure further code operates on `tr`s only. (#145)
- const trs = Array.from( tableChild.getChildren() ).filter( el => el.is( 'element', 'tr' ) );
- for ( const tr of trs ) {
- // This <tr> is a child of a first <thead> element.
- if ( tr.parent.name === 'thead' && tr.parent === firstTheadElement ) {
- tableMeta.headingRows++;
- headRows.push( tr );
- } else {
- bodyRows.push( tr );
- // For other rows check how many column headings this row has.
- const headingCols = scanRowForHeadingColumns( tr, tableMeta, firstTheadElement );
- if ( headingCols > tableMeta.headingColumns ) {
- tableMeta.headingColumns = headingCols;
- }
- }
- }
- }
- }
- tableMeta.rows = [ ...headRows, ...bodyRows ];
- return tableMeta;
- }
- // Scans a `<tr>` element and its children for metadata:
- // - For heading row:
- // - Adds this row to either the heading or the body rows.
- // - Updates the number of heading rows.
- // - For body rows:
- // - Calculates the number of column headings.
- //
- // @private
- // @param {module:engine/view/element~Element} tr
- // @returns {Number}
- function scanRowForHeadingColumns( tr ) {
- let headingColumns = 0;
- let index = 0;
- // Filter out empty text nodes from tr children.
- const children = Array.from( tr.getChildren() )
- .filter( child => child.name === 'th' || child.name === 'td' );
- // Count starting adjacent <th> elements of a <tr>.
- while ( index < children.length && children[ index ].name === 'th' ) {
- const th = children[ index ];
- // Adjust columns calculation by the number of spanned columns.
- const colspan = parseInt( th.getAttribute( 'colspan' ) || 1 );
- headingColumns = headingColumns + colspan;
- index++;
- }
- return headingColumns;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/table.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/table.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Table; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /* harmony import */ var _tableediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tableediting */ "./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js");
- /* harmony import */ var _tableui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tableui */ "./node_modules/@ckeditor/ckeditor5-table/src/tableui.js");
- /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
- /* harmony import */ var _tableclipboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tableclipboard */ "./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js");
- /* harmony import */ var _tablekeyboard__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tablekeyboard */ "./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js");
- /* harmony import */ var _tablemouse__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tablemouse */ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js");
- /* harmony import */ var _theme_table_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/table.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/table.css");
- /* harmony import */ var _theme_table_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_theme_table_css__WEBPACK_IMPORTED_MODULE_8__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/table
- */
- /**
- * The table plugin.
- *
- * For a detailed overview, check the {@glink features/table Table feature documentation}.
- *
- * This is a "glue" plugin that loads the following table features:
- *
- * * {@link module:table/tableediting~TableEditing editing feature},
- * * {@link module:table/tableselection~TableSelection selection feature},
- * * {@link module:table/tablekeyboard~TableKeyboard keyboard navigation feature},
- * * {@link module:table/tablemouse~TableMouse mouse selection feature},
- * * {@link module:table/tableclipboard~TableClipboard clipboard feature},
- * * {@link module:table/tableui~TableUI UI feature}.
- *
- * @extends module:core/plugin~Plugin
- */
- class Table extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _tableediting__WEBPACK_IMPORTED_MODULE_2__["default"], _tableui__WEBPACK_IMPORTED_MODULE_3__["default"], _tableselection__WEBPACK_IMPORTED_MODULE_4__["default"], _tablemouse__WEBPACK_IMPORTED_MODULE_7__["default"], _tablekeyboard__WEBPACK_IMPORTED_MODULE_6__["default"], _tableclipboard__WEBPACK_IMPORTED_MODULE_5__["default"], ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["Widget"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Table';
- }
- }
- /**
- * The configuration of the table feature. Used by the table feature in the `@ckeditor/ckeditor5-table` package.
- *
- * ClassicEditor
- * .create( editorElement, {
- * table: ... // Table feature options.
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- *
- * @interface TableConfig
- */
- /**
- * The configuration of the {@link module:table/table~Table} feature.
- *
- * Read more in {@link module:table/table~TableConfig}.
- *
- * @member {module:table/table~TableConfig} module:core/editor/editorconfig~EditorConfig#table
- */
- /**
- * An array of color definitions (either strings or objects).
- *
- * const colors = [
- * {
- * color: 'hsl(0, 0%, 60%)',
- * label: 'Grey'
- * },
- * 'hsl(0, 0%, 80%)',
- * {
- * color: 'hsl(0, 0%, 90%)',
- * label: 'Light grey'
- * },
- * {
- * color: 'hsl(0, 0%, 100%)',
- * label: 'White',
- * hasBorder: true
- * },
- * '#FF0000'
- * ]
- *
- * Usually used as a configuration parameter, for instance in
- * {@link module:table/table~TableConfig#tableProperties `config.table.tableProperties`}
- * or {@link module:table/table~TableConfig#tableCellProperties `config.table.tableCellProperties`}.
- *
- * @typedef {Array.<String|Object>} module:table/table~TableColorConfig
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js ***!
- \**********************************************************************/
- /*! exports provided: default, getTableIfOnlyTableInContent */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableClipboard; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTableIfOnlyTableInContent", function() { return getTableIfOnlyTableInContent; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
- /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
- /* harmony import */ var _tableutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/tableclipboard
- */
- /**
- * This plugin adds support for copying/cutting/pasting fragments of tables.
- * It is loaded automatically by the {@link module:table/table~Table} plugin.
- *
- * @extends module:core/plugin~Plugin
- */
- class TableClipboard extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'TableClipboard';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"], _tableutils__WEBPACK_IMPORTED_MODULE_3__["default"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const viewDocument = editor.editing.view.document;
- this.listenTo( viewDocument, 'copy', ( evt, data ) => this._onCopyCut( evt, data ) );
- this.listenTo( viewDocument, 'cut', ( evt, data ) => this._onCopyCut( evt, data ) );
- this.listenTo( editor.model, 'insertContent', ( evt, args ) => this._onInsertContent( evt, ...args ), { priority: 'high' } );
- this.decorate( '_replaceTableSlotCell' );
- }
- /**
- * Copies table content to a clipboard on "copy" & "cut" events.
- *
- * @private
- * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the handled event.
- * @param {Object} data Clipboard event data.
- */
- _onCopyCut( evt, data ) {
- const tableSelection = this.editor.plugins.get( _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] );
- if ( !tableSelection.getSelectedTableCells() ) {
- return;
- }
- if ( evt.name == 'cut' && this.editor.isReadOnly ) {
- return;
- }
- data.preventDefault();
- evt.stop();
- const dataController = this.editor.data;
- const viewDocument = this.editor.editing.view.document;
- const content = dataController.toView( tableSelection.getSelectionAsFragment() );
- viewDocument.fire( 'clipboardOutput', {
- dataTransfer: data.dataTransfer,
- content,
- method: evt.name
- } );
- }
- /**
- * Overrides default {@link module:engine/model/model~Model#insertContent `model.insertContent()`} method to handle pasting table inside
- * selected table fragment.
- *
- * Depending on selected table fragment:
- * - If a selected table fragment is smaller than paste table it will crop pasted table to match dimensions.
- * - If dimensions are equal it will replace selected table fragment with a pasted table contents.
- *
- * @private
- * @param evt
- * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
- * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
- * The selection into which the content should be inserted. If not provided the current model document selection will be used.
- */
- _onInsertContent( evt, content, selectable ) {
- if ( selectable && !selectable.is( 'documentSelection' ) ) {
- return;
- }
- const model = this.editor.model;
- const tableUtils = this.editor.plugins.get( _tableutils__WEBPACK_IMPORTED_MODULE_3__["default"] );
- // We might need to crop table before inserting so reference might change.
- let pastedTable = getTableIfOnlyTableInContent( content, model );
- if ( !pastedTable ) {
- return;
- }
- const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getSelectionAffectedTableCells"])( model.document.selection );
- if ( !selectedTableCells.length ) {
- Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["removeEmptyRowsColumns"])( pastedTable, tableUtils );
- return;
- }
- // Override default model.insertContent() handling at this point.
- evt.stop();
- model.change( writer => {
- const pastedDimensions = {
- width: tableUtils.getColumns( pastedTable ),
- height: tableUtils.getRows( pastedTable )
- };
- // Prepare the table for pasting.
- const selection = prepareTableForPasting( selectedTableCells, pastedDimensions, writer, tableUtils );
- // Beyond this point we operate on a fixed content table with rectangular selection and proper last row/column values.
- const selectionHeight = selection.lastRow - selection.firstRow + 1;
- const selectionWidth = selection.lastColumn - selection.firstColumn + 1;
- // Crop pasted table if:
- // - Pasted table dimensions exceeds selection area.
- // - Pasted table has broken layout (ie some cells sticks out by the table dimensions established by the first and last row).
- //
- // Note: The table dimensions are established by the width of the first row and the total number of rows.
- // It is possible to programmatically create a table that has rows which would have cells anchored beyond first row width but
- // such table will not be created by other editing solutions.
- const cropDimensions = {
- startRow: 0,
- startColumn: 0,
- endRow: Math.min( selectionHeight, pastedDimensions.height ) - 1,
- endColumn: Math.min( selectionWidth, pastedDimensions.width ) - 1
- };
- pastedTable = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["cropTableToDimensions"])( pastedTable, cropDimensions, writer );
- // Content table to which we insert a pasted table.
- const selectedTable = selectedTableCells[ 0 ].findAncestor( 'table' );
- const cellsToSelect = this._replaceSelectedCellsWithPasted( pastedTable, pastedDimensions, selectedTable, selection, writer );
- if ( this.editor.plugins.get( 'TableSelection' ).isEnabled ) {
- // Selection ranges must be sorted because the first and last selection ranges are considered
- // as anchor/focus cell ranges for multi-cell selection.
- const selectionRanges = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["sortRanges"])( cellsToSelect.map( cell => writer.createRangeOn( cell ) ) );
- writer.setSelection( selectionRanges );
- } else {
- // Set selection inside first cell if multi-cell selection is disabled.
- writer.setSelection( cellsToSelect[ 0 ], 0 );
- }
- } );
- }
- /**
- * Replaces the part of selectedTable with pastedTable.
- *
- * @private
- * @param {module:engine/model/element~Element} pastedTable
- * @param {Object} pastedDimensions
- * @param {Number} pastedDimensions.height
- * @param {Number} pastedDimensions.width
- * @param {module:engine/model/element~Element} selectedTable
- * @param {Object} selection
- * @param {Number} selection.firstColumn
- * @param {Number} selection.firstRow
- * @param {Number} selection.lastColumn
- * @param {Number} selection.lastRow
- * @param {module:engine/model/writer~Writer} writer
- * @returns {Array.<module:engine/model/element~Element>}
- */
- _replaceSelectedCellsWithPasted( pastedTable, pastedDimensions, selectedTable, selection, writer ) {
- const { width: pastedWidth, height: pastedHeight } = pastedDimensions;
- // Holds two-dimensional array that is addressed by [ row ][ column ] that stores cells anchored at given location.
- const pastedTableLocationMap = createLocationMap( pastedTable, pastedWidth, pastedHeight );
- const selectedTableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( selectedTable, {
- startRow: selection.firstRow,
- endRow: selection.lastRow,
- startColumn: selection.firstColumn,
- endColumn: selection.lastColumn,
- includeAllSlots: true
- } ) ];
- // Selection must be set to pasted cells (some might be removed or new created).
- const cellsToSelect = [];
- // Store next cell insert position.
- let insertPosition;
- // Content table replace cells algorithm iterates over a selected table fragment and:
- //
- // - Removes existing table cells at current slot (location).
- // - Inserts cell from a pasted table for a matched slots.
- //
- // This ensures proper table geometry after the paste
- for ( const tableSlot of selectedTableMap ) {
- const { row, column } = tableSlot;
- // Save the insert position for current row start.
- if ( column === selection.firstColumn ) {
- insertPosition = tableSlot.getPositionBefore();
- }
- // Map current table slot location to an pasted table slot location.
- const pastedRow = row - selection.firstRow;
- const pastedColumn = column - selection.firstColumn;
- const pastedCell = pastedTableLocationMap[ pastedRow % pastedHeight ][ pastedColumn % pastedWidth ];
- // Clone cell to insert (to duplicate its attributes and children).
- // Cloning is required to support repeating pasted table content when inserting to a bigger selection.
- const cellToInsert = pastedCell ? writer.cloneElement( pastedCell ) : null;
- // Replace the cell from the current slot with new table cell.
- const newTableCell = this._replaceTableSlotCell( tableSlot, cellToInsert, insertPosition, writer );
- // The cell was only removed.
- if ( !newTableCell ) {
- continue;
- }
- // Trim the cell if it's row/col-spans would exceed selection area.
- Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["trimTableCellIfNeeded"])( newTableCell, row, column, selection.lastRow, selection.lastColumn, writer );
- cellsToSelect.push( newTableCell );
- insertPosition = writer.createPositionAfter( newTableCell );
- }
- // If there are any headings, all the cells that overlap from heading must be splitted.
- const headingRows = parseInt( selectedTable.getAttribute( 'headingRows' ) || 0 );
- const headingColumns = parseInt( selectedTable.getAttribute( 'headingColumns' ) || 0 );
- const areHeadingRowsIntersectingSelection = selection.firstRow < headingRows && headingRows <= selection.lastRow;
- const areHeadingColumnsIntersectingSelection = selection.firstColumn < headingColumns && headingColumns <= selection.lastColumn;
- if ( areHeadingRowsIntersectingSelection ) {
- const columnsLimit = { first: selection.firstColumn, last: selection.lastColumn };
- const newCells = doHorizontalSplit( selectedTable, headingRows, columnsLimit, writer, selection.firstRow );
- cellsToSelect.push( ...newCells );
- }
- if ( areHeadingColumnsIntersectingSelection ) {
- const rowsLimit = { first: selection.firstRow, last: selection.lastRow };
- const newCells = doVerticalSplit( selectedTable, headingColumns, rowsLimit, writer );
- cellsToSelect.push( ...newCells );
- }
- return cellsToSelect;
- }
- /**
- * Replaces a single table slot.
- *
- * @private
- * @param {module:table/tablewalker~TableSlot} tableSlot
- * @param {module:engine/model/element~Element} cellToInsert
- * @param {module:engine/model/position~Position} insertPosition
- * @param {module:engine/model/writer~Writer} writer
- * @returns {module:engine/model/element~Element|null} Inserted table cell or null if slot should remain empty.
- */
- _replaceTableSlotCell( tableSlot, cellToInsert, insertPosition, writer ) {
- const { cell, isAnchor } = tableSlot;
- // If the slot is occupied by a cell in a selected table - remove it.
- // The slot of this cell will be either:
- // - Replaced by a pasted table cell.
- // - Spanned by a previously pasted table cell.
- if ( isAnchor ) {
- writer.remove( cell );
- }
- // There is no cell to insert (might be spanned by other cell in a pasted table) - advance to the next content table slot.
- if ( !cellToInsert ) {
- return null;
- }
- writer.insert( cellToInsert, insertPosition );
- return cellToInsert;
- }
- }
- /**
- * Extract table for pasting into table.
- *
- * @private
- * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
- * @param {module:engine/model/model~Model} model The editor model.
- * @returns {module:engine/model/element~Element|null}
- */
- function getTableIfOnlyTableInContent( content, model ) {
- if ( !content.is( 'documentFragment' ) && !content.is( 'element' ) ) {
- return null;
- }
- // Table passed directly.
- if ( content.is( 'element', 'table' ) ) {
- return content;
- }
- // We do not support mixed content when pasting table into table.
- // See: https://github.com/ckeditor/ckeditor5/issues/6817.
- if ( content.childCount == 1 && content.getChild( 0 ).is( 'element', 'table' ) ) {
- return content.getChild( 0 );
- }
- // If there are only whitespaces around a table then use that table for pasting.
- const contentRange = model.createRangeIn( content );
- for ( const element of contentRange.getItems() ) {
- if ( element.is( 'element', 'table' ) ) {
- // Stop checking if there is some content before table.
- const rangeBefore = model.createRange( contentRange.start, model.createPositionBefore( element ) );
- if ( model.hasContent( rangeBefore, { ignoreWhitespaces: true } ) ) {
- return null;
- }
- // Stop checking if there is some content after table.
- const rangeAfter = model.createRange( model.createPositionAfter( element ), contentRange.end );
- if ( model.hasContent( rangeAfter, { ignoreWhitespaces: true } ) ) {
- return null;
- }
- // There wasn't any content neither before nor after.
- return element;
- }
- }
- return null;
- }
- // Prepares a table for pasting and returns adjusted selection dimensions.
- //
- // @param {Array.<module:engine/model/element~Element>} selectedTableCells
- // @param {Object} pastedDimensions
- // @param {Number} pastedDimensions.height
- // @param {Number} pastedDimensions.width
- // @param {module:engine/model/writer~Writer} writer
- // @param {module:table/tableutils~TableUtils} tableUtils
- // @returns {Object} selection
- // @returns {Number} selection.firstColumn
- // @returns {Number} selection.firstRow
- // @returns {Number} selection.lastColumn
- // @returns {Number} selection.lastRow
- function prepareTableForPasting( selectedTableCells, pastedDimensions, writer, tableUtils ) {
- const selectedTable = selectedTableCells[ 0 ].findAncestor( 'table' );
- const columnIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getColumnIndexes"])( selectedTableCells );
- const rowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getRowIndexes"])( selectedTableCells );
- const selection = {
- firstColumn: columnIndexes.first,
- lastColumn: columnIndexes.last,
- firstRow: rowIndexes.first,
- lastRow: rowIndexes.last
- };
- // Single cell selected - expand selection to pasted table dimensions.
- const shouldExpandSelection = selectedTableCells.length === 1;
- if ( shouldExpandSelection ) {
- selection.lastRow += pastedDimensions.height - 1;
- selection.lastColumn += pastedDimensions.width - 1;
- expandTableSize( selectedTable, selection.lastRow + 1, selection.lastColumn + 1, tableUtils );
- }
- // In case of expanding selection we do not reset the selection so in this case we will always try to fix selection
- // like in the case of a non-rectangular area. This might be fixed by re-setting selected cells array but this shortcut is safe.
- if ( shouldExpandSelection || !Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["isSelectionRectangular"])( selectedTableCells, tableUtils ) ) {
- // For a non-rectangular selection (ie in which some cells sticks out from a virtual selection rectangle) we need to create
- // a table layout that has a rectangular selection. This will split cells so the selection become rectangular.
- // Beyond this point we will operate on fixed content table.
- splitCellsToRectangularSelection( selectedTable, selection, writer );
- }
- // However a selected table fragment might be invalid if examined alone. Ie such table fragment:
- //
- // +---+---+---+---+
- // 0 | a | b | c | d |
- // + + +---+---+
- // 1 | | e | f | g |
- // + +---+ +---+
- // 2 | | h | | i | <- last row, each cell has rowspan = 2,
- // + + + + + so we need to return 3, not 2
- // 3 | | | | |
- // +---+---+---+---+
- //
- // is invalid as the cells "h" and "i" have rowspans.
- // This case needs only adjusting the selection dimension as the rest of the algorithm operates on empty slots also.
- else {
- selection.lastRow = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["adjustLastRowIndex"])( selectedTable, selection );
- selection.lastColumn = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["adjustLastColumnIndex"])( selectedTable, selection );
- }
- return selection;
- }
- // Expand table (in place) to expected size.
- function expandTableSize( table, expectedHeight, expectedWidth, tableUtils ) {
- const tableWidth = tableUtils.getColumns( table );
- const tableHeight = tableUtils.getRows( table );
- if ( expectedWidth > tableWidth ) {
- tableUtils.insertColumns( table, {
- at: tableWidth,
- columns: expectedWidth - tableWidth
- } );
- }
- if ( expectedHeight > tableHeight ) {
- tableUtils.insertRows( table, {
- at: tableHeight,
- rows: expectedHeight - tableHeight
- } );
- }
- }
- // Returns two-dimensional array that is addressed by [ row ][ column ] that stores cells anchored at given location.
- //
- // At given row & column location it might be one of:
- //
- // * cell - cell from pasted table anchored at this location.
- // * null - if no cell is anchored at this location.
- //
- // For instance, from a table below:
- //
- // +----+----+----+----+
- // | 00 | 01 | 02 | 03 |
- // + +----+----+----+
- // | | 11 | 13 |
- // +----+ +----+
- // | 20 | | 23 |
- // +----+----+----+----+
- //
- // The method will return an array (numbers represents cell element):
- //
- // const map = [
- // [ '00', '01', '02', '03' ],
- // [ null, '11', null, '13' ],
- // [ '20', null, null, '23' ]
- // ]
- //
- // This allows for a quick access to table at give row & column. For instance to access table cell "13" from pasted table call:
- //
- // const cell = map[ 1 ][ 3 ]
- //
- function createLocationMap( table, width, height ) {
- // Create height x width (row x column) two-dimensional table to store cells.
- const map = new Array( height ).fill( null )
- .map( () => new Array( width ).fill( null ) );
- for ( const { column, row, cell } of new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table ) ) {
- map[ row ][ column ] = cell;
- }
- return map;
- }
- // Make selected cells rectangular by splitting the cells that stand out from a rectangular selection.
- //
- // In the table below a selection is shown with "::" and slots with anchor cells are named.
- //
- // +----+----+----+----+----+ +----+----+----+----+----+
- // | 00 | 01 | 02 | 03 | | 00 | 01 | 02 | 03 |
- // + +----+ +----+----+ | ::::::::::::::::----+
- // | | 11 | | 13 | 14 | | ::11 | | 13:: 14 | <- first row
- // +----+----+ + +----+ +----::---| | ::----+
- // | 20 | 21 | | | 24 | select cells: | 20 ::21 | | :: 24 |
- // +----+----+ +----+----+ 11 -> 33 +----::---| |---::----+
- // | 30 | | 33 | 34 | | 30 :: | | 33:: 34 | <- last row
- // + + +----+ + | :::::::::::::::: +
- // | | | 43 | | | | | 43 | |
- // +----+----+----+----+----+ +----+----+----+----+----+
- // ^ ^
- // first & last columns
- //
- // Will update table to:
- //
- // +----+----+----+----+----+
- // | 00 | 01 | 02 | 03 |
- // + +----+----+----+----+
- // | | 11 | | 13 | 14 |
- // +----+----+ + +----+
- // | 20 | 21 | | | 24 |
- // +----+----+ +----+----+
- // | 30 | | | 33 | 34 |
- // + +----+----+----+ +
- // | | | | 43 | |
- // +----+----+----+----+----+
- //
- // In th example above:
- // - Cell "02" which have `rowspan = 4` must be trimmed at first and at after last row.
- // - Cell "03" which have `rowspan = 2` and `colspan = 2` must be trimmed at first column and after last row.
- // - Cells "00", "03" & "30" which cannot be cut by this algorithm as they are outside the trimmed area.
- // - Cell "13" cannot be cut as it is inside the trimmed area.
- function splitCellsToRectangularSelection( table, dimensions, writer ) {
- const { firstRow, lastRow, firstColumn, lastColumn } = dimensions;
- const rowIndexes = { first: firstRow, last: lastRow };
- const columnIndexes = { first: firstColumn, last: lastColumn };
- // 1. Split cells vertically in two steps as first step might create cells that needs to split again.
- doVerticalSplit( table, firstColumn, rowIndexes, writer );
- doVerticalSplit( table, lastColumn + 1, rowIndexes, writer );
- // 2. Split cells horizontally in two steps as first step might create cells that needs to split again.
- doHorizontalSplit( table, firstRow, columnIndexes, writer );
- doHorizontalSplit( table, lastRow + 1, columnIndexes, writer, firstRow );
- }
- function doHorizontalSplit( table, splitRow, limitColumns, writer, startRow = 0 ) {
- // If selection starts at first row then no split is needed.
- if ( splitRow < 1 ) {
- return;
- }
- const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["getVerticallyOverlappingCells"])( table, splitRow, startRow );
- // Filter out cells that are not touching insides of the rectangular selection.
- const cellsToSplit = overlappingCells.filter( ( { column, cellWidth } ) => isAffectedBySelection( column, cellWidth, limitColumns ) );
- return cellsToSplit.map( ( { cell } ) => Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["splitHorizontally"])( cell, splitRow, writer ) );
- }
- function doVerticalSplit( table, splitColumn, limitRows, writer ) {
- // If selection starts at first column then no split is needed.
- if ( splitColumn < 1 ) {
- return;
- }
- const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["getHorizontallyOverlappingCells"])( table, splitColumn );
- // Filter out cells that are not touching insides of the rectangular selection.
- const cellsToSplit = overlappingCells.filter( ( { row, cellHeight } ) => isAffectedBySelection( row, cellHeight, limitRows ) );
- return cellsToSplit.map( ( { cell, column } ) => Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["splitVertically"])( cell, column, splitColumn, writer ) );
- }
- // Checks if cell at given row (column) is affected by a rectangular selection defined by first/last column (row).
- //
- // The same check is used for row as for column.
- function isAffectedBySelection( index, span, limit ) {
- const endIndex = index + span - 1;
- const { first, last } = limit;
- const isInsideSelection = index >= first && index <= last;
- const overlapsSelectionFromOutside = index < first && endIndex >= first;
- return isInsideSelection || overlapsSelectionFromOutside;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableEditing; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./converters/upcasttable */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js");
- /* harmony import */ var _converters_downcast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./converters/downcast */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js");
- /* harmony import */ var _commands_inserttablecommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./commands/inserttablecommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js");
- /* harmony import */ var _commands_insertrowcommand__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands/insertrowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js");
- /* harmony import */ var _commands_insertcolumncommand__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands/insertcolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js");
- /* harmony import */ var _commands_splitcellcommand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./commands/splitcellcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js");
- /* harmony import */ var _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/mergecellcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js");
- /* harmony import */ var _commands_removerowcommand__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./commands/removerowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js");
- /* harmony import */ var _commands_removecolumncommand__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./commands/removecolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js");
- /* harmony import */ var _commands_setheaderrowcommand__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commands/setheaderrowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js");
- /* harmony import */ var _commands_setheadercolumncommand__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./commands/setheadercolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js");
- /* harmony import */ var _commands_mergecellscommand__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./commands/mergecellscommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js");
- /* harmony import */ var _commands_selectrowcommand__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./commands/selectrowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js");
- /* harmony import */ var _commands_selectcolumncommand__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commands/selectcolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js");
- /* harmony import */ var _src_tableutils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../src/tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
- /* harmony import */ var _converters_table_layout_post_fixer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./converters/table-layout-post-fixer */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js");
- /* harmony import */ var _converters_table_cell_paragraph_post_fixer__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./converters/table-cell-paragraph-post-fixer */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js");
- /* harmony import */ var _converters_table_cell_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./converters/table-cell-refresh-post-fixer */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js");
- /* harmony import */ var _converters_table_heading_rows_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./converters/table-heading-rows-refresh-post-fixer */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-heading-rows-refresh-post-fixer.js");
- /* harmony import */ var _theme_tableediting_css__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../theme/tableediting.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css");
- /* harmony import */ var _theme_tableediting_css__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_theme_tableediting_css__WEBPACK_IMPORTED_MODULE_20__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/tableediting
- */
- /**
- * The table editing feature.
- *
- * @extends module:core/plugin~Plugin
- */
- class TableEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'TableEditing';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const model = editor.model;
- const schema = model.schema;
- const conversion = editor.conversion;
- schema.register( 'table', {
- allowWhere: '$block',
- allowAttributes: [ 'headingRows', 'headingColumns' ],
- isObject: true,
- isBlock: true
- } );
- schema.register( 'tableRow', {
- allowIn: 'table',
- isLimit: true
- } );
- schema.register( 'tableCell', {
- allowIn: 'tableRow',
- allowChildren: '$block',
- allowAttributes: [ 'colspan', 'rowspan' ],
- isLimit: true,
- isSelectable: true
- } );
- // Figure conversion.
- conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["upcastTableFigure"])() );
- // Table conversion.
- conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["default"])() );
- conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertTable"])( { asWidget: true } ) );
- conversion.for( 'dataDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertTable"])() );
- // Table row conversion.
- conversion.for( 'upcast' ).elementToElement( { model: 'tableRow', view: 'tr' } );
- conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["skipEmptyTableRow"])() );
- conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertRow"])() );
- conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastRemoveRow"])() );
- // Table cell conversion.
- conversion.for( 'upcast' ).elementToElement( { model: 'tableCell', view: 'td' } );
- conversion.for( 'upcast' ).elementToElement( { model: 'tableCell', view: 'th' } );
- conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["ensureParagraphInTableCell"])( 'td' ) );
- conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["ensureParagraphInTableCell"])( 'th' ) );
- conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertCell"])() );
- // Duplicates code - needed to properly refresh paragraph inside a table cell.
- conversion.for( 'editingDowncast' ).elementToElement( {
- model: 'paragraph',
- view: _converters_downcast__WEBPACK_IMPORTED_MODULE_2__["convertParagraphInTableCell"],
- converterPriority: 'high'
- } );
- // Table attributes conversion.
- conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
- conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
- // Table heading columns conversion (a change of heading rows requires a reconversion of the whole table).
- conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastTableHeadingColumnsChange"])() );
- // Define all the commands.
- editor.commands.add( 'insertTable', new _commands_inserttablecommand__WEBPACK_IMPORTED_MODULE_3__["default"]( editor ) );
- editor.commands.add( 'insertTableRowAbove', new _commands_insertrowcommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor, { order: 'above' } ) );
- editor.commands.add( 'insertTableRowBelow', new _commands_insertrowcommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor, { order: 'below' } ) );
- editor.commands.add( 'insertTableColumnLeft', new _commands_insertcolumncommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor, { order: 'left' } ) );
- editor.commands.add( 'insertTableColumnRight', new _commands_insertcolumncommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor, { order: 'right' } ) );
- editor.commands.add( 'removeTableRow', new _commands_removerowcommand__WEBPACK_IMPORTED_MODULE_8__["default"]( editor ) );
- editor.commands.add( 'removeTableColumn', new _commands_removecolumncommand__WEBPACK_IMPORTED_MODULE_9__["default"]( editor ) );
- editor.commands.add( 'splitTableCellVertically', new _commands_splitcellcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor, { direction: 'vertically' } ) );
- editor.commands.add( 'splitTableCellHorizontally', new _commands_splitcellcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor, { direction: 'horizontally' } ) );
- editor.commands.add( 'mergeTableCells', new _commands_mergecellscommand__WEBPACK_IMPORTED_MODULE_12__["default"]( editor ) );
- editor.commands.add( 'mergeTableCellRight', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'right' } ) );
- editor.commands.add( 'mergeTableCellLeft', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'left' } ) );
- editor.commands.add( 'mergeTableCellDown', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'down' } ) );
- editor.commands.add( 'mergeTableCellUp', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'up' } ) );
- editor.commands.add( 'setTableColumnHeader', new _commands_setheadercolumncommand__WEBPACK_IMPORTED_MODULE_11__["default"]( editor ) );
- editor.commands.add( 'setTableRowHeader', new _commands_setheaderrowcommand__WEBPACK_IMPORTED_MODULE_10__["default"]( editor ) );
- editor.commands.add( 'selectTableRow', new _commands_selectrowcommand__WEBPACK_IMPORTED_MODULE_13__["default"]( editor ) );
- editor.commands.add( 'selectTableColumn', new _commands_selectcolumncommand__WEBPACK_IMPORTED_MODULE_14__["default"]( editor ) );
- Object(_converters_table_heading_rows_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_19__["default"])( model );
- Object(_converters_table_layout_post_fixer__WEBPACK_IMPORTED_MODULE_16__["default"])( model );
- Object(_converters_table_cell_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_18__["default"])( model, editor.editing.mapper );
- Object(_converters_table_cell_paragraph_post_fixer__WEBPACK_IMPORTED_MODULE_17__["default"])( model );
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _src_tableutils__WEBPACK_IMPORTED_MODULE_15__["default"] ];
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableKeyboard; });
- /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
- /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/tablekeyboard
- */
- /**
- * This plugin enables keyboard navigation for tables.
- * It is loaded automatically by the {@link module:table/table~Table} plugin.
- *
- * @extends module:core/plugin~Plugin
- */
- class TableKeyboard extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'TableKeyboard';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _tableselection__WEBPACK_IMPORTED_MODULE_0__["default"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const view = this.editor.editing.view;
- const viewDocument = view.document;
- // Handle Tab key navigation.
- this.editor.keystrokes.set( 'Tab', ( ...args ) => this._handleTabOnSelectedTable( ...args ), { priority: 'low' } );
- this.editor.keystrokes.set( 'Tab', this._getTabHandler( true ), { priority: 'low' } );
- this.editor.keystrokes.set( 'Shift+Tab', this._getTabHandler( false ), { priority: 'low' } );
- this.listenTo( viewDocument, 'arrowKey', ( ...args ) => this._onArrowKey( ...args ), { context: 'table' } );
- }
- /**
- * Handles {@link module:engine/view/document~Document#event:keydown keydown} events for the <kbd>Tab</kbd> key executed
- * when the table widget is selected.
- *
- * @private
- * @param {module:engine/view/observer/keyobserver~KeyEventData} data Key event data.
- * @param {Function} cancel The stop/stopPropagation/preventDefault function.
- */
- _handleTabOnSelectedTable( data, cancel ) {
- const editor = this.editor;
- const selection = editor.model.document.selection;
- const selectedElement = selection.getSelectedElement();
- if ( !selectedElement || !selectedElement.is( 'element', 'table' ) ) {
- return;
- }
- cancel();
- editor.model.change( writer => {
- writer.setSelection( writer.createRangeIn( selectedElement.getChild( 0 ).getChild( 0 ) ) );
- } );
- }
- /**
- * Returns a handler for {@link module:engine/view/document~Document#event:keydown keydown} events for the <kbd>Tab</kbd> key executed
- * inside table cells.
- *
- * @private
- * @param {Boolean} isForward Whether this handler will move the selection to the next or the previous cell.
- */
- _getTabHandler( isForward ) {
- const editor = this.editor;
- return ( domEventData, cancel ) => {
- const selection = editor.model.document.selection;
- let tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getTableCellsContainingSelection"])( selection )[ 0 ];
- if ( !tableCell ) {
- tableCell = this.editor.plugins.get( 'TableSelection' ).getFocusCell();
- }
- if ( !tableCell ) {
- return;
- }
- cancel();
- const tableRow = tableCell.parent;
- const table = tableRow.parent;
- const currentRowIndex = table.getChildIndex( tableRow );
- const currentCellIndex = tableRow.getChildIndex( tableCell );
- const isFirstCellInRow = currentCellIndex === 0;
- if ( !isForward && isFirstCellInRow && currentRowIndex === 0 ) {
- // Set the selection over the whole table if the selection was in the first table cell.
- editor.model.change( writer => {
- writer.setSelection( writer.createRangeOn( table ) );
- } );
- return;
- }
- const tableUtils = this.editor.plugins.get( 'TableUtils' );
- const isLastCellInRow = currentCellIndex === tableRow.childCount - 1;
- const isLastRow = currentRowIndex === tableUtils.getRows( table ) - 1;
- if ( isForward && isLastRow && isLastCellInRow ) {
- editor.execute( 'insertTableRowBelow' );
- // Check if the command actually added a row. If `insertTableRowBelow` execution didn't add a row (because it was disabled
- // or it got overwritten) set the selection over the whole table to mirror the first cell case.
- if ( currentRowIndex === tableUtils.getRows( table ) - 1 ) {
- editor.model.change( writer => {
- writer.setSelection( writer.createRangeOn( table ) );
- } );
- return;
- }
- }
- let cellToFocus;
- // Move to the first cell in the next row.
- if ( isForward && isLastCellInRow ) {
- const nextRow = table.getChild( currentRowIndex + 1 );
- cellToFocus = nextRow.getChild( 0 );
- }
- // Move to the last cell in the previous row.
- else if ( !isForward && isFirstCellInRow ) {
- const previousRow = table.getChild( currentRowIndex - 1 );
- cellToFocus = previousRow.getChild( previousRow.childCount - 1 );
- }
- // Move to the next/previous cell.
- else {
- cellToFocus = tableRow.getChild( currentCellIndex + ( isForward ? 1 : -1 ) );
- }
- editor.model.change( writer => {
- writer.setSelection( writer.createRangeIn( cellToFocus ) );
- } );
- };
- }
- /**
- * Handles {@link module:engine/view/document~Document#event:keydown keydown} events.
- *
- * @private
- * @param {module:utils/eventinfo~EventInfo} eventInfo
- * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
- */
- _onArrowKey( eventInfo, domEventData ) {
- const editor = this.editor;
- const keyCode = domEventData.keyCode;
- const direction = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["getLocalizedArrowKeyCodeDirection"])( keyCode, editor.locale.contentLanguageDirection );
- const wasHandled = this._handleArrowKeys( direction, domEventData.shiftKey );
- if ( wasHandled ) {
- domEventData.preventDefault();
- domEventData.stopPropagation();
- eventInfo.stop();
- }
- }
- /**
- * Handles arrow keys to move the selection around the table.
- *
- * @private
- * @param {'left'|'up'|'right'|'down'} direction The direction of the arrow key.
- * @param {Boolean} expandSelection If the current selection should be expanded.
- * @returns {Boolean} Returns `true` if key was handled.
- */
- _handleArrowKeys( direction, expandSelection ) {
- const model = this.editor.model;
- const selection = model.document.selection;
- const isForward = [ 'right', 'down' ].includes( direction );
- // In case one or more table cells are selected (from outside),
- // move the selection to a cell adjacent to the selected table fragment.
- const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getSelectedTableCells"])( selection );
- if ( selectedCells.length ) {
- let focusCell;
- if ( expandSelection ) {
- focusCell = this.editor.plugins.get( 'TableSelection' ).getFocusCell();
- } else {
- focusCell = isForward ? selectedCells[ selectedCells.length - 1 ] : selectedCells[ 0 ];
- }
- this._navigateFromCellInDirection( focusCell, direction, expandSelection );
- return true;
- }
- // Abort if we're not in a table cell.
- const tableCell = selection.focus.findAncestor( 'tableCell' );
- /* istanbul ignore if: paranoid check */
- if ( !tableCell ) {
- return false;
- }
- // Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.
- // Selection for sure will not approach cell edge.
- if ( expandSelection && !selection.isCollapsed && selection.isBackward == isForward ) {
- return false;
- }
- // Let's check if the selection is at the beginning/end of the cell.
- if ( this._isSelectionAtCellEdge( selection, tableCell, isForward ) ) {
- this._navigateFromCellInDirection( tableCell, direction, expandSelection );
- return true;
- }
- return false;
- }
- /**
- * Returns `true` if the selection is at the boundary of a table cell according to the navigation direction.
- *
- * @private
- * @param {module:engine/model/selection~Selection} selection The current selection.
- * @param {module:engine/model/element~Element} tableCell The current table cell element.
- * @param {Boolean} isForward The expected navigation direction.
- * @returns {Boolean}
- */
- _isSelectionAtCellEdge( selection, tableCell, isForward ) {
- const model = this.editor.model;
- const schema = this.editor.model.schema;
- const focus = isForward ? selection.getLastPosition() : selection.getFirstPosition();
- // If the current limit element is not table cell we are for sure not at the cell edge.
- // Also `modifySelection` will not let us out of it.
- if ( !schema.getLimitElement( focus ).is( 'element', 'tableCell' ) ) {
- const boundaryPosition = model.createPositionAt( tableCell, isForward ? 'end' : 0 );
- return boundaryPosition.isTouching( focus );
- }
- const probe = model.createSelection( focus );
- model.modifySelection( probe, { direction: isForward ? 'forward' : 'backward' } );
- // If there was no change in the focus position, then it's not possible to move the selection there.
- return focus.isEqual( probe.focus );
- }
- /**
- * Moves the selection from the given table cell in the specified direction.
- *
- * @protected
- * @param {module:engine/model/element~Element} focusCell The table cell that is current multi-cell selection focus.
- * @param {'left'|'up'|'right'|'down'} direction Direction in which selection should move.
- * @param {Boolean} [expandSelection=false] If the current selection should be expanded.
- */
- _navigateFromCellInDirection( focusCell, direction, expandSelection = false ) {
- const model = this.editor.model;
- const table = focusCell.findAncestor( 'table' );
- const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { includeAllSlots: true } ) ];
- const { row: lastRow, column: lastColumn } = tableMap[ tableMap.length - 1 ];
- const currentCellInfo = tableMap.find( ( { cell } ) => cell == focusCell );
- let { row, column } = currentCellInfo;
- switch ( direction ) {
- case 'left':
- column--;
- break;
- case 'up':
- row--;
- break;
- case 'right':
- column += currentCellInfo.cellWidth;
- break;
- case 'down':
- row += currentCellInfo.cellHeight;
- break;
- }
- const isOutsideVertically = row < 0 || row > lastRow;
- const isBeforeFirstCell = column < 0 && row <= 0;
- const isAfterLastCell = column > lastColumn && row >= lastRow;
- // Note that if the table cell at the end of a row is row-spanned then isAfterLastCell will never be true.
- // However, we don't know if user was navigating on the last row or not, so let's stay in the table.
- if ( isOutsideVertically || isBeforeFirstCell || isAfterLastCell ) {
- model.change( writer => {
- writer.setSelection( writer.createRangeOn( table ) );
- } );
- return;
- }
- if ( column < 0 ) {
- column = expandSelection ? 0 : lastColumn;
- row--;
- } else if ( column > lastColumn ) {
- column = expandSelection ? lastColumn : 0;
- row++;
- }
- const cellToSelect = tableMap.find( cellInfo => cellInfo.row == row && cellInfo.column == column ).cell;
- const isForward = [ 'right', 'down' ].includes( direction );
- const tableSelection = this.editor.plugins.get( 'TableSelection' );
- if ( expandSelection && tableSelection.isEnabled ) {
- const anchorCell = tableSelection.getAnchorCell() || focusCell;
- tableSelection.setCellSelection( anchorCell, cellToSelect );
- } else {
- const positionToSelect = model.createPositionAt( cellToSelect, isForward ? 0 : 'end' );
- model.change( writer => {
- writer.setSelection( positionToSelect );
- } );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableMouse; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
- /* harmony import */ var _tablemouse_mouseeventsobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablemouse/mouseeventsobserver */ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/tablemouse
- */
- /**
- * This plugin enables a table cells' selection with the mouse.
- * It is loaded automatically by the {@link module:table/table~Table} plugin.
- *
- * @extends module:core/plugin~Plugin
- */
- class TableMouse extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'TableMouse';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Currently the MouseObserver only handles `mousedown` and `mouseup` events.
- // TODO move to the engine?
- editor.editing.view.addObserver( _tablemouse_mouseeventsobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
- this._enableShiftClickSelection();
- this._enableMouseDragSelection();
- }
- /**
- * Enables making cells selection by <kbd>Shift</kbd>+click. Creates a selection from the cell which previously held
- * the selection to the cell which was clicked. It can be the same cell, in which case it selects a single cell.
- *
- * @private
- */
- _enableShiftClickSelection() {
- const editor = this.editor;
- let blockSelectionChange = false;
- const tableSelection = editor.plugins.get( _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] );
- this.listenTo( editor.editing.view.document, 'mousedown', ( evt, domEventData ) => {
- if ( !this.isEnabled || !tableSelection.isEnabled ) {
- return;
- }
- if ( !domEventData.domEvent.shiftKey ) {
- return;
- }
- const anchorCell = tableSelection.getAnchorCell() || Object(_utils_selection__WEBPACK_IMPORTED_MODULE_3__["getTableCellsContainingSelection"])( editor.model.document.selection )[ 0 ];
- if ( !anchorCell ) {
- return;
- }
- const targetCell = this._getModelTableCellFromDomEvent( domEventData );
- if ( targetCell && haveSameTableParent( anchorCell, targetCell ) ) {
- blockSelectionChange = true;
- tableSelection.setCellSelection( anchorCell, targetCell );
- domEventData.preventDefault();
- }
- } );
- this.listenTo( editor.editing.view.document, 'mouseup', () => {
- blockSelectionChange = false;
- } );
- // We need to ignore a `selectionChange` event that is fired after we render our new table cells selection.
- // When downcasting table cells selection to the view, we put the view selection in the last selected cell
- // in a place that may not be natively a "correct" location. This is – we put it directly in the `<td>` element.
- // All browsers fire the native `selectionchange` event.
- // However, all browsers except Safari return the selection in the exact place where we put it
- // (even though it's visually normalized). Safari returns `<td><p>^foo` that makes our selection observer
- // fire our `selectionChange` event (because the view selection that we set in the first step differs from the DOM selection).
- // Since `selectionChange` is fired, we automatically update the model selection that moves it that paragraph.
- // This breaks our dear cells selection.
- //
- // Theoretically this issue concerns only Safari that is the only browser that do normalize the selection.
- // However, to avoid code branching and to have a good coverage for this event blocker, I enabled it for all browsers.
- //
- // Note: I'm keeping the `blockSelectionChange` state separately for shift+click and mouse drag (exact same logic)
- // so I don't have to try to analyze whether they don't overlap in some weird cases. Probably they don't.
- // But I have other things to do, like writing this comment.
- this.listenTo( editor.editing.view.document, 'selectionChange', evt => {
- if ( blockSelectionChange ) {
- // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );
- evt.stop();
- }
- }, { priority: 'highest' } );
- }
- /**
- * Enables making cells selection by dragging.
- *
- * The selection is made only on mousemove. Mouse tracking is started on mousedown.
- * However, the cells selection is enabled only after the mouse cursor left the anchor cell.
- * Thanks to that normal text selection within one cell works just fine. However, you can still select
- * just one cell by leaving the anchor cell and moving back to it.
- *
- * @private
- */
- _enableMouseDragSelection() {
- const editor = this.editor;
- let anchorCell, targetCell;
- let beganCellSelection = false;
- let blockSelectionChange = false;
- const tableSelection = editor.plugins.get( _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] );
- this.listenTo( editor.editing.view.document, 'mousedown', ( evt, domEventData ) => {
- if ( !this.isEnabled || !tableSelection.isEnabled ) {
- return;
- }
- // Make sure to not conflict with the shift+click listener and any other possible handler.
- if ( domEventData.domEvent.shiftKey || domEventData.domEvent.ctrlKey || domEventData.domEvent.altKey ) {
- return;
- }
- anchorCell = this._getModelTableCellFromDomEvent( domEventData );
- } );
- this.listenTo( editor.editing.view.document, 'mousemove', ( evt, domEventData ) => {
- if ( !domEventData.domEvent.buttons ) {
- return;
- }
- if ( !anchorCell ) {
- return;
- }
- const newTargetCell = this._getModelTableCellFromDomEvent( domEventData );
- if ( newTargetCell && haveSameTableParent( anchorCell, newTargetCell ) ) {
- targetCell = newTargetCell;
- // Switch to the cell selection mode after the mouse cursor left the anchor cell.
- // Switch off only on mouseup (makes selecting a single cell possible).
- if ( !beganCellSelection && targetCell != anchorCell ) {
- beganCellSelection = true;
- }
- }
- // Yep, not making a cell selection yet. See method docs.
- if ( !beganCellSelection ) {
- return;
- }
- blockSelectionChange = true;
- tableSelection.setCellSelection( anchorCell, targetCell );
- domEventData.preventDefault();
- } );
- this.listenTo( editor.editing.view.document, 'mouseup', () => {
- beganCellSelection = false;
- blockSelectionChange = false;
- anchorCell = null;
- targetCell = null;
- } );
- // See the explanation in `_enableShiftClickSelection()`.
- this.listenTo( editor.editing.view.document, 'selectionChange', evt => {
- if ( blockSelectionChange ) {
- // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );
- evt.stop();
- }
- }, { priority: 'highest' } );
- }
- /**
- * Returns the model table cell element based on the target element of the passed DOM event.
- *
- * @private
- * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
- * @returns {module:engine/model/element~Element|undefined} Returns the table cell or `undefined`.
- */
- _getModelTableCellFromDomEvent( domEventData ) {
- // Note: Work with positions (not element mapping) because the target element can be an attribute or other non-mapped element.
- const viewTargetElement = domEventData.target;
- const viewPosition = this.editor.editing.view.createPositionAt( viewTargetElement, 0 );
- const modelPosition = this.editor.editing.mapper.toModelPosition( viewPosition );
- const modelElement = modelPosition.parent;
- return modelElement.findAncestor( 'tableCell', { includeSelf: true } );
- }
- }
- function haveSameTableParent( cellA, cellB ) {
- return cellA.parent.parent == cellB.parent.parent;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js ***!
- \**************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MouseEventsObserver; });
- /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/tableselection/mouseeventsobserver
- */
- /**
- * The mouse selection event observer.
- *
- * It registers listeners for the following DOM events:
- *
- * - `'mousemove'`
- * - `'mouseup'`
- * - `'mouseleave'`
- *
- * Note that this observer is disabled by default. To enable this observer, it needs to be added to
- * {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
- *
- * The observer is registered by the {@link module:table/tableselection~TableSelection} plugin.
- *
- * @extends module:engine/view/observer/domeventobserver~DomEventObserver
- */
- class MouseEventsObserver extends ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["DomEventObserver"] {
- /**
- * @inheritDoc
- */
- constructor( view ) {
- super( view );
- this.domEventType = [ 'mousemove', 'mouseleave' ];
- }
- /**
- * @inheritDoc
- */
- onDomEvent( domEvent ) {
- this.fire( domEvent.type, domEvent );
- }
- }
- /**
- * Fired when the mouse is moved over one of the editables.
- *
- * Introduced by {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver}.
- *
- * Note that this event is not available by default. To make it available,
- * {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver} needs to be added
- * to {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
- *
- * @see module:table/tableselection/mouseeventsobserver~MouseEventsObserver
- * @event module:engine/view/document~Document#event:mousemove
- * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
- */
- /**
- * Fired when the mouse is moved out of one of the editables.
- *
- * Introduced by {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver}.
- *
- * Note that this event is not available by default. To make it available,
- * {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver} needs to be added
- * to {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
- *
- * @see module:table/tableselection/mouseeventsobserver~MouseEventsObserver
- * @event module:engine/view/document~Document#event:mouseleave
- * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableSelection; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
- /* harmony import */ var _tableutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
- /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
- /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
- /* harmony import */ var _theme_tableselection_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../theme/tableselection.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css");
- /* harmony import */ var _theme_tableselection_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_theme_tableselection_css__WEBPACK_IMPORTED_MODULE_6__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/tableselection
- */
- /**
- * This plugin enables the advanced table cells, rows and columns selection.
- * It is loaded automatically by the {@link module:table/table~Table} plugin.
- *
- * @extends module:core/plugin~Plugin
- */
- class TableSelection extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'TableSelection';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _tableutils__WEBPACK_IMPORTED_MODULE_3__["default"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const model = editor.model;
- this.listenTo( model, 'deleteContent', ( evt, args ) => this._handleDeleteContent( evt, args ), { priority: 'high' } );
- this._defineSelectionConverter();
- this._enablePluginDisabling(); // sic!
- }
- /**
- * Returns the currently selected table cells or `null` if it is not a table cells selection.
- *
- * @returns {Array.<module:engine/model/element~Element>|null}
- */
- getSelectedTableCells() {
- const selection = this.editor.model.document.selection;
- const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getSelectedTableCells"])( selection );
- if ( selectedCells.length == 0 ) {
- return null;
- }
- // This should never happen, but let's know if it ever happens.
- // @if CK_DEBUG // /* istanbul ignore next */
- // @if CK_DEBUG // if ( selectedCells.length != selection.rangeCount ) {
- // @if CK_DEBUG // console.warn( 'Mixed selection warning. The selection contains table cells and some other ranges.' );
- // @if CK_DEBUG // }
- return selectedCells;
- }
- /**
- * Returns the selected table fragment as a document fragment.
- *
- * @returns {module:engine/model/documentfragment~DocumentFragment|null}
- */
- getSelectionAsFragment() {
- const selectedCells = this.getSelectedTableCells();
- if ( !selectedCells ) {
- return null;
- }
- return this.editor.model.change( writer => {
- const documentFragment = writer.createDocumentFragment();
- const tableUtils = this.editor.plugins.get( 'TableUtils' );
- const { first: firstColumn, last: lastColumn } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getColumnIndexes"])( selectedCells );
- const { first: firstRow, last: lastRow } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getRowIndexes"])( selectedCells );
- const sourceTable = selectedCells[ 0 ].findAncestor( 'table' );
- let adjustedLastRow = lastRow;
- let adjustedLastColumn = lastColumn;
- // If the selection is rectangular there could be a case of all cells in the last row/column spanned over
- // next row/column so the real lastRow/lastColumn should be updated.
- if ( Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["isSelectionRectangular"])( selectedCells, tableUtils ) ) {
- const dimensions = {
- firstColumn,
- lastColumn,
- firstRow,
- lastRow
- };
- adjustedLastRow = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["adjustLastRowIndex"])( sourceTable, dimensions );
- adjustedLastColumn = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["adjustLastColumnIndex"])( sourceTable, dimensions );
- }
- const cropDimensions = {
- startRow: firstRow,
- startColumn: firstColumn,
- endRow: adjustedLastRow,
- endColumn: adjustedLastColumn
- };
- const table = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["cropTableToDimensions"])( sourceTable, cropDimensions, writer );
- writer.insert( table, documentFragment, 0 );
- return documentFragment;
- } );
- }
- /**
- * Sets the model selection based on given anchor and target cells (can be the same cell).
- * Takes care of setting the backward flag.
- *
- * const modelRoot = editor.model.document.getRoot();
- * const firstCell = modelRoot.getNodeByPath( [ 0, 0, 0 ] );
- * const lastCell = modelRoot.getNodeByPath( [ 0, 0, 1 ] );
- *
- * const tableSelection = editor.plugins.get( 'TableSelection' );
- * tableSelection.setCellSelection( firstCell, lastCell );
- *
- * @param {module:engine/model/element~Element} anchorCell
- * @param {module:engine/model/element~Element} targetCell
- */
- setCellSelection( anchorCell, targetCell ) {
- const cellsToSelect = this._getCellsToSelect( anchorCell, targetCell );
- this.editor.model.change( writer => {
- writer.setSelection(
- cellsToSelect.cells.map( cell => writer.createRangeOn( cell ) ),
- { backward: cellsToSelect.backward }
- );
- } );
- }
- /**
- * Returns the focus cell from the current selection.
- *
- * @returns {module:engine/model/element~Element}
- */
- getFocusCell() {
- const selection = this.editor.model.document.selection;
- const focusCellRange = [ ...selection.getRanges() ].pop();
- const element = focusCellRange.getContainedElement();
- if ( element && element.is( 'element', 'tableCell' ) ) {
- return element;
- }
- return null;
- }
- /**
- * Returns the anchor cell from the current selection.
- *
- * @returns {module:engine/model/element~Element} anchorCell
- */
- getAnchorCell() {
- const selection = this.editor.model.document.selection;
- const anchorCellRange = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( selection.getRanges() );
- const element = anchorCellRange.getContainedElement();
- if ( element && element.is( 'element', 'tableCell' ) ) {
- return element;
- }
- return null;
- }
- /**
- * Defines a selection converter which marks the selected cells with a specific class.
- *
- * The real DOM selection is put in the last cell. Since the order of ranges is dependent on whether the
- * selection is backward or not, the last cell will usually be close to the "focus" end of the selection
- * (a selection has anchor and focus).
- *
- * The real DOM selection is then hidden with CSS.
- *
- * @private
- */
- _defineSelectionConverter() {
- const editor = this.editor;
- const highlighted = new Set();
- editor.conversion.for( 'editingDowncast' ).add( dispatcher => dispatcher.on( 'selection', ( evt, data, conversionApi ) => {
- const viewWriter = conversionApi.writer;
- clearHighlightedTableCells( viewWriter );
- const selectedCells = this.getSelectedTableCells();
- if ( !selectedCells ) {
- return;
- }
- for ( const tableCell of selectedCells ) {
- const viewElement = conversionApi.mapper.toViewElement( tableCell );
- viewWriter.addClass( 'ck-editor__editable_selected', viewElement );
- highlighted.add( viewElement );
- }
- const lastViewCell = conversionApi.mapper.toViewElement( selectedCells[ selectedCells.length - 1 ] );
- viewWriter.setSelection( lastViewCell, 0 );
- }, { priority: 'lowest' } ) );
- function clearHighlightedTableCells( writer ) {
- for ( const previouslyHighlighted of highlighted ) {
- writer.removeClass( 'ck-editor__editable_selected', previouslyHighlighted );
- }
- highlighted.clear();
- }
- }
- /**
- * Creates a listener that reacts to changes in {@link #isEnabled} and, if the plugin was disabled,
- * it collapses the multi-cell selection to a regular selection placed inside a table cell.
- *
- * This listener helps features that disable the table selection plugin bring the selection
- * to a clear state they can work with (for instance, because they don't support multiple cell selection).
- */
- _enablePluginDisabling() {
- const editor = this.editor;
- this.on( 'change:isEnabled', () => {
- if ( !this.isEnabled ) {
- const selectedCells = this.getSelectedTableCells();
- if ( !selectedCells ) {
- return;
- }
- editor.model.change( writer => {
- const position = writer.createPositionAt( selectedCells[ 0 ], 0 );
- const range = editor.model.schema.getNearestSelectionRange( position );
- writer.setSelection( range );
- } );
- }
- } );
- }
- /**
- * Overrides the default `model.deleteContent()` behavior over a selected table fragment.
- *
- * @private
- * @param {module:utils/eventinfo~EventInfo} event
- * @param {Array.<*>} args Delete content method arguments.
- */
- _handleDeleteContent( event, args ) {
- const [ selection, options ] = args;
- const model = this.editor.model;
- const isBackward = !options || options.direction == 'backward';
- const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getSelectedTableCells"])( selection );
- if ( !selectedTableCells.length ) {
- return;
- }
- event.stop();
- model.change( writer => {
- const tableCellToSelect = selectedTableCells[ isBackward ? selectedTableCells.length - 1 : 0 ];
- model.change( writer => {
- for ( const tableCell of selectedTableCells ) {
- model.deleteContent( writer.createSelection( tableCell, 'in' ) );
- }
- } );
- const rangeToSelect = model.schema.getNearestSelectionRange( writer.createPositionAt( tableCellToSelect, 0 ) );
- // Note: we ignore the case where rangeToSelect may be null because deleteContent() will always (unless someone broke it)
- // create an empty paragraph to accommodate the selection.
- if ( selection.is( 'documentSelection' ) ) {
- writer.setSelection( rangeToSelect );
- } else {
- selection.setTo( rangeToSelect );
- }
- } );
- }
- /**
- * Returns an array of table cells that should be selected based on the
- * given anchor cell and target (focus) cell.
- *
- * The cells are returned in a reverse direction if the selection is backward.
- *
- * @private
- * @param {module:engine/model/element~Element} anchorCell
- * @param {module:engine/model/element~Element} targetCell
- * @returns {Array.<module:engine/model/element~Element>}
- */
- _getCellsToSelect( anchorCell, targetCell ) {
- const tableUtils = this.editor.plugins.get( 'TableUtils' );
- const startLocation = tableUtils.getCellLocation( anchorCell );
- const endLocation = tableUtils.getCellLocation( targetCell );
- const startRow = Math.min( startLocation.row, endLocation.row );
- const endRow = Math.max( startLocation.row, endLocation.row );
- const startColumn = Math.min( startLocation.column, endLocation.column );
- const endColumn = Math.max( startLocation.column, endLocation.column );
- // 2-dimensional array of the selected cells to ease flipping the order of cells for backward selections.
- const selectionMap = new Array( endRow - startRow + 1 ).fill( null ).map( () => [] );
- const walkerOptions = {
- startRow,
- endRow,
- startColumn,
- endColumn
- };
- for ( const { row, cell } of new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( anchorCell.findAncestor( 'table' ), walkerOptions ) ) {
- selectionMap[ row - startRow ].push( cell );
- }
- const flipVertically = endLocation.row < startLocation.row;
- const flipHorizontally = endLocation.column < startLocation.column;
- if ( flipVertically ) {
- selectionMap.reverse();
- }
- if ( flipHorizontally ) {
- selectionMap.forEach( row => row.reverse() );
- }
- return {
- cells: selectionMap.flat(),
- backward: flipVertically || flipHorizontally
- };
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableToolbar; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /* harmony import */ var _utils_ui_widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/ui/widget */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/tabletoolbar
- */
- /**
- * The table toolbar class. It creates toolbars for the table feature and its content (for now only for the table cell content).
- *
- * The table toolbar shows up when a table widget is selected. Its components (e.g. buttons) are created based on the
- * {@link module:table/table~TableConfig#tableToolbar `table.tableToolbar` configuration option}.
- *
- * Table content toolbar shows up when the selection is inside the content of a table. It creates its component based on the
- * {@link module:table/table~TableConfig#contentToolbar `table.contentToolbar` configuration option}.
- *
- * @extends module:core/plugin~Plugin
- */
- class TableToolbar extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetToolbarRepository"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'TableToolbar';
- }
- /**
- * @inheritDoc
- */
- afterInit() {
- const editor = this.editor;
- const t = editor.t;
- const widgetToolbarRepository = editor.plugins.get( ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetToolbarRepository"] );
- const tableContentToolbarItems = editor.config.get( 'table.contentToolbar' );
- const tableToolbarItems = editor.config.get( 'table.tableToolbar' );
- if ( tableContentToolbarItems ) {
- widgetToolbarRepository.register( 'tableContent', {
- ariaLabel: t( 'Table toolbar' ),
- items: tableContentToolbarItems,
- getRelatedElement: _utils_ui_widget__WEBPACK_IMPORTED_MODULE_2__["getTableWidgetAncestor"]
- } );
- }
- if ( tableToolbarItems ) {
- widgetToolbarRepository.register( 'table', {
- ariaLabel: t( 'Table toolbar' ),
- items: tableToolbarItems,
- getRelatedElement: _utils_ui_widget__WEBPACK_IMPORTED_MODULE_2__["getSelectedTableWidget"]
- } );
- }
- }
- }
- /**
- * Items to be placed in the table content toolbar.
- * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
- *
- * Assuming that you use the {@link module:table/tableui~TableUI} feature, the following toolbar items will be available
- * in {@link module:ui/componentfactory~ComponentFactory}:
- *
- * * `'tableRow'`,
- * * `'tableColumn'`,
- * * `'mergeTableCells'`.
- *
- * You can thus configure the toolbar like this:
- *
- * const tableConfig = {
- * contentToolbar: [ 'tableRow', 'tableColumn', 'mergeTableCells' ]
- * };
- *
- * Of course, the same buttons can also be used in the
- * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
- *
- * Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
- *
- * @member {Array.<String>} module:table/table~TableConfig#contentToolbar
- */
- /**
- * Items to be placed in the table toolbar.
- * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
- *
- * You can thus configure the toolbar like this:
- *
- * const tableConfig = {
- * tableToolbar: [ 'blockQuote' ]
- * };
- *
- * Of course, the same buttons can also be used in the
- * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
- *
- * Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
- *
- * @member {Array.<String>} module:table/table~TableConfig#tableToolbar
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableui.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableui.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableUI; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var _ui_inserttableview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ui/inserttableview */ "./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js");
- /* harmony import */ var _theme_icons_table_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../theme/icons/table.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg");
- /* harmony import */ var _theme_icons_table_column_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../theme/icons/table-column.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg");
- /* harmony import */ var _theme_icons_table_row_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../theme/icons/table-row.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg");
- /* harmony import */ var _theme_icons_table_merge_cell_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../theme/icons/table-merge-cell.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/tableui
- */
- /**
- * The table UI plugin. It introduces:
- *
- * * The `'insertTable'` dropdown,
- * * The `'tableColumn'` dropdown,
- * * The `'tableRow'` dropdown,
- * * The `'mergeTableCells'` split button.
- *
- * The `'tableColumn'`, `'tableRow'` and `'mergeTableCells'` dropdowns work best with {@link module:table/tabletoolbar~TableToolbar}.
- *
- * @extends module:core/plugin~Plugin
- */
- class TableUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'TableUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const t = this.editor.t;
- const contentLanguageDirection = editor.locale.contentLanguageDirection;
- const isContentLtr = contentLanguageDirection === 'ltr';
- editor.ui.componentFactory.add( 'insertTable', locale => {
- const command = editor.commands.get( 'insertTable' );
- const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
- dropdownView.bind( 'isEnabled' ).to( command );
- // Decorate dropdown's button.
- dropdownView.buttonView.set( {
- icon: _theme_icons_table_svg__WEBPACK_IMPORTED_MODULE_4__["default"],
- label: t( 'Insert table' ),
- tooltip: true
- } );
- let insertTableView;
- dropdownView.on( 'change:isOpen', () => {
- if ( insertTableView ) {
- return;
- }
- // Prepare custom view for dropdown's panel.
- insertTableView = new _ui_inserttableview__WEBPACK_IMPORTED_MODULE_3__["default"]( locale );
- dropdownView.panelView.children.add( insertTableView );
- insertTableView.delegate( 'execute' ).to( dropdownView );
- dropdownView.buttonView.on( 'open', () => {
- // Reset the chooser before showing it to the user.
- insertTableView.rows = 0;
- insertTableView.columns = 0;
- } );
- dropdownView.on( 'execute', () => {
- editor.execute( 'insertTable', { rows: insertTableView.rows, columns: insertTableView.columns } );
- editor.editing.view.focus();
- } );
- } );
- return dropdownView;
- } );
- editor.ui.componentFactory.add( 'tableColumn', locale => {
- const options = [
- {
- type: 'switchbutton',
- model: {
- commandName: 'setTableColumnHeader',
- label: t( 'Header column' ),
- bindIsOn: true
- }
- },
- { type: 'separator' },
- {
- type: 'button',
- model: {
- commandName: isContentLtr ? 'insertTableColumnLeft' : 'insertTableColumnRight',
- label: t( 'Insert column left' )
- }
- },
- {
- type: 'button',
- model: {
- commandName: isContentLtr ? 'insertTableColumnRight' : 'insertTableColumnLeft',
- label: t( 'Insert column right' )
- }
- },
- {
- type: 'button',
- model: {
- commandName: 'removeTableColumn',
- label: t( 'Delete column' )
- }
- },
- {
- type: 'button',
- model: {
- commandName: 'selectTableColumn',
- label: t( 'Select column' )
- }
- }
- ];
- return this._prepareDropdown( t( 'Column' ), _theme_icons_table_column_svg__WEBPACK_IMPORTED_MODULE_5__["default"], options, locale );
- } );
- editor.ui.componentFactory.add( 'tableRow', locale => {
- const options = [
- {
- type: 'switchbutton',
- model: {
- commandName: 'setTableRowHeader',
- label: t( 'Header row' ),
- bindIsOn: true
- }
- },
- { type: 'separator' },
- {
- type: 'button',
- model: {
- commandName: 'insertTableRowAbove',
- label: t( 'Insert row above' )
- }
- },
- {
- type: 'button',
- model: {
- commandName: 'insertTableRowBelow',
- label: t( 'Insert row below' )
- }
- },
- {
- type: 'button',
- model: {
- commandName: 'removeTableRow',
- label: t( 'Delete row' )
- }
- },
- {
- type: 'button',
- model: {
- commandName: 'selectTableRow',
- label: t( 'Select row' )
- }
- }
- ];
- return this._prepareDropdown( t( 'Row' ), _theme_icons_table_row_svg__WEBPACK_IMPORTED_MODULE_6__["default"], options, locale );
- } );
- editor.ui.componentFactory.add( 'mergeTableCells', locale => {
- const options = [
- {
- type: 'button',
- model: {
- commandName: 'mergeTableCellUp',
- label: t( 'Merge cell up' )
- }
- },
- {
- type: 'button',
- model: {
- commandName: isContentLtr ? 'mergeTableCellRight' : 'mergeTableCellLeft',
- label: t( 'Merge cell right' )
- }
- },
- {
- type: 'button',
- model: {
- commandName: 'mergeTableCellDown',
- label: t( 'Merge cell down' )
- }
- },
- {
- type: 'button',
- model: {
- commandName: isContentLtr ? 'mergeTableCellLeft' : 'mergeTableCellRight',
- label: t( 'Merge cell left' )
- }
- },
- { type: 'separator' },
- {
- type: 'button',
- model: {
- commandName: 'splitTableCellVertically',
- label: t( 'Split cell vertically' )
- }
- },
- {
- type: 'button',
- model: {
- commandName: 'splitTableCellHorizontally',
- label: t( 'Split cell horizontally' )
- }
- }
- ];
- return this._prepareMergeSplitButtonDropdown( t( 'Merge cells' ), _theme_icons_table_merge_cell_svg__WEBPACK_IMPORTED_MODULE_7__["default"], options, locale );
- } );
- }
- /**
- * Creates a dropdown view from a set of options.
- *
- * @private
- * @param {String} label The dropdown button label.
- * @param {String} icon An icon for the dropdown button.
- * @param {Array.<module:ui/dropdown/utils~ListDropdownItemDefinition>} options The list of options for the dropdown.
- * @param {module:utils/locale~Locale} locale
- * @returns {module:ui/dropdown/dropdownview~DropdownView}
- */
- _prepareDropdown( label, icon, options, locale ) {
- const editor = this.editor;
- const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
- const commands = this._fillDropdownWithListOptions( dropdownView, options );
- // Decorate dropdown's button.
- dropdownView.buttonView.set( {
- label,
- icon,
- tooltip: true
- } );
- // Make dropdown button disabled when all options are disabled.
- dropdownView.bind( 'isEnabled' ).toMany( commands, 'isEnabled', ( ...areEnabled ) => {
- return areEnabled.some( isEnabled => isEnabled );
- } );
- this.listenTo( dropdownView, 'execute', evt => {
- editor.execute( evt.source.commandName );
- editor.editing.view.focus();
- } );
- return dropdownView;
- }
- /**
- * Creates a dropdown view with a {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} for
- * merge (and split)–related commands.
- *
- * @private
- * @param {String} label The dropdown button label.
- * @param {String} icon An icon for the dropdown button.
- * @param {Array.<module:ui/dropdown/utils~ListDropdownItemDefinition>} options The list of options for the dropdown.
- * @param {module:utils/locale~Locale} locale
- * @returns {module:ui/dropdown/dropdownview~DropdownView}
- */
- _prepareMergeSplitButtonDropdown( label, icon, options, locale ) {
- const editor = this.editor;
- const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["SplitButtonView"] );
- const mergeCommandName = 'mergeTableCells';
- // Main command.
- const mergeCommand = editor.commands.get( mergeCommandName );
- // Subcommands in the dropdown.
- const commands = this._fillDropdownWithListOptions( dropdownView, options );
- dropdownView.buttonView.set( {
- label,
- icon,
- tooltip: true,
- isEnabled: true
- } );
- // Make dropdown button disabled when all options are disabled together with the main command.
- dropdownView.bind( 'isEnabled' ).toMany( [ mergeCommand, ...commands ], 'isEnabled', ( ...areEnabled ) => {
- return areEnabled.some( isEnabled => isEnabled );
- } );
- // Merge selected table cells when the main part of the split button is clicked.
- this.listenTo( dropdownView.buttonView, 'execute', () => {
- editor.execute( mergeCommandName );
- editor.editing.view.focus();
- } );
- // Execute commands for events coming from the list in the dropdown panel.
- this.listenTo( dropdownView, 'execute', evt => {
- editor.execute( evt.source.commandName );
- editor.editing.view.focus();
- } );
- return dropdownView;
- }
- /**
- * Injects a {@link module:ui/list/listview~ListView} into the passed dropdown with buttons
- * which execute editor commands as configured in passed options.
- *
- * @private
- * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
- * @param {Array.<module:ui/dropdown/utils~ListDropdownItemDefinition>} options The list of options for the dropdown.
- * @returns {Array.<module:core/command~Command>} Commands the list options are interacting with.
- */
- _fillDropdownWithListOptions( dropdownView, options ) {
- const editor = this.editor;
- const commands = [];
- const itemDefinitions = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["Collection"]();
- for ( const option of options ) {
- addListOption( option, editor, commands, itemDefinitions );
- }
- Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addListToDropdown"])( dropdownView, itemDefinitions, editor.ui.componentFactory );
- return commands;
- }
- }
- // Adds an option to a list view.
- //
- // @param {module:table/tableui~DropdownOption} option A configuration option.
- // @param {module:core/editor/editor~Editor} editor
- // @param {Array.<module:core/command~Command>} commands The list of commands to update.
- // @param {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} itemDefinitions
- // A collection of dropdown items to update with the given option.
- function addListOption( option, editor, commands, itemDefinitions ) {
- const model = option.model = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Model"]( option.model );
- const { commandName, bindIsOn } = option.model;
- if ( option.type === 'button' || option.type === 'switchbutton' ) {
- const command = editor.commands.get( commandName );
- commands.push( command );
- model.set( { commandName } );
- model.bind( 'isEnabled' ).to( command );
- if ( bindIsOn ) {
- model.bind( 'isOn' ).to( command, 'value' );
- }
- }
- model.set( {
- withText: true
- } );
- itemDefinitions.add( option );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableUtils; });
- /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
- /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
- /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/tableutils
- */
- /**
- * The table utilities plugin.
- *
- * @extends module:core/plugin~Plugin
- */
- class TableUtils extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'TableUtils';
- }
- /**
- * @inheritDoc
- */
- init() {
- this.decorate( 'insertColumns' );
- this.decorate( 'insertRows' );
- }
- /**
- * Returns the table cell location as an object with table row and table column indexes.
- *
- * For instance, in the table below:
- *
- * 0 1 2 3
- * +---+---+---+---+
- * 0 | a | b | c |
- * + + +---+
- * 1 | | | d |
- * +---+---+ +---+
- * 2 | e | | f |
- * +---+---+---+---+
- *
- * the method will return:
- *
- * const cellA = table.getNodeByPath( [ 0, 0 ] );
- * editor.plugins.get( 'TableUtils' ).getCellLocation( cellA );
- * // will return { row: 0, column: 0 }
- *
- * const cellD = table.getNodeByPath( [ 1, 0 ] );
- * editor.plugins.get( 'TableUtils' ).getCellLocation( cellD );
- * // will return { row: 1, column: 3 }
- *
- * @param {module:engine/model/element~Element} tableCell
- * @returns {Object} Returns a `{row, column}` object.
- */
- getCellLocation( tableCell ) {
- const tableRow = tableCell.parent;
- const table = tableRow.parent;
- const rowIndex = table.getChildIndex( tableRow );
- const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { row: rowIndex } );
- for ( const { cell, row, column } of tableWalker ) {
- if ( cell === tableCell ) {
- return { row, column };
- }
- }
- }
- /**
- * Creates an empty table with a proper structure. The table needs to be inserted into the model,
- * for example, by using the {@link module:engine/model/model~Model#insertContent} function.
- *
- * model.change( ( writer ) => {
- * // Create a table of 2 rows and 7 columns:
- * const table = tableUtils.createTable( writer, { rows: 2, columns: 7 } );
- *
- * // Insert a table to the model at the best position taking the current selection:
- * model.insertContent( table );
- * }
- *
- * @param {module:engine/model/writer~Writer} writer The model writer.
- * @param {Object} options
- * @param {Number} [options.rows=2] The number of rows to create.
- * @param {Number} [options.columns=2] The number of columns to create.
- * @param {Number} [options.headingRows=0] The number of heading rows.
- * @param {Number} [options.headingColumns=0] The number of heading columns.
- * @returns {module:engine/model/element~Element} The created table element.
- */
- createTable( writer, options ) {
- const table = writer.createElement( 'table' );
- const rows = parseInt( options.rows ) || 2;
- const columns = parseInt( options.columns ) || 2;
- createEmptyRows( writer, table, 0, rows, columns );
- if ( options.headingRows ) {
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingRows', options.headingRows, table, writer, 0 );
- }
- if ( options.headingColumns ) {
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingColumns', options.headingColumns, table, writer, 0 );
- }
- return table;
- }
- /**
- * Inserts rows into a table.
- *
- * editor.plugins.get( 'TableUtils' ).insertRows( table, { at: 1, rows: 2 } );
- *
- * Assuming the table on the left, the above code will transform it to the table on the right:
- *
- * row index
- * 0 +---+---+---+ `at` = 1, +---+---+---+ 0
- * | a | b | c | `rows` = 2, | a | b | c |
- * 1 + +---+---+ <-- insert here + +---+---+ 1
- * | | d | e | | | | |
- * 2 + +---+---+ will give: + +---+---+ 2
- * | | f | g | | | | |
- * 3 +---+---+---+ + +---+---+ 3
- * | | d | e |
- * + +---+---+ 4
- * + + f | g |
- * +---+---+---+ 5
- *
- * @param {module:engine/model/element~Element} table The table model element where the rows will be inserted.
- * @param {Object} options
- * @param {Number} [options.at=0] The row index at which the rows will be inserted.
- * @param {Number} [options.rows=1] The number of rows to insert.
- * @param {Boolean|undefined} [options.copyStructureFromAbove] The flag for copying row structure. Note that
- * the row structure will not be copied if this option is not provided.
- */
- insertRows( table, options = {} ) {
- const model = this.editor.model;
- const insertAt = options.at || 0;
- const rowsToInsert = options.rows || 1;
- const isCopyStructure = options.copyStructureFromAbove !== undefined;
- const copyStructureFrom = options.copyStructureFromAbove ? insertAt - 1 : insertAt;
- const rows = this.getRows( table );
- const columns = this.getColumns( table );
- if ( insertAt > rows ) {
- /**
- * The `options.at` points at a row position that does not exist.
- *
- * @error tableutils-insertrows-insert-out-of-range
- */
- throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"](
- 'tableutils-insertrows-insert-out-of-range',
- this,
- { options }
- );
- }
- model.change( writer => {
- const headingRows = table.getAttribute( 'headingRows' ) || 0;
- // Inserting rows inside heading section requires to update `headingRows` attribute as the heading section will grow.
- if ( headingRows > insertAt ) {
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingRows', headingRows + rowsToInsert, table, writer, 0 );
- }
- // Inserting at the end or at the beginning of a table doesn't require to calculate anything special.
- if ( !isCopyStructure && ( insertAt === 0 || insertAt === rows ) ) {
- createEmptyRows( writer, table, insertAt, rowsToInsert, columns );
- return;
- }
- // Iterate over all the rows above the inserted rows in order to check for the row-spanned cells.
- const walkerEndRow = isCopyStructure ? Math.max( insertAt, copyStructureFrom ) : insertAt;
- const tableIterator = new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { endRow: walkerEndRow } );
- // Store spans of the reference row to reproduce it's structure. This array is column number indexed.
- const rowColSpansMap = new Array( columns ).fill( 1 );
- for ( const { row, column, cellHeight, cellWidth, cell } of tableIterator ) {
- const lastCellRow = row + cellHeight - 1;
- const isOverlappingInsertedRow = row < insertAt && insertAt <= lastCellRow;
- const isReferenceRow = row <= copyStructureFrom && copyStructureFrom <= lastCellRow;
- // If the cell is row-spanned and overlaps the inserted row, then reserve space for it in the row map.
- if ( isOverlappingInsertedRow ) {
- // This cell overlaps the inserted rows so we need to expand it further.
- writer.setAttribute( 'rowspan', cellHeight + rowsToInsert, cell );
- // Mark this cell with negative number to indicate how many cells should be skipped when adding the new cells.
- rowColSpansMap[ column ] = -cellWidth;
- }
- // Store the colspan from reference row.
- else if ( isCopyStructure && isReferenceRow ) {
- rowColSpansMap[ column ] = cellWidth;
- }
- }
- for ( let rowIndex = 0; rowIndex < rowsToInsert; rowIndex++ ) {
- const tableRow = writer.createElement( 'tableRow' );
- writer.insert( tableRow, table, insertAt );
- for ( let cellIndex = 0; cellIndex < rowColSpansMap.length; cellIndex++ ) {
- const colspan = rowColSpansMap[ cellIndex ];
- const insertPosition = writer.createPositionAt( tableRow, 'end' );
- // Insert the empty cell only if this slot is not row-spanned from any other cell.
- if ( colspan > 0 ) {
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["createEmptyTableCell"])( writer, insertPosition, colspan > 1 ? { colspan } : null );
- }
- // Skip the col-spanned slots, there won't be any cells.
- cellIndex += Math.abs( colspan ) - 1;
- }
- }
- } );
- }
- /**
- * Inserts columns into a table.
- *
- * editor.plugins.get( 'TableUtils' ).insertColumns( table, { at: 1, columns: 2 } );
- *
- * Assuming the table on the left, the above code will transform it to the table on the right:
- *
- * 0 1 2 3 0 1 2 3 4 5
- * +---+---+---+ +---+---+---+---+---+
- * | a | b | | a | b |
- * + +---+ + +---+
- * | | c | | | c |
- * +---+---+---+ will give: +---+---+---+---+---+
- * | d | e | f | | d | | | e | f |
- * +---+ +---+ +---+---+---+ +---+
- * | g | | h | | g | | | | h |
- * +---+---+---+ +---+---+---+---+---+
- * | i | | i |
- * +---+---+---+ +---+---+---+---+---+
- * ^---- insert here, `at` = 1, `columns` = 2
- *
- * @param {module:engine/model/element~Element} table The table model element where the columns will be inserted.
- * @param {Object} options
- * @param {Number} [options.at=0] The column index at which the columns will be inserted.
- * @param {Number} [options.columns=1] The number of columns to insert.
- */
- insertColumns( table, options = {} ) {
- const model = this.editor.model;
- const insertAt = options.at || 0;
- const columnsToInsert = options.columns || 1;
- model.change( writer => {
- const headingColumns = table.getAttribute( 'headingColumns' );
- // Inserting columns inside heading section requires to update `headingColumns` attribute as the heading section will grow.
- if ( insertAt < headingColumns ) {
- writer.setAttribute( 'headingColumns', headingColumns + columnsToInsert, table );
- }
- const tableColumns = this.getColumns( table );
- // Inserting at the end and at the beginning of a table doesn't require to calculate anything special.
- if ( insertAt === 0 || tableColumns === insertAt ) {
- for ( const tableRow of table.getChildren() ) {
- // Ignore non-row elements inside the table (e.g. caption).
- if ( !tableRow.is( 'element', 'tableRow' ) ) {
- continue;
- }
- createCells( columnsToInsert, writer, writer.createPositionAt( tableRow, insertAt ? 'end' : 0 ) );
- }
- return;
- }
- const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { column: insertAt, includeAllSlots: true } );
- for ( const tableSlot of tableWalker ) {
- const { row, cell, cellAnchorColumn, cellAnchorRow, cellWidth, cellHeight } = tableSlot;
- // When iterating over column the table walker outputs either:
- // - cells at given column index (cell "e" from method docs),
- // - spanned columns (spanned cell from row between cells "g" and "h" - spanned by "e", only if `includeAllSlots: true`),
- // - or a cell from the same row which spans over this column (cell "a").
- if ( cellAnchorColumn < insertAt ) {
- // If cell is anchored in previous column, it is a cell that spans over an inserted column (cell "a" & "i").
- // For such cells expand them by a number of columns inserted.
- writer.setAttribute( 'colspan', cellWidth + columnsToInsert, cell );
- // This cell will overlap cells in rows below so skip them (because of `includeAllSlots` option) - (cell "a")
- const lastCellRow = cellAnchorRow + cellHeight - 1;
- for ( let i = row; i <= lastCellRow; i++ ) {
- tableWalker.skipRow( i );
- }
- } else {
- // It's either cell at this column index or spanned cell by a row-spanned cell from row above.
- // In table above it's cell "e" and a spanned position from row below (empty cell between cells "g" and "h")
- createCells( columnsToInsert, writer, tableSlot.getPositionBefore() );
- }
- }
- } );
- }
- /**
- * Removes rows from the given `table`.
- *
- * This method re-calculates the table geometry including `rowspan` attribute of table cells overlapping removed rows
- * and table headings values.
- *
- * editor.plugins.get( 'TableUtils' ).removeRows( table, { at: 1, rows: 2 } );
- *
- * Executing the above code in the context of the table on the left will transform its structure as presented on the right:
- *
- * row index
- * ┌───┬───┬───┐ `at` = 1 ┌───┬───┬───┐
- * 0 │ a │ b │ c │ `rows` = 2 │ a │ b │ c │ 0
- * │ ├───┼───┤ │ ├───┼───┤
- * 1 │ │ d │ e │ <-- remove from here │ │ d │ g │ 1
- * │ │ ├───┤ will give: ├───┼───┼───┤
- * 2 │ │ │ f │ │ h │ i │ j │ 2
- * │ │ ├───┤ └───┴───┴───┘
- * 3 │ │ │ g │
- * ├───┼───┼───┤
- * 4 │ h │ i │ j │
- * └───┴───┴───┘
- *
- * @param {module:engine/model/element~Element} table
- * @param {Object} options
- * @param {Number} options.at The row index at which the removing rows will start.
- * @param {Number} [options.rows=1] The number of rows to remove.
- */
- removeRows( table, options ) {
- const model = this.editor.model;
- const rowsToRemove = options.rows || 1;
- const rowCount = this.getRows( table );
- const first = options.at;
- const last = first + rowsToRemove - 1;
- if ( last > rowCount - 1 ) {
- /**
- * The `options.at` param must point at existing row and `options.rows` must not exceed the rows in the table.
- *
- * @error tableutils-removerows-row-index-out-of-range
- */
- throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"](
- 'tableutils-removerows-row-index-out-of-range',
- this,
- { table, options }
- );
- }
- model.change( writer => {
- // Removing rows from the table require that most calculations to be done prior to changing table structure.
- // Preparations must be done in the same enqueueChange callback to use the current table structure.
- // 1. Preparation - get row-spanned cells that have to be modified after removing rows.
- const { cellsToMove, cellsToTrim } = getCellsToMoveAndTrimOnRemoveRow( table, first, last );
- // 2. Execution
- // 2a. Move cells from removed rows that extends over a removed section - must be done before removing rows.
- // This will fill any gaps in a rows below that previously were empty because of row-spanned cells.
- if ( cellsToMove.size ) {
- const rowAfterRemovedSection = last + 1;
- moveCellsToRow( table, rowAfterRemovedSection, cellsToMove, writer );
- }
- // 2b. Remove all required rows.
- for ( let i = last; i >= first; i-- ) {
- writer.remove( table.getChild( i ) );
- }
- // 2c. Update cells from rows above that overlap removed section. Similar to step 2 but does not involve moving cells.
- for ( const { rowspan, cell } of cellsToTrim ) {
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', rowspan, cell, writer );
- }
- // 2d. Adjust heading rows if removed rows were in a heading section.
- updateHeadingRows( table, first, last, writer );
- // 2e. Remove empty columns (without anchored cells) if there are any.
- if ( !Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyColumns"])( table, this ) ) {
- // If there wasn't any empty columns then we still need to check if this wasn't called
- // because of cleaning empty rows and we only removed one of them.
- Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRows"])( table, this );
- }
- } );
- }
- /**
- * Removes columns from the given `table`.
- *
- * This method re-calculates the table geometry including the `colspan` attribute of table cells overlapping removed columns
- * and table headings values.
- *
- * editor.plugins.get( 'TableUtils' ).removeColumns( table, { at: 1, columns: 2 } );
- *
- * Executing the above code in the context of the table on the left will transform its structure as presented on the right:
- *
- * 0 1 2 3 4 0 1 2
- * ┌───────────────┬───┐ ┌───────┬───┐
- * │ a │ b │ │ a │ b │
- * │ ├───┤ │ ├───┤
- * │ │ c │ │ │ c │
- * ├───┬───┬───┬───┼───┤ will give: ├───┬───┼───┤
- * │ d │ e │ f │ g │ h │ │ d │ g │ h │
- * ├───┼───┼───┤ ├───┤ ├───┤ ├───┤
- * │ i │ j │ k │ │ l │ │ i │ │ l │
- * ├───┴───┴───┴───┴───┤ ├───┴───┴───┤
- * │ m │ │ m │
- * └───────────────────┘ └───────────┘
- * ^---- remove from here, `at` = 1, `columns` = 2
- *
- * @param {module:engine/model/element~Element} table
- * @param {Object} options
- * @param {Number} options.at The row index at which the removing columns will start.
- * @param {Number} [options.columns=1] The number of columns to remove.
- */
- removeColumns( table, options ) {
- const model = this.editor.model;
- const first = options.at;
- const columnsToRemove = options.columns || 1;
- const last = options.at + columnsToRemove - 1;
- model.change( writer => {
- adjustHeadingColumns( table, { first, last }, writer );
- for ( let removedColumnIndex = last; removedColumnIndex >= first; removedColumnIndex-- ) {
- for ( const { cell, column, cellWidth } of [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table ) ] ) {
- // If colspaned cell overlaps removed column decrease its span.
- if ( column <= removedColumnIndex && cellWidth > 1 && column + cellWidth > removedColumnIndex ) {
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'colspan', cellWidth - 1, cell, writer );
- } else if ( column === removedColumnIndex ) {
- // The cell in removed column has colspan of 1.
- writer.remove( cell );
- }
- }
- }
- // Remove empty rows that could appear after removing columns.
- if ( !Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRows"])( table, this ) ) {
- // If there wasn't any empty rows then we still need to check if this wasn't called
- // because of cleaning empty columns and we only removed one of them.
- Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyColumns"])( table, this );
- }
- } );
- }
- /**
- * Divides a table cell vertically into several ones.
- *
- * The cell will be visually split into more cells by updating colspans of other cells in a column
- * and inserting cells (columns) after that cell.
- *
- * In the table below, if cell "a" is split into 3 cells:
- *
- * +---+---+---+
- * | a | b | c |
- * +---+---+---+
- * | d | e | f |
- * +---+---+---+
- *
- * it will result in the table below:
- *
- * +---+---+---+---+---+
- * | a | | | b | c |
- * +---+---+---+---+---+
- * | d | e | f |
- * +---+---+---+---+---+
- *
- * So cell "d" will get its `colspan` updated to `3` and 2 cells will be added (2 columns will be created).
- *
- * Splitting a cell that already has a `colspan` attribute set will distribute the cell `colspan` evenly and the remainder
- * will be left to the original cell:
- *
- * +---+---+---+
- * | a |
- * +---+---+---+
- * | b | c | d |
- * +---+---+---+
- *
- * Splitting cell "a" with `colspan=3` into 2 cells will create 1 cell with a `colspan=a` and cell "a" that will have `colspan=2`:
- *
- * +---+---+---+
- * | a | |
- * +---+---+---+
- * | b | c | d |
- * +---+---+---+
- *
- * @param {module:engine/model/element~Element} tableCell
- * @param {Number} numberOfCells
- */
- splitCellVertically( tableCell, numberOfCells = 2 ) {
- const model = this.editor.model;
- const tableRow = tableCell.parent;
- const table = tableRow.parent;
- const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
- const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
- model.change( writer => {
- // First check - the cell spans over multiple rows so before doing anything else just split this cell.
- if ( colspan > 1 ) {
- // Get spans of new (inserted) cells and span to update of split cell.
- const { newCellsSpan, updatedSpan } = breakSpanEvenly( colspan, numberOfCells );
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'colspan', updatedSpan, tableCell, writer );
- // Each inserted cell will have the same attributes:
- const newCellsAttributes = {};
- // Do not store default value in the model.
- if ( newCellsSpan > 1 ) {
- newCellsAttributes.colspan = newCellsSpan;
- }
- // Copy rowspan of split cell.
- if ( rowspan > 1 ) {
- newCellsAttributes.rowspan = rowspan;
- }
- const cellsToInsert = colspan > numberOfCells ? numberOfCells - 1 : colspan - 1;
- createCells( cellsToInsert, writer, writer.createPositionAfter( tableCell ), newCellsAttributes );
- }
- // Second check - the cell has colspan of 1 or we need to create more cells then the currently one spans over.
- if ( colspan < numberOfCells ) {
- const cellsToInsert = numberOfCells - colspan;
- // First step: expand cells on the same column as split cell.
- const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table ) ];
- // Get the column index of split cell.
- const { column: splitCellColumn } = tableMap.find( ( { cell } ) => cell === tableCell );
- // Find cells which needs to be expanded vertically - those on the same column or those that spans over split cell's column.
- const cellsToUpdate = tableMap.filter( ( { cell, cellWidth, column } ) => {
- const isOnSameColumn = cell !== tableCell && column === splitCellColumn;
- const spansOverColumn = ( column < splitCellColumn && column + cellWidth > splitCellColumn );
- return isOnSameColumn || spansOverColumn;
- } );
- // Expand cells vertically.
- for ( const { cell, cellWidth } of cellsToUpdate ) {
- writer.setAttribute( 'colspan', cellWidth + cellsToInsert, cell );
- }
- // Second step: create columns after split cell.
- // Each inserted cell will have the same attributes:
- const newCellsAttributes = {};
- // Do not store default value in the model.
- // Copy rowspan of split cell.
- if ( rowspan > 1 ) {
- newCellsAttributes.rowspan = rowspan;
- }
- createCells( cellsToInsert, writer, writer.createPositionAfter( tableCell ), newCellsAttributes );
- const headingColumns = table.getAttribute( 'headingColumns' ) || 0;
- // Update heading section if split cell is in heading section.
- if ( headingColumns > splitCellColumn ) {
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingColumns', headingColumns + cellsToInsert, table, writer );
- }
- }
- } );
- }
- /**
- * Divides a table cell horizontally into several ones.
- *
- * The cell will be visually split into more cells by updating rowspans of other cells in the row and inserting rows with a single cell
- * below.
- *
- * If in the table below cell "b" is split into 3 cells:
- *
- * +---+---+---+
- * | a | b | c |
- * +---+---+---+
- * | d | e | f |
- * +---+---+---+
- *
- * It will result in the table below:
- *
- * +---+---+---+
- * | a | b | c |
- * + +---+ +
- * | | | |
- * + +---+ +
- * | | | |
- * +---+---+---+
- * | d | e | f |
- * +---+---+---+
- *
- * So cells "a" and "b" will get their `rowspan` updated to `3` and 2 rows with a single cell will be added.
- *
- * Splitting a cell that already has a `rowspan` attribute set will distribute the cell `rowspan` evenly and the remainder
- * will be left to the original cell:
- *
- * +---+---+---+
- * | a | b | c |
- * + +---+---+
- * | | d | e |
- * + +---+---+
- * | | f | g |
- * + +---+---+
- * | | h | i |
- * +---+---+---+
- *
- * Splitting cell "a" with `rowspan=4` into 3 cells will create 2 cells with a `rowspan=1` and cell "a" will have `rowspan=2`:
- *
- * +---+---+---+
- * | a | b | c |
- * + +---+---+
- * | | d | e |
- * +---+---+---+
- * | | f | g |
- * +---+---+---+
- * | | h | i |
- * +---+---+---+
- *
- * @param {module:engine/model/element~Element} tableCell
- * @param {Number} numberOfCells
- */
- splitCellHorizontally( tableCell, numberOfCells = 2 ) {
- const model = this.editor.model;
- const tableRow = tableCell.parent;
- const table = tableRow.parent;
- const splitCellRow = table.getChildIndex( tableRow );
- const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
- const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
- model.change( writer => {
- // First check - the cell spans over multiple rows so before doing anything else just split this cell.
- if ( rowspan > 1 ) {
- // Cache table map before updating table.
- const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, {
- startRow: splitCellRow,
- endRow: splitCellRow + rowspan - 1,
- includeAllSlots: true
- } ) ];
- // Get spans of new (inserted) cells and span to update of split cell.
- const { newCellsSpan, updatedSpan } = breakSpanEvenly( rowspan, numberOfCells );
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', updatedSpan, tableCell, writer );
- const { column: cellColumn } = tableMap.find( ( { cell } ) => cell === tableCell );
- // Each inserted cell will have the same attributes:
- const newCellsAttributes = {};
- // Do not store default value in the model.
- if ( newCellsSpan > 1 ) {
- newCellsAttributes.rowspan = newCellsSpan;
- }
- // Copy colspan of split cell.
- if ( colspan > 1 ) {
- newCellsAttributes.colspan = colspan;
- }
- for ( const tableSlot of tableMap ) {
- const { column, row } = tableSlot;
- // As both newly created cells and the split cell might have rowspan,
- // the insertion of new cells must go to appropriate rows:
- //
- // 1. It's a row after split cell + it's height.
- const isAfterSplitCell = row >= splitCellRow + updatedSpan;
- // 2. Is on the same column.
- const isOnSameColumn = column === cellColumn;
- // 3. And it's row index is after previous cell height.
- const isInEvenlySplitRow = ( row + splitCellRow + updatedSpan ) % newCellsSpan === 0;
- if ( isAfterSplitCell && isOnSameColumn && isInEvenlySplitRow ) {
- createCells( 1, writer, tableSlot.getPositionBefore(), newCellsAttributes );
- }
- }
- }
- // Second check - the cell has rowspan of 1 or we need to create more cells than the current cell spans over.
- if ( rowspan < numberOfCells ) {
- // We already split the cell in check one so here we split to the remaining number of cells only.
- const cellsToInsert = numberOfCells - rowspan;
- // This check is needed since we need to check if there are any cells from previous rows than spans over this cell's row.
- const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { startRow: 0, endRow: splitCellRow } ) ];
- // First step: expand cells.
- for ( const { cell, cellHeight, row } of tableMap ) {
- // Expand rowspan of cells that are either:
- // - on the same row as current cell,
- // - or are below split cell row and overlaps that row.
- if ( cell !== tableCell && row + cellHeight > splitCellRow ) {
- const rowspanToSet = cellHeight + cellsToInsert;
- writer.setAttribute( 'rowspan', rowspanToSet, cell );
- }
- }
- // Second step: create rows with single cell below split cell.
- const newCellsAttributes = {};
- // Copy colspan of split cell.
- if ( colspan > 1 ) {
- newCellsAttributes.colspan = colspan;
- }
- createEmptyRows( writer, table, splitCellRow + 1, cellsToInsert, 1, newCellsAttributes );
- // Update heading section if split cell is in heading section.
- const headingRows = table.getAttribute( 'headingRows' ) || 0;
- if ( headingRows > splitCellRow ) {
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingRows', headingRows + cellsToInsert, table, writer );
- }
- }
- } );
- }
- /**
- * Returns the number of columns for a given table.
- *
- * editor.plugins.get( 'TableUtils' ).getColumns( table );
- *
- * @param {module:engine/model/element~Element} table The table to analyze.
- * @returns {Number}
- */
- getColumns( table ) {
- // Analyze first row only as all the rows should have the same width.
- // Using the first row without checking if it's a tableRow because we expect
- // that table will have only tableRow model elements at the beginning.
- const row = table.getChild( 0 );
- return [ ...row.getChildren() ].reduce( ( columns, row ) => {
- const columnWidth = parseInt( row.getAttribute( 'colspan' ) || 1 );
- return columns + columnWidth;
- }, 0 );
- }
- /**
- * Returns the number of rows for a given table. Any other element present in the table model is omitted.
- *
- * editor.plugins.get( 'TableUtils' ).getRows( table );
- *
- * @param {module:engine/model/element~Element} table The table to analyze.
- * @returns {Number}
- */
- getRows( table ) {
- // Rowspan not included due to #6427.
- return Array.from( table.getChildren() )
- .reduce( ( rowCount, child ) => child.is( 'element', 'tableRow' ) ? rowCount + 1 : rowCount, 0 );
- }
- }
- // Creates empty rows at the given index in an existing table.
- //
- // @param {module:engine/model/writer~Writer} writer
- // @param {module:engine/model/element~Element} table
- // @param {Number} insertAt The row index of row insertion.
- // @param {Number} rows The number of rows to create.
- // @param {Number} tableCellToInsert The number of cells to insert in each row.
- function createEmptyRows( writer, table, insertAt, rows, tableCellToInsert, attributes = {} ) {
- for ( let i = 0; i < rows; i++ ) {
- const tableRow = writer.createElement( 'tableRow' );
- writer.insert( tableRow, table, insertAt );
- createCells( tableCellToInsert, writer, writer.createPositionAt( tableRow, 'end' ), attributes );
- }
- }
- // Creates cells at a given position.
- //
- // @param {Number} columns The number of columns to create
- // @param {module:engine/model/writer~Writer} writer
- // @param {module:engine/model/position~Position} insertPosition
- function createCells( cells, writer, insertPosition, attributes = {} ) {
- for ( let i = 0; i < cells; i++ ) {
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["createEmptyTableCell"])( writer, insertPosition, attributes );
- }
- }
- // Evenly distributes the span of a cell to a number of provided cells.
- // The resulting spans will always be integer values.
- //
- // For instance breaking a span of 7 into 3 cells will return:
- //
- // { newCellsSpan: 2, updatedSpan: 3 }
- //
- // as two cells will have a span of 2 and the remainder will go the first cell so its span will change to 3.
- //
- // @param {Number} span The span value do break.
- // @param {Number} numberOfCells The number of resulting spans.
- // @returns {{newCellsSpan: Number, updatedSpan: Number}}
- function breakSpanEvenly( span, numberOfCells ) {
- if ( span < numberOfCells ) {
- return { newCellsSpan: 1, updatedSpan: 1 };
- }
- const newCellsSpan = Math.floor( span / numberOfCells );
- const updatedSpan = ( span - newCellsSpan * numberOfCells ) + newCellsSpan;
- return { newCellsSpan, updatedSpan };
- }
- // Updates heading columns attribute if removing a row from head section.
- function adjustHeadingColumns( table, removedColumnIndexes, writer ) {
- const headingColumns = table.getAttribute( 'headingColumns' ) || 0;
- if ( headingColumns && removedColumnIndexes.first < headingColumns ) {
- const headingsRemoved = Math.min( headingColumns - 1 /* Other numbers are 0-based */, removedColumnIndexes.last ) -
- removedColumnIndexes.first + 1;
- writer.setAttribute( 'headingColumns', headingColumns - headingsRemoved, table );
- }
- }
- // Calculates a new heading rows value for removing rows from heading section.
- function updateHeadingRows( table, first, last, writer ) {
- const headingRows = table.getAttribute( 'headingRows' ) || 0;
- if ( first < headingRows ) {
- const newRows = last < headingRows ? headingRows - ( last - first + 1 ) : first;
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingRows', newRows, table, writer, 0 );
- }
- }
- // Finds cells that will be:
- // - trimmed - Cells that are "above" removed rows sections and overlap the removed section - their rowspan must be trimmed.
- // - moved - Cells from removed rows section might stick out of. These cells are moved to the next row after a removed section.
- //
- // Sample table with overlapping & sticking out cells:
- //
- // +----+----+----+----+----+
- // | 00 | 01 | 02 | 03 | 04 |
- // +----+ + + + +
- // | 10 | | | | |
- // +----+----+ + + +
- // | 20 | 21 | | | | <-- removed row
- // + + +----+ + +
- // | | | 32 | | | <-- removed row
- // +----+ + +----+ +
- // | 40 | | | 43 | |
- // +----+----+----+----+----+
- //
- // In a table above:
- // - cells to trim: '02', '03' & '04'.
- // - cells to move: '21' & '32'.
- function getCellsToMoveAndTrimOnRemoveRow( table, first, last ) {
- const cellsToMove = new Map();
- const cellsToTrim = [];
- for ( const { row, column, cellHeight, cell } of new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { endRow: last } ) ) {
- const lastRowOfCell = row + cellHeight - 1;
- const isCellStickingOutFromRemovedRows = row >= first && row <= last && lastRowOfCell > last;
- if ( isCellStickingOutFromRemovedRows ) {
- const rowspanInRemovedSection = last - row + 1;
- const rowSpanToSet = cellHeight - rowspanInRemovedSection;
- cellsToMove.set( column, {
- cell,
- rowspan: rowSpanToSet
- } );
- }
- const isCellOverlappingRemovedRows = row < first && lastRowOfCell >= first;
- if ( isCellOverlappingRemovedRows ) {
- let rowspanAdjustment;
- // Cell fully covers removed section - trim it by removed rows count.
- if ( lastRowOfCell >= last ) {
- rowspanAdjustment = last - first + 1;
- }
- // Cell partially overlaps removed section - calculate cell's span that is in removed section.
- else {
- rowspanAdjustment = lastRowOfCell - first + 1;
- }
- cellsToTrim.push( {
- cell,
- rowspan: cellHeight - rowspanAdjustment
- } );
- }
- }
- return { cellsToMove, cellsToTrim };
- }
- function moveCellsToRow( table, targetRowIndex, cellsToMove, writer ) {
- const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, {
- includeAllSlots: true,
- row: targetRowIndex
- } );
- const tableRowMap = [ ...tableWalker ];
- const row = table.getChild( targetRowIndex );
- let previousCell;
- for ( const { column, cell, isAnchor } of tableRowMap ) {
- if ( cellsToMove.has( column ) ) {
- const { cell: cellToMove, rowspan } = cellsToMove.get( column );
- const targetPosition = previousCell ?
- writer.createPositionAfter( previousCell ) :
- writer.createPositionAt( row, 0 );
- writer.move( writer.createRangeOn( cellToMove ), targetPosition );
- Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', rowspan, cellToMove, writer );
- previousCell = cellToMove;
- } else if ( isAnchor ) {
- // If cell is spanned then `cell` holds reference to overlapping cell. See ckeditor/ckeditor5#6502.
- previousCell = cell;
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableWalker; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/tablewalker
- */
- // @if CK_DEBUG // import { CKEditorError } from 'ckeditor5/src/utils';
- /**
- * The table iterator class. It allows to iterate over table cells. For each cell the iterator yields
- * {@link module:table/tablewalker~TableSlot} with proper table cell attributes.
- */
- class TableWalker {
- /**
- * Creates an instance of the table walker.
- *
- * The table walker iterates internally by traversing the table from row index = 0 and column index = 0.
- * It walks row by row and column by column in order to output values defined in the constructor.
- * By default it will output only the locations that are occupied by a cell. To include also spanned rows and columns,
- * pass the `includeAllSlots` option to the constructor.
- *
- * The most important values of the iterator are column and row indexes of a cell.
- *
- * See {@link module:table/tablewalker~TableSlot} what values are returned by the table walker.
- *
- * To iterate over a given row:
- *
- * const tableWalker = new TableWalker( table, { startRow: 1, endRow: 2 } );
- *
- * for ( const tableSlot of tableWalker ) {
- * console.log( 'A cell at row', tableSlot.row, 'and column', tableSlot.column );
- * }
- *
- * For instance the code above for the following table:
- *
- * +----+----+----+----+----+----+
- * | 00 | 02 | 03 | 04 | 05 |
- * | +----+----+----+----+
- * | | 12 | 14 | 15 |
- * | +----+----+----+ +
- * | | 22 | |
- * |----+----+----+----+----+ +
- * | 30 | 31 | 32 | 33 | 34 | |
- * +----+----+----+----+----+----+
- *
- * will log in the console:
- *
- * 'A cell at row 1 and column 2'
- * 'A cell at row 1 and column 4'
- * 'A cell at row 1 and column 5'
- * 'A cell at row 2 and column 2'
- *
- * To also iterate over spanned cells:
- *
- * const tableWalker = new TableWalker( table, { row: 1, includeAllSlots: true } );
- *
- * for ( const tableSlot of tableWalker ) {
- * console.log( 'Slot at', tableSlot.row, 'x', tableSlot.column, ':', tableSlot.isAnchor ? 'is anchored' : 'is spanned' );
- * }
- *
- * will log in the console for the table from the previous example:
- *
- * 'Cell at 1 x 0 : is spanned'
- * 'Cell at 1 x 1 : is spanned'
- * 'Cell at 1 x 2 : is anchored'
- * 'Cell at 1 x 3 : is spanned'
- * 'Cell at 1 x 4 : is anchored'
- * 'Cell at 1 x 5 : is anchored'
- *
- * **Note**: Option `row` is a shortcut that sets both `startRow` and `endRow` to the same row.
- * (Use either `row` or `startRow` and `endRow` but never together). Similarly the `column` option sets both `startColumn`
- * and `endColumn` to the same column (Use either `column` or `startColumn` and `endColumn` but never together).
- *
- * @constructor
- * @param {module:engine/model/element~Element} table A table over which the walker iterates.
- * @param {Object} [options={}] An object with configuration.
- * @param {Number} [options.row] A row index for which this iterator will output cells.
- * Can't be used together with `startRow` and `endRow`.
- * @param {Number} [options.startRow=0] A row index from which this iterator should start. Can't be used together with `row`.
- * @param {Number} [options.endRow] A row index at which this iterator should end. Can't be used together with `row`.
- * @param {Number} [options.column] A column index for which this iterator will output cells.
- * Can't be used together with `startColumn` and `endColumn`.
- * @param {Number} [options.startColumn=0] A column index from which this iterator should start. Can't be used together with `column`.
- * @param {Number} [options.endColumn] A column index at which this iterator should end. Can't be used together with `column`.
- * @param {Boolean} [options.includeAllSlots=false] Also return values for spanned cells.
- */
- constructor( table, options = {} ) {
- /**
- * The walker's table element.
- *
- * @readonly
- * @member {module:engine/model/element~Element}
- * @protected
- */
- this._table = table;
- /**
- * A row index from which this iterator will start.
- *
- * @readonly
- * @member {Number}
- * @private
- */
- this._startRow = options.row !== undefined ? options.row : options.startRow || 0;
- /**
- * A row index at which this iterator will end.
- *
- * @readonly
- * @member {Number}
- * @private
- */
- this._endRow = options.row !== undefined ? options.row : options.endRow;
- /**
- * If set, the table walker will only output cells from a given column and following ones or cells that overlap them.
- *
- * @readonly
- * @member {Number}
- * @private
- */
- this._startColumn = options.column !== undefined ? options.column : options.startColumn || 0;
- /**
- * If set, the table walker will only output cells up to a given column.
- *
- * @readonly
- * @member {Number}
- * @private
- */
- this._endColumn = options.column !== undefined ? options.column : options.endColumn;
- /**
- * Enables output of spanned cells that are normally not yielded.
- *
- * @readonly
- * @member {Boolean}
- * @private
- */
- this._includeAllSlots = !!options.includeAllSlots;
- /**
- * Row indexes to skip from the iteration.
- *
- * @readonly
- * @member {Set<Number>}
- * @private
- */
- this._skipRows = new Set();
- /**
- * The current row index.
- *
- * @member {Number}
- * @protected
- */
- this._row = 0;
- /**
- * The index of the current row element in the table.
- *
- * @type {Number}
- * @protected
- */
- this._rowIndex = 0;
- /**
- * The current column index.
- *
- * @member {Number}
- * @protected
- */
- this._column = 0;
- /**
- * The cell index in a parent row. For spanned cells when {@link #_includeAllSlots} is set to `true`,
- * this represents the index of the next table cell.
- *
- * @member {Number}
- * @protected
- */
- this._cellIndex = 0;
- /**
- * Holds a map of spanned cells in a table.
- *
- * @readonly
- * @member {Map.<Number, Map.<Number, Object>>}
- * @private
- */
- this._spannedCells = new Map();
- /**
- * Index of the next column where a cell is anchored.
- *
- * @member {Number}
- * @private
- */
- this._nextCellAtColumn = -1;
- }
- /**
- * Iterable interface.
- *
- * @returns {Iterable.<module:table/tablewalker~TableSlot>}
- */
- [ Symbol.iterator ]() {
- return this;
- }
- /**
- * Gets the next table walker's value.
- *
- * @returns {module:table/tablewalker~TableSlot} The next table walker's value.
- */
- next() {
- const row = this._table.getChild( this._rowIndex );
- // Iterator is done when there's no row (table ended) or the row is after `endRow` limit.
- if ( !row || this._isOverEndRow() ) {
- return { done: true };
- }
- // We step over current element when it is not a tableRow instance.
- if ( !row.is( 'element', 'tableRow' ) ) {
- this._rowIndex++;
- return this.next();
- }
- if ( this._isOverEndColumn() ) {
- return this._advanceToNextRow();
- }
- let outValue = null;
- const spanData = this._getSpanned();
- if ( spanData ) {
- if ( this._includeAllSlots && !this._shouldSkipSlot() ) {
- outValue = this._formatOutValue( spanData.cell, spanData.row, spanData.column );
- }
- } else {
- const cell = row.getChild( this._cellIndex );
- if ( !cell ) {
- // If there are no more cells left in row advance to the next row.
- return this._advanceToNextRow();
- }
- const colspan = parseInt( cell.getAttribute( 'colspan' ) || 1 );
- const rowspan = parseInt( cell.getAttribute( 'rowspan' ) || 1 );
- // Record this cell spans if it's not 1x1 cell.
- if ( colspan > 1 || rowspan > 1 ) {
- this._recordSpans( cell, rowspan, colspan );
- }
- if ( !this._shouldSkipSlot() ) {
- outValue = this._formatOutValue( cell );
- }
- this._nextCellAtColumn = this._column + colspan;
- }
- // Advance to the next column before returning value.
- this._column++;
- if ( this._column == this._nextCellAtColumn ) {
- this._cellIndex++;
- }
- // The current value will be returned only if current row and column are not skipped.
- return outValue || this.next();
- }
- /**
- * Marks a row to skip in the next iteration. It will also skip cells from the current row if there are any cells from the current row
- * to output.
- *
- * @param {Number} row The row index to skip.
- */
- skipRow( row ) {
- this._skipRows.add( row );
- }
- /**
- * Advances internal cursor to the next row.
- *
- * @private
- * @returns {module:table/tablewalker~TableSlot}
- */
- _advanceToNextRow() {
- this._row++;
- this._rowIndex++;
- this._column = 0;
- this._cellIndex = 0;
- this._nextCellAtColumn = -1;
- return this.next();
- }
- /**
- * Checks if the current row is over {@link #_endRow}.
- *
- * @private
- * @returns {Boolean}
- */
- _isOverEndRow() {
- // If #_endRow is defined skip all rows after it.
- return this._endRow !== undefined && this._row > this._endRow;
- }
- /**
- * Checks if the current cell is over {@link #_endColumn}
- *
- * @private
- * @returns {Boolean}
- */
- _isOverEndColumn() {
- // If #_endColumn is defined skip all cells after it.
- return this._endColumn !== undefined && this._column > this._endColumn;
- }
- /**
- * A common method for formatting the iterator's output value.
- *
- * @private
- * @param {module:engine/model/element~Element} cell The table cell to output.
- * @param {Number} [anchorRow] The row index of a cell anchor slot.
- * @param {Number} [anchorColumn] The column index of a cell anchor slot.
- * @returns {{done: Boolean, value: {cell: *, row: Number, column: *, rowspan: *, colspan: *, cellIndex: Number}}}
- */
- _formatOutValue( cell, anchorRow = this._row, anchorColumn = this._column ) {
- return {
- done: false,
- value: new TableSlot( this, cell, anchorRow, anchorColumn )
- };
- }
- /**
- * Checks if the current slot should be skipped.
- *
- * @private
- * @returns {Boolean}
- */
- _shouldSkipSlot() {
- const rowIsMarkedAsSkipped = this._skipRows.has( this._row );
- const rowIsBeforeStartRow = this._row < this._startRow;
- const columnIsBeforeStartColumn = this._column < this._startColumn;
- const columnIsAfterEndColumn = this._endColumn !== undefined && this._column > this._endColumn;
- return rowIsMarkedAsSkipped || rowIsBeforeStartRow || columnIsBeforeStartColumn || columnIsAfterEndColumn;
- }
- /**
- * Returns the cell element that is spanned over the current cell location.
- *
- * @private
- * @returns {module:engine/model/element~Element}
- */
- _getSpanned() {
- const rowMap = this._spannedCells.get( this._row );
- // No spans for given row.
- if ( !rowMap ) {
- return null;
- }
- // If spans for given rows has entry for column it means that this location if spanned by other cell.
- return rowMap.get( this._column ) || null;
- }
- /**
- * Updates spanned cells map relative to the current cell location and its span dimensions.
- *
- * @private
- * @param {module:engine/model/element~Element} cell A cell that is spanned.
- * @param {Number} rowspan Cell height.
- * @param {Number} colspan Cell width.
- */
- _recordSpans( cell, rowspan, colspan ) {
- const data = {
- cell,
- row: this._row,
- column: this._column
- };
- for ( let rowToUpdate = this._row; rowToUpdate < this._row + rowspan; rowToUpdate++ ) {
- for ( let columnToUpdate = this._column; columnToUpdate < this._column + colspan; columnToUpdate++ ) {
- if ( rowToUpdate != this._row || columnToUpdate != this._column ) {
- this._markSpannedCell( rowToUpdate, columnToUpdate, data );
- }
- }
- }
- }
- /**
- * Marks the cell location as spanned by another cell.
- *
- * @private
- * @param {Number} row The row index of the cell location.
- * @param {Number} column The column index of the cell location.
- * @param {Object} data A spanned cell details (cell element, anchor row and column).
- */
- _markSpannedCell( row, column, data ) {
- if ( !this._spannedCells.has( row ) ) {
- this._spannedCells.set( row, new Map() );
- }
- const rowSpans = this._spannedCells.get( row );
- rowSpans.set( column, data );
- }
- }
- /**
- * An object returned by {@link module:table/tablewalker~TableWalker} when traversing table cells.
- */
- class TableSlot {
- /**
- * Creates an instance of the table walker value.
- *
- * @protected
- * @param {module:table/tablewalker~TableWalker} tableWalker The table walker instance.
- * @param {module:engine/model/element~Element} cell The current table cell.
- * @param {Number} anchorRow The row index of a cell anchor slot.
- * @param {Number} anchorColumn The column index of a cell anchor slot.
- */
- constructor( tableWalker, cell, anchorRow, anchorColumn ) {
- /**
- * The current table cell.
- *
- * @readonly
- * @member {module:engine/model/element~Element}
- */
- this.cell = cell;
- /**
- * The row index of a table slot.
- *
- * @readonly
- * @member {Number}
- */
- this.row = tableWalker._row;
- /**
- * The column index of a table slot.
- *
- * @readonly
- * @member {Number}
- */
- this.column = tableWalker._column;
- /**
- * The row index of a cell anchor slot.
- *
- * @readonly
- * @member {Number}
- */
- this.cellAnchorRow = anchorRow;
- /**
- * The column index of a cell anchor slot.
- *
- * @readonly
- * @member {Number}
- */
- this.cellAnchorColumn = anchorColumn;
- /**
- * The index of the current cell in the parent row.
- *
- * @readonly
- * @member {Number}
- * @private
- */
- this._cellIndex = tableWalker._cellIndex;
- /**
- * The index of the current row element in the table.
- *
- * @readonly
- * @member {Number}
- * @private
- */
- this._rowIndex = tableWalker._rowIndex;
- /**
- * The table element.
- *
- * @readonly
- * @member {module:engine/model/element~Element}
- * @private
- */
- this._table = tableWalker._table;
- }
- /**
- * Whether the cell is anchored in the current slot.
- *
- * @readonly
- * @returns {Boolean}
- */
- get isAnchor() {
- return this.row === this.cellAnchorRow && this.column === this.cellAnchorColumn;
- }
- /**
- * The width of a cell defined by a `colspan` attribute. If the model attribute is not present, it is set to `1`.
- *
- * @readonly
- * @returns {Number}
- */
- get cellWidth() {
- return parseInt( this.cell.getAttribute( 'colspan' ) || 1 );
- }
- /**
- * The height of a cell defined by a `rowspan` attribute. If the model attribute is not present, it is set to `1`.
- *
- * @readonly
- * @returns {Number}
- */
- get cellHeight() {
- return parseInt( this.cell.getAttribute( 'rowspan' ) || 1 );
- }
- /**
- * The index of the current row element in the table.
- *
- * @readonly
- * @returns {Number}
- */
- get rowIndex() {
- return this._rowIndex;
- }
- /**
- * Returns the {@link module:engine/model/position~Position} before the table slot.
- *
- * @returns {module:engine/model/position~Position}
- */
- getPositionBefore() {
- const model = this._table.root.document.model;
- return model.createPositionAt( this._table.getChild( this.row ), this._cellIndex );
- }
- // @if CK_DEBUG // get isSpanned() { throwMissingGetterError( 'isSpanned' ); }
- // @if CK_DEBUG // get colspan() { throwMissingGetterError( 'colspan' ); }
- // @if CK_DEBUG // get rowspan() { throwMissingGetterError( 'rowspan' ); }
- // @if CK_DEBUG // get cellIndex() { throwMissingGetterError( 'cellIndex' ); }
- }
- /**
- * This `TableSlot`'s getter (property) was removed in CKEditor 5 v20.0.0.
- *
- * Check out the new `TableWalker`'s API in the documentation.
- *
- * @error tableslot-getter-removed
- * @param {String} getterName
- */
- // @if CK_DEBUG // function throwMissingGetterError( getterName ) {
- // @if CK_DEBUG // throw new CKEditorError( 'tableslot-getter-removed', this, {
- // @if CK_DEBUG // getterName
- // @if CK_DEBUG // } );
- // @if CK_DEBUG // }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertTableView; });
- /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
- /* harmony import */ var _theme_inserttable_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../theme/inserttable.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css");
- /* harmony import */ var _theme_inserttable_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_theme_inserttable_css__WEBPACK_IMPORTED_MODULE_1__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/ui/inserttableview
- */
- /**
- * The table size view.
- *
- * It renders a 10x10 grid to choose the inserted table size.
- *
- * @extends module:ui/view~View
- * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
- */
- class InsertTableView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- const bind = this.bindTemplate;
- /**
- * A collection of table size box items.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.items = this._createGridCollection();
- /**
- * The currently selected number of rows of the new table.
- *
- * @observable
- * @member {Number} #rows
- */
- this.set( 'rows', 0 );
- /**
- * The currently selected number of columns of the new table.
- *
- * @observable
- * @member {Number} #columns
- */
- this.set( 'columns', 0 );
- /**
- * The label text displayed under the boxes.
- *
- * @observable
- * @member {String} #label
- */
- this.bind( 'label' )
- .to( this, 'columns', this, 'rows', ( columns, rows ) => `${ rows } × ${ columns }` );
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [ 'ck' ]
- },
- children: [
- {
- tag: 'div',
- attributes: {
- class: [ 'ck-insert-table-dropdown__grid' ]
- },
- on: {
- 'mouseover@.ck-insert-table-dropdown-grid-box': bind.to( 'boxover' )
- },
- children: this.items
- },
- {
- tag: 'div',
- attributes: {
- class: [ 'ck-insert-table-dropdown__label' ]
- },
- children: [
- {
- text: bind.to( 'label' )
- }
- ]
- }
- ],
- on: {
- mousedown: bind.to( evt => {
- evt.preventDefault();
- } ),
- click: bind.to( () => {
- this.fire( 'execute' );
- } )
- }
- } );
- this.on( 'boxover', ( evt, domEvt ) => {
- const { row, column } = domEvt.target.dataset;
- // As row & column indexes are zero-based transform it to number of selected rows & columns.
- this.set( {
- rows: parseInt( row ),
- columns: parseInt( column )
- } );
- } );
- this.on( 'change:columns', () => {
- this._highlightGridBoxes();
- } );
- this.on( 'change:rows', () => {
- this._highlightGridBoxes();
- } );
- }
- /**
- * @inheritDoc
- */
- focus() {
- // The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.
- // The method should be implemented while working on keyboard support for this view. See #22.
- }
- /**
- * @inheritDoc
- */
- focusLast() {
- // The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.
- // The method should be implemented while working on keyboard support for this view. See #22.
- }
- /**
- * Highlights grid boxes depending on rows and columns selected.
- *
- * @private
- */
- _highlightGridBoxes() {
- const rows = this.rows;
- const columns = this.columns;
- this.items.map( ( boxView, index ) => {
- // Translate box index to the row & column index.
- const itemRow = Math.floor( index / 10 );
- const itemColumn = index % 10;
- // Grid box is highlighted when its row & column index belongs to selected number of rows & columns.
- const isOn = itemRow < rows && itemColumn < columns;
- boxView.set( 'isOn', isOn );
- } );
- }
- /**
- * @private
- * @returns {module:ui/viewcollection~ViewCollection} A view collection containing boxes to be placed in a table grid.
- */
- _createGridCollection() {
- const boxes = [];
- // Add grid boxes to table selection view.
- for ( let index = 0; index < 100; index++ ) {
- const row = Math.floor( index / 10 );
- const column = index % 10;
- boxes.push( new TableSizeGridBoxView( this.locale, row + 1, column + 1 ) );
- }
- return this.createCollection( boxes );
- }
- /**
- * Fired when the mouse hover over one of the {@link #items child grid boxes}.
- *
- * @event boxover
- */
- }
- /**
- * A single grid box view element.
- *
- * This class is used to render the table size selection grid in {@link module:table/ui/inserttableview~InsertTableView}.
- *
- * @private
- */
- class TableSizeGridBoxView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
- /**
- * @inheritDoc
- */
- constructor( locale, row, column ) {
- super( locale );
- const bind = this.bindTemplate;
- /**
- * Controls whether the grid box view is "on".
- *
- * @observable
- * @member {Boolean} #isOn
- */
- this.set( 'isOn', false );
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck-insert-table-dropdown-grid-box',
- bind.if( 'isOn', 'ck-on' )
- ],
- 'data-row': row,
- 'data-column': column
- }
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js ***!
- \********************************************************************/
- /*! exports provided: updateNumericAttribute, createEmptyTableCell, isHeadingColumnCell */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateNumericAttribute", function() { return updateNumericAttribute; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEmptyTableCell", function() { return createEmptyTableCell; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHeadingColumnCell", function() { return isHeadingColumnCell; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/utils/common
- */
- /**
- * A common method to update the numeric value. If a value is the default one, it will be unset.
- *
- * @param {String} key An attribute key.
- * @param {*} value The new attribute value.
- * @param {module:engine/model/item~Item} item A model item on which the attribute will be set.
- * @param {module:engine/model/writer~Writer} writer
- * @param {*} defaultValue The default attribute value. If a value is lower or equal, it will be unset.
- */
- function updateNumericAttribute( key, value, item, writer, defaultValue = 1 ) {
- if ( value > defaultValue ) {
- writer.setAttribute( key, value, item );
- } else {
- writer.removeAttribute( key, item );
- }
- }
- /**
- * A common method to create an empty table cell. It creates a proper model structure as a table cell must have at least one block inside.
- *
- * @param {module:engine/model/writer~Writer} writer The model writer.
- * @param {module:engine/model/position~Position} insertPosition The position at which the table cell should be inserted.
- * @param {Object} attributes The element attributes.
- * @returns {module:engine/model/element~Element} Created table cell.
- */
- function createEmptyTableCell( writer, insertPosition, attributes = {} ) {
- const tableCell = writer.createElement( 'tableCell', attributes );
- writer.insertElement( 'paragraph', tableCell );
- writer.insert( tableCell, insertPosition );
- return tableCell;
- }
- /**
- * Checks if a table cell belongs to the heading column section.
- *
- * @param {module:table/tableutils~TableUtils} tableUtils
- * @param {module:engine/model/element~Element} tableCell
- * @returns {Boolean}
- */
- function isHeadingColumnCell( tableUtils, tableCell ) {
- const table = tableCell.parent.parent;
- const headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 );
- const { column } = tableUtils.getCellLocation( tableCell );
- return !!headingColumns && column < headingColumns;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js ***!
- \***********************************************************************/
- /*! exports provided: getSelectedTableCells, getTableCellsContainingSelection, getSelectionAffectedTableCells, getRowIndexes, getColumnIndexes, isSelectionRectangular, sortRanges */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedTableCells", function() { return getSelectedTableCells; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTableCellsContainingSelection", function() { return getTableCellsContainingSelection; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectionAffectedTableCells", function() { return getSelectionAffectedTableCells; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRowIndexes", function() { return getRowIndexes; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColumnIndexes", function() { return getColumnIndexes; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSelectionRectangular", function() { return isSelectionRectangular; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortRanges", function() { return sortRanges; });
- /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/utils/selection
- */
- /**
- * Returns all model table cells that are fully selected (from the outside)
- * within the provided model selection's ranges.
- *
- * To obtain the cells selected from the inside, use
- * {@link module:table/utils/selection~getTableCellsContainingSelection}.
- *
- * @param {module:engine/model/selection~Selection} selection
- * @returns {Array.<module:engine/model/element~Element>}
- */
- function getSelectedTableCells( selection ) {
- const cells = [];
- for ( const range of sortRanges( selection.getRanges() ) ) {
- const element = range.getContainedElement();
- if ( element && element.is( 'element', 'tableCell' ) ) {
- cells.push( element );
- }
- }
- return cells;
- }
- /**
- * Returns all model table cells that the provided model selection's ranges
- * {@link module:engine/model/range~Range#start} inside.
- *
- * To obtain the cells selected from the outside, use
- * {@link module:table/utils/selection~getSelectedTableCells}.
- *
- * @param {module:engine/model/selection~Selection} selection
- * @returns {Array.<module:engine/model/element~Element>}
- */
- function getTableCellsContainingSelection( selection ) {
- const cells = [];
- for ( const range of selection.getRanges() ) {
- const cellWithSelection = range.start.findAncestor( 'tableCell' );
- if ( cellWithSelection ) {
- cells.push( cellWithSelection );
- }
- }
- return cells;
- }
- /**
- * Returns all model table cells that are either completely selected
- * by selection ranges or host selection range
- * {@link module:engine/model/range~Range#start start positions} inside them.
- *
- * Combines {@link module:table/utils/selection~getTableCellsContainingSelection} and
- * {@link module:table/utils/selection~getSelectedTableCells}.
- *
- * @param {module:engine/model/selection~Selection} selection
- * @returns {Array.<module:engine/model/element~Element>}
- */
- function getSelectionAffectedTableCells( selection ) {
- const selectedCells = getSelectedTableCells( selection );
- if ( selectedCells.length ) {
- return selectedCells;
- }
- return getTableCellsContainingSelection( selection );
- }
- /**
- * Returns an object with the `first` and `last` row index contained in the given `tableCells`.
- *
- * const selectedTableCells = getSelectedTableCells( editor.model.document.selection );
- *
- * const { first, last } = getRowIndexes( selectedTableCells );
- *
- * console.log( `Selected rows: ${ first } to ${ last }` );
- *
- * @param {Array.<module:engine/model/element~Element>} tableCells
- * @returns {Object} Returns an object with the `first` and `last` table row indexes.
- */
- function getRowIndexes( tableCells ) {
- const indexes = tableCells.map( cell => cell.parent.index );
- return getFirstLastIndexesObject( indexes );
- }
- /**
- * Returns an object with the `first` and `last` column index contained in the given `tableCells`.
- *
- * const selectedTableCells = getSelectedTableCells( editor.model.document.selection );
- *
- * const { first, last } = getColumnIndexes( selectedTableCells );
- *
- * console.log( `Selected columns: ${ first } to ${ last }` );
- *
- * @param {Array.<module:engine/model/element~Element>} tableCells
- * @returns {Object} Returns an object with the `first` and `last` table column indexes.
- */
- function getColumnIndexes( tableCells ) {
- const table = tableCells[ 0 ].findAncestor( 'table' );
- const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table ) ];
- const indexes = tableMap
- .filter( entry => tableCells.includes( entry.cell ) )
- .map( entry => entry.column );
- return getFirstLastIndexesObject( indexes );
- }
- /**
- * Checks if the selection contains cells that do not exceed rectangular selection.
- *
- * In a table below:
- *
- * ┌───┬───┬───┬───┐
- * │ a │ b │ c │ d │
- * ├───┴───┼───┤ │
- * │ e │ f │ │
- * │ ├───┼───┤
- * │ │ g │ h │
- * └───────┴───┴───┘
- *
- * Valid selections are these which create a solid rectangle (without gaps), such as:
- * - a, b (two horizontal cells)
- * - c, f (two vertical cells)
- * - a, b, e (cell "e" spans over four cells)
- * - c, d, f (cell d spans over a cell in the row below)
- *
- * While an invalid selection would be:
- * - a, c (the unselected cell "b" creates a gap)
- * - f, g, h (cell "d" spans over a cell from the row of "f" cell - thus creates a gap)
- *
- * @param {Array.<module:engine/model/element~Element>} selectedTableCells
- * @param {module:table/tableutils~TableUtils} tableUtils
- * @returns {Boolean}
- */
- function isSelectionRectangular( selectedTableCells, tableUtils ) {
- if ( selectedTableCells.length < 2 || !areCellInTheSameTableSection( selectedTableCells ) ) {
- return false;
- }
- // A valid selection is a fully occupied rectangle composed of table cells.
- // Below we will calculate the area of a selected table cells and the area of valid selection.
- // The area of a valid selection is defined by top-left and bottom-right cells.
- const rows = new Set();
- const columns = new Set();
- let areaOfSelectedCells = 0;
- for ( const tableCell of selectedTableCells ) {
- const { row, column } = tableUtils.getCellLocation( tableCell );
- const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
- const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
- // Record row & column indexes of current cell.
- rows.add( row );
- columns.add( column );
- // For cells that spans over multiple rows add also the last row that this cell spans over.
- if ( rowspan > 1 ) {
- rows.add( row + rowspan - 1 );
- }
- // For cells that spans over multiple columns add also the last column that this cell spans over.
- if ( colspan > 1 ) {
- columns.add( column + colspan - 1 );
- }
- areaOfSelectedCells += ( rowspan * colspan );
- }
- // We can only merge table cells that are in adjacent rows...
- const areaOfValidSelection = getBiggestRectangleArea( rows, columns );
- return areaOfValidSelection == areaOfSelectedCells;
- }
- /**
- * Returns array of sorted ranges.
- *
- * @param {Iterable.<module:engine/model/range~Range>} ranges
- * @return {Array.<module:engine/model/range~Range>}
- */
- function sortRanges( ranges ) {
- return Array.from( ranges ).sort( compareRangeOrder );
- }
- // Helper method to get an object with `first` and `last` indexes from an unsorted array of indexes.
- function getFirstLastIndexesObject( indexes ) {
- const allIndexesSorted = indexes.sort( ( indexA, indexB ) => indexA - indexB );
- const first = allIndexesSorted[ 0 ];
- const last = allIndexesSorted[ allIndexesSorted.length - 1 ];
- return { first, last };
- }
- function compareRangeOrder( rangeA, rangeB ) {
- // Since table cell ranges are disjoint, it's enough to check their start positions.
- const posA = rangeA.start;
- const posB = rangeB.start;
- // Checking for equal position (returning 0) is not needed because this would be either:
- // a. Intersecting range (not allowed by model)
- // b. Collapsed range on the same position (allowed by model but should not happen).
- return posA.isBefore( posB ) ? -1 : 1;
- }
- // Calculates the area of a maximum rectangle that can span over the provided row & column indexes.
- //
- // @param {Array.<Number>} rows
- // @param {Array.<Number>} columns
- // @returns {Number}
- function getBiggestRectangleArea( rows, columns ) {
- const rowsIndexes = Array.from( rows.values() );
- const columnIndexes = Array.from( columns.values() );
- const lastRow = Math.max( ...rowsIndexes );
- const firstRow = Math.min( ...rowsIndexes );
- const lastColumn = Math.max( ...columnIndexes );
- const firstColumn = Math.min( ...columnIndexes );
- return ( lastRow - firstRow + 1 ) * ( lastColumn - firstColumn + 1 );
- }
- // Checks if the selection does not mix a header (column or row) with other cells.
- //
- // For instance, in the table below valid selections consist of cells with the same letter only.
- // So, a-a (same heading row and column) or d-d (body cells) are valid while c-d or a-b are not.
- //
- // header columns
- // ↓ ↓
- // ┌───┬───┬───┬───┐
- // │ a │ a │ b │ b │ ← header row
- // ├───┼───┼───┼───┤
- // │ c │ c │ d │ d │
- // ├───┼───┼───┼───┤
- // │ c │ c │ d │ d │
- // └───┴───┴───┴───┘
- function areCellInTheSameTableSection( tableCells ) {
- const table = tableCells[ 0 ].findAncestor( 'table' );
- const rowIndexes = getRowIndexes( tableCells );
- const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
- // Calculating row indexes is a bit cheaper so if this check fails we can't merge.
- if ( !areIndexesInSameSection( rowIndexes, headingRows ) ) {
- return false;
- }
- const headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 );
- const columnIndexes = getColumnIndexes( tableCells );
- // Similarly cells must be in same column section.
- return areIndexesInSameSection( columnIndexes, headingColumns );
- }
- // Unified check if table rows/columns indexes are in the same heading/body section.
- function areIndexesInSameSection( { first, last }, headingSectionSize ) {
- const firstCellIsInHeading = first < headingSectionSize;
- const lastCellIsInHeading = last < headingSectionSize;
- return firstCellIsInHeading === lastCellIsInHeading;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js ***!
- \***********************************************************************/
- /*! exports provided: cropTableToDimensions, getVerticallyOverlappingCells, splitHorizontally, getHorizontallyOverlappingCells, splitVertically, trimTableCellIfNeeded, removeEmptyColumns, removeEmptyRows, removeEmptyRowsColumns, adjustLastRowIndex, adjustLastColumnIndex */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cropTableToDimensions", function() { return cropTableToDimensions; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVerticallyOverlappingCells", function() { return getVerticallyOverlappingCells; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitHorizontally", function() { return splitHorizontally; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHorizontallyOverlappingCells", function() { return getHorizontallyOverlappingCells; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitVertically", function() { return splitVertically; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trimTableCellIfNeeded", function() { return trimTableCellIfNeeded; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEmptyColumns", function() { return removeEmptyColumns; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEmptyRows", function() { return removeEmptyRows; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEmptyRowsColumns", function() { return removeEmptyRowsColumns; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjustLastRowIndex", function() { return adjustLastRowIndex; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjustLastColumnIndex", function() { return adjustLastColumnIndex; });
- /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
- /* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/utils/structure
- */
- /**
- * Returns a cropped table according to given dimensions.
- * To return a cropped table that starts at first row and first column and end in third row and column:
- *
- * const croppedTable = cropTableToDimensions( table, {
- * startRow: 1,
- * endRow: 3,
- * startColumn: 1,
- * endColumn: 3
- * }, writer );
- *
- * Calling the code above for the table below:
- *
- * 0 1 2 3 4 0 1 2
- * ┌───┬───┬───┬───┬───┐
- * 0 │ a │ b │ c │ d │ e │
- * ├───┴───┤ ├───┴───┤ ┌───┬───┬───┐
- * 1 │ f │ │ g │ │ │ │ g │ 0
- * ├───┬───┴───┼───┬───┤ will return: ├───┴───┼───┤
- * 2 │ h │ i │ j │ k │ │ i │ j │ 1
- * ├───┤ ├───┤ │ │ ├───┤
- * 3 │ l │ │ m │ │ │ │ m │ 2
- * ├───┼───┬───┤ ├───┤ └───────┴───┘
- * 4 │ n │ o │ p │ │ q │
- * └───┴───┴───┴───┴───┘
- *
- * @param {module:engine/model/element~Element} sourceTable
- * @param {Object} cropDimensions
- * @param {Number} cropDimensions.startRow
- * @param {Number} cropDimensions.startColumn
- * @param {Number} cropDimensions.endRow
- * @param {Number} cropDimensions.endColumn
- * @param {module:engine/model/writer~Writer} writer
- * @returns {module:engine/model/element~Element}
- */
- function cropTableToDimensions( sourceTable, cropDimensions, writer ) {
- const { startRow, startColumn, endRow, endColumn } = cropDimensions;
- // Create empty table with empty rows equal to crop height.
- const croppedTable = writer.createElement( 'table' );
- const cropHeight = endRow - startRow + 1;
- for ( let i = 0; i < cropHeight; i++ ) {
- writer.insertElement( 'tableRow', croppedTable, 'end' );
- }
- const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( sourceTable, { startRow, endRow, startColumn, endColumn, includeAllSlots: true } ) ];
- // Iterate over source table slots (including empty - spanned - ones).
- for ( const { row: sourceRow, column: sourceColumn, cell: tableCell, isAnchor, cellAnchorRow, cellAnchorColumn } of tableMap ) {
- // Row index in cropped table.
- const rowInCroppedTable = sourceRow - startRow;
- const row = croppedTable.getChild( rowInCroppedTable );
- // For empty slots: fill the gap with empty table cell.
- if ( !isAnchor ) {
- // But fill the gap only if the spanning cell is anchored outside cropped area.
- // In the table from method jsdoc those cells are: "c" & "f".
- if ( cellAnchorRow < startRow || cellAnchorColumn < startColumn ) {
- Object(_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, writer.createPositionAt( row, 'end' ) );
- }
- }
- // Otherwise clone the cell with all children and trim if it exceeds cropped area.
- else {
- const tableCellCopy = writer.cloneElement( tableCell );
- writer.append( tableCellCopy, row );
- // Trim table if it exceeds cropped area.
- // In the table from method jsdoc those cells are: "g" & "m".
- trimTableCellIfNeeded( tableCellCopy, sourceRow, sourceColumn, endRow, endColumn, writer );
- }
- }
- // Adjust heading rows & columns in cropped table if crop selection includes headings parts.
- addHeadingsToCroppedTable( croppedTable, sourceTable, startRow, startColumn, writer );
- return croppedTable;
- }
- /**
- * Returns slot info of cells that starts above and overlaps a given row.
- *
- * In a table below, passing `overlapRow = 3`
- *
- * ┌───┬───┬───┬───┬───┐
- * 0 │ a │ b │ c │ d │ e │
- * │ ├───┼───┼───┼───┤
- * 1 │ │ f │ g │ h │ i │
- * ├───┤ ├───┼───┤ │
- * 2 │ j │ │ k │ l │ │
- * │ │ │ ├───┼───┤
- * 3 │ │ │ │ m │ n │ <- overlap row to check
- * ├───┼───┤ │ ├───│
- * 4 │ o │ p │ │ │ q │
- * └───┴───┴───┴───┴───┘
- *
- * will return slot info for cells: "j", "f", "k".
- *
- * @param {module:engine/model/element~Element} table The table to check.
- * @param {Number} overlapRow The index of the row to check.
- * @param {Number} [startRow=0] A row to start analysis. Use it when it is known that the cells above that row will not overlap.
- * @returns {Array.<module:table/tablewalker~TableSlot>}
- */
- function getVerticallyOverlappingCells( table, overlapRow, startRow = 0 ) {
- const cells = [];
- const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { startRow, endRow: overlapRow - 1 } );
- for ( const slotInfo of tableWalker ) {
- const { row, cellHeight } = slotInfo;
- const cellEndRow = row + cellHeight - 1;
- if ( row < overlapRow && overlapRow <= cellEndRow ) {
- cells.push( slotInfo );
- }
- }
- return cells;
- }
- /**
- * Splits the table cell horizontally.
- *
- * @param {module:engine/model/element~Element} tableCell
- * @param {Number} splitRow
- * @param {module:engine/model/writer~Writer} writer
- * @returns {module:engine/model/element~Element} Created table cell.
- */
- function splitHorizontally( tableCell, splitRow, writer ) {
- const tableRow = tableCell.parent;
- const table = tableRow.parent;
- const rowIndex = tableRow.index;
- const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) );
- const newRowspan = splitRow - rowIndex;
- const newCellAttributes = {};
- const newCellRowSpan = rowspan - newRowspan;
- if ( newCellRowSpan > 1 ) {
- newCellAttributes.rowspan = newCellRowSpan;
- }
- const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
- if ( colspan > 1 ) {
- newCellAttributes.colspan = colspan;
- }
- const startRow = rowIndex;
- const endRow = startRow + newRowspan;
- const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { startRow, endRow, includeAllSlots: true } ) ];
- let newCell = null;
- let columnIndex;
- for ( const tableSlot of tableMap ) {
- const { row, column, cell } = tableSlot;
- if ( cell === tableCell && columnIndex === undefined ) {
- columnIndex = column;
- }
- if ( columnIndex !== undefined && columnIndex === column && row === endRow ) {
- newCell = Object(_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, tableSlot.getPositionBefore(), newCellAttributes );
- }
- }
- // Update the rowspan attribute after updating table.
- Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'rowspan', newRowspan, tableCell, writer );
- return newCell;
- }
- /**
- * Returns slot info of cells that starts before and overlaps a given column.
- *
- * In a table below, passing `overlapColumn = 3`
- *
- * 0 1 2 3 4
- * ┌───────┬───────┬───┐
- * │ a │ b │ c │
- * │───┬───┴───────┼───┤
- * │ d │ e │ f │
- * ├───┼───┬───────┴───┤
- * │ g │ h │ i │
- * ├───┼───┼───┬───────┤
- * │ j │ k │ l │ m │
- * ├───┼───┴───┼───┬───┤
- * │ n │ o │ p │ q │
- * └───┴───────┴───┴───┘
- * ^
- * Overlap column to check
- *
- * will return slot info for cells: "b", "e", "i".
- *
- * @param {module:engine/model/element~Element} table The table to check.
- * @param {Number} overlapColumn The index of the column to check.
- * @returns {Array.<module:table/tablewalker~TableSlot>}
- */
- function getHorizontallyOverlappingCells( table, overlapColumn ) {
- const cellsToSplit = [];
- const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table );
- for ( const slotInfo of tableWalker ) {
- const { column, cellWidth } = slotInfo;
- const cellEndColumn = column + cellWidth - 1;
- if ( column < overlapColumn && overlapColumn <= cellEndColumn ) {
- cellsToSplit.push( slotInfo );
- }
- }
- return cellsToSplit;
- }
- /**
- * Splits the table cell vertically.
- *
- * @param {module:engine/model/element~Element} tableCell
- * @param {Number} columnIndex The table cell column index.
- * @param {Number} splitColumn The index of column to split cell on.
- * @param {module:engine/model/writer~Writer} writer
- * @returns {module:engine/model/element~Element} Created table cell.
- */
- function splitVertically( tableCell, columnIndex, splitColumn, writer ) {
- const colspan = parseInt( tableCell.getAttribute( 'colspan' ) );
- const newColspan = splitColumn - columnIndex;
- const newCellAttributes = {};
- const newCellColSpan = colspan - newColspan;
- if ( newCellColSpan > 1 ) {
- newCellAttributes.colspan = newCellColSpan;
- }
- const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
- if ( rowspan > 1 ) {
- newCellAttributes.rowspan = rowspan;
- }
- const newCell = Object(_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, writer.createPositionAfter( tableCell ), newCellAttributes );
- // Update the colspan attribute after updating table.
- Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'colspan', newColspan, tableCell, writer );
- return newCell;
- }
- /**
- * Adjusts table cell dimensions to not exceed limit row and column.
- *
- * If table cell width (or height) covers a column (or row) that is after a limit column (or row)
- * this method will trim "colspan" (or "rowspan") attribute so the table cell will fit in a defined limits.
- *
- * @param {module:engine/model/element~Element} tableCell
- * @param {Number} cellRow
- * @param {Number} cellColumn
- * @param {Number} limitRow
- * @param {Number} limitColumn
- * @param {module:engine/model/writer~Writer} writer
- */
- function trimTableCellIfNeeded( tableCell, cellRow, cellColumn, limitRow, limitColumn, writer ) {
- const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
- const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
- const endColumn = cellColumn + colspan - 1;
- if ( endColumn > limitColumn ) {
- const trimmedSpan = limitColumn - cellColumn + 1;
- Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'colspan', trimmedSpan, tableCell, writer, 1 );
- }
- const endRow = cellRow + rowspan - 1;
- if ( endRow > limitRow ) {
- const trimmedSpan = limitRow - cellRow + 1;
- Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'rowspan', trimmedSpan, tableCell, writer, 1 );
- }
- }
- // Sets proper heading attributes to a cropped table.
- function addHeadingsToCroppedTable( croppedTable, sourceTable, startRow, startColumn, writer ) {
- const headingRows = parseInt( sourceTable.getAttribute( 'headingRows' ) || 0 );
- if ( headingRows > 0 ) {
- const headingRowsInCrop = headingRows - startRow;
- Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingRows', headingRowsInCrop, croppedTable, writer, 0 );
- }
- const headingColumns = parseInt( sourceTable.getAttribute( 'headingColumns' ) || 0 );
- if ( headingColumns > 0 ) {
- const headingColumnsInCrop = headingColumns - startColumn;
- Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingColumns', headingColumnsInCrop, croppedTable, writer, 0 );
- }
- }
- /**
- * Removes columns that have no cells anchored.
- *
- * In table below:
- *
- * +----+----+----+----+----+----+----+
- * | 00 | 01 | 03 | 04 | 06 |
- * +----+----+----+----+ +----+
- * | 10 | 11 | 13 | | 16 |
- * +----+----+----+----+----+----+----+
- * | 20 | 21 | 23 | 24 | 26 |
- * +----+----+----+----+----+----+----+
- * ^--- empty ---^
- *
- * Will remove columns 2 and 5.
- *
- * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.
- * To remove a column from a table use {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`}.
- *
- * @protected
- * @param {module:engine/model/element~Element} table
- * @param {module:table/tableutils~TableUtils} tableUtils
- * @returns {Boolean} True if removed some columns.
- */
- function removeEmptyColumns( table, tableUtils ) {
- const width = tableUtils.getColumns( table );
- const columnsMap = new Array( width ).fill( 0 );
- for ( const { column } of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table ) ) {
- columnsMap[ column ]++;
- }
- const emptyColumns = columnsMap.reduce( ( result, cellsCount, column ) => {
- return cellsCount ? result : [ ...result, column ];
- }, [] );
- if ( emptyColumns.length > 0 ) {
- // Remove only last empty column because it will recurrently trigger removing empty rows.
- const emptyColumn = emptyColumns[ emptyColumns.length - 1 ];
- // @if CK_DEBUG_TABLE // console.log( `Removing empty column: ${ emptyColumn }.` );
- tableUtils.removeColumns( table, { at: emptyColumn } );
- return true;
- }
- return false;
- }
- /**
- * Removes rows that have no cells anchored.
- *
- * In table below:
- *
- * +----+----+----+
- * | 00 | 01 | 02 |
- * +----+----+----+
- * | 10 | 11 | 12 |
- * + + + +
- * | | | | <-- empty
- * +----+----+----+
- * | 30 | 31 | 32 |
- * +----+----+----+
- * | 40 | 42 |
- * + + +
- * | | | <-- empty
- * +----+----+----+
- * | 60 | 61 | 62 |
- * +----+----+----+
- *
- * Will remove rows 2 and 5.
- *
- * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.
- * To remove a row from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`}.
- *
- * @protected
- * @param {module:engine/model/element~Element} table
- * @param {module:table/tableutils~TableUtils} tableUtils
- * @returns {Boolean} True if removed some rows.
- */
- function removeEmptyRows( table, tableUtils ) {
- const emptyRows = [];
- const tableRowCount = tableUtils.getRows( table );
- for ( let rowIndex = 0; rowIndex < tableRowCount; rowIndex++ ) {
- const tableRow = table.getChild( rowIndex );
- if ( tableRow.isEmpty ) {
- emptyRows.push( rowIndex );
- }
- }
- if ( emptyRows.length > 0 ) {
- // Remove only last empty row because it will recurrently trigger removing empty columns.
- const emptyRow = emptyRows[ emptyRows.length - 1 ];
- // @if CK_DEBUG_TABLE // console.log( `Removing empty row: ${ emptyRow }.` );
- tableUtils.removeRows( table, { at: emptyRow } );
- return true;
- }
- return false;
- }
- /**
- * Removes rows and columns that have no cells anchored.
- *
- * In table below:
- *
- * +----+----+----+----+
- * | 00 | 02 |
- * +----+----+ +
- * | 10 | |
- * +----+----+----+----+
- * | 20 | 22 | 23 |
- * + + + +
- * | | | | <-- empty row
- * +----+----+----+----+
- * ^--- empty column
- *
- * Will remove row 3 and column 1.
- *
- * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.
- * To remove a rows from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`} and
- * {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`} to remove a column.
- *
- * @protected
- * @param {module:engine/model/element~Element} table
- * @param {module:table/tableutils~TableUtils} tableUtils
- */
- function removeEmptyRowsColumns( table, tableUtils ) {
- const removedColumns = removeEmptyColumns( table, tableUtils );
- // If there was some columns removed then cleaning empty rows was already triggered.
- if ( !removedColumns ) {
- removeEmptyRows( table, tableUtils );
- }
- }
- /**
- * Returns adjusted last row index if selection covers part of a row with empty slots (spanned by other cells).
- * The `dimensions.lastRow` is equal to last row index but selection might be bigger.
- *
- * This happens *only* on rectangular selection so we analyze a case like this:
- *
- * +---+---+---+---+
- * 0 | a | b | c | d |
- * + + +---+---+
- * 1 | | e | f | g |
- * + +---+ +---+
- * 2 | | h | | i | <- last row, each cell has rowspan = 2,
- * + + + + + so we need to return 3, not 2
- * 3 | | | | |
- * +---+---+---+---+
- *
- * @param {module:engine/model/element~Element} table
- * @param {Object} dimensions
- * @param {Number} dimensions.firstRow
- * @param {Number} dimensions.firstColumn
- * @param {Number} dimensions.lastRow
- * @param {Number} dimensions.lastColumn
- * @returns {Number} Adjusted last row index.
- */
- function adjustLastRowIndex( table, dimensions ) {
- const lastRowMap = Array.from( new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, {
- startColumn: dimensions.firstColumn,
- endColumn: dimensions.lastColumn,
- row: dimensions.lastRow
- } ) );
- const everyCellHasSingleRowspan = lastRowMap.every( ( { cellHeight } ) => cellHeight === 1 );
- // It is a "flat" row, so the last row index is OK.
- if ( everyCellHasSingleRowspan ) {
- return dimensions.lastRow;
- }
- // Otherwise get any cell's rowspan and adjust the last row index.
- const rowspanAdjustment = lastRowMap[ 0 ].cellHeight - 1;
- return dimensions.lastRow + rowspanAdjustment;
- }
- /**
- * Returns adjusted last column index if selection covers part of a column with empty slots (spanned by other cells).
- * The `dimensions.lastColumn` is equal to last column index but selection might be bigger.
- *
- * This happens *only* on rectangular selection so we analyze a case like this:
- *
- * 0 1 2 3
- * +---+---+---+---+
- * | a |
- * +---+---+---+---+
- * | b | c | d |
- * +---+---+---+---+
- * | e | f |
- * +---+---+---+---+
- * | g | h |
- * +---+---+---+---+
- * ^
- * last column, each cell has colspan = 2, so we need to return 3, not 2
- *
- * @param {module:engine/model/element~Element} table
- * @param {Object} dimensions
- * @param {Number} dimensions.firstRow
- * @param {Number} dimensions.firstColumn
- * @param {Number} dimensions.lastRow
- * @param {Number} dimensions.lastColumn
- * @returns {Number} Adjusted last column index.
- */
- function adjustLastColumnIndex( table, dimensions ) {
- const lastColumnMap = Array.from( new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, {
- startRow: dimensions.firstRow,
- endRow: dimensions.lastRow,
- column: dimensions.lastColumn
- } ) );
- const everyCellHasSingleColspan = lastColumnMap.every( ( { cellWidth } ) => cellWidth === 1 );
- // It is a "flat" column, so the last column index is OK.
- if ( everyCellHasSingleColspan ) {
- return dimensions.lastColumn;
- }
- // Otherwise get any cell's colspan and adjust the last column index.
- const colspanAdjustment = lastColumnMap[ 0 ].cellWidth - 1;
- return dimensions.lastColumn + colspanAdjustment;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js ***!
- \***********************************************************************/
- /*! exports provided: getSelectedTableWidget, getTableWidgetAncestor */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedTableWidget", function() { return getSelectedTableWidget; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTableWidgetAncestor", function() { return getTableWidgetAncestor; });
- /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/utils/ui/widget
- */
- /**
- * Returns a table widget editing view element if one is selected.
- *
- * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
- * @returns {module:engine/view/element~Element|null}
- */
- function getSelectedTableWidget( selection ) {
- const viewElement = selection.getSelectedElement();
- if ( viewElement && isTableWidget( viewElement ) ) {
- return viewElement;
- }
- return null;
- }
- /**
- * Returns a table widget editing view element if one is among the selection's ancestors.
- *
- * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
- * @returns {module:engine/view/element~Element|null}
- */
- function getTableWidgetAncestor( selection ) {
- let parent = selection.getFirstPosition().parent;
- while ( parent ) {
- if ( parent.is( 'element' ) && isTableWidget( parent ) ) {
- return parent;
- }
- parent = parent.parent;
- }
- return null;
- }
- // Checks if a given view element is a table widget.
- //
- // @param {module:engine/view/element~Element} viewElement
- // @returns {Boolean}
- function isTableWidget( viewElement ) {
- return !!viewElement.getCustomProperty( 'table' ) && Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["isWidget"])( viewElement );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\" opacity=\".6\"/><path d=\"M18 7v1H2V7h16zm0 5v1H2v-1h16z\" opacity=\".6\"/><path d=\"M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\" opacity=\".6\"/><path d=\"M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z\" opacity=\".6\"/><path d=\"M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\" opacity=\".6\"/><path d=\"M7 2h1v16H7V2zm5 0h1v16h-1V2z\" opacity=\".6\"/><path d=\"M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css ***!
- \**********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./inserttable.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/table.css":
- /*!****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/theme/table.css ***!
- \****************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./table.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/table.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css ***!
- \***********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./tableediting.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css":
- /*!*************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css ***!
- \*************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./tableselection.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/delete.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Delete; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _deletecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./deletecommand */ "./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js");
- /* harmony import */ var _deleteobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deleteobserver */ "./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/delete
- */
- /**
- * The delete and backspace feature. Handles the <kbd>Delete</kbd> and <kbd>Backspace</kbd> keys in the editor.
- *
- * @extends module:core/plugin~Plugin
- */
- class Delete extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Delete';
- }
- init() {
- const editor = this.editor;
- const view = editor.editing.view;
- const viewDocument = view.document;
- view.addObserver( _deleteobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
- const deleteForwardCommand = new _deletecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'forward' );
- // Register `deleteForward` command and add `forwardDelete` command as an alias for backward compatibility.
- editor.commands.add( 'deleteForward', deleteForwardCommand );
- editor.commands.add( 'forwardDelete', deleteForwardCommand );
- editor.commands.add( 'delete', new _deletecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'backward' ) );
- this.listenTo( viewDocument, 'delete', ( evt, data ) => {
- const deleteCommandParams = { unit: data.unit, sequence: data.sequence };
- // If a specific (view) selection to remove was set, convert it to a model selection and set as a parameter for `DeleteCommand`.
- if ( data.selectionToRemove ) {
- const modelSelection = editor.model.createSelection();
- const ranges = [];
- for ( const viewRange of data.selectionToRemove.getRanges() ) {
- ranges.push( editor.editing.mapper.toModelRange( viewRange ) );
- }
- modelSelection.setTo( ranges );
- deleteCommandParams.selection = modelSelection;
- }
- editor.execute( data.direction == 'forward' ? 'deleteForward' : 'delete', deleteCommandParams );
- data.preventDefault();
- view.scrollToTheSelection();
- }, { priority: 'low' } );
- // Android IMEs have a quirk - they change DOM selection after the input changes were performed by the browser.
- // This happens on `keyup` event. Android doesn't know anything about our deletion and selection handling. Even if the selection
- // was changed during input events, IME remembers the position where the selection "should" be placed and moves it there.
- //
- // To prevent incorrect selection, we save the selection after deleting here and then re-set it on `keyup`. This has to be done
- // on DOM selection level, because on `keyup` the model selection is still the same as it was just after deletion, so it
- // wouldn't be changed and the fix would do nothing.
- //
- if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_3__["default"].isAndroid ) {
- let domSelectionAfterDeletion = null;
- this.listenTo( viewDocument, 'delete', ( evt, data ) => {
- const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
- domSelectionAfterDeletion = {
- anchorNode: domSelection.anchorNode,
- anchorOffset: domSelection.anchorOffset,
- focusNode: domSelection.focusNode,
- focusOffset: domSelection.focusOffset
- };
- }, { priority: 'lowest' } );
- this.listenTo( viewDocument, 'keyup', ( evt, data ) => {
- if ( domSelectionAfterDeletion ) {
- const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
- domSelection.collapse( domSelectionAfterDeletion.anchorNode, domSelectionAfterDeletion.anchorOffset );
- domSelection.extend( domSelectionAfterDeletion.focusNode, domSelectionAfterDeletion.focusOffset );
- domSelectionAfterDeletion = null;
- }
- } );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DeleteCommand; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/count */ "./node_modules/@ckeditor/ckeditor5-utils/src/count.js");
- /* harmony import */ var _utils_changebuffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/changebuffer */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/deletecommand
- */
- /**
- * The delete command. Used by the {@link module:typing/delete~Delete delete feature} to handle the <kbd>Delete</kbd> and
- * <kbd>Backspace</kbd> keys.
- *
- * @extends module:core/command~Command
- */
- class DeleteCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an instance of the command.
- *
- * @param {module:core/editor/editor~Editor} editor
- * @param {'forward'|'backward'} direction The directionality of the delete describing in what direction it
- * should consume the content when the selection is collapsed.
- */
- constructor( editor, direction ) {
- super( editor );
- /**
- * The directionality of the delete describing in what direction it should
- * consume the content when the selection is collapsed.
- *
- * @readonly
- * @member {'forward'|'backward'} #direction
- */
- this.direction = direction;
- /**
- * Delete's change buffer used to group subsequent changes into batches.
- *
- * @readonly
- * @private
- * @type {module:typing/utils/changebuffer~ChangeBuffer}
- */
- this._buffer = new _utils_changebuffer__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.model, editor.config.get( 'typing.undoStep' ) );
- }
- /**
- * The current change buffer.
- *
- * @type {module:typing/utils/changebuffer~ChangeBuffer}
- */
- get buffer() {
- return this._buffer;
- }
- /**
- * Executes the delete command. Depending on whether the selection is collapsed or not, deletes its content
- * or a piece of content in the {@link #direction defined direction}.
- *
- * @fires execute
- * @param {Object} [options] The command options.
- * @param {'character'} [options.unit='character'] See {@link module:engine/model/utils/modifyselection~modifySelection}'s options.
- * @param {Number} [options.sequence=1] A number describing which subsequent delete event it is without the key being released.
- * See the {@link module:engine/view/document~Document#event:delete} event data.
- * @param {module:engine/model/selection~Selection} [options.selection] Selection to remove. If not set, current model selection
- * will be used.
- */
- execute( options = {} ) {
- const model = this.editor.model;
- const doc = model.document;
- model.enqueueChange( this._buffer.batch, writer => {
- this._buffer.lock();
- const selection = writer.createSelection( options.selection || doc.selection );
- const sequence = options.sequence || 1;
- // Do not replace the whole selected content if selection was collapsed.
- // This prevents such situation:
- //
- // <h1></h1><p>[]</p> --> <h1>[</h1><p>]</p> --> <p></p>
- // starting content --> after `modifySelection` --> after `deleteContent`.
- const doNotResetEntireContent = selection.isCollapsed;
- // Try to extend the selection in the specified direction.
- if ( selection.isCollapsed ) {
- model.modifySelection( selection, { direction: this.direction, unit: options.unit } );
- }
- // Check if deleting in an empty editor. See #61.
- if ( this._shouldEntireContentBeReplacedWithParagraph( sequence ) ) {
- this._replaceEntireContentWithParagraph( writer );
- return;
- }
- // Check if deleting in the first empty block.
- // See https://github.com/ckeditor/ckeditor5/issues/8137.
- if ( this._shouldReplaceFirstBlockWithParagraph( selection, sequence ) ) {
- this.editor.execute( 'paragraph', { selection } );
- return;
- }
- // If selection is still collapsed, then there's nothing to delete.
- if ( selection.isCollapsed ) {
- return;
- }
- let changeCount = 0;
- selection.getFirstRange().getMinimalFlatRanges().forEach( range => {
- changeCount += Object(_ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_1__["default"])(
- range.getWalker( { singleCharacters: true, ignoreElementEnd: true, shallow: true } )
- );
- } );
- model.deleteContent( selection, {
- doNotResetEntireContent,
- direction: this.direction
- } );
- this._buffer.input( changeCount );
- writer.setSelection( selection );
- this._buffer.unlock();
- } );
- }
- /**
- * If the user keeps <kbd>Backspace</kbd> or <kbd>Delete</kbd> key pressed, the content of the current
- * editable will be cleared. However, this will not yet lead to resetting the remaining block to a paragraph
- * (which happens e.g. when the user does <kbd>Ctrl</kbd> + <kbd>A</kbd>, <kbd>Backspace</kbd>).
- *
- * But, if the user pressed the key in an empty editable for the first time,
- * we want to replace the entire content with a paragraph if:
- *
- * * the current limit element is empty,
- * * the paragraph is allowed in the limit element,
- * * the limit doesn't already have a paragraph inside.
- *
- * See https://github.com/ckeditor/ckeditor5-typing/issues/61.
- *
- * @private
- * @param {Number} sequence A number describing which subsequent delete event it is without the key being released.
- * @returns {Boolean}
- */
- _shouldEntireContentBeReplacedWithParagraph( sequence ) {
- // Does nothing if user pressed and held the "Backspace" or "Delete" key.
- if ( sequence > 1 ) {
- return false;
- }
- const model = this.editor.model;
- const doc = model.document;
- const selection = doc.selection;
- const limitElement = model.schema.getLimitElement( selection );
- // If a collapsed selection contains the whole content it means that the content is empty
- // (from the user perspective).
- const limitElementIsEmpty = selection.isCollapsed && selection.containsEntireContent( limitElement );
- if ( !limitElementIsEmpty ) {
- return false;
- }
- if ( !model.schema.checkChild( limitElement, 'paragraph' ) ) {
- return false;
- }
- const limitElementFirstChild = limitElement.getChild( 0 );
- // Does nothing if the limit element already contains only a paragraph.
- // We ignore the case when paragraph might have some inline elements (<p><inlineWidget>[]</inlineWidget></p>)
- // because we don't support such cases yet and it's unclear whether inlineWidget shouldn't be a limit itself.
- if ( limitElementFirstChild && limitElementFirstChild.name === 'paragraph' ) {
- return false;
- }
- return true;
- }
- /**
- * The entire content is replaced with the paragraph. Selection is moved inside the paragraph.
- *
- * @private
- * @param {module:engine/model/writer~Writer} writer The model writer.
- */
- _replaceEntireContentWithParagraph( writer ) {
- const model = this.editor.model;
- const doc = model.document;
- const selection = doc.selection;
- const limitElement = model.schema.getLimitElement( selection );
- const paragraph = writer.createElement( 'paragraph' );
- writer.remove( writer.createRangeIn( limitElement ) );
- writer.insert( paragraph, limitElement );
- writer.setSelection( paragraph, 0 );
- }
- /**
- * Checks if the selection is inside an empty element that is the first child of the limit element
- * and should be replaced with a paragraph.
- *
- * @private
- * @param {module:engine/model/selection~Selection} selection The selection.
- * @param {Number} sequence A number describing which subsequent delete event it is without the key being released.
- * @returns {Boolean}
- */
- _shouldReplaceFirstBlockWithParagraph( selection, sequence ) {
- const model = this.editor.model;
- // Does nothing if user pressed and held the "Backspace" key or it was a "Delete" button.
- if ( sequence > 1 || this.direction != 'backward' ) {
- return false;
- }
- if ( !selection.isCollapsed ) {
- return false;
- }
- const position = selection.getFirstPosition();
- const limitElement = model.schema.getLimitElement( position );
- const limitElementFirstChild = limitElement.getChild( 0 );
- // Only elements that are direct children of the limit element can be replaced.
- // Unwrapping from a block quote should be handled in a dedicated feature.
- if ( position.parent != limitElementFirstChild ) {
- return false;
- }
- // A block should be replaced only if it was empty.
- if ( !selection.containsEntireContent( limitElementFirstChild ) ) {
- return false;
- }
- // Replace with a paragraph only if it's allowed there.
- if ( !model.schema.checkChild( limitElement, 'paragraph' ) ) {
- return false;
- }
- // Does nothing if the limit element already contains only a paragraph.
- if ( limitElementFirstChild.name == 'paragraph' ) {
- return false;
- }
- return true;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DeleteObserver; });
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_bubblingeventinfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/deleteobserver
- */
- /**
- * Delete observer introduces the {@link module:engine/view/document~Document#event:delete} event.
- *
- * @extends module:engine/view/observer/observer~Observer
- */
- class DeleteObserver extends _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( view ) {
- super( view );
- const document = view.document;
- let sequence = 0;
- document.on( 'keyup', ( evt, data ) => {
- if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].delete || data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].backspace ) {
- sequence = 0;
- }
- } );
- document.on( 'keydown', ( evt, data ) => {
- const deleteData = {};
- if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].delete ) {
- deleteData.direction = 'forward';
- deleteData.unit = 'character';
- } else if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].backspace ) {
- deleteData.direction = 'backward';
- deleteData.unit = 'codePoint';
- } else {
- return;
- }
- const hasWordModifier = _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__["default"].isMac ? data.altKey : data.ctrlKey;
- deleteData.unit = hasWordModifier ? 'word' : deleteData.unit;
- deleteData.sequence = ++sequence;
- fireViewDeleteEvent( evt, data.domEvent, deleteData );
- } );
- // `beforeinput` is handled only for Android devices. Desktop Chrome and iOS are skipped because they are working fine now.
- if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__["default"].isAndroid ) {
- document.on( 'beforeinput', ( evt, data ) => {
- // If event type is other than `deleteContentBackward` then this is not deleting.
- if ( data.domEvent.inputType != 'deleteContentBackward' ) {
- return;
- }
- const deleteData = {
- unit: 'codepoint',
- direction: 'backward',
- sequence: 1
- };
- // Android IMEs may change the DOM selection on `beforeinput` event so that the selection contains all the text
- // that the IME wants to remove. We will pass this information to `delete` event so proper part of the content is removed.
- //
- // Sometimes it is only expanding by a one character (in case of collapsed selection). In this case we don't need to
- // set a different selection to remove, it will work just fine.
- const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
- if ( domSelection.anchorNode == domSelection.focusNode && domSelection.anchorOffset + 1 != domSelection.focusOffset ) {
- deleteData.selectionToRemove = view.domConverter.domSelectionToView( domSelection );
- }
- fireViewDeleteEvent( evt, data.domEvent, deleteData );
- } );
- }
- function fireViewDeleteEvent( originalEvent, domEvent, deleteData ) {
- const event = new _ckeditor_ckeditor5_engine_src_view_observer_bubblingeventinfo__WEBPACK_IMPORTED_MODULE_2__["default"]( document, 'delete', document.selection.getFirstRange() );
- document.fire( event, new _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__["default"]( document, domEvent, deleteData ) );
- // Stop the original event if `delete` event was stopped.
- // https://github.com/ckeditor/ckeditor5/issues/753
- if ( event.stop.called ) {
- originalEvent.stop();
- }
- }
- }
- /**
- * @inheritDoc
- */
- observe() {}
- }
- /**
- * Event fired when the user tries to delete content (e.g. presses <kbd>Delete</kbd> or <kbd>Backspace</kbd>).
- *
- * Note: This event is fired by the {@link module:typing/deleteobserver~DeleteObserver observer}
- * (usually registered by the {@link module:typing/delete~Delete delete feature}).
- *
- * @event module:engine/view/document~Document#event:delete
- * @param {module:engine/view/observer/domeventdata~DomEventData} data
- * @param {'forward'|'delete'} data.direction The direction in which the deletion should happen.
- * @param {'character'|'word'} data.unit The "amount" of content that should be deleted.
- * @param {Number} data.sequence A number describing which subsequent delete event it is without the key being released.
- * If it's 2 or more it means that the key was pressed and hold.
- * @param {module:engine/view/selection~Selection} [data.selectionToRemove] View selection which content should be removed. If not set,
- * current selection should be used.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/index.js":
- /*!**************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/index.js ***!
- \**************************************************************/
- /*! exports provided: Typing, Input, Delete, TextWatcher, TwoStepCaretMovement, TextTransformation, inlineHighlight, findAttributeRange, getLastTextLine, isNonTypingKeystroke */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _typing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typing */ "./node_modules/@ckeditor/ckeditor5-typing/src/typing.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Typing", function() { return _typing__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./input */ "./node_modules/@ckeditor/ckeditor5-typing/src/input.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return _input__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _delete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Delete", function() { return _delete__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _textwatcher__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textwatcher */ "./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextWatcher", function() { return _textwatcher__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _twostepcaretmovement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./twostepcaretmovement */ "./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TwoStepCaretMovement", function() { return _twostepcaretmovement__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _texttransformation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./texttransformation */ "./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextTransformation", function() { return _texttransformation__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _utils_inlinehighlight__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/inlinehighlight */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inlineHighlight", function() { return _utils_inlinehighlight__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _utils_findattributerange__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/findattributerange */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findAttributeRange", function() { return _utils_findattributerange__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _utils_getlasttextline__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/getlasttextline */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLastTextLine", function() { return _utils_getlasttextline__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/injectunsafekeystrokeshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNonTypingKeystroke", function() { return _utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_9__["isNonTypingKeystroke"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/input.js":
- /*!**************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/input.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Input; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _inputcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inputcommand */ "./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js");
- /* harmony import */ var _utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/injectunsafekeystrokeshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js");
- /* harmony import */ var _utils_injecttypingmutationshandling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/injecttypingmutationshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injecttypingmutationshandling.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/input
- */
- /**
- * Handles text input coming from the keyboard or other input methods.
- *
- * @extends module:core/plugin~Plugin
- */
- class Input extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Input';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // TODO The above default configuration value should be defined using editor.config.define() once it's fixed.
- const inputCommand = new _inputcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, editor.config.get( 'typing.undoStep' ) || 20 );
- editor.commands.add( 'input', inputCommand );
- Object(_utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_2__["default"])( editor );
- Object(_utils_injecttypingmutationshandling__WEBPACK_IMPORTED_MODULE_3__["default"])( editor );
- }
- /**
- * Checks batch if it is a result of user input - e.g. typing.
- *
- * const input = editor.plugins.get( 'Input' );
- *
- * editor.model.document.on( 'change:data', ( evt, batch ) => {
- * if ( input.isInput( batch ) ) {
- * console.log( 'The user typed something...' );
- * }
- * } );
- *
- * **Note:** This method checks if the batch was created using {@link module:typing/inputcommand~InputCommand 'input'}
- * command as typing changes coming from user input are inserted to the document using that command.
- *
- * @param {module:engine/model/batch~Batch} batch A batch to check.
- * @returns {Boolean}
- */
- isInput( batch ) {
- const inputCommand = this.editor.commands.get( 'input' );
- return inputCommand._batches.has( batch );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InputCommand; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
- /* harmony import */ var _utils_changebuffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/changebuffer */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/inputcommand
- */
- /**
- * The input command. Used by the {@link module:typing/input~Input input feature} to handle typing.
- *
- * @extends module:core/command~Command
- */
- class InputCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an instance of the command.
- *
- * @param {module:core/editor/editor~Editor} editor
- * @param {Number} undoStepSize The maximum number of atomic changes
- * which can be contained in one batch in the command buffer.
- */
- constructor( editor, undoStepSize ) {
- super( editor );
- /**
- * Typing's change buffer used to group subsequent changes into batches.
- *
- * @readonly
- * @private
- * @member {module:typing/utils/changebuffer~ChangeBuffer} #_buffer
- */
- this._buffer = new _utils_changebuffer__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.model, undoStepSize );
- /**
- * Stores batches created by the input command. The batches are used to differentiate input batches from other batches using
- * {@link module:typing/input~Input#isInput} method.
- *
- * @type {WeakSet<module:engine/model/batch~Batch>}
- * @protected
- */
- this._batches = new WeakSet();
- }
- /**
- * The current change buffer.
- *
- * @type {module:typing/utils/changebuffer~ChangeBuffer}
- */
- get buffer() {
- return this._buffer;
- }
- /**
- * @inheritDoc
- */
- destroy() {
- super.destroy();
- this._buffer.destroy();
- }
- /**
- * Executes the input command. It replaces the content within the given range with the given text.
- * Replacing is a two step process, first the content within the range is removed and then the new text is inserted
- * at the beginning of the range (which after the removal is a collapsed range).
- *
- * @fires execute
- * @param {Object} [options] The command options.
- * @param {String} [options.text=''] The text to be inserted.
- * @param {module:engine/model/range~Range} [options.range] The range in which the text is inserted. Defaults
- * to the first range in the current selection.
- * @param {module:engine/model/range~Range} [options.resultRange] The range where the selection
- * should be placed after the insertion. If not specified, the selection will be placed right after
- * the inserted text.
- */
- execute( options = {} ) {
- const model = this.editor.model;
- const doc = model.document;
- const text = options.text || '';
- const textInsertions = text.length;
- const selection = options.range ? model.createSelection( options.range ) : doc.selection;
- const resultRange = options.resultRange;
- model.enqueueChange( this._buffer.batch, writer => {
- this._buffer.lock();
- // Store the batch as an 'input' batch for the Input.isInput( batch ) check.
- this._batches.add( this._buffer.batch );
- model.deleteContent( selection );
- if ( text ) {
- model.insertContent( writer.createText( text, doc.selection.getAttributes() ), selection );
- }
- if ( resultRange ) {
- writer.setSelection( resultRange );
- } else if ( !selection.is( 'documentSelection' ) ) {
- writer.setSelection( selection );
- }
- this._buffer.unlock();
- this._buffer.input( textInsertions );
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextTransformation; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _textwatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textwatcher */ "./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/texttransformation
- */
- // All named transformations.
- const TRANSFORMATIONS = {
- // Common symbols:
- copyright: { from: '(c)', to: '©' },
- registeredTrademark: { from: '(r)', to: '®' },
- trademark: { from: '(tm)', to: '™' },
- // Mathematical:
- oneHalf: { from: '1/2', to: '½' },
- oneThird: { from: '1/3', to: '⅓' },
- twoThirds: { from: '2/3', to: '⅔' },
- oneForth: { from: '1/4', to: '¼' },
- threeQuarters: { from: '3/4', to: '¾' },
- lessThanOrEqual: { from: '<=', to: '≤' },
- greaterThanOrEqual: { from: '>=', to: '≥' },
- notEqual: { from: '!=', to: '≠' },
- arrowLeft: { from: '<-', to: '←' },
- arrowRight: { from: '->', to: '→' },
- // Typography:
- horizontalEllipsis: { from: '...', to: '…' },
- enDash: { from: /(^| )(--)( )$/, to: [ null, '–', null ] },
- emDash: { from: /(^| )(---)( )$/, to: [ null, '—', null ] },
- // Quotations:
- // English, US
- quotesPrimary: { from: buildQuotesRegExp( '"' ), to: [ null, '“', null, '”' ] },
- quotesSecondary: { from: buildQuotesRegExp( '\'' ), to: [ null, '‘', null, '’' ] },
- // English, UK
- quotesPrimaryEnGb: { from: buildQuotesRegExp( '\'' ), to: [ null, '‘', null, '’' ] },
- quotesSecondaryEnGb: { from: buildQuotesRegExp( '"' ), to: [ null, '“', null, '”' ] },
- // Polish
- quotesPrimaryPl: { from: buildQuotesRegExp( '"' ), to: [ null, '„', null, '”' ] },
- quotesSecondaryPl: { from: buildQuotesRegExp( '\'' ), to: [ null, '‚', null, '’' ] }
- };
- // Transformation groups.
- const TRANSFORMATION_GROUPS = {
- symbols: [ 'copyright', 'registeredTrademark', 'trademark' ],
- mathematical: [
- 'oneHalf', 'oneThird', 'twoThirds', 'oneForth', 'threeQuarters',
- 'lessThanOrEqual', 'greaterThanOrEqual', 'notEqual',
- 'arrowLeft', 'arrowRight'
- ],
- typography: [ 'horizontalEllipsis', 'enDash', 'emDash' ],
- quotes: [ 'quotesPrimary', 'quotesSecondary' ]
- };
- // A set of default transformations provided by the feature.
- const DEFAULT_TRANSFORMATIONS = [
- 'symbols',
- 'mathematical',
- 'typography',
- 'quotes'
- ];
- /**
- * The text transformation plugin.
- *
- * @extends module:core/plugin~Plugin
- */
- class TextTransformation extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'TextTransformation';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- editor.config.define( 'typing', {
- transformations: {
- include: DEFAULT_TRANSFORMATIONS
- }
- } );
- }
- /**
- * @inheritDoc
- */
- init() {
- const model = this.editor.model;
- const modelSelection = model.document.selection;
- modelSelection.on( 'change:range', () => {
- // Disable plugin when selection is inside a code block.
- this.isEnabled = !modelSelection.anchor.parent.is( 'element', 'codeBlock' );
- } );
- this._enableTransformationWatchers();
- }
- /**
- * Create new TextWatcher listening to the editor for typing and selection events.
- *
- * @private
- */
- _enableTransformationWatchers() {
- const editor = this.editor;
- const model = editor.model;
- const input = editor.plugins.get( 'Input' );
- const normalizedTransformations = normalizeTransformations( editor.config.get( 'typing.transformations' ) );
- const testCallback = text => {
- for ( const normalizedTransformation of normalizedTransformations ) {
- const from = normalizedTransformation.from;
- const match = from.test( text );
- if ( match ) {
- return { normalizedTransformation };
- }
- }
- };
- const watcherCallback = ( evt, data ) => {
- if ( !input.isInput( data.batch ) ) {
- return;
- }
- const { from, to } = data.normalizedTransformation;
- const matches = from.exec( data.text );
- const replaces = to( matches.slice( 1 ) );
- const matchedRange = data.range;
- let changeIndex = matches.index;
- model.enqueueChange( writer => {
- for ( let i = 1; i < matches.length; i++ ) {
- const match = matches[ i ];
- const replaceWith = replaces[ i - 1 ];
- if ( replaceWith == null ) {
- changeIndex += match.length;
- continue;
- }
- const replacePosition = matchedRange.start.getShiftedBy( changeIndex );
- const replaceRange = model.createRange( replacePosition, replacePosition.getShiftedBy( match.length ) );
- const attributes = getTextAttributesAfterPosition( replacePosition );
- model.insertContent( writer.createText( replaceWith, attributes ), replaceRange );
- changeIndex += replaceWith.length;
- }
- } );
- };
- const watcher = new _textwatcher__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.model, testCallback );
- watcher.on( 'matched:data', watcherCallback );
- watcher.bind( 'isEnabled' ).to( this );
- }
- }
- // Normalizes the configuration `from` parameter value.
- // The normalized value for the `from` parameter is a RegExp instance. If the passed `from` is already a RegExp instance,
- // it is returned unchanged.
- //
- // @param {String|RegExp} from
- // @returns {RegExp}
- function normalizeFrom( from ) {
- if ( typeof from == 'string' ) {
- return new RegExp( `(${ Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["escapeRegExp"])( from ) })$` );
- }
- // `from` is already a regular expression.
- return from;
- }
- // Normalizes the configuration `to` parameter value.
- // The normalized value for the `to` parameter is a function that takes an array and returns an array. See more in the
- // configuration description. If the passed `to` is already a function, it is returned unchanged.
- //
- // @param {String|Array.<null|String>|Function} to
- // @returns {Function}
- function normalizeTo( to ) {
- if ( typeof to == 'string' ) {
- return () => [ to ];
- } else if ( to instanceof Array ) {
- return () => to;
- }
- // `to` is already a function.
- return to;
- }
- // For given `position` returns attributes for the text that is after that position.
- // The text can be in the same text node as the position (`foo[]bar`) or in the next text node (`foo[]<$text bold="true">bar</$text>`).
- //
- // @param {module:engine/model/position~Position} position
- // @returns {Iterable.<*>}
- function getTextAttributesAfterPosition( position ) {
- const textNode = position.textNode ? position.textNode : position.nodeAfter;
- return textNode.getAttributes();
- }
- // Returns a RegExp pattern string that detects a sentence inside a quote.
- //
- // @param {String} quoteCharacter The character to create a pattern for.
- // @returns {String}
- function buildQuotesRegExp( quoteCharacter ) {
- return new RegExp( `(^|\\s)(${ quoteCharacter })([^${ quoteCharacter }]*)(${ quoteCharacter })$` );
- }
- // Reads text transformation config and returns normalized array of transformations objects.
- //
- // @param {module:typing/texttransformation~TextTransformationDescription} config
- // @returns {Array.<{from:String,to:Function}>}
- function normalizeTransformations( config ) {
- const extra = config.extra || [];
- const remove = config.remove || [];
- const isNotRemoved = transformation => !remove.includes( transformation );
- const configured = config.include.concat( extra ).filter( isNotRemoved );
- return expandGroupsAndRemoveDuplicates( configured )
- .filter( isNotRemoved ) // Filter out 'remove' transformations as they might be set in group
- .map( transformation => TRANSFORMATIONS[ transformation ] || transformation )
- .map( transformation => ( {
- from: normalizeFrom( transformation.from ),
- to: normalizeTo( transformation.to )
- } ) );
- }
- // Reads definitions and expands named groups if needed to transformation names.
- // This method also removes duplicated named transformations if any.
- //
- // @param {Array.<String|Object>} definitions
- // @returns {Array.<String|Object>}
- function expandGroupsAndRemoveDuplicates( definitions ) {
- // Set is using to make sure that transformation names are not duplicated.
- const definedTransformations = new Set();
- for ( const transformationOrGroup of definitions ) {
- if ( TRANSFORMATION_GROUPS[ transformationOrGroup ] ) {
- for ( const transformation of TRANSFORMATION_GROUPS[ transformationOrGroup ] ) {
- definedTransformations.add( transformation );
- }
- } else {
- definedTransformations.add( transformationOrGroup );
- }
- }
- return Array.from( definedTransformations );
- }
- /**
- * The text transformation definition object. It describes what should be replaced with what.
- *
- * The input value (`from`) can be passed either as a string or as a regular expression.
- *
- * * If a string is passed, it will be simply checked if the end of the input matches it.
- * * If a regular expression is passed, its entire length must be covered with capturing groups (e.g. `/(foo)(bar)$/`).
- * Also, since it is compared against the end of the input, it has to end with `$` to be correctly matched.
- * See examples below.
- *
- * The output value (`to`) can be passed as a string, as an array or as a function.
- *
- * * If a string is passed, it will be used as a replacement value as-is. Note that a string output value can be used only if
- * the input value is a string, too.
- * * If an array is passed, it has to have the same number of elements as there are capturing groups in the input value regular expression.
- * Each capture group will be replaced with a corresponding string from the passed array. If a given capturing group should not be replaced,
- * use `null` instead of passing a string.
- * * If a function is used, it should return an array as described above. The function is passed one parameter — an array with matches
- * by the regular expression. See the examples below.
- *
- * A simple string-to-string replacement:
- *
- * { from: '(c)', to: '©' }
- *
- * Change quote styles using a regular expression. Note how all the parts are in separate capturing groups and the space at the beginning
- * and the text inside quotes are not replaced (`null` passed as the first and the third value in the `to` parameter):
- *
- * {
- * from: /(^|\s)(")([^"]*)(")$/,
- * to: [ null, '“', null, '”' ]
- * }
- *
- * Automatic uppercase after a dot using a callback:
- *
- * {
- * from: /(\. )([a-z])$/,
- * to: matches => [ null, matches[ 1 ].toUpperCase() ]
- * }
- *
- * @typedef {Object} module:typing/texttransformation~TextTransformationDescription
- * @property {String|RegExp} from The string or regular expression to transform.
- * @property {String} to The text to transform compatible with `String.replace()`.
- */
- /**
- * The configuration of the {@link module:typing/texttransformation~TextTransformation} feature.
- *
- * Read more in {@link module:typing/texttransformation~TextTransformationConfig}.
- *
- * @member {module:typing/texttransformation~TextTransformationConfig} module:typing/typing~TypingConfig#transformations
- */
- /**
- * The configuration of the text transformation feature.
- *
- * ClassicEditor
- * .create( editorElement, {
- * typing: {
- * transformations: ... // Text transformation feature options.
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * By default, the feature comes pre-configured
- * (via {@link module:typing/texttransformation~TextTransformationConfig#include `config.typing.transformations.include`}) with the
- * following groups of transformations:
- *
- * * Typography (group name: `typography`)
- * - `ellipsis`: transforms `...` to `…`
- * - `enDash`: transforms ` -- ` to ` – `
- * - `emDash`: transforms ` --- ` to ` — `
- * * Quotations (group name: `quotes`)
- * - `quotesPrimary`: transforms `"Foo bar"` to `“Foo bar”`
- * - `quotesSecondary`: transforms `'Foo bar'` to `‘Foo bar’`
- * * Symbols (group name: `symbols`)
- * - `trademark`: transforms `(tm)` to `™`
- * - `registeredTrademark`: transforms `(r)` to `®`
- * - `copyright`: transforms `(c)` to `©`
- * * Mathematical (group name: `mathematical`)
- * - `oneHalf`: transforms `1/2` to: `½`
- * - `oneThird`: transforms `1/3` to: `⅓`
- * - `twoThirds`: transforms `2/3` to: `⅔`
- * - `oneForth`: transforms `1/4` to: `¼`
- * - `threeQuarters`: transforms `3/4` to: `¾`
- * - `lessThanOrEqual`: transforms `<=` to: `≤`
- * - `greaterThanOrEqual`: transforms `>=` to: `≥`
- * - `notEqual`: transforms `!=` to: `≠`
- * - `arrowLeft`: transforms `<-` to: `←`
- * - `arrowRight`: transforms `->` to: `→`
- * * Misc:
- * - `quotesPrimaryEnGb`: transforms `'Foo bar'` to `‘Foo bar’`
- * - `quotesSecondaryEnGb`: transforms `"Foo bar"` to `“Foo bar”`
- * - `quotesPrimaryPl`: transforms `"Foo bar"` to `„Foo bar”`
- * - `quotesSecondaryPl`: transforms `'Foo bar'` to `‚Foo bar’`
- *
- * In order to load additional transformations, use the
- * {@link module:typing/texttransformation~TextTransformationConfig#extra `transformations.extra` option}.
- *
- * In order to narrow down the list of transformations, use the
- * {@link module:typing/texttransformation~TextTransformationConfig#remove `transformations.remove` option}.
- *
- * In order to completely override the supported transformations, use the
- * {@link module:typing/texttransformation~TextTransformationConfig#include `transformations.include` option}.
- *
- * Examples:
- *
- * const transformationsConfig = {
- * include: [
- * // Use only the 'quotes' and 'typography' groups.
- * 'quotes',
- * 'typography',
- *
- * // Plus, some custom transformation.
- * { from: 'CKE', to: 'CKEditor' }
- * ]
- * };
- *
- * const transformationsConfig = {
- * // Remove the 'ellipsis' transformation loaded by the 'typography' group.
- * remove: [ 'ellipsis' ]
- * }
- *
- * @interface TextTransformationConfig
- */
- /* eslint-disable max-len */
- /**
- * The standard list of text transformations supported by the editor. By default it comes pre-configured with a couple dozen of them
- * (see {@link module:typing/texttransformation~TextTransformationConfig} for the full list). You can override this list completely
- * by setting this option or use the other two options
- * ({@link module:typing/texttransformation~TextTransformationConfig#extra `transformations.extra`},
- * {@link module:typing/texttransformation~TextTransformationConfig#remove `transformations.remove`}) to fine-tune the default list.
- *
- * @member {Array.<module:typing/texttransformation~TextTransformationDescription>} module:typing/texttransformation~TextTransformationConfig#include
- */
- /**
- * Additional text transformations that are added to the transformations defined in
- * {@link module:typing/texttransformation~TextTransformationConfig#include `transformations.include`}.
- *
- * const transformationsConfig = {
- * extra: [
- * { from: 'CKE', to: 'CKEditor' }
- * ]
- * };
- *
- * @member {Array.<module:typing/texttransformation~TextTransformationDescription>} module:typing/texttransformation~TextTransformationConfig#extra
- */
- /**
- * The text transformation names that are removed from transformations defined in
- * {@link module:typing/texttransformation~TextTransformationConfig#include `transformations.include`} or
- * {@link module:typing/texttransformation~TextTransformationConfig#extra `transformations.extra`}.
- *
- * const transformationsConfig = {
- * remove: [
- * 'ellipsis', // Remove only 'ellipsis' from the 'typography' group.
- * 'mathematical' // Remove all transformations from the 'mathematical' group.
- * ]
- * }
- *
- * @member {Array.<module:typing/texttransformation~TextTransformationDescription>} module:typing/texttransformation~TextTransformationConfig#remove
- */
- /* eslint-enable max-len */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextWatcher; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _utils_getlasttextline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/getlasttextline */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/textwatcher
- */
- /**
- * The text watcher feature.
- *
- * Fires the {@link module:typing/textwatcher~TextWatcher#event:matched:data `matched:data`},
- * {@link module:typing/textwatcher~TextWatcher#event:matched:selection `matched:selection`} and
- * {@link module:typing/textwatcher~TextWatcher#event:unmatched `unmatched`} events on typing or selection changes.
- *
- * @private
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class TextWatcher {
- /**
- * Creates a text watcher instance.
- *
- * @param {module:engine/model/model~Model} model
- * @param {Function} testCallback See {@link module:typing/textwatcher~TextWatcher#testCallback}.
- */
- constructor( model, testCallback ) {
- /**
- * The editor's model.
- *
- * @readonly
- * @member {module:engine/model/model~Model}
- */
- this.model = model;
- /**
- * The function used to match the text.
- *
- * The test callback can return 3 values:
- *
- * * `false` if there is no match,
- * * `true` if there is a match,
- * * an object if there is a match and we want to pass some additional information to the {@link #event:matched:data} event.
- *
- * @member {Function} #testCallback
- * @returns {Object} testResult
- */
- this.testCallback = testCallback;
- /**
- * Whether there is a match currently.
- *
- * @readonly
- * @member {Boolean}
- */
- this.hasMatch = false;
- /**
- * Flag indicating whether the `TextWatcher` instance is enabled or disabled.
- * A disabled TextWatcher will not evaluate text.
- *
- * To disable TextWatcher:
- *
- * const watcher = new TextWatcher( editor.model, testCallback );
- *
- * // After this a testCallback will not be called.
- * watcher.isEnabled = false;
- *
- * @observable
- * @member {Boolean} #isEnabled
- */
- this.set( 'isEnabled', true );
- // Toggle text watching on isEnabled state change.
- this.on( 'change:isEnabled', () => {
- if ( this.isEnabled ) {
- this._startListening();
- } else {
- this.stopListening( model.document.selection );
- this.stopListening( model.document );
- }
- } );
- this._startListening();
- }
- /**
- * Starts listening to the editor for typing and selection events.
- *
- * @private
- */
- _startListening() {
- const model = this.model;
- const document = model.document;
- this.listenTo( document.selection, 'change:range', ( evt, { directChange } ) => {
- // Indirect changes (i.e. when the user types or external changes are applied) are handled in the document's change event.
- if ( !directChange ) {
- return;
- }
- // Act only on collapsed selection.
- if ( !document.selection.isCollapsed ) {
- if ( this.hasMatch ) {
- this.fire( 'unmatched' );
- this.hasMatch = false;
- }
- return;
- }
- this._evaluateTextBeforeSelection( 'selection' );
- } );
- this.listenTo( document, 'change:data', ( evt, batch ) => {
- if ( batch.type == 'transparent' ) {
- return;
- }
- this._evaluateTextBeforeSelection( 'data', { batch } );
- } );
- }
- /**
- * Checks the editor content for matched text.
- *
- * @fires matched:data
- * @fires matched:selection
- * @fires unmatched
- *
- * @private
- * @param {'data'|'selection'} suffix A suffix used for generating the event name.
- * @param {Object} data Data object for event.
- */
- _evaluateTextBeforeSelection( suffix, data = {} ) {
- const model = this.model;
- const document = model.document;
- const selection = document.selection;
- const rangeBeforeSelection = model.createRange( model.createPositionAt( selection.focus.parent, 0 ), selection.focus );
- const { text, range } = Object(_utils_getlasttextline__WEBPACK_IMPORTED_MODULE_2__["default"])( rangeBeforeSelection, model );
- const testResult = this.testCallback( text );
- if ( !testResult && this.hasMatch ) {
- this.fire( 'unmatched' );
- }
- this.hasMatch = !!testResult;
- if ( testResult ) {
- const eventData = Object.assign( data, { text, range } );
- // If the test callback returns an object with additional data, assign the data as well.
- if ( typeof testResult == 'object' ) {
- Object.assign( eventData, testResult );
- }
- this.fire( `matched:${ suffix }`, eventData );
- }
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( TextWatcher, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /**
- * Fired whenever the text watcher found a match for data changes.
- *
- * @event matched:data
- * @param {Object} data Event data.
- * @param {String} data.text The full text before selection to which the regexp was applied.
- * @param {module:engine/model/range~Range} data.range The range representing the position of the `data.text`.
- * @param {Object} [data.testResult] The additional data returned from the {@link module:typing/textwatcher~TextWatcher#testCallback}.
- */
- /**
- * Fired whenever the text watcher found a match for selection changes.
- *
- * @event matched:selection
- * @param {Object} data Event data.
- * @param {String} data.text The full text before selection.
- * @param {module:engine/model/range~Range} data.range The range representing the position of the `data.text`.
- * @param {Object} [data.testResult] The additional data returned from the {@link module:typing/textwatcher~TextWatcher#testCallback}.
- */
- /**
- * Fired whenever the text does not match anymore. Fired only when the text watcher found a match.
- *
- * @event unmatched
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TwoStepCaretMovement; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/twostepcaretmovement
- */
- /**
- * This plugin enables the two-step caret (phantom) movement behavior for
- * {@link module:typing/twostepcaretmovement~TwoStepCaretMovement#registerAttribute registered attributes}
- * on arrow right (<kbd>→</kbd>) and left (<kbd>←</kbd>) key press.
- *
- * Thanks to this (phantom) caret movement the user is able to type before/after as well as at the
- * beginning/end of an attribute.
- *
- * **Note:** This plugin support right–to–left (Arabic, Hebrew, etc.) content by mirroring its behavior
- * but for the sake of simplicity examples showcase only left–to–right use–cases.
- *
- * # Forward movement
- *
- * ## "Entering" an attribute:
- *
- * When this plugin is enabled and registered for the `a` attribute and the selection is right before it
- * (at the attribute boundary), pressing the right arrow key will not move the selection but update its
- * attributes accordingly:
- *
- * * When enabled:
- *
- * foo{}<$text a="true">bar</$text>
- *
- * <kbd>→</kbd>
- *
- * foo<$text a="true">{}bar</$text>
- *
- * * When disabled:
- *
- * foo{}<$text a="true">bar</$text>
- *
- * <kbd>→</kbd>
- *
- * foo<$text a="true">b{}ar</$text>
- *
- *
- * ## "Leaving" an attribute:
- *
- * * When enabled:
- *
- * <$text a="true">bar{}</$text>baz
- *
- * <kbd>→</kbd>
- *
- * <$text a="true">bar</$text>{}baz
- *
- * * When disabled:
- *
- * <$text a="true">bar{}</$text>baz
- *
- * <kbd>→</kbd>
- *
- * <$text a="true">bar</$text>b{}az
- *
- * # Backward movement
- *
- * * When enabled:
- *
- * <$text a="true">bar</$text>{}baz
- *
- * <kbd>←</kbd>
- *
- * <$text a="true">bar{}</$text>baz
- *
- * * When disabled:
- *
- * <$text a="true">bar</$text>{}baz
- *
- * <kbd>←</kbd>
- *
- * <$text a="true">ba{}r</$text>b{}az
- *
- * # Multiple attributes
- *
- * * When enabled and many attributes starts or ends at the same position:
- *
- * <$text a="true" b="true">bar</$text>{}baz
- *
- * <kbd>←</kbd>
- *
- * <$text a="true" b="true">bar{}</$text>baz
- *
- * * When enabled and one procedes another:
- *
- * <$text a="true">bar</$text><$text b="true">{}bar</$text>
- *
- * <kbd>←</kbd>
- *
- * <$text a="true">bar{}</$text><$text b="true">bar</$text>
- *
- */
- class TwoStepCaretMovement extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'TwoStepCaretMovement';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- /**
- * A set of attributes to handle.
- *
- * @protected
- * @property {module:typing/twostepcaretmovement~TwoStepCaretMovement}
- */
- this.attributes = new Set();
- /**
- * The current UID of the overridden gravity, as returned by
- * {@link module:engine/model/writer~Writer#overrideSelectionGravity}.
- *
- * @private
- * @member {String}
- */
- this._overrideUid = null;
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const model = editor.model;
- const view = editor.editing.view;
- const locale = editor.locale;
- const modelSelection = model.document.selection;
- // Listen to keyboard events and handle the caret movement according to the 2-step caret logic.
- this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
- // This implementation works only for collapsed selection.
- if ( !modelSelection.isCollapsed ) {
- return;
- }
- // When user tries to expand the selection or jump over the whole word or to the beginning/end then
- // two-steps movement is not necessary.
- if ( data.shiftKey || data.altKey || data.ctrlKey ) {
- return;
- }
- const arrowRightPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].arrowright;
- const arrowLeftPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].arrowleft;
- // When neither left or right arrow has been pressed then do noting.
- if ( !arrowRightPressed && !arrowLeftPressed ) {
- return;
- }
- const contentDirection = locale.contentLanguageDirection;
- let isMovementHandled = false;
- if ( ( contentDirection === 'ltr' && arrowRightPressed ) || ( contentDirection === 'rtl' && arrowLeftPressed ) ) {
- isMovementHandled = this._handleForwardMovement( data );
- } else {
- isMovementHandled = this._handleBackwardMovement( data );
- }
- // Stop the keydown event if the two-step caret movement handled it. Avoid collisions
- // with other features which may also take over the caret movement (e.g. Widget).
- if ( isMovementHandled === true ) {
- evt.stop();
- }
- }, { context: '$text', priority: 'highest' } );
- /**
- * A flag indicating that the automatic gravity restoration should not happen upon the next
- * gravity restoration.
- * {@link module:engine/model/selection~Selection#event:change:range} event.
- *
- * @private
- * @member {String}
- */
- this._isNextGravityRestorationSkipped = false;
- // The automatic gravity restoration logic.
- this.listenTo( modelSelection, 'change:range', ( evt, data ) => {
- // Skipping the automatic restoration is needed if the selection should change
- // but the gravity must remain overridden afterwards. See the #handleBackwardMovement
- // to learn more.
- if ( this._isNextGravityRestorationSkipped ) {
- this._isNextGravityRestorationSkipped = false;
- return;
- }
- // Skip automatic restore when the gravity is not overridden — simply, there's nothing to restore
- // at this moment.
- if ( !this._isGravityOverridden ) {
- return;
- }
- // Skip automatic restore when the change is indirect AND the selection is at the attribute boundary.
- // It means that e.g. if the change was external (collaboration) and the user had their
- // selection around the link, its gravity should remain intact in this change:range event.
- if ( !data.directChange && isBetweenDifferentAttributes( modelSelection.getFirstPosition(), this.attributes ) ) {
- return;
- }
- this._restoreGravity();
- } );
- }
- /**
- * Registers a given attribute for the two-step caret movement.
- *
- * @param {String} attribute Name of the attribute to handle.
- */
- registerAttribute( attribute ) {
- this.attributes.add( attribute );
- }
- /**
- * Updates the document selection and the view according to the two–step caret movement state
- * when moving **forwards**. Executed upon `keypress` in the {@link module:engine/view/view~View}.
- *
- * @private
- * @param {module:engine/view/observer/domeventdata~DomEventData} data Data of the key press.
- * @returns {Boolean} `true` when the handler prevented caret movement
- */
- _handleForwardMovement( data ) {
- const attributes = this.attributes;
- const model = this.editor.model;
- const selection = model.document.selection;
- const position = selection.getFirstPosition();
- // DON'T ENGAGE 2-SCM if gravity is already overridden. It means that we just entered
- //
- // <paragraph>foo<$text attribute>{}bar</$text>baz</paragraph>
- //
- // or left the attribute
- //
- // <paragraph>foo<$text attribute>bar</$text>{}baz</paragraph>
- //
- // and the gravity will be restored automatically.
- if ( this._isGravityOverridden ) {
- return false;
- }
- // DON'T ENGAGE 2-SCM when the selection is at the beginning of the block AND already has the
- // attribute:
- // * when the selection was initially set there using the mouse,
- // * when the editor has just started
- //
- // <paragraph><$text attribute>{}bar</$text>baz</paragraph>
- //
- if ( position.isAtStart && hasAnyAttribute( selection, attributes ) ) {
- return false;
- }
- // ENGAGE 2-SCM When at least one of the observed attributes changes its value (incl. starts, ends).
- //
- // <paragraph>foo<$text attribute>bar{}</$text>baz</paragraph>
- // <paragraph>foo<$text attribute>bar{}</$text><$text otherAttribute>baz</$text></paragraph>
- // <paragraph>foo<$text attribute=1>bar{}</$text><$text attribute=2>baz</$text></paragraph>
- // <paragraph>foo{}<$text attribute>bar</$text>baz</paragraph>
- //
- if ( isBetweenDifferentAttributes( position, attributes ) ) {
- preventCaretMovement( data );
- this._overrideGravity();
- return true;
- }
- }
- /**
- * Updates the document selection and the view according to the two–step caret movement state
- * when moving **backwards**. Executed upon `keypress` in the {@link module:engine/view/view~View}.
- *
- * @private
- * @param {module:engine/view/observer/domeventdata~DomEventData} data Data of the key press.
- * @returns {Boolean} `true` when the handler prevented caret movement
- */
- _handleBackwardMovement( data ) {
- const attributes = this.attributes;
- const model = this.editor.model;
- const selection = model.document.selection;
- const position = selection.getFirstPosition();
- // When the gravity is already overridden (by this plugin), it means we are on the two-step position.
- // Prevent the movement, restore the gravity and update selection attributes.
- //
- // <paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>{}baz</$text></paragraph>
- // <paragraph>foo<$text attribute>bar</$text><$text otherAttribute>{}baz</$text></paragraph>
- // <paragraph>foo<$text attribute>{}bar</$text>baz</paragraph>
- // <paragraph>foo<$text attribute>bar</$text>{}baz</paragraph>
- //
- if ( this._isGravityOverridden ) {
- preventCaretMovement( data );
- this._restoreGravity();
- setSelectionAttributesFromTheNodeBefore( model, attributes, position );
- return true;
- } else {
- // REMOVE SELECTION ATTRIBUTE when restoring gravity towards a non-existent content at the
- // beginning of the block.
- //
- // <paragraph>{}<$text attribute>bar</$text></paragraph>
- //
- if ( position.isAtStart ) {
- if ( hasAnyAttribute( selection, attributes ) ) {
- preventCaretMovement( data );
- setSelectionAttributesFromTheNodeBefore( model, attributes, position );
- return true;
- }
- return false;
- }
- // When we are moving from natural gravity, to the position of the 2SCM, we need to override the gravity,
- // and make sure it won't be restored. Unless it's at the end of the block and an observed attribute.
- // We need to check if the caret is a one position before the attribute boundary:
- //
- // <paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>b{}az</$text></paragraph>
- // <paragraph>foo<$text attribute>bar</$text><$text otherAttribute>b{}az</$text></paragraph>
- // <paragraph>foo<$text attribute>b{}ar</$text>baz</paragraph>
- // <paragraph>foo<$text attribute>bar</$text>b{}az</paragraph>
- //
- if ( isStepAfterAnyAttributeBoundary( position, attributes ) ) {
- // ENGAGE 2-SCM if the selection has no attribute. This may happen when the user
- // left the attribute using a FORWARD 2-SCM.
- //
- // <paragraph><$text attribute>bar</$text>{}</paragraph>
- //
- if (
- position.isAtEnd &&
- !hasAnyAttribute( selection, attributes ) &&
- isBetweenDifferentAttributes( position, attributes )
- ) {
- preventCaretMovement( data );
- setSelectionAttributesFromTheNodeBefore( model, attributes, position );
- return true;
- }
- // Skip the automatic gravity restore upon the next selection#change:range event.
- // If not skipped, it would automatically restore the gravity, which should remain
- // overridden.
- this._isNextGravityRestorationSkipped = true;
- this._overrideGravity();
- // Don't return "true" here because we didn't call _preventCaretMovement.
- // Returning here will destabilize the filler logic, which also listens to
- // keydown (and the event would be stopped).
- return false;
- }
- }
- }
- /**
- * `true` when the gravity is overridden for the plugin.
- *
- * @readonly
- * @private
- * @type {Boolean}
- */
- get _isGravityOverridden() {
- return !!this._overrideUid;
- }
- /**
- * Overrides the gravity using the {@link module:engine/model/writer~Writer model writer}
- * and stores the information about this fact in the {@link #_overrideUid}.
- *
- * A shorthand for {@link module:engine/model/writer~Writer#overrideSelectionGravity}.
- *
- * @private
- */
- _overrideGravity() {
- this._overrideUid = this.editor.model.change( writer => {
- return writer.overrideSelectionGravity();
- } );
- }
- /**
- * Restores the gravity using the {@link module:engine/model/writer~Writer model writer}.
- *
- * A shorthand for {@link module:engine/model/writer~Writer#restoreSelectionGravity}.
- *
- * @private
- */
- _restoreGravity() {
- this.editor.model.change( writer => {
- writer.restoreSelectionGravity( this._overrideUid );
- this._overrideUid = null;
- } );
- }
- }
- // Checks whether the selection has any of given attributes.
- //
- // @param {module:engine/model/documentselection~DocumentSelection} selection
- // @param {Iterable.<String>} attributes
- function hasAnyAttribute( selection, attributes ) {
- for ( const observedAttribute of attributes ) {
- if ( selection.hasAttribute( observedAttribute ) ) {
- return true;
- }
- }
- return false;
- }
- // Applies the given attributes to the current selection using using the
- // values from the node before the current position. Uses
- // the {@link module:engine/model/writer~Writer model writer}.
- //
- // @param {module:engine/model/model~Model}
- // @param {Iterable.<String>} attributess
- // @param {module:engine/model/position~Position} position
- function setSelectionAttributesFromTheNodeBefore( model, attributes, position ) {
- const nodeBefore = position.nodeBefore;
- model.change( writer => {
- if ( nodeBefore ) {
- writer.setSelectionAttribute( nodeBefore.getAttributes() );
- } else {
- writer.removeSelectionAttribute( attributes );
- }
- } );
- }
- // Prevents the caret movement in the view by calling `preventDefault` on the event data.
- //
- // @alias data.preventDefault
- function preventCaretMovement( data ) {
- data.preventDefault();
- }
- // Checks whether the step before `isBetweenDifferentAttributes()`.
- //
- // @param {module:engine/model/position~Position} position
- // @param {String} attribute
- function isStepAfterAnyAttributeBoundary( position, attributes ) {
- const positionBefore = position.getShiftedBy( -1 );
- return isBetweenDifferentAttributes( positionBefore, attributes );
- }
- // Checks whether the given position is between different values of given attributes.
- //
- // @param {module:engine/model/position~Position} position
- // @param {Iterable.<String>} attributes
- function isBetweenDifferentAttributes( position, attributes ) {
- const { nodeBefore, nodeAfter } = position;
- for ( const observedAttribute of attributes ) {
- const attrBefore = nodeBefore ? nodeBefore.getAttribute( observedAttribute ) : undefined;
- const attrAfter = nodeAfter ? nodeAfter.getAttribute( observedAttribute ) : undefined;
- if ( attrAfter !== attrBefore ) {
- return true;
- }
- }
- return false;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/typing.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/typing.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Typing; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./input */ "./node_modules/@ckeditor/ckeditor5-typing/src/input.js");
- /* harmony import */ var _delete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/typing
- */
- /**
- * The typing feature. It handles typing.
- *
- * This is a "glue" plugin which loads the {@link module:typing/input~Input} and {@link module:typing/delete~Delete}
- * plugins.
- *
- * @extends module:core/plugin~Plugin
- */
- class Typing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- static get requires() {
- return [ _input__WEBPACK_IMPORTED_MODULE_1__["default"], _delete__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Typing';
- }
- }
- /**
- * The configuration of the typing features. Used by the features from the `@ckeditor/ckeditor5-typing` package.
- *
- * Read more in {@link module:typing/typing~TypingConfig}.
- *
- * @member {module:typing/typing~TypingConfig} module:core/editor/editorconfig~EditorConfig#typing
- */
- /**
- * The configuration of the typing features. Used by the typing features in `@ckeditor/ckeditor5-typing` package.
- *
- * ClassicEditor
- * .create( editorElement, {
- * typing: ... // Typing feature options.
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- *
- * @interface TypingConfig
- */
- /**
- * The granularity of undo/redo for typing and deleting. The value `20` means (more or less) that a new undo step
- * is created every 20 characters are inserted or deleted.
- *
- * @member {Number} [module:typing/typing~TypingConfig#undoStep=20]
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ChangeBuffer; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/utils/changebuffer
- */
- /**
- * Change buffer allows to group atomic changes (like characters that have been typed) into
- * {@link module:engine/model/batch~Batch batches}.
- *
- * Batches represent single undo steps, hence changes added to one single batch are undone together.
- *
- * The buffer has a configurable limit of atomic changes that it can accommodate. After the limit was
- * exceeded (see {@link ~ChangeBuffer#input}), a new batch is created in {@link ~ChangeBuffer#batch}.
- *
- * To use the change buffer you need to let it know about the number of changes that were added to the batch:
- *
- * const buffer = new ChangeBuffer( model, LIMIT );
- *
- * // Later on in your feature:
- * buffer.batch.insert( pos, insertedCharacters );
- * buffer.input( insertedCharacters.length );
- *
- */
- class ChangeBuffer {
- /**
- * Creates a new instance of the change buffer.
- *
- * @param {module:engine/model/model~Model} model
- * @param {Number} [limit=20] The maximum number of atomic changes which can be contained in one batch.
- */
- constructor( model, limit = 20 ) {
- /**
- * The model instance.
- *
- * @readonly
- * @member {module:engine/model/model~Model} #model
- */
- this.model = model;
- /**
- * The number of atomic changes in the buffer. Once it exceeds the {@link #limit},
- * the {@link #batch batch} is set to a new one.
- *
- * @readonly
- * @member {Number} #size
- */
- this.size = 0;
- /**
- * The maximum number of atomic changes which can be contained in one batch.
- *
- * @readonly
- * @member {Number} #limit
- */
- this.limit = limit;
- /**
- * Whether the buffer is locked. A locked buffer cannot be reset unless it gets unlocked.
- *
- * @readonly
- * @member {Boolean} #isLocked
- */
- this.isLocked = false;
- // The function to be called in order to notify the buffer about batches which appeared in the document.
- // The callback will check whether it is a new batch and in that case the buffer will be flushed.
- //
- // The reason why the buffer needs to be flushed whenever a new batch appears is that the changes added afterwards
- // should be added to a new batch. For instance, when the user types, then inserts an image, and then types again,
- // the characters typed after inserting the image should be added to a different batch than the characters typed before.
- this._changeCallback = ( evt, batch ) => {
- if ( batch.type != 'transparent' && batch !== this._batch ) {
- this._reset( true );
- }
- };
- this._selectionChangeCallback = () => {
- this._reset();
- };
- this.model.document.on( 'change', this._changeCallback );
- this.model.document.selection.on( 'change:range', this._selectionChangeCallback );
- this.model.document.selection.on( 'change:attribute', this._selectionChangeCallback );
- /**
- * The current batch instance.
- *
- * @private
- * @member #_batch
- */
- /**
- * The callback to document the change event which later needs to be removed.
- *
- * @private
- * @member #_changeCallback
- */
- /**
- * The callback to document selection `change:attribute` and `change:range` events which resets the buffer.
- *
- * @private
- * @member #_selectionChangeCallback
- */
- }
- /**
- * The current batch to which a feature should add its operations. Once the {@link #size}
- * is reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.
- *
- * @type {module:engine/model/batch~Batch}
- */
- get batch() {
- if ( !this._batch ) {
- this._batch = this.model.createBatch();
- }
- return this._batch;
- }
- /**
- * The input number of changes into the buffer. Once the {@link #size} is
- * reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.
- *
- * @param {Number} changeCount The number of atomic changes to input.
- */
- input( changeCount ) {
- this.size += changeCount;
- if ( this.size >= this.limit ) {
- this._reset( true );
- }
- }
- /**
- * Locks the buffer.
- */
- lock() {
- this.isLocked = true;
- }
- /**
- * Unlocks the buffer.
- */
- unlock() {
- this.isLocked = false;
- }
- /**
- * Destroys the buffer.
- */
- destroy() {
- this.model.document.off( 'change', this._changeCallback );
- this.model.document.selection.off( 'change:range', this._selectionChangeCallback );
- this.model.document.selection.off( 'change:attribute', this._selectionChangeCallback );
- }
- /**
- * Resets the change buffer.
- *
- * @private
- * @param {Boolean} [ignoreLock] Whether internal lock {@link #isLocked} should be ignored.
- */
- _reset( ignoreLock ) {
- if ( !this.isLocked || ignoreLock ) {
- this._batch = null;
- this.size = 0;
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return findAttributeRange; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/utils/findattributerange
- */
- /**
- * Returns a model range that covers all consecutive nodes with the same `attributeName` and its `value`
- * that intersect the given `position`.
- *
- * It can be used e.g. to get the entire range on which the `linkHref` attribute needs to be changed when having a
- * selection inside a link.
- *
- * @param {module:engine/model/position~Position} position The start position.
- * @param {String} attributeName The attribute name.
- * @param {String} value The attribute value.
- * @param {module:engine/model/model~Model} model The model instance.
- * @returns {module:engine/model/range~Range} The link range.
- */
- function findAttributeRange( position, attributeName, value, model ) {
- return model.createRange(
- _findBound( position, attributeName, value, true, model ),
- _findBound( position, attributeName, value, false, model )
- );
- }
- // Walks forward or backward (depends on the `lookBack` flag), node by node, as long as they have the same attribute value
- // and returns a position just before or after (depends on the `lookBack` flag) the last matched node.
- //
- // @param {module:engine/model/position~Position} position The start position.
- // @param {String} attributeName The attribute name.
- // @param {String} value The attribute value.
- // @param {Boolean} lookBack Whether the walk direction is forward (`false`) or backward (`true`).
- // @returns {module:engine/model/position~Position} The position just before the last matched node.
- function _findBound( position, attributeName, value, lookBack, model ) {
- // Get node before or after position (depends on `lookBack` flag).
- // When position is inside text node then start searching from text node.
- let node = position.textNode || ( lookBack ? position.nodeBefore : position.nodeAfter );
- let lastNode = null;
- while ( node && node.getAttribute( attributeName ) == value ) {
- lastNode = node;
- node = lookBack ? node.previousSibling : node.nextSibling;
- }
- return lastNode ? model.createPositionAt( lastNode, lookBack ? 'before' : 'after' ) : position;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getLastTextLine; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/utils/getlasttextline
- */
- /**
- * Returns the last text line from the given range.
- *
- * "The last text line" is understood as text (from one or more text nodes) which is limited either by a parent block
- * or by inline elements (e.g. `<softBreak>`).
- *
- * const rangeToCheck = model.createRange(
- * model.createPositionAt( paragraph, 0 ),
- * model.createPositionAt( paragraph, 'end' )
- * );
- *
- * const { text, range } = getLastTextLine( rangeToCheck, model );
- *
- * For model below, the returned `text` will be "Foo bar baz" and `range` will be set on whole `<paragraph>` content:
- *
- * <paragraph>Foo bar baz<paragraph>
- *
- * However, in below case, `text` will be set to "baz" and `range` will be set only on "baz".
- *
- * <paragraph>Foo<softBreak></softBreak>bar<softBreak></softBreak>baz<paragraph>
- *
- * @protected
- * @param {module:engine/model/range~Range} range
- * @param {module:engine/model/model~Model} model
- * @returns {module:typing/utils/getlasttextline~LastTextLineData}
- */
- function getLastTextLine( range, model ) {
- let start = range.start;
- const text = Array.from( range.getItems() ).reduce( ( rangeText, node ) => {
- // Trim text to a last occurrence of an inline element and update range start.
- if ( !( node.is( '$text' ) || node.is( '$textProxy' ) ) ) {
- start = model.createPositionAfter( node );
- return '';
- }
- return rangeText + node.data;
- }, '' );
- return { text, range: model.createRange( start, range.end ) };
- }
- /**
- * The value returned by {@link module:typing/utils/getlasttextline~getLastTextLine}.
- *
- * @typedef {Object} module:typing/utils/getlasttextline~LastTextLineData
- *
- * @property {String} text The text from the text nodes in the last text line.
- * @property {module:engine/model/range~Range} range The range set on the text nodes in the last text line.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injecttypingmutationshandling.js":
- /*!********************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/injecttypingmutationshandling.js ***!
- \********************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTypingMutationsHandling; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/diff */ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_domconverter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/utils/injecttypingmutationshandling
- */
- /**
- * Handles mutations caused by normal typing.
- *
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- */
- function injectTypingMutationsHandling( editor ) {
- editor.editing.view.document.on( 'mutations', ( evt, mutations, viewSelection ) => {
- new MutationHandler( editor ).handle( mutations, viewSelection );
- } );
- }
- /**
- * Helper class for translating DOM mutations into model changes.
- *
- * @private
- */
- class MutationHandler {
- /**
- * Creates an instance of the mutation handler.
- *
- * @param {module:core/editor/editor~Editor} editor
- */
- constructor( editor ) {
- /**
- * Editor instance for which mutations are handled.
- *
- * @readonly
- * @member {module:core/editor/editor~Editor} #editor
- */
- this.editor = editor;
- /**
- * The editing controller.
- *
- * @readonly
- * @member {module:engine/controller/editingcontroller~EditingController} #editing
- */
- this.editing = this.editor.editing;
- }
- /**
- * Handles given mutations.
- *
- * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
- * module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
- * @param {module:engine/view/selection~Selection|null} viewSelection
- */
- handle( mutations, viewSelection ) {
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_2__["containerChildrenMutated"])( mutations ) ) {
- this._handleContainerChildrenMutations( mutations, viewSelection );
- } else {
- for ( const mutation of mutations ) {
- // Fortunately it will never be both.
- this._handleTextMutation( mutation, viewSelection );
- this._handleTextNodeInsertion( mutation );
- }
- }
- }
- /**
- * Handles situations when container's children mutated during input. This can happen when
- * the browser is trying to "fix" DOM in certain situations. For example, when the user starts to type
- * in `<p><a href=""><i>Link{}</i></a></p>`, the browser might change the order of elements
- * to `<p><i><a href="">Link</a>x{}</i></p>`. A similar situation happens when the spell checker
- * replaces a word wrapped with `<strong>` with a word wrapped with a `<b>` element.
- *
- * To handle such situations, the common DOM ancestor of all mutations is converted to the model representation
- * and then compared with the current model to calculate the proper text change.
- *
- * Note: Single text node insertion is handled in {@link #_handleTextNodeInsertion} and text node mutation is handled
- * in {@link #_handleTextMutation}).
- *
- * @private
- * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
- * module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
- * @param {module:engine/view/selection~Selection|null} viewSelection
- */
- _handleContainerChildrenMutations( mutations, viewSelection ) {
- // Get common ancestor of all mutations.
- const mutationsCommonAncestor = getMutationsContainer( mutations );
- // Quit if there is no common ancestor.
- if ( !mutationsCommonAncestor ) {
- return;
- }
- const domConverter = this.editor.editing.view.domConverter;
- // Get common ancestor in DOM.
- const domMutationCommonAncestor = domConverter.mapViewToDom( mutationsCommonAncestor );
- // Create fresh DomConverter so it will not use existing mapping and convert current DOM to model.
- // This wouldn't be needed if DomConverter would allow to create fresh view without checking any mappings.
- const freshDomConverter = new _ckeditor_ckeditor5_engine_src_view_domconverter__WEBPACK_IMPORTED_MODULE_1__["default"]( this.editor.editing.view.document );
- const modelFromCurrentDom = this.editor.data.toModel(
- freshDomConverter.domToView( domMutationCommonAncestor )
- ).getChild( 0 );
- // Current model.
- const currentModel = this.editor.editing.mapper.toModelElement( mutationsCommonAncestor );
- // If common ancestor is not mapped, do not do anything. It probably is a parent of another view element.
- // That means that we would need to diff model elements (see `if` below). Better return early instead of
- // trying to get a reasonable model ancestor. It will fell into the `if` below anyway.
- // This situation happens for example for lists. If `<ul>` is a common ancestor, `currentModel` is `undefined`
- // because `<ul>` is not mapped (`<li>`s are).
- // See https://github.com/ckeditor/ckeditor5/issues/718.
- if ( !currentModel ) {
- return;
- }
- // Get children from both ancestors.
- const modelFromDomChildren = Array.from( modelFromCurrentDom.getChildren() );
- const currentModelChildren = Array.from( currentModel.getChildren() );
- // Remove the last `<softBreak>` from the end of `modelFromDomChildren` if there is no `<softBreak>` in current model.
- // If the described scenario happened, it means that this is a bogus `<br />` added by a browser.
- const lastDomChild = modelFromDomChildren[ modelFromDomChildren.length - 1 ];
- const lastCurrentChild = currentModelChildren[ currentModelChildren.length - 1 ];
- const isLastDomChildSoftBreak = lastDomChild && lastDomChild.is( 'element', 'softBreak' );
- const isLastCurrentChildSoftBreak = lastCurrentChild && !lastCurrentChild.is( 'element', 'softBreak' );
- if ( isLastDomChildSoftBreak && isLastCurrentChildSoftBreak ) {
- modelFromDomChildren.pop();
- }
- const schema = this.editor.model.schema;
- // Skip situations when common ancestor has any container elements.
- if ( !isSafeForTextMutation( modelFromDomChildren, schema ) || !isSafeForTextMutation( currentModelChildren, schema ) ) {
- return;
- }
- // Replace inserted by the browser with normal space. See comment in `_handleTextMutation`.
- // Replace non-texts with any character. This is potentially dangerous but passes in manual tests. The thing is
- // that we need to take care of proper indexes so we cannot simply remove non-text elements from the content.
- // By inserting a character we keep all the real texts on their indexes.
- const newText = modelFromDomChildren.map( item => item.is( '$text' ) ? item.data : '@' ).join( '' ).replace( /\u00A0/g, ' ' );
- const oldText = currentModelChildren.map( item => item.is( '$text' ) ? item.data : '@' ).join( '' ).replace( /\u00A0/g, ' ' );
- // Do nothing if mutations created same text.
- if ( oldText === newText ) {
- return;
- }
- const diffResult = Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__["default"])( oldText, newText );
- const { firstChangeAt, insertions, deletions } = calculateChanges( diffResult );
- // Try setting new model selection according to passed view selection.
- let modelSelectionRange = null;
- if ( viewSelection ) {
- modelSelectionRange = this.editing.mapper.toModelRange( viewSelection.getFirstRange() );
- }
- const insertText = newText.substr( firstChangeAt, insertions );
- const removeRange = this.editor.model.createRange(
- this.editor.model.createPositionAt( currentModel, firstChangeAt ),
- this.editor.model.createPositionAt( currentModel, firstChangeAt + deletions )
- );
- this.editor.execute( 'input', {
- text: insertText,
- range: removeRange,
- resultRange: modelSelectionRange
- } );
- }
- /**
- * @private
- */
- _handleTextMutation( mutation, viewSelection ) {
- if ( mutation.type != 'text' ) {
- return;
- }
- // Replace inserted by the browser with normal space.
- // We want only normal spaces in the model and in the view. Renderer and DOM Converter will be then responsible
- // for rendering consecutive spaces using , but the model and the view has to be clear.
- // Other feature may introduce inserting non-breakable space on specific key stroke (for example shift + space).
- // However then it will be handled outside of mutations, like enter key is.
- // The replacing is here because it has to be done before `diff` and `diffToChanges` functions, as they
- // take `newText` and compare it to (cleaned up) view.
- // It could also be done in mutation observer too, however if any outside plugin would like to
- // introduce additional events for mutations, they would get already cleaned up version (this may be good or not).
- const newText = mutation.newText.replace( /\u00A0/g, ' ' );
- // To have correct `diffResult`, we also compare view node text data with replaced by space.
- const oldText = mutation.oldText.replace( /\u00A0/g, ' ' );
- // Do nothing if mutations created same text.
- if ( oldText === newText ) {
- return;
- }
- const diffResult = Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__["default"])( oldText, newText );
- const { firstChangeAt, insertions, deletions } = calculateChanges( diffResult );
- // Try setting new model selection according to passed view selection.
- let modelSelectionRange = null;
- if ( viewSelection ) {
- modelSelectionRange = this.editing.mapper.toModelRange( viewSelection.getFirstRange() );
- }
- // Get the position in view and model where the changes will happen.
- const viewPos = this.editing.view.createPositionAt( mutation.node, firstChangeAt );
- const modelPos = this.editing.mapper.toModelPosition( viewPos );
- const removeRange = this.editor.model.createRange( modelPos, modelPos.getShiftedBy( deletions ) );
- const insertText = newText.substr( firstChangeAt, insertions );
- this.editor.execute( 'input', {
- text: insertText,
- range: removeRange,
- resultRange: modelSelectionRange
- } );
- }
- /**
- * @private
- */
- _handleTextNodeInsertion( mutation ) {
- if ( mutation.type != 'children' ) {
- return;
- }
- const change = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getSingleTextNodeChange"])( mutation );
- const viewPos = this.editing.view.createPositionAt( mutation.node, change.index );
- const modelPos = this.editing.mapper.toModelPosition( viewPos );
- const insertedText = change.values[ 0 ].data;
- this.editor.execute( 'input', {
- // Replace inserted by the browser with normal space.
- // See comment in `_handleTextMutation`.
- // In this case we don't need to do this before `diff` because we diff whole nodes.
- // Just change in case there are some.
- text: insertedText.replace( /\u00A0/g, ' ' ),
- range: this.editor.model.createRange( modelPos )
- } );
- }
- }
- // Returns first common ancestor of all mutations that is either {@link module:engine/view/containerelement~ContainerElement}
- // or {@link module:engine/view/rootelement~RootElement}.
- //
- // @private
- // @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
- // module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
- // @returns {module:engine/view/containerelement~ContainerElement|engine/view/rootelement~RootElement|undefined}
- function getMutationsContainer( mutations ) {
- const lca = mutations
- .map( mutation => mutation.node )
- .reduce( ( commonAncestor, node ) => {
- return commonAncestor.getCommonAncestor( node, { includeSelf: true } );
- } );
- if ( !lca ) {
- return;
- }
- // We need to look for container and root elements only, so check all LCA's
- // ancestors (starting from itself).
- return lca.getAncestors( { includeSelf: true, parentFirst: true } )
- .find( element => element.is( 'containerElement' ) || element.is( 'rootElement' ) );
- }
- // Returns true if provided array contains content that won't be problematic during diffing and text mutation handling.
- //
- // @param {Array.<module:engine/model/node~Node>} children
- // @param {module:engine/model/schema~Schema} schema
- // @returns {Boolean}
- function isSafeForTextMutation( children, schema ) {
- return children.every( child => schema.isInline( child ) );
- }
- // Calculates first change index and number of characters that should be inserted and deleted starting from that index.
- //
- // @private
- // @param diffResult
- // @returns {{insertions: number, deletions: number, firstChangeAt: *}}
- function calculateChanges( diffResult ) {
- // Index where the first change happens. Used to set the position from which nodes will be removed and where will be inserted.
- let firstChangeAt = null;
- // Index where the last change happens. Used to properly count how many characters have to be removed and inserted.
- let lastChangeAt = null;
- // Get `firstChangeAt` and `lastChangeAt`.
- for ( let i = 0; i < diffResult.length; i++ ) {
- const change = diffResult[ i ];
- if ( change != 'equal' ) {
- firstChangeAt = firstChangeAt === null ? i : firstChangeAt;
- lastChangeAt = i;
- }
- }
- // How many characters, starting from `firstChangeAt`, should be removed.
- let deletions = 0;
- // How many characters, starting from `firstChangeAt`, should be inserted.
- let insertions = 0;
- for ( let i = firstChangeAt; i <= lastChangeAt; i++ ) {
- // If there is no change (equal) or delete, the character is existing in `oldText`. We count it for removing.
- if ( diffResult[ i ] != 'insert' ) {
- deletions++;
- }
- // If there is no change (equal) or insert, the character is existing in `newText`. We count it for inserting.
- if ( diffResult[ i ] != 'delete' ) {
- insertions++;
- }
- }
- return { insertions, deletions, firstChangeAt };
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js":
- /*!*********************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js ***!
- \*********************************************************************************************/
- /*! exports provided: default, isNonTypingKeystroke */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectUnsafeKeystrokesHandling; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonTypingKeystroke", function() { return isNonTypingKeystroke; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/utils/injectunsafekeystrokeshandling
- */
- /**
- * Handles keystrokes which are unsafe for typing. This handler's logic is explained
- * in https://github.com/ckeditor/ckeditor5-typing/issues/83#issuecomment-398690251.
- *
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- */
- function injectUnsafeKeystrokesHandling( editor ) {
- let latestCompositionSelection = null;
- const model = editor.model;
- const view = editor.editing.view;
- const inputCommand = editor.commands.get( 'input' );
- // For Android, we want to handle keystrokes on `beforeinput` to be sure that code in `DeleteObserver` already had a chance to be fired.
- if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_1__["default"].isAndroid ) {
- view.document.on( 'beforeinput', ( evt, evtData ) => handleUnsafeKeystroke( evtData ), { priority: 'lowest' } );
- } else {
- view.document.on( 'keydown', ( evt, evtData ) => handleUnsafeKeystroke( evtData ), { priority: 'lowest' } );
- }
- view.document.on( 'compositionstart', handleCompositionStart, { priority: 'lowest' } );
- view.document.on( 'compositionend', () => {
- latestCompositionSelection = model.createSelection( model.document.selection );
- }, { priority: 'lowest' } );
- // Handles the keydown event. We need to guess whether such keystroke is going to result
- // in typing. If so, then before character insertion happens, any selected content needs
- // to be deleted. Otherwise the default browser deletion mechanism would be
- // triggered, resulting in:
- //
- // * Hundreds of mutations which could not be handled.
- // * But most importantly, loss of control over how the content is being deleted.
- //
- // The method is used in a low-priority listener, hence allowing other listeners (e.g. delete or enter features)
- // to handle the event.
- //
- // @param {module:engine/view/observer/keyobserver~KeyEventData} evtData
- function handleUnsafeKeystroke( evtData ) {
- const doc = model.document;
- const isComposing = view.document.isComposing;
- const isSelectionUnchanged = latestCompositionSelection && latestCompositionSelection.isEqual( doc.selection );
- // Reset stored composition selection.
- latestCompositionSelection = null;
- // By relying on the state of the input command we allow disabling the entire input easily
- // by just disabling the input command. We could’ve used here the delete command but that
- // would mean requiring the delete feature which would block loading one without the other.
- // We could also check the editor.isReadOnly property, but that wouldn't allow to block
- // the input without blocking other features.
- if ( !inputCommand.isEnabled ) {
- return;
- }
- if ( isNonTypingKeystroke( evtData ) || doc.selection.isCollapsed ) {
- return;
- }
- // If during composition, deletion should be prevented as it may remove composed sequence (#83).
- if ( isComposing && evtData.keyCode === 229 ) {
- return;
- }
- // If there is a `keydown` event fired with '229' keycode it might be related
- // to recent composition. Check if selection is the same as upon ending recent composition,
- // if so do not remove selected content as it will remove composed sequence (#83).
- if ( !isComposing && evtData.keyCode === 229 && isSelectionUnchanged ) {
- return;
- }
- deleteSelectionContent();
- }
- // Handles the `compositionstart` event. It is used only in special cases to remove the contents
- // of a non-collapsed selection so composition itself does not result in complex mutations.
- //
- // The special case mentioned above is a situation in which the `keydown` event is fired after
- // `compositionstart` event. In such cases {@link #handleKeydown} cannot clear current selection
- // contents (because it is too late and will break the composition) so the composition handler takes care of it.
- function handleCompositionStart() {
- const doc = model.document;
- const isFlatSelection = doc.selection.rangeCount === 1 ? doc.selection.getFirstRange().isFlat : true;
- // If on `compositionstart` there is a non-collapsed selection which start and end have different parents
- // it means the `handleKeydown()` method did not remove its contents. It happens usually because
- // of different order of events (`compositionstart` before `keydown` - in Safari). In such cases
- // we need to remove selection contents on composition start (#83).
- if ( doc.selection.isCollapsed || isFlatSelection ) {
- return;
- }
- deleteSelectionContent();
- }
- function deleteSelectionContent() {
- const buffer = inputCommand.buffer;
- buffer.lock();
- const batch = buffer.batch;
- inputCommand._batches.add( batch );
- model.enqueueChange( batch, () => {
- model.deleteContent( model.document.selection );
- } );
- buffer.unlock();
- }
- }
- const safeKeycodes = [
- Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowUp' ),
- Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowRight' ),
- Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowDown' ),
- Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowLeft' ),
- 9, // Tab
- 16, // Shift
- 17, // Ctrl
- 18, // Alt
- 19, // Pause
- 20, // CapsLock
- 27, // Escape
- 33, // PageUp
- 34, // PageDown
- 35, // Home
- 36, // End,
- 45, // Insert,
- 91, // Windows,
- 93, // Menu key,
- 144, // NumLock
- 145, // ScrollLock,
- 173, // Mute/Unmute
- 174, // Volume up
- 175, // Volume down,
- 176, // Next song,
- 177, // Previous song,
- 178, // Stop,
- 179, // Play/Pause,
- 255 // Display brightness (increase and decrease)
- ];
- // Function keys.
- for ( let code = 112; code <= 135; code++ ) {
- safeKeycodes.push( code );
- }
- /**
- * Returns `true` if a keystroke will **not** result in "typing".
- *
- * For instance, keystrokes that result in typing are letters "a-zA-Z", numbers "0-9", delete, backspace, etc.
- *
- * Keystrokes that do not cause typing are, for instance, Fn keys (F5, F8, etc.), arrow keys (←, →, ↑, ↓),
- * Tab (↹), "Windows logo key" (⊞ Win), etc.
- *
- * Note: This implementation is very simple and will need to be refined with time.
- *
- * @param {module:engine/view/observer/keyobserver~KeyEventData} keyData
- * @returns {Boolean}
- */
- function isNonTypingKeystroke( keyData ) {
- // Keystrokes which contain Ctrl or Cmd don't represent typing.
- if ( keyData.ctrlKey || keyData.metaKey ) {
- return true;
- }
- return safeKeycodes.includes( keyData.keyCode );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return inlineHighlight; });
- /* harmony import */ var _findattributerange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./findattributerange */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/utils/inlinehighlight
- */
- /**
- * Adds a visual highlight style to an attribute element in which the selection is anchored.
- * Together with two-step caret movement, they indicate that the user is typing inside the element.
- *
- * Highlight is turned on by adding the given class to the attribute element in the view:
- *
- * * The class is removed before the conversion has started, as callbacks added with the `'highest'` priority
- * to {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} events.
- * * The class is added in the view post fixer, after other changes in the model tree were converted to the view.
- *
- * This way, adding and removing the highlight does not interfere with conversion.
- *
- * Usage:
- *
- * import inlineHighlight from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight';
- *
- * // Make `ck-link_selected` class be applied on an `a` element
- * // whenever the corresponding `linkHref` attribute element is selected.
- * inlineHighlight( editor, 'linkHref', 'a', 'ck-link_selected' );
- *
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- * @param {String} attributeName The attribute name to check.
- * @param {String} tagName The tagName of a view item.
- * @param {String} className The class name to apply in the view.
- */
- function inlineHighlight( editor, attributeName, tagName, className ) {
- const view = editor.editing.view;
- const highlightedElements = new Set();
- // Adding the class.
- view.document.registerPostFixer( writer => {
- const selection = editor.model.document.selection;
- let changed = false;
- if ( selection.hasAttribute( attributeName ) ) {
- const modelRange = Object(_findattributerange__WEBPACK_IMPORTED_MODULE_0__["default"])(
- selection.getFirstPosition(),
- attributeName,
- selection.getAttribute( attributeName ),
- editor.model
- );
- const viewRange = editor.editing.mapper.toViewRange( modelRange );
- // There might be multiple view elements in the `viewRange`, for example, when the `a` element is
- // broken by a UIElement.
- for ( const item of viewRange.getItems() ) {
- if ( item.is( 'element', tagName ) && !item.hasClass( className ) ) {
- writer.addClass( className, item );
- highlightedElements.add( item );
- changed = true;
- }
- }
- }
- return changed;
- } );
- // Removing the class.
- editor.conversion.for( 'editingDowncast' ).add( dispatcher => {
- // Make sure the highlight is removed on every possible event, before conversion is started.
- dispatcher.on( 'insert', removeHighlight, { priority: 'highest' } );
- dispatcher.on( 'remove', removeHighlight, { priority: 'highest' } );
- dispatcher.on( 'attribute', removeHighlight, { priority: 'highest' } );
- dispatcher.on( 'selection', removeHighlight, { priority: 'highest' } );
- function removeHighlight() {
- view.change( writer => {
- for ( const item of highlightedElements.values() ) {
- writer.removeClass( className, item );
- highlightedElements.delete( item );
- }
- } );
- }
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js ***!
- \********************************************************************/
- /*! exports provided: containerChildrenMutated, getSingleTextNodeChange, compareChildNodes */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containerChildrenMutated", function() { return containerChildrenMutated; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSingleTextNodeChange", function() { return getSingleTextNodeChange; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareChildNodes", function() { return compareChildNodes; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/diff */ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_difftochanges__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/difftochanges */ "./node_modules/@ckeditor/ckeditor5-utils/src/difftochanges.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module typing/utils/utils
- */
- /**
- * Returns true if container children have mutated or more than a single text node was changed.
- *
- * @private
- * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
- * module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
- * @returns {Boolean}
- */
- function containerChildrenMutated( mutations ) {
- if ( mutations.length == 0 ) {
- return false;
- }
- // Check if there is any mutation of `children` type or any mutation that changes more than one text node.
- for ( const mutation of mutations ) {
- if ( mutation.type === 'children' && !getSingleTextNodeChange( mutation ) ) {
- return true;
- }
- }
- return false;
- }
- /**
- * Returns change made to a single text node.
- *
- * @private
- * @param {module:engine/view/observer/mutationobserver~MutatedText|
- * module:engine/view/observer/mutationobserver~MutatedChildren} mutation
- * @returns {Object|undefined} Change object (see {@link module:utils/difftochanges~diffToChanges} output)
- * or undefined if more than a single text node was changed.
- */
- function getSingleTextNodeChange( mutation ) {
- // One new node.
- if ( mutation.newChildren.length - mutation.oldChildren.length != 1 ) {
- return;
- }
- // Which is text.
- const diffResult = Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__["default"])( mutation.oldChildren, mutation.newChildren, compareChildNodes );
- const changes = Object(_ckeditor_ckeditor5_utils_src_difftochanges__WEBPACK_IMPORTED_MODULE_1__["default"])( diffResult, mutation.newChildren );
- // In case of [ delete, insert, insert ] the previous check will not exit.
- if ( changes.length > 1 ) {
- return;
- }
- const change = changes[ 0 ];
- // Which is text.
- if ( !( !!change.values[ 0 ] && change.values[ 0 ].is( '$text' ) ) ) {
- return;
- }
- return change;
- }
- /**
- * Checks whether two view nodes are identical, which means they are the same object
- * or contain exactly same data (in case of text nodes).
- *
- * @private
- * @param {module:engine/view/node~Node} oldChild
- * @param {module:engine/view/node~Node} newChild
- * @returns {Boolean}
- */
- function compareChildNodes( oldChild, newChild ) {
- if ( !!oldChild && oldChild.is( '$text' ) && !!newChild && newChild.is( '$text' ) ) {
- return oldChild.data === newChild.data;
- } else {
- return oldChild === newChild;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return clickOutsideHandler; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/bindings/clickoutsidehandler
- */
- /* global document */
- /**
- * Handles clicking **outside** of a specified set of elements, then fires an action.
- *
- * **Note**: Actually, the action is executed upon `mousedown`, not `click`. It prevents
- * certain issues when the user keeps holding the mouse button and the UI cannot react
- * properly.
- *
- * @param {Object} options Configuration options.
- * @param {module:utils/dom/emittermixin~Emitter} options.emitter The emitter to which this behavior
- * should be added.
- * @param {Function} options.activator Function returning a `Boolean`, to determine whether the handler is active.
- * @param {Array.<HTMLElement>} options.contextElements HTML elements that determine the scope of the
- * handler. Clicking any of them or their descendants will **not** fire the callback.
- * @param {Function} options.callback An action executed by the handler.
- */
- function clickOutsideHandler( { emitter, activator, callback, contextElements } ) {
- emitter.listenTo( document, 'mousedown', ( evt, domEvt ) => {
- if ( !activator() ) {
- return;
- }
- // Check if `composedPath` is `undefined` in case the browser does not support native shadow DOM.
- // Can be removed when all supported browsers support native shadow DOM.
- const path = typeof domEvt.composedPath == 'function' ? domEvt.composedPath() : [];
- for ( const contextElement of contextElements ) {
- if ( contextElement.contains( domEvt.target ) || path.includes( contextElement ) ) {
- return;
- }
- }
- callback();
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler.js":
- /*!*****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler.js ***!
- \*****************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectCssTransitionDisabler; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/bindings/injectcsstransitiondisabler
- */
- /**
- * A decorator that brings the possibility to temporarily disable CSS transitions using
- * {@link module:ui/view~View} methods. It is helpful when, for instance, the transitions should not happen
- * when the view is first displayed but they should work normal in other cases.
- *
- * The methods to control the CSS transitions are:
- * * `disableCssTransitions()` – Adds the `.ck-transitions-disabled` class to the
- * {@link module:ui/view~View#element view element}.
- * * `enableCssTransitions()` – Removes the `.ck-transitions-disabled` class from the
- * {@link module:ui/view~View#element view element}.
- *
- * **Note**: This helper extends the {@link module:ui/view~View#template template} and must be used **after**
- * {@link module:ui/view~View#setTemplate} is called:
- *
- * import injectCssTransitionDisabler from '@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler';
- *
- * class MyView extends View {
- * constructor() {
- * super();
- *
- * // ...
- *
- * this.setTemplate( { ... } );
- *
- * // ...
- *
- * injectCssTransitionDisabler( this );
- *
- * // ...
- * }
- * }
- *
- * The usage comes down to:
- *
- * const view = new MyView();
- *
- * // ...
- *
- * view.disableCssTransitions();
- * view.show();
- * view.enableCssTransitions();
- *
- * @param {module:ui/view~View} view View instance that should get this functionality.
- */
- function injectCssTransitionDisabler( view ) {
- view.set( '_isCssTransitionsDisabled', false );
- view.disableCssTransitions = () => {
- view._isCssTransitionsDisabled = true;
- };
- view.enableCssTransitions = () => {
- view._isCssTransitionsDisabled = false;
- };
- view.extendTemplate( {
- attributes: {
- class: [
- view.bindTemplate.if( '_isCssTransitionsDisabled', 'ck-transitions-disabled' )
- ]
- }
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return preventDefault; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/bindings/preventdefault
- */
- /**
- * A helper which executes a native `Event.preventDefault()` if the target of an event equals the
- * {@link module:ui/view~View#element element of the view}. It shortens the definition of a
- * {@link module:ui/view~View#template template}.
- *
- * // In a class extending View.
- * import preventDefault from '@ckeditor/ckeditor5-ui/src/bindings/preventdefault';
- *
- * // ...
- *
- * this.setTemplate( {
- * tag: 'div',
- *
- * on: {
- * // Prevent the default mousedown action on this view.
- * mousedown: preventDefault( this )
- * }
- * } );
- *
- * @param {module:ui/view~View} view View instance that defines the template.
- * @returns {module:ui/template~TemplateToBinding}
- */
- function preventDefault( view ) {
- return view.bindTemplate.to( evt => {
- if ( evt.target === view.element ) {
- evt.preventDefault();
- }
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return submitHandler; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/bindings/submithandler
- */
- /**
- * A handler useful for {@link module:ui/view~View views} working as HTML forms. It intercepts a native DOM
- * `submit` event, prevents the default web browser behavior (navigation and page reload) and
- * fires the `submit` event on a view instead. Such a custom event can be then used by any
- * {@link module:utils/dom/emittermixin~Emitter emitter}, e.g. to serialize the form data.
- *
- * import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler';
- *
- * // ...
- *
- * class AnyFormView extends View {
- * constructor() {
- * super();
- *
- * // ...
- *
- * submitHandler( {
- * view: this
- * } );
- * }
- * }
- *
- * // ...
- *
- * const view = new AnyFormView();
- *
- * // A sample listener attached by an emitter working with the view.
- * this.listenTo( view, 'submit', () => {
- * saveTheFormData();
- * hideTheForm();
- * } );
- *
- * @param {Object} [options] Configuration options.
- * @param {module:ui/view~View} options.view The view which DOM `submit` events should be handled.
- */
- function submitHandler( { view } ) {
- view.listenTo( view.element, 'submit', ( evt, domEvt ) => {
- domEvt.preventDefault();
- view.fire( 'submit' );
- }, { useCapture: true } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ButtonView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _icon_iconview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
- /* harmony import */ var _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../tooltip/tooltipview */ "./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /* harmony import */ var _theme_components_button_button_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/components/button/button.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css");
- /* harmony import */ var _theme_components_button_button_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_components_button_button_css__WEBPACK_IMPORTED_MODULE_5__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/button/buttonview
- */
- /**
- * The button view class.
- *
- * const view = new ButtonView();
- *
- * view.set( {
- * label: 'A button',
- * keystroke: 'Ctrl+B',
- * tooltip: true,
- * withText: true
- * } );
- *
- * view.render();
- *
- * document.body.append( view.element );
- *
- * @extends module:ui/view~View
- * @implements module:ui/button/button~Button
- */
- class ButtonView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- const bind = this.bindTemplate;
- const ariaLabelUid = Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_3__["default"])();
- // Implement the Button interface.
- this.set( 'class' );
- this.set( 'labelStyle' );
- this.set( 'icon' );
- this.set( 'isEnabled', true );
- this.set( 'isOn', false );
- this.set( 'isVisible', true );
- this.set( 'isToggleable', false );
- this.set( 'keystroke' );
- this.set( 'label' );
- this.set( 'tabindex', -1 );
- this.set( 'tooltip' );
- this.set( 'tooltipPosition', 's' );
- this.set( 'type', 'button' );
- this.set( 'withText', false );
- this.set( 'withKeystroke', false );
- /**
- * Collection of the child views inside of the button {@link #element}.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.children = this.createCollection();
- /**
- * Tooltip of the button view. It is configurable using the {@link #tooltip tooltip attribute}.
- *
- * @readonly
- * @member {module:ui/tooltip/tooltipview~TooltipView} #tooltipView
- */
- this.tooltipView = this._createTooltipView();
- /**
- * Label of the button view. It is configurable using the {@link #label label attribute}.
- *
- * @readonly
- * @member {module:ui/view~View} #labelView
- */
- this.labelView = this._createLabelView( ariaLabelUid );
- /**
- * The icon view of the button. Will be added to {@link #children} when the
- * {@link #icon icon attribute} is defined.
- *
- * @readonly
- * @member {module:ui/icon/iconview~IconView} #iconView
- */
- this.iconView = new _icon_iconview__WEBPACK_IMPORTED_MODULE_1__["default"]();
- this.iconView.extendTemplate( {
- attributes: {
- class: 'ck-button__icon'
- }
- } );
- /**
- * A view displaying the keystroke of the button next to the {@link #labelView label}.
- * Added to {@link #children} when the {@link #withKeystroke `withKeystroke` attribute}
- * is defined.
- *
- * @readonly
- * @member {module:ui/view/view~View} #keystrokeView
- */
- this.keystrokeView = this._createKeystrokeView();
- /**
- * Tooltip of the button bound to the template.
- *
- * @see #tooltip
- * @see #_getTooltipString
- * @private
- * @observable
- * @member {Boolean} #_tooltipString
- */
- this.bind( '_tooltipString' ).to(
- this, 'tooltip',
- this, 'label',
- this, 'keystroke',
- this._getTooltipString.bind( this )
- );
- this.setTemplate( {
- tag: 'button',
- attributes: {
- class: [
- 'ck',
- 'ck-button',
- bind.to( 'class' ),
- bind.if( 'isEnabled', 'ck-disabled', value => !value ),
- bind.if( 'isVisible', 'ck-hidden', value => !value ),
- bind.to( 'isOn', value => value ? 'ck-on' : 'ck-off' ),
- bind.if( 'withText', 'ck-button_with-text' ),
- bind.if( 'withKeystroke', 'ck-button_with-keystroke' )
- ],
- type: bind.to( 'type', value => value ? value : 'button' ),
- tabindex: bind.to( 'tabindex' ),
- 'aria-labelledby': `ck-editor__aria-label_${ ariaLabelUid }`,
- 'aria-disabled': bind.if( 'isEnabled', true, value => !value ),
- 'aria-pressed': bind.to( 'isOn', value => this.isToggleable ? String( value ) : false )
- },
- children: this.children,
- on: {
- mousedown: bind.to( evt => {
- evt.preventDefault();
- } ),
- click: bind.to( evt => {
- // We can't make the button disabled using the disabled attribute, because it won't be focusable.
- // Though, shouldn't this condition be moved to the button controller?
- if ( this.isEnabled ) {
- this.fire( 'execute' );
- } else {
- // Prevent the default when button is disabled, to block e.g.
- // automatic form submitting. See ckeditor/ckeditor5-link#74.
- evt.preventDefault();
- }
- } )
- }
- } );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- if ( this.icon ) {
- this.iconView.bind( 'content' ).to( this, 'icon' );
- this.children.add( this.iconView );
- }
- this.children.add( this.tooltipView );
- this.children.add( this.labelView );
- if ( this.withKeystroke ) {
- this.children.add( this.keystrokeView );
- }
- }
- /**
- * Focuses the {@link #element} of the button.
- */
- focus() {
- this.element.focus();
- }
- /**
- * Creates a {@link module:ui/tooltip/tooltipview~TooltipView} instance and binds it with button
- * attributes.
- *
- * @private
- * @returns {module:ui/tooltip/tooltipview~TooltipView}
- */
- _createTooltipView() {
- const tooltipView = new _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_2__["default"]();
- tooltipView.bind( 'text' ).to( this, '_tooltipString' );
- tooltipView.bind( 'position' ).to( this, 'tooltipPosition' );
- return tooltipView;
- }
- /**
- * Creates a label view instance and binds it with button attributes.
- *
- * @private
- * @param {String} ariaLabelUid The aria label UID.
- * @returns {module:ui/view~View}
- */
- _createLabelView( ariaLabelUid ) {
- const labelView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]();
- const bind = this.bindTemplate;
- labelView.setTemplate( {
- tag: 'span',
- attributes: {
- class: [
- 'ck',
- 'ck-button__label'
- ],
- style: bind.to( 'labelStyle' ),
- id: `ck-editor__aria-label_${ ariaLabelUid }`
- },
- children: [
- {
- text: this.bindTemplate.to( 'label' )
- }
- ]
- } );
- return labelView;
- }
- /**
- * Creates a view that displays a keystroke next to a {@link #labelView label }
- * and binds it with button attributes.
- *
- * @private
- * @returns {module:ui/view~View}
- */
- _createKeystrokeView() {
- const keystrokeView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]();
- keystrokeView.setTemplate( {
- tag: 'span',
- attributes: {
- class: [
- 'ck',
- 'ck-button__keystroke'
- ]
- },
- children: [
- {
- text: this.bindTemplate.to( 'keystroke', text => Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["getEnvKeystrokeText"])( text ) )
- }
- ]
- } );
- return keystrokeView;
- }
- /**
- * Gets the text for the {@link #tooltipView} from the combination of
- * {@link #tooltip}, {@link #label} and {@link #keystroke} attributes.
- *
- * @private
- * @see #tooltip
- * @see #_tooltipString
- * @param {Boolean|String|Function} tooltip Button tooltip.
- * @param {String} label Button label.
- * @param {String} keystroke Button keystroke.
- * @returns {String}
- */
- _getTooltipString( tooltip, label, keystroke ) {
- if ( tooltip ) {
- if ( typeof tooltip == 'string' ) {
- return tooltip;
- } else {
- if ( keystroke ) {
- keystroke = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["getEnvKeystrokeText"])( keystroke );
- }
- if ( tooltip instanceof Function ) {
- return tooltip( label, keystroke );
- } else {
- return `${ label }${ keystroke ? ` (${ keystroke })` : '' }`;
- }
- }
- }
- return '';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SwitchButtonView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
- /* harmony import */ var _theme_components_button_switchbutton_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/button/switchbutton.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css");
- /* harmony import */ var _theme_components_button_switchbutton_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_components_button_switchbutton_css__WEBPACK_IMPORTED_MODULE_2__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/button/switchbuttonview
- */
- /**
- * The switch button view class.
- *
- * const view = new SwitchButtonView();
- *
- * view.set( {
- * withText: true,
- * label: 'Switch me!'
- * } );
- *
- * view.render();
- *
- * document.body.append( view.element );
- *
- * @extends module:ui/button/buttonview~ButtonView
- */
- class SwitchButtonView extends _buttonview__WEBPACK_IMPORTED_MODULE_1__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- this.isToggleable = true;
- /**
- * The toggle switch of the button.
- *
- * @readonly
- * @member {module:ui/view~View} #toggleSwitchView
- */
- this.toggleSwitchView = this._createToggleView();
- this.extendTemplate( {
- attributes: {
- class: 'ck-switchbutton'
- }
- } );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- this.children.add( this.toggleSwitchView );
- }
- /**
- * Creates a toggle child view.
- *
- * @private
- * @returns {module:ui/view~View}
- */
- _createToggleView() {
- const toggleSwitchView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]();
- toggleSwitchView.setTemplate( {
- tag: 'span',
- attributes: {
- class: [
- 'ck',
- 'ck-button__toggle'
- ]
- },
- children: [
- {
- tag: 'span',
- attributes: {
- class: [
- 'ck',
- 'ck-button__toggle__inner'
- ]
- }
- }
- ]
- } );
- return toggleSwitchView;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorGridView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _colortileview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colortileview */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
- /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
- /* harmony import */ var _theme_components_colorgrid_colorgrid_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/components/colorgrid/colorgrid.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css");
- /* harmony import */ var _theme_components_colorgrid_colorgrid_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_components_colorgrid_colorgrid_css__WEBPACK_IMPORTED_MODULE_5__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/colorgrid/colorgrid
- */
- /**
- * A grid of {@link module:ui/colorgrid/colortile~ColorTileView color tiles}.
- *
- * @extends module:ui/view~View
- */
- class ColorGridView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an instance of a color grid containing {@link module:ui/colorgrid/colortile~ColorTileView tiles}.
- *
- * @param {module:utils/locale~Locale} [locale] The localization services instance.
- * @param {Object} options Component configuration
- * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} [options.colorDefinitions] Array with definitions
- * required to create the {@link module:ui/colorgrid/colortile~ColorTileView tiles}.
- * @param {Number} options.columns A number of columns to display the tiles.
- */
- constructor( locale, options ) {
- super( locale );
- const colorDefinitions = options && options.colorDefinitions || [];
- const viewStyleAttribute = {};
- if ( options && options.columns ) {
- viewStyleAttribute.gridTemplateColumns = `repeat( ${ options.columns }, 1fr)`;
- }
- /**
- * The color of the currently selected color tile in {@link #items}.
- *
- * @observable
- * @type {String}
- */
- this.set( 'selectedColor' );
- /**
- * Collection of the child tile views.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.items = this.createCollection();
- /**
- * Tracks information about DOM focus in the grid.
- *
- * @readonly
- * @member {module:utils/focustracker~FocusTracker}
- */
- this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_2__["default"]();
- /**
- * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
- *
- * @readonly
- * @member {module:utils/keystrokehandler~KeystrokeHandler}
- */
- this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_4__["default"]();
- /**
- * Helps cycling over focusable {@link #items} in the grid.
- *
- * @readonly
- * @protected
- * @member {module:ui/focuscycler~FocusCycler}
- */
- this._focusCycler = new _focuscycler__WEBPACK_IMPORTED_MODULE_3__["default"]( {
- focusables: this.items,
- focusTracker: this.focusTracker,
- keystrokeHandler: this.keystrokes,
- actions: {
- // Navigate grid items backwards using the arrowup key.
- focusPrevious: 'arrowleft',
- // Navigate grid items forwards using the arrowdown key.
- focusNext: 'arrowright'
- }
- } );
- this.items.on( 'add', ( evt, colorTile ) => {
- colorTile.isOn = colorTile.color === this.selectedColor;
- } );
- colorDefinitions.forEach( color => {
- const colorTile = new _colortileview__WEBPACK_IMPORTED_MODULE_1__["default"]();
- colorTile.set( {
- color: color.color,
- label: color.label,
- tooltip: true,
- hasBorder: color.options.hasBorder
- } );
- colorTile.on( 'execute', () => {
- this.fire( 'execute', {
- value: color.color,
- hasBorder: color.options.hasBorder,
- label: color.label
- } );
- } );
- this.items.add( colorTile );
- } );
- this.setTemplate( {
- tag: 'div',
- children: this.items,
- attributes: {
- class: [
- 'ck',
- 'ck-color-grid'
- ],
- style: viewStyleAttribute
- }
- } );
- this.on( 'change:selectedColor', ( evt, name, selectedColor ) => {
- for ( const item of this.items ) {
- item.isOn = item.color === selectedColor;
- }
- } );
- }
- /**
- * Focuses the first focusable in {@link #items}.
- */
- focus() {
- if ( this.items.length ) {
- this.items.first.focus();
- }
- }
- /**
- * Focuses the last focusable in {@link #items}.
- */
- focusLast() {
- if ( this.items.length ) {
- this.items.last.focus();
- }
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- // Items added before rendering should be known to the #focusTracker.
- for ( const item of this.items ) {
- this.focusTracker.add( item.element );
- }
- this.items.on( 'add', ( evt, item ) => {
- this.focusTracker.add( item.element );
- } );
- this.items.on( 'remove', ( evt, item ) => {
- this.focusTracker.remove( item.element );
- } );
- // Start listening for the keystrokes coming from #element.
- this.keystrokes.listenTo( this.element );
- }
- /**
- * Fired when the `ColorTileView` for the picked item is executed.
- *
- * @event execute
- * @param {Object} data Additional information about the event.
- * @param {String} data.value The value of the selected color
- * ({@link module:ui/colorgrid/colorgrid~ColorDefinition#color `color.color`}).
- * @param {Boolean} data.hasBorder The `hasBorder` property of the selected color
- * ({@link module:ui/colorgrid/colorgrid~ColorDefinition#options `color.options.hasBorder`}).
- * @param {String} data.Label The label of the selected color
- * ({@link module:ui/colorgrid/colorgrid~ColorDefinition#label `color.label`})
- */
- }
- /**
- * A color definition used to create a {@link module:ui/colorgrid/colortile~ColorTileView}.
- *
- * {
- * color: 'hsl(0, 0%, 75%)',
- * label: 'Light Grey',
- * options: {
- * hasBorder: true
- * }
- * }
- *
- * @typedef {Object} module:ui/colorgrid/colorgrid~ColorDefinition
- * @type Object
- *
- * @property {String} color String representing a color.
- * It is used as value of background-color style in {@link module:ui/colorgrid/colortile~ColorTileView}.
- * @property {String} label String used as label for {@link module:ui/colorgrid/colortile~ColorTileView}.
- * @property {Object} options Additional options passed to create a {@link module:ui/colorgrid/colortile~ColorTileView}.
- * @property {Boolean} options.hasBorder A flag that indicates if special a CSS class should be added
- * to {@link module:ui/colorgrid/colortile~ColorTileView}, which renders a border around it.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorTileView; });
- /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
- /* harmony import */ var _theme_icons_color_tile_check_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/icons/color-tile-check.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/colorgrid/colortile
- */
- /**
- * This class represents a single color tile in the {@link module:ui/colorgrid/colorgrid~ColorGridView}.
- *
- * @extends module:ui/button/buttonview~ButtonView
- */
- class ColorTileView extends _button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"] {
- constructor( locale ) {
- super( locale );
- const bind = this.bindTemplate;
- /**
- * String representing a color shown as tile's background.
- *
- * @type {String}
- */
- this.set( 'color' );
- /**
- * A flag that toggles a special CSS class responsible for displaying
- * a border around the button.
- *
- * @type {Boolean}
- */
- this.set( 'hasBorder' );
- this.icon = _theme_icons_color_tile_check_svg__WEBPACK_IMPORTED_MODULE_1__["default"];
- this.extendTemplate( {
- attributes: {
- style: {
- backgroundColor: bind.to( 'color' )
- },
- class: [
- 'ck',
- 'ck-color-grid__tile',
- bind.if( 'hasBorder', 'ck-color-table__color-tile_bordered' )
- ]
- }
- } );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- this.iconView.fillColor = 'hsl(0, 0%, 100%)';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js ***!
- \********************************************************************/
- /*! exports provided: getLocalizedColorOptions, normalizeColorOptions, normalizeSingleColorDefinition */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedColorOptions", function() { return getLocalizedColorOptions; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeColorOptions", function() { return normalizeColorOptions; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSingleColorDefinition", function() { return normalizeSingleColorDefinition; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/colorgrid/utils
- */
- /**
- * Returns color configuration options as defined in `editor.config.(fontColor|fontBackgroundColor).colors` or
- * `editor.config.table.(tableProperties|tableCellProperties).(background|border).colors
- * but processed to account for editor localization in the correct language.
- *
- * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
- * when the user configuration is defined because the editor does not exist yet.
- *
- * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
- * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} options
- * @returns {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>}.
- */
- function getLocalizedColorOptions( locale, options ) {
- const t = locale.t;
- const localizedColorNames = {
- Black: t( 'Black' ),
- 'Dim grey': t( 'Dim grey' ),
- Grey: t( 'Grey' ),
- 'Light grey': t( 'Light grey' ),
- White: t( 'White' ),
- Red: t( 'Red' ),
- Orange: t( 'Orange' ),
- Yellow: t( 'Yellow' ),
- 'Light green': t( 'Light green' ),
- Green: t( 'Green' ),
- Aquamarine: t( 'Aquamarine' ),
- Turquoise: t( 'Turquoise' ),
- 'Light blue': t( 'Light blue' ),
- Blue: t( 'Blue' ),
- Purple: t( 'Purple' )
- };
- return options.map( colorOption => {
- const label = localizedColorNames[ colorOption.label ];
- if ( label && label != colorOption.label ) {
- colorOption.label = label;
- }
- return colorOption;
- } );
- }
- /**
- * Creates a unified color definition object from color configuration options.
- * The object contains the information necessary to both render the UI and initialize the conversion.
- *
- * @param {module:ui/colorgrid/colorgrid~ColorDefinition} options
- * @returns {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>}
- */
- function normalizeColorOptions( options ) {
- return options
- .map( normalizeSingleColorDefinition )
- .filter( option => !!option );
- }
- // Creates a normalized color definition from the user-defined configuration.
- // The "normalization" means it will create full
- // {@link module:ui/colorgrid/colorgrid~ColorDefinition `ColorDefinition-like`}
- // object for string values, and add a `view` property, for each definition.
- //
- // @param {String|module:ui/colorgrid/colorgrid~ColorDefinition}
- // @returns {module:ui/colorgrid/colorgrid~ColorDefinition}
- function normalizeSingleColorDefinition( color ) {
- if ( typeof color === 'string' ) {
- return {
- model: color,
- label: color,
- hasBorder: false,
- view: {
- name: 'span',
- styles: {
- color
- }
- }
- };
- } else {
- return {
- model: color.color,
- label: color.label || color.color,
- hasBorder: color.hasBorder === undefined ? false : color.hasBorder,
- view: {
- name: 'span',
- styles: {
- color: `${ color.color }`
- }
- }
- };
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ComponentFactory; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/componentfactory
- */
- /**
- * A helper class implementing the UI component ({@link module:ui/view~View view}) factory.
- *
- * It allows functions producing specific UI components to be registered under their unique names
- * in the factory. A registered component can be then instantiated by providing its name.
- * Note that names are case insensitive.
- *
- * // The editor provides localization tools for the factory.
- * const factory = new ComponentFactory( editor );
- *
- * factory.add( 'foo', locale => new FooView( locale ) );
- * factory.add( 'bar', locale => new BarView( locale ) );
- *
- * // An instance of FooView.
- * const fooInstance = factory.create( 'foo' );
- *
- * // Names are case insensitive so this is also allowed:
- * const barInstance = factory.create( 'Bar' );
- *
- * The {@link module:core/editor/editor~Editor#locale editor locale} is passed to the factory
- * function when {@link module:ui/componentfactory~ComponentFactory#create} is called.
- */
- class ComponentFactory {
- /**
- * Creates an instance of the factory.
- *
- * @constructor
- * @param {module:core/editor/editor~Editor} editor The editor instance.
- */
- constructor( editor ) {
- /**
- * The editor instance that the factory belongs to.
- *
- * @readonly
- * @member {module:core/editor/editor~Editor}
- */
- this.editor = editor;
- /**
- * Registered component factories.
- *
- * @private
- * @member {Map}
- */
- this._components = new Map();
- }
- /**
- * Returns an iterator of registered component names. Names are returned in lower case.
- *
- * @returns {Iterable.<String>}
- */
- * names() {
- for ( const value of this._components.values() ) {
- yield value.originalName;
- }
- }
- /**
- * Registers a component factory function that will be used by the
- * {@link #create create} method and called with the
- * {@link module:core/editor/editor~Editor#locale editor locale} as an argument,
- * allowing localization of the {@link module:ui/view~View view}.
- *
- * @param {String} name The name of the component.
- * @param {Function} callback The callback that returns the component.
- */
- add( name, callback ) {
- this._components.set( getNormalized( name ), { callback, originalName: name } );
- }
- /**
- * Creates an instance of a component registered in the factory under a specific name.
- *
- * When called, the {@link module:core/editor/editor~Editor#locale editor locale} is passed to
- * the previously {@link #add added} factory function, allowing localization of the
- * {@link module:ui/view~View view}.
- *
- * @param {String} name The name of the component.
- * @returns {module:ui/view~View} The instantiated component view.
- */
- create( name ) {
- if ( !this.has( name ) ) {
- /**
- * The required component is not registered in the component factory. Please make sure
- * the provided name is correct and the component has been correctly
- * {@link #add added} to the factory.
- *
- * @error componentfactory-item-missing
- * @param {String} name The name of the missing component.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'componentfactory-item-missing',
- this,
- { name }
- );
- }
- return this._components.get( getNormalized( name ) ).callback( this.editor.locale );
- }
- /**
- * Checks if a component of a given name is registered in the factory.
- *
- * @param {String} name The name of the component.
- * @returns {Boolean}
- */
- has( name ) {
- return this._components.has( getNormalized( name ) );
- }
- }
- //
- // Ensures that the component name used as the key in the internal map is in lower case.
- //
- // @private
- // @param {String} name
- // @returns {String}
- function getNormalized( name ) {
- return String( name ).toLowerCase();
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js ***!
- \***************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DropdownButtonView; });
- /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
- /* harmony import */ var _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../theme/icons/dropdown-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg");
- /* harmony import */ var _icon_iconview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/dropdown/button/dropdownbuttonview
- */
- /**
- * The default dropdown button view class.
- *
- * const view = new DropdownButtonView();
- *
- * view.set( {
- * label: 'A button',
- * keystroke: 'Ctrl+B',
- * tooltip: true
- * } );
- *
- * view.render();
- *
- * document.body.append( view.element );
- *
- * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.
- *
- * @implements module:ui/dropdown/button/dropdownbutton~DropdownButton
- * @extends module:ui/button/buttonview~ButtonView
- */
- class DropdownButtonView extends _button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- /**
- * An icon that displays arrow to indicate a dropdown button.
- *
- * @readonly
- * @member {module:ui/icon/iconview~IconView}
- */
- this.arrowView = this._createArrowView();
- this.extendTemplate( {
- attributes: {
- 'aria-haspopup': true
- }
- } );
- // The DropdownButton interface expects the open event upon which will open the dropdown.
- this.delegate( 'execute' ).to( this, 'open' );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- this.children.add( this.arrowView );
- }
- /**
- * Creates a {@link module:ui/icon/iconview~IconView} instance as {@link #arrowView}.
- *
- * @private
- * @returns {module:ui/icon/iconview~IconView}
- */
- _createArrowView() {
- const arrowView = new _icon_iconview__WEBPACK_IMPORTED_MODULE_2__["default"]();
- arrowView.content = _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_1__["default"];
- arrowView.extendTemplate( {
- attributes: {
- class: 'ck-dropdown__arrow'
- }
- } );
- return arrowView;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SplitButtonView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
- /* harmony import */ var _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../theme/icons/dropdown-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg");
- /* harmony import */ var _theme_components_dropdown_splitbutton_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../theme/components/dropdown/splitbutton.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css");
- /* harmony import */ var _theme_components_dropdown_splitbutton_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_components_dropdown_splitbutton_css__WEBPACK_IMPORTED_MODULE_5__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/dropdown/button/splitbuttonview
- */
- /**
- * The split button view class.
- *
- * const view = new SplitButtonView();
- *
- * view.set( {
- * label: 'A button',
- * keystroke: 'Ctrl+B',
- * tooltip: true
- * } );
- *
- * view.render();
- *
- * document.body.append( view.element );
- *
- * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.
- *
- * @implements module:ui/dropdown/button/dropdownbutton~DropdownButton
- * @extends module:ui/view~View
- */
- class SplitButtonView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- const bind = this.bindTemplate;
- // Implement the Button interface.
- this.set( 'icon' );
- this.set( 'isEnabled', true );
- this.set( 'isOn', false );
- this.set( 'isToggleable', false );
- this.set( 'isVisible', true );
- this.set( 'keystroke' );
- this.set( 'label' );
- this.set( 'tabindex', -1 );
- this.set( 'tooltip' );
- this.set( 'tooltipPosition', 's' );
- this.set( 'type', 'button' );
- this.set( 'withText', false );
- /**
- * Collection of the child views inside of the split button {@link #element}.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.children = this.createCollection();
- /**
- * A main button of split button.
- *
- * @readonly
- * @member {module:ui/button/buttonview~ButtonView}
- */
- this.actionView = this._createActionView();
- /**
- * A secondary button of split button that opens dropdown.
- *
- * @readonly
- * @member {module:ui/button/buttonview~ButtonView}
- */
- this.arrowView = this._createArrowView();
- /**
- * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}. It manages
- * keystrokes of the split button:
- *
- * * <kbd>▶</kbd> moves focus to arrow view when action view is focused,
- * * <kbd>◀</kbd> moves focus to action view when arrow view is focused.
- *
- * @readonly
- * @member {module:utils/keystrokehandler~KeystrokeHandler}
- */
- this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_2__["default"]();
- /**
- * Tracks information about DOM focus in the dropdown.
- *
- * @readonly
- * @member {module:utils/focustracker~FocusTracker}
- */
- this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_3__["default"]();
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-splitbutton',
- bind.if( 'isVisible', 'ck-hidden', value => !value ),
- this.arrowView.bindTemplate.if( 'isOn', 'ck-splitbutton_open' )
- ]
- },
- children: this.children
- } );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- this.children.add( this.actionView );
- this.children.add( this.arrowView );
- this.focusTracker.add( this.actionView.element );
- this.focusTracker.add( this.arrowView.element );
- this.keystrokes.listenTo( this.element );
- // Overrides toolbar focus cycling behavior.
- this.keystrokes.set( 'arrowright', ( evt, cancel ) => {
- if ( this.focusTracker.focusedElement === this.actionView.element ) {
- this.arrowView.focus();
- cancel();
- }
- } );
- // Overrides toolbar focus cycling behavior.
- this.keystrokes.set( 'arrowleft', ( evt, cancel ) => {
- if ( this.focusTracker.focusedElement === this.arrowView.element ) {
- this.actionView.focus();
- cancel();
- }
- } );
- }
- /**
- * Focuses the {@link #actionView#element} of the action part of split button.
- */
- focus() {
- this.actionView.focus();
- }
- /**
- * Creates a {@link module:ui/button/buttonview~ButtonView} instance as {@link #actionView} and binds it with main split button
- * attributes.
- *
- * @private
- * @returns {module:ui/button/buttonview~ButtonView}
- */
- _createActionView() {
- const actionView = new _button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]();
- actionView.bind(
- 'icon',
- 'isEnabled',
- 'isOn',
- 'isToggleable',
- 'keystroke',
- 'label',
- 'tabindex',
- 'tooltip',
- 'tooltipPosition',
- 'type',
- 'withText'
- ).to( this );
- actionView.extendTemplate( {
- attributes: {
- class: 'ck-splitbutton__action'
- }
- } );
- actionView.delegate( 'execute' ).to( this );
- return actionView;
- }
- /**
- * Creates a {@link module:ui/button/buttonview~ButtonView} instance as {@link #arrowView} and binds it with main split button
- * attributes.
- *
- * @private
- * @returns {module:ui/button/buttonview~ButtonView}
- */
- _createArrowView() {
- const arrowView = new _button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]();
- const bind = arrowView.bindTemplate;
- arrowView.icon = _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_4__["default"];
- arrowView.extendTemplate( {
- attributes: {
- class: 'ck-splitbutton__arrow',
- 'aria-haspopup': true,
- 'aria-expanded': bind.to( 'isOn', value => String( value ) )
- }
- } );
- arrowView.bind( 'isEnabled' ).to( this );
- arrowView.delegate( 'execute' ).to( this, 'open' );
- return arrowView;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DropdownPanelView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/dropdown/dropdownpanelview
- */
- /**
- * The dropdown panel view class.
- *
- * See {@link module:ui/dropdown/dropdownview~DropdownView} to learn about the common usage.
- *
- * @extends module:ui/view~View
- */
- class DropdownPanelView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- const bind = this.bindTemplate;
- /**
- * Controls whether the panel is visible.
- *
- * @observable
- * @member {Boolean} #isVisible
- */
- this.set( 'isVisible', false );
- /**
- * The position of the panel, relative to the parent.
- *
- * This property is reflected in the CSS class set to {@link #element} that controls
- * the position of the panel.
- *
- * @observable
- * @default 'se'
- * @member {'s'|'se'|'sw'|'sme'|'smw'|'n'|'ne'|'nw'|'nme'|'nmw'} #position
- */
- this.set( 'position', 'se' );
- /**
- * Collection of the child views in this panel.
- *
- * A common child type is the {@link module:ui/list/listview~ListView} and {@link module:ui/toolbar/toolbarview~ToolbarView}.
- * See {@link module:ui/dropdown/utils~addListToDropdown} and
- * {@link module:ui/dropdown/utils~addToolbarToDropdown} to learn more about child views of dropdowns.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.children = this.createCollection();
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-reset',
- 'ck-dropdown__panel',
- bind.to( 'position', value => `ck-dropdown__panel_${ value }` ),
- bind.if( 'isVisible', 'ck-dropdown__panel-visible' )
- ]
- },
- children: this.children,
- on: {
- // Drag and drop in the panel should not break the selection in the editor.
- // https://github.com/ckeditor/ckeditor5-ui/issues/228
- selectstart: bind.to( evt => evt.preventDefault() )
- }
- } );
- }
- /**
- * Focuses the view element or first item in view collection on opening dropdown's panel.
- *
- * See also {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable}.
- */
- focus() {
- if ( this.children.length ) {
- this.children.first.focus();
- }
- }
- /**
- * Focuses the view element or last item in view collection on opening dropdown's panel.
- *
- * See also {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable}.
- */
- focusLast() {
- if ( this.children.length ) {
- const lastChild = this.children.last;
- if ( typeof lastChild.focusLast === 'function' ) {
- lastChild.focusLast();
- } else {
- lastChild.focus();
- }
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DropdownView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
- /* harmony import */ var _theme_components_dropdown_dropdown_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/dropdown/dropdown.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css");
- /* harmony import */ var _theme_components_dropdown_dropdown_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_components_dropdown_dropdown_css__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/position */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/dropdown/dropdownview
- */
- /**
- * The dropdown view class. It manages the dropdown button and dropdown panel.
- *
- * In most cases, the easiest way to create a dropdown is by using the {@link module:ui/dropdown/utils~createDropdown}
- * util:
- *
- * const dropdown = createDropdown( locale );
- *
- * // Configure dropdown's button properties:
- * dropdown.buttonView.set( {
- * label: 'A dropdown',
- * withText: true
- * } );
- *
- * dropdown.render();
- *
- * dropdown.panelView.element.textContent = 'Content of the panel';
- *
- * // Will render a dropdown with a panel containing a "Content of the panel" text.
- * document.body.appendChild( dropdown.element );
- *
- * If you want to add a richer content to the dropdown panel, you can use the {@link module:ui/dropdown/utils~addListToDropdown}
- * and {@link module:ui/dropdown/utils~addToolbarToDropdown} helpers. See more examples in
- * {@link module:ui/dropdown/utils~createDropdown} documentation.
- *
- * If you want to create a completely custom dropdown, then you can compose it manually:
- *
- * const button = new DropdownButtonView( locale );
- * const panel = new DropdownPanelView( locale );
- * const dropdown = new DropdownView( locale, button, panel );
- *
- * button.set( {
- * label: 'A dropdown',
- * withText: true
- * } );
- *
- * dropdown.render();
- *
- * panel.element.textContent = 'Content of the panel';
- *
- * // Will render a dropdown with a panel containing a "Content of the panel" text.
- * document.body.appendChild( dropdown.element );
- *
- * However, dropdown created this way will contain little behavior. You will need to implement handlers for actions
- * such as {@link module:ui/bindings/clickoutsidehandler~clickOutsideHandler clicking outside an open dropdown}
- * (which should close it) and support for arrow keys inside the panel. Therefore, unless you really know what
- * you do and you really need to do it, it is recommended to use the {@link module:ui/dropdown/utils~createDropdown} helper.
- *
- * @extends module:ui/view~View
- */
- class DropdownView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an instance of the dropdown.
- *
- * Also see {@link #render}.
- *
- * @param {module:utils/locale~Locale} [locale] The localization services instance.
- * @param {module:ui/dropdown/button/dropdownbutton~DropdownButton} buttonView
- * @param {module:ui/dropdown/dropdownpanelview~DropdownPanelView} panelView
- */
- constructor( locale, buttonView, panelView ) {
- super( locale );
- const bind = this.bindTemplate;
- /**
- * Button of the dropdown view. Clicking the button opens the {@link #panelView}.
- *
- * @readonly
- * @member {module:ui/button/buttonview~ButtonView} #buttonView
- */
- this.buttonView = buttonView;
- /**
- * Panel of the dropdown. It opens when the {@link #buttonView} is
- * {@link module:ui/button/buttonview~ButtonView#event:execute executed} (i.e. clicked).
- *
- * Child views can be added to the panel's `children` collection:
- *
- * dropdown.panelView.children.add( childView );
- *
- * See {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView#children} and
- * {@link module:ui/viewcollection~ViewCollection#add}.
- *
- * @readonly
- * @member {module:ui/dropdown/dropdownpanelview~DropdownPanelView} #panelView
- */
- this.panelView = panelView;
- /**
- * Controls whether the dropdown view is open, i.e. shows or hides the {@link #panelView panel}.
- *
- * @observable
- * @member {Boolean} #isOpen
- */
- this.set( 'isOpen', false );
- /**
- * Controls whether the dropdown is enabled, i.e. it can be clicked and execute an action.
- *
- * See {@link module:ui/button/buttonview~ButtonView#isEnabled}.
- *
- * @observable
- * @member {Boolean} #isEnabled
- */
- this.set( 'isEnabled', true );
- /**
- * (Optional) The additional CSS class set on the dropdown {@link #element}.
- *
- * @observable
- * @member {String} #class
- */
- this.set( 'class' );
- /**
- * (Optional) The `id` attribute of the dropdown (i.e. to pair with a `<label>` element).
- *
- * @observable
- * @member {String} #id
- */
- this.set( 'id' );
- /**
- * The position of the panel, relative to the dropdown.
- *
- * **Note**: When `'auto'`, the panel will use one of the remaining positions to stay
- * in the viewport, visible to the user. The positions correspond directly to
- * {@link module:ui/dropdown/dropdownview~DropdownView.defaultPanelPositions default panel positions}.
- *
- * **Note**: This value has an impact on the
- * {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView#position} property
- * each time the panel becomes {@link #isOpen open}.
- *
- * @observable
- * @default 'auto'
- * @member {'auto'|'s'|'se'|'sw'|'sme'|'smw'|'n'|'ne'|'nw'|'nme'|'nmw'} #panelPosition
- */
- this.set( 'panelPosition', 'auto' );
- /**
- * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}. It manages
- * keystrokes of the dropdown:
- *
- * * <kbd>▼</kbd> opens the dropdown,
- * * <kbd>◀</kbd> and <kbd>Esc</kbd> closes the dropdown.
- *
- * @readonly
- * @member {module:utils/keystrokehandler~KeystrokeHandler}
- */
- this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_1__["default"]();
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-dropdown',
- bind.to( 'class' ),
- bind.if( 'isEnabled', 'ck-disabled', value => !value )
- ],
- id: bind.to( 'id' ),
- 'aria-describedby': bind.to( 'ariaDescribedById' )
- },
- children: [
- buttonView,
- panelView
- ]
- } );
- buttonView.extendTemplate( {
- attributes: {
- class: [
- 'ck-dropdown__button'
- ]
- }
- } );
- /**
- * A child {@link module:ui/list/listview~ListView list view} of the dropdown located
- * in its {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
- *
- * **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addListToDropdown}.
- *
- * @readonly
- * @member {module:ui/list/listview~ListView} #listView
- */
- /**
- * A child toolbar of the dropdown located in the
- * {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
- *
- * **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addToolbarToDropdown}.
- *
- * @readonly
- * @member {module:ui/toolbar/toolbarview~ToolbarView} #toolbarView
- */
- /**
- * Fired when the toolbar button or list item is executed.
- *
- * For {@link #listView} It fires when a child of some {@link module:ui/list/listitemview~ListItemView}
- * fired `execute`.
- *
- * For {@link #toolbarView} It fires when one of the buttons has been
- * {@link module:ui/button/buttonview~ButtonView#event:execute executed}.
- *
- * **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addListToDropdown}
- * or {@link module:ui/dropdown/utils~addToolbarToDropdown}.
- *
- * @event execute
- */
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- // Toggle the dropdown when its button has been clicked.
- this.listenTo( this.buttonView, 'open', () => {
- this.isOpen = !this.isOpen;
- } );
- // Toggle the visibility of the panel when the dropdown becomes open.
- this.panelView.bind( 'isVisible' ).to( this, 'isOpen' );
- // Let the dropdown control the position of the panel. The position must
- // be updated every time the dropdown is open.
- this.on( 'change:isOpen', () => {
- if ( !this.isOpen ) {
- return;
- }
- // If "auto", find the best position of the panel to fit into the viewport.
- // Otherwise, simply assign the static position.
- if ( this.panelPosition === 'auto' ) {
- this.panelView.position = DropdownView._getOptimalPosition( {
- element: this.panelView.element,
- target: this.buttonView.element,
- fitInViewport: true,
- positions: this._panelPositions
- } ).name;
- } else {
- this.panelView.position = this.panelPosition;
- }
- } );
- // Listen for keystrokes coming from within #element.
- this.keystrokes.listenTo( this.element );
- const closeDropdown = ( data, cancel ) => {
- if ( this.isOpen ) {
- this.buttonView.focus();
- this.isOpen = false;
- cancel();
- }
- };
- // Open the dropdown panel using the arrow down key, just like with return or space.
- this.keystrokes.set( 'arrowdown', ( data, cancel ) => {
- // Don't open if the dropdown is disabled or already open.
- if ( this.buttonView.isEnabled && !this.isOpen ) {
- this.isOpen = true;
- cancel();
- }
- } );
- // Block the right arrow key (until nested dropdowns are implemented).
- this.keystrokes.set( 'arrowright', ( data, cancel ) => {
- if ( this.isOpen ) {
- cancel();
- }
- } );
- // Close the dropdown using the arrow left/escape key.
- this.keystrokes.set( 'arrowleft', closeDropdown );
- this.keystrokes.set( 'esc', closeDropdown );
- }
- /**
- * Focuses the {@link #buttonView}.
- */
- focus() {
- this.buttonView.focus();
- }
- /**
- * Returns {@link #panelView panel} positions to be used by the
- * {@link module:utils/dom/position~getOptimalPosition `getOptimalPosition()`}
- * utility considering the direction of the language the UI of the editor is displayed in.
- *
- * @type {module:utils/dom/position~Options#positions}
- * @private
- */
- get _panelPositions() {
- const {
- south, north,
- southEast, southWest,
- northEast, northWest,
- southMiddleEast, southMiddleWest,
- northMiddleEast, northMiddleWest
- } = DropdownView.defaultPanelPositions;
- if ( this.locale.uiLanguageDirection !== 'rtl' ) {
- return [
- southEast, southWest, southMiddleEast, southMiddleWest, south,
- northEast, northWest, northMiddleEast, northMiddleWest, north
- ];
- } else {
- return [
- southWest, southEast, southMiddleWest, southMiddleEast, south,
- northWest, northEast, northMiddleWest, northMiddleEast, north
- ];
- }
- }
- }
- /**
- * A set of positioning functions used by the dropdown view to determine
- * the optimal position (i.e. fitting into the browser viewport) of its
- * {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel} when
- * {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition} is set to 'auto'`.
- *
- * The available positioning functions are as follow:
- *
- * **South**
- *
- * * `south`
- *
- * [ Button ]
- * +-----------------+
- * | Panel |
- * +-----------------+
- *
- * * `southEast`
- *
- * [ Button ]
- * +-----------------+
- * | Panel |
- * +-----------------+
- *
- * * `southWest`
- *
- * [ Button ]
- * +-----------------+
- * | Panel |
- * +-----------------+
- *
- * * `southMiddleEast`
- *
- * [ Button ]
- * +-----------------+
- * | Panel |
- * +-----------------+
- *
- * * `southMiddleWest`
- *
- * [ Button ]
- * +-----------------+
- * | Panel |
- * +-----------------+
- *
- * **North**
- *
- * * `north`
- *
- * +-----------------+
- * | Panel |
- * +-----------------+
- * [ Button ]
- *
- * * `northEast`
- *
- * +-----------------+
- * | Panel |
- * +-----------------+
- * [ Button ]
- *
- * * `northWest`
- *
- * +-----------------+
- * | Panel |
- * +-----------------+
- * [ Button ]
- *
- * * `northMiddleEast`
- *
- * +-----------------+
- * | Panel |
- * +-----------------+
- * [ Button ]
- *
- * * `northMiddleWest`
- *
- * +-----------------+
- * | Panel |
- * +-----------------+
- * [ Button ]
- *
- * Positioning functions are compatible with {@link module:utils/dom/position~Position}.
- *
- * The name that position function returns will be reflected in dropdown panel's class that
- * controls its placement. See {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition}
- * to learn more.
- *
- * @member {Object} module:ui/dropdown/dropdownview~DropdownView.defaultPanelPositions
- */
- DropdownView.defaultPanelPositions = {
- south: ( buttonRect, panelRect ) => {
- return {
- top: buttonRect.bottom,
- left: buttonRect.left - ( panelRect.width - buttonRect.width ) / 2,
- name: 's'
- };
- },
- southEast: buttonRect => {
- return {
- top: buttonRect.bottom,
- left: buttonRect.left,
- name: 'se'
- };
- },
- southWest: ( buttonRect, panelRect ) => {
- return {
- top: buttonRect.bottom,
- left: buttonRect.left - panelRect.width + buttonRect.width,
- name: 'sw'
- };
- },
- southMiddleEast: ( buttonRect, panelRect ) => {
- return {
- top: buttonRect.bottom,
- left: buttonRect.left - ( panelRect.width - buttonRect.width ) / 4,
- name: 'sme'
- };
- },
- southMiddleWest: ( buttonRect, panelRect ) => {
- return {
- top: buttonRect.bottom,
- left: buttonRect.left - ( panelRect.width - buttonRect.width ) * 3 / 4,
- name: 'smw'
- };
- },
- north: ( buttonRect, panelRect ) => {
- return {
- top: buttonRect.top - panelRect.height,
- left: buttonRect.left - ( panelRect.width - buttonRect.width ) / 2,
- name: 'n'
- };
- },
- northEast: ( buttonRect, panelRect ) => {
- return {
- top: buttonRect.top - panelRect.height,
- left: buttonRect.left,
- name: 'ne'
- };
- },
- northWest: ( buttonRect, panelRect ) => {
- return {
- top: buttonRect.top - panelRect.height,
- left: buttonRect.left - panelRect.width + buttonRect.width,
- name: 'nw'
- };
- },
- northMiddleEast: ( buttonRect, panelRect ) => {
- return {
- top: buttonRect.top - panelRect.height,
- left: buttonRect.left - ( panelRect.width - buttonRect.width ) / 4,
- name: 'nme'
- };
- },
- northMiddleWest: ( buttonRect, panelRect ) => {
- return {
- top: buttonRect.top - panelRect.height,
- left: buttonRect.left - ( panelRect.width - buttonRect.width ) * 3 / 4,
- name: 'nmw'
- };
- }
- };
- /**
- * A function used to calculate the optimal position for the dropdown panel.
- *
- * @protected
- * @member {Function} module:ui/dropdown/dropdownview~DropdownView._getOptimalPosition
- */
- DropdownView._getOptimalPosition = _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_3__["getOptimalPosition"];
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js ***!
- \*******************************************************************/
- /*! exports provided: createDropdown, addToolbarToDropdown, addListToDropdown */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDropdown", function() { return createDropdown; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addToolbarToDropdown", function() { return addToolbarToDropdown; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addListToDropdown", function() { return addListToDropdown; });
- /* harmony import */ var _dropdownpanelview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dropdownpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js");
- /* harmony import */ var _dropdownview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dropdownview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js");
- /* harmony import */ var _button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./button/dropdownbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js");
- /* harmony import */ var _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../toolbar/toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
- /* harmony import */ var _list_listview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../list/listview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js");
- /* harmony import */ var _list_listitemview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../list/listitemview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js");
- /* harmony import */ var _list_listseparatorview__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../list/listseparatorview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js");
- /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
- /* harmony import */ var _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../button/switchbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js");
- /* harmony import */ var _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../bindings/clickoutsidehandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js");
- /* harmony import */ var _theme_components_dropdown_toolbardropdown_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../theme/components/dropdown/toolbardropdown.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css");
- /* harmony import */ var _theme_components_dropdown_toolbardropdown_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_theme_components_dropdown_toolbardropdown_css__WEBPACK_IMPORTED_MODULE_10__);
- /* harmony import */ var _theme_components_dropdown_listdropdown_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../theme/components/dropdown/listdropdown.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css");
- /* harmony import */ var _theme_components_dropdown_listdropdown_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_theme_components_dropdown_listdropdown_css__WEBPACK_IMPORTED_MODULE_11__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/dropdown/utils
- */
- /**
- * A helper for creating dropdowns. It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown},
- * with a {@link module:ui/dropdown/button/dropdownbutton~DropdownButton button},
- * {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView panel} and all standard dropdown's behaviors.
- *
- * # Creating dropdowns
- *
- * By default, the default {@link module:ui/dropdown/button/dropdownbuttonview~DropdownButtonView} class is used as
- * definition of the button:
- *
- * const dropdown = createDropdown( model );
- *
- * // Configure dropdown's button properties:
- * dropdown.buttonView.set( {
- * label: 'A dropdown',
- * withText: true
- * } );
- *
- * dropdown.render();
- *
- * // Will render a dropdown labeled "A dropdown" with an empty panel.
- * document.body.appendChild( dropdown.element );
- *
- * You can also provide other button views (they need to implement the
- * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface). For instance, you can use
- * {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} to create a dropdown with a split button.
- *
- * const dropdown = createDropdown( model, SplitButtonView );
- *
- * // Configure dropdown's button properties:
- * dropdown.buttonView.set( {
- * label: 'A dropdown',
- * withText: true
- * } );
- *
- * dropdown.buttonView.on( 'execute', () => {
- * // Add the behavior of the "action part" of the split button.
- * // Split button consists of the "action part" and "arrow part".
- * // The arrow opens the dropdown while the action part can have some other behavior.
- * } );
- *
- * dropdown.render();
- *
- * // Will render a dropdown labeled "A dropdown" with an empty panel.
- * document.body.appendChild( dropdown.element );
- *
- * # Adding content to the dropdown's panel
- *
- * The content of the panel can be inserted directly into the `dropdown.panelView.element`:
- *
- * dropdown.panelView.element.textContent = 'Content of the panel';
- *
- * However, most of the time you will want to add there either a {@link module:ui/list/listview~ListView list of options}
- * or a list of buttons (i.e. a {@link module:ui/toolbar/toolbarview~ToolbarView toolbar}).
- * To simplify the task, you can use, respectively, {@link module:ui/dropdown/utils~addListToDropdown} or
- * {@link module:ui/dropdown/utils~addToolbarToDropdown} utils.
- *
- * @param {module:utils/locale~Locale} locale The locale instance.
- * @param {Function} ButtonClass The dropdown button view class. Needs to implement the
- * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface.
- * @returns {module:ui/dropdown/dropdownview~DropdownView} The dropdown view instance.
- */
- function createDropdown( locale, ButtonClass = _button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
- const buttonView = new ButtonClass( locale );
- const panelView = new _dropdownpanelview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
- const dropdownView = new _dropdownview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale, buttonView, panelView );
- buttonView.bind( 'isEnabled' ).to( dropdownView );
- if ( buttonView instanceof _button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
- buttonView.bind( 'isOn' ).to( dropdownView, 'isOpen' );
- } else {
- buttonView.arrowView.bind( 'isOn' ).to( dropdownView, 'isOpen' );
- }
- addDefaultBehavior( dropdownView );
- return dropdownView;
- }
- /**
- * Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.
- *
- * const buttons = [];
- *
- * // Either create a new ButtonView instance or create existing.
- * buttons.push( new ButtonView() );
- * buttons.push( editor.ui.componentFactory.create( 'someButton' ) );
- *
- * const dropdown = createDropdown( locale );
- *
- * addToolbarToDropdown( dropdown, buttons );
- *
- * dropdown.toolbarView.isVertical = true;
- *
- * // Will render a vertical button dropdown labeled "A button dropdown"
- * // with a button group in the panel containing two buttons.
- * dropdown.render()
- * document.body.appendChild( dropdown.element );
- *
- * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:ui/toolbar/toolbarview~ToolbarView}.
- *
- * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView A dropdown instance to which `ToolbarView` will be added.
- * @param {Iterable.<module:ui/button/buttonview~ButtonView>} buttons
- */
- function addToolbarToDropdown( dropdownView, buttons ) {
- const locale = dropdownView.locale;
- const t = locale.t;
- const toolbarView = dropdownView.toolbarView = new _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_3__["default"]( locale );
- toolbarView.set( 'ariaLabel', t( 'Dropdown toolbar' ) );
- dropdownView.extendTemplate( {
- attributes: {
- class: [ 'ck-toolbar-dropdown' ]
- }
- } );
- buttons.map( view => toolbarView.items.add( view ) );
- dropdownView.panelView.children.add( toolbarView );
- toolbarView.items.delegate( 'execute' ).to( dropdownView );
- }
- /**
- * Adds an instance of {@link module:ui/list/listview~ListView} to a dropdown.
- *
- * const items = new Collection();
- *
- * items.add( {
- * type: 'button',
- * model: new Model( {
- * withText: true,
- * label: 'First item',
- * labelStyle: 'color: red'
- * } )
- * } );
- *
- * items.add( {
- * type: 'button',
- * model: new Model( {
- * withText: true,
- * label: 'Second item',
- * labelStyle: 'color: green',
- * class: 'foo'
- * } )
- * } );
- *
- * const dropdown = createDropdown( locale );
- *
- * addListToDropdown( dropdown, items );
- *
- * // Will render a dropdown with a list in the panel containing two items.
- * dropdown.render()
- * document.body.appendChild( dropdown.element );
- *
- * The `items` collection passed to this methods controls the presence and attributes of respective
- * {@link module:ui/list/listitemview~ListItemView list items}.
- *
- *
- * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:list/list~List}.
- *
- * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView A dropdown instance to which `ListVIew` will be added.
- * @param {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} items
- * A collection of the list item definitions to populate the list.
- */
- function addListToDropdown( dropdownView, items ) {
- const locale = dropdownView.locale;
- const listView = dropdownView.listView = new _list_listview__WEBPACK_IMPORTED_MODULE_4__["default"]( locale );
- listView.items.bindTo( items ).using( ( { type, model } ) => {
- if ( type === 'separator' ) {
- return new _list_listseparatorview__WEBPACK_IMPORTED_MODULE_6__["default"]( locale );
- } else if ( type === 'button' || type === 'switchbutton' ) {
- const listItemView = new _list_listitemview__WEBPACK_IMPORTED_MODULE_5__["default"]( locale );
- let buttonView;
- if ( type === 'button' ) {
- buttonView = new _button_buttonview__WEBPACK_IMPORTED_MODULE_7__["default"]( locale );
- } else {
- buttonView = new _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_8__["default"]( locale );
- }
- // Bind all model properties to the button view.
- buttonView.bind( ...Object.keys( model ) ).to( model );
- buttonView.delegate( 'execute' ).to( listItemView );
- listItemView.children.add( buttonView );
- return listItemView;
- }
- } );
- dropdownView.panelView.children.add( listView );
- listView.items.delegate( 'execute' ).to( dropdownView );
- }
- // Add a set of default behaviors to dropdown view.
- //
- // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
- function addDefaultBehavior( dropdownView ) {
- closeDropdownOnBlur( dropdownView );
- closeDropdownOnExecute( dropdownView );
- focusDropdownContentsOnArrows( dropdownView );
- }
- // Adds a behavior to a dropdownView that closes opened dropdown when user clicks outside the dropdown.
- //
- // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
- function closeDropdownOnBlur( dropdownView ) {
- dropdownView.on( 'render', () => {
- Object(_bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_9__["default"])( {
- emitter: dropdownView,
- activator: () => dropdownView.isOpen,
- callback: () => {
- dropdownView.isOpen = false;
- },
- contextElements: [ dropdownView.element ]
- } );
- } );
- }
- // Adds a behavior to a dropdownView that closes the dropdown view on "execute" event.
- //
- // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
- function closeDropdownOnExecute( dropdownView ) {
- // Close the dropdown when one of the list items has been executed.
- dropdownView.on( 'execute', evt => {
- // Toggling a switch button view should not close the dropdown.
- if ( evt.source instanceof _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_8__["default"] ) {
- return;
- }
- dropdownView.isOpen = false;
- } );
- }
- // Adds a behavior to a dropdownView that focuses the dropdown's panel view contents on keystrokes.
- //
- // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
- function focusDropdownContentsOnArrows( dropdownView ) {
- // If the dropdown panel is already open, the arrow down key should focus the first child of the #panelView.
- dropdownView.keystrokes.set( 'arrowdown', ( data, cancel ) => {
- if ( dropdownView.isOpen ) {
- dropdownView.panelView.focus();
- cancel();
- }
- } );
- // If the dropdown panel is already open, the arrow up key should focus the last child of the #panelView.
- dropdownView.keystrokes.set( 'arrowup', ( data, cancel ) => {
- if ( dropdownView.isOpen ) {
- dropdownView.panelView.focusLast();
- cancel();
- }
- } );
- }
- /**
- * A definition of the list item used by the {@link module:ui/dropdown/utils~addListToDropdown}
- * utility.
- *
- * @typedef {Object} module:ui/dropdown/utils~ListDropdownItemDefinition
- *
- * @property {String} type Either `'separator'`, `'button'` or `'switchbutton'`.
- * @property {module:ui/model~Model} [model] Model of the item (when **not** `'separator'`).
- * Its properties fuel the newly created list item (or its children, depending on the `type`).
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditableUIView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/editableui/editableuiview
- */
- /**
- * The editable UI view class.
- *
- * @extends module:ui/view~View
- */
- class EditableUIView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an instance of EditableUIView class.
- *
- * @param {module:utils/locale~Locale} [locale] The locale instance.
- * @param {module:engine/view/view~View} editingView The editing view instance the editable is related to.
- * @param {HTMLElement} [editableElement] The editable element. If not specified, this view
- * should create it. Otherwise, the existing element should be used.
- */
- constructor( locale, editingView, editableElement ) {
- super( locale );
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-content',
- 'ck-editor__editable',
- 'ck-rounded-corners'
- ],
- lang: locale.contentLanguage,
- dir: locale.contentLanguageDirection
- }
- } );
- /**
- * The name of the editable UI view.
- *
- * @member {String} #name
- */
- this.name = null;
- /**
- * Controls whether the editable is focused, i.e. the user is typing in it.
- *
- * @observable
- * @member {Boolean} #isFocused
- */
- this.set( 'isFocused', false );
- /**
- * The element which is the main editable element (usually the one with `contentEditable="true"`).
- *
- * @private
- * @type {HTMLElement}
- */
- this._editableElement = editableElement;
- /**
- * Whether an external {@link #_editableElement} was passed into the constructor, which also means
- * the view will not render its {@link #template}.
- *
- * @private
- * @type {Boolean}
- */
- this._hasExternalElement = !!this._editableElement;
- /**
- * The editing view instance the editable is related to. Editable uses the editing
- * view to dynamically modify its certain DOM attributes after {@link #render rendering}.
- *
- * **Note**: The DOM attributes are performed by the editing view and not UI
- * {@link module:ui/view~View#bindTemplate template bindings} because once rendered,
- * the editable DOM element must remain under the full control of the engine to work properly.
- *
- * @protected
- * @type {module:engine/view/view~View}
- */
- this._editingView = editingView;
- }
- /**
- * Renders the view by either applying the {@link #template} to the existing
- * {@link #_editableElement} or assigning {@link #element} as {@link #_editableElement}.
- */
- render() {
- super.render();
- if ( this._hasExternalElement ) {
- this.template.apply( this.element = this._editableElement );
- } else {
- this._editableElement = this.element;
- }
- this.on( 'change:isFocused', () => this._updateIsFocusedClasses() );
- this._updateIsFocusedClasses();
- }
- /**
- * @inheritDoc
- */
- destroy() {
- if ( this._hasExternalElement ) {
- this.template.revert( this._editableElement );
- }
- super.destroy();
- }
- /**
- * Updates the `ck-focused` and `ck-blurred` CSS classes on the {@link #element} according to
- * the {@link #isFocused} property value using the {@link #_editingView editing view} API.
- *
- * @private
- */
- _updateIsFocusedClasses() {
- const editingView = this._editingView;
- if ( editingView.isRenderingInProgress ) {
- updateAfterRender( this );
- } else {
- update( this );
- }
- function update( view ) {
- editingView.change( writer => {
- const viewRoot = editingView.document.getRoot( view.name );
- writer.addClass( view.isFocused ? 'ck-focused' : 'ck-blurred', viewRoot );
- writer.removeClass( view.isFocused ? 'ck-blurred' : 'ck-focused', viewRoot );
- } );
- }
- // In a case of a multi-root editor, a callback will be attached more than once (one callback for each root).
- // While executing one callback the `isRenderingInProgress` observable is changing what causes executing another
- // callback and render is called inside the already pending render.
- // We need to be sure that callback is executed only when the value has changed from `true` to `false`.
- // See https://github.com/ckeditor/ckeditor5/issues/1676.
- function updateAfterRender( view ) {
- editingView.once( 'change:isRenderingInProgress', ( evt, name, value ) => {
- if ( !value ) {
- update( view );
- } else {
- updateAfterRender( view );
- }
- } );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js":
- /*!*******************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js ***!
- \*******************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InlineEditableUIView; });
- /* harmony import */ var _editableui_editableuiview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editableui/editableuiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/editableui/inline/inlineeditableuiview
- */
- /**
- * The inline editable UI class implementing an inline {@link module:ui/editableui/editableuiview~EditableUIView}.
- *
- * @extends module:ui/editableui/editableuiview~EditableUIView
- */
- class InlineEditableUIView extends _editableui_editableuiview__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an instance of the InlineEditableUIView class.
- *
- * @param {module:utils/locale~Locale} [locale] The locale instance.
- * @param {module:engine/view/view~View} editingView The editing view instance the editable is related to.
- * @param {HTMLElement} [editableElement] The editable element. If not specified, the
- * {@link module:ui/editableui/editableuiview~EditableUIView}
- * will create it. Otherwise, the existing element will be used.
- */
- constructor( locale, editingView, editableElement ) {
- super( locale, editingView, editableElement );
- this.extendTemplate( {
- attributes: {
- role: 'textbox',
- class: 'ck-editor__editable_inline'
- }
- } );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- const editingView = this._editingView;
- const t = this.t;
- editingView.change( writer => {
- const viewRoot = editingView.document.getRoot( this.name );
- writer.setAttribute( 'aria-label', t( 'Rich Text Editor, %0', this.name ), viewRoot );
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BodyCollection; });
- /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
- /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_createelement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/createelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/editorui/bodycollection
- */
- /* globals document */
- /**
- * This is a special {@link module:ui/viewcollection~ViewCollection} dedicated to elements that are detached
- * from the DOM structure of the editor, like panels, icons, etc.
- *
- * The body collection is available in the {@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`} property.
- * Any plugin can add a {@link module:ui/view~View view} to this collection.
- * These views will render in a container placed directly in the `<body>` element.
- * The editor will detach and destroy this collection when the editor will be {@link module:core/editor/editor~Editor#destroy destroyed}.
- *
- * If you need to control the life cycle of the body collection on your own, you can create your own instance of this class.
- *
- * A body collection will render itself automatically in the DOM body element as soon as you call {@link ~BodyCollection#attachToDom}.
- * If you create multiple body collections, this class will create a special wrapper element in the DOM to limit the number of
- * elements created directly in the body and remove it when the last body collection will be
- * {@link ~BodyCollection#detachFromDom detached}.
- *
- * @extends module:ui/viewcollection~ViewCollection
- */
- class BodyCollection extends _viewcollection__WEBPACK_IMPORTED_MODULE_1__["default"] {
- /**
- * Creates a new instance of the {@link module:ui/editorui/bodycollection~BodyCollection}.
- *
- * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor editor's locale} instance.
- * @param {Iterable.<module:ui/view~View>} [initialItems] The initial items of the collection.
- */
- constructor( locale, initialItems = [] ) {
- super( initialItems );
- /**
- * The {@link module:core/editor/editor~Editor#locale editor's locale} instance.
- * See the view {@link module:ui/view~View#locale locale} property.
- *
- * @member {module:utils/locale~Locale}
- */
- this.locale = locale;
- }
- /**
- * Attaches the body collection to the DOM body element. You need to execute this method to render the content of
- * the body collection.
- */
- attachToDom() {
- /**
- * The element holding elements of the body region.
- *
- * @protected
- * @member {HTMLElement} #_bodyCollectionContainer
- */
- this._bodyCollectionContainer = new _template__WEBPACK_IMPORTED_MODULE_0__["default"]( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-reset_all',
- 'ck-body',
- 'ck-rounded-corners'
- ],
- dir: this.locale.uiLanguageDirection
- },
- children: this
- } ).render();
- let wrapper = document.querySelector( '.ck-body-wrapper' );
- if ( !wrapper ) {
- wrapper = Object(_ckeditor_ckeditor5_utils_src_dom_createelement__WEBPACK_IMPORTED_MODULE_2__["default"])( document, 'div', { class: 'ck-body-wrapper' } );
- document.body.appendChild( wrapper );
- }
- wrapper.appendChild( this._bodyCollectionContainer );
- }
- /**
- * Detaches the collection from the DOM structure. Use this method when you do not need to use the body collection
- * anymore to clean-up the DOM structure.
- */
- detachFromDom() {
- super.destroy();
- if ( this._bodyCollectionContainer ) {
- this._bodyCollectionContainer.remove();
- }
- const wrapper = document.querySelector( '.ck-body-wrapper' );
- if ( wrapper && wrapper.childElementCount == 0 ) {
- wrapper.remove();
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js":
- /*!*************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js ***!
- \*************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoxedEditorUIView; });
- /* harmony import */ var _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editorui/editoruiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js");
- /* harmony import */ var _label_labelview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../label/labelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/editorui/boxed/boxededitoruiview
- */
- /**
- * The boxed editor UI view class. This class represents an editor interface
- * consisting of a toolbar and an editable area, enclosed within a box.
- *
- * @extends module:ui/editorui/editoruiview~EditorUIView
- */
- class BoxedEditorUIView extends _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an instance of the boxed editor UI view class.
- *
- * @param {module:utils/locale~Locale} locale The locale instance..
- */
- constructor( locale ) {
- super( locale );
- /**
- * Collection of the child views located in the top (`.ck-editor__top`)
- * area of the UI.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.top = this.createCollection();
- /**
- * Collection of the child views located in the main (`.ck-editor__main`)
- * area of the UI.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.main = this.createCollection();
- /**
- * Voice label of the UI.
- *
- * @protected
- * @readonly
- * @member {module:ui/view~View} #_voiceLabelView
- */
- this._voiceLabelView = this._createVoiceLabel();
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-reset',
- 'ck-editor',
- 'ck-rounded-corners'
- ],
- role: 'application',
- dir: locale.uiLanguageDirection,
- lang: locale.uiLanguage,
- 'aria-labelledby': this._voiceLabelView.id
- },
- children: [
- this._voiceLabelView,
- {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-editor__top',
- 'ck-reset_all'
- ],
- role: 'presentation'
- },
- children: this.top
- },
- {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-editor__main'
- ],
- role: 'presentation'
- },
- children: this.main
- }
- ]
- } );
- }
- /**
- * Creates a voice label view instance.
- *
- * @private
- * @returns {module:ui/label/labelview~LabelView}
- */
- _createVoiceLabel() {
- const t = this.t;
- const voiceLabel = new _label_labelview__WEBPACK_IMPORTED_MODULE_1__["default"]();
- voiceLabel.text = t( 'Rich Text Editor' );
- voiceLabel.extendTemplate( {
- attributes: {
- class: 'ck-voice-label'
- }
- } );
- return voiceLabel;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditorUIView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _bodycollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bodycollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js");
- /* harmony import */ var _theme_components_editorui_editorui_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/editorui/editorui.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css");
- /* harmony import */ var _theme_components_editorui_editorui_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_components_editorui_editorui_css__WEBPACK_IMPORTED_MODULE_2__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/editorui/editoruiview
- */
- /**
- * The editor UI view class. Base class for the editor main views.
- *
- * @extends module:ui/view~View
- */
- class EditorUIView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an instance of the editor UI view class.
- *
- * @param {module:utils/locale~Locale} [locale] The locale instance.
- */
- constructor( locale ) {
- super( locale );
- /**
- * Collection of the child views, detached from the DOM
- * structure of the editor, like panels, icons etc.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection} #body
- */
- this.body = new _bodycollection__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- this.body.attachToDom();
- }
- /**
- * @inheritDoc
- */
- destroy() {
- this.body.detachFromDom();
- return super.destroy();
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js":
- /*!****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FocusCycler; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/focuscycler
- */
- /**
- * A utility class that helps cycling over focusable {@link module:ui/view~View views} in a
- * {@link module:ui/viewcollection~ViewCollection} when the focus is tracked by the
- * {@link module:utils/focustracker~FocusTracker} instance. It helps implementing keyboard
- * navigation in HTML forms, toolbars, lists and the like.
- *
- * To work properly it requires:
- * * a collection of focusable (HTML `tabindex` attribute) views that implement the `focus()` method,
- * * an associated focus tracker to determine which view is focused.
- *
- * A simple cycler setup can look like this:
- *
- * const focusables = new ViewCollection();
- * const focusTracker = new FocusTracker();
- *
- * // Add focusable views to the focus tracker.
- * focusTracker.add( ... );
- *
- * Then, the cycler can be used manually:
- *
- * const cycler = new FocusCycler( { focusables, focusTracker } );
- *
- * // Will focus the first focusable view in #focusables.
- * cycler.focusFirst();
- *
- * // Will log the next focusable item in #focusables.
- * console.log( cycler.next );
- *
- * Alternatively, it can work side by side with the {@link module:utils/keystrokehandler~KeystrokeHandler}:
- *
- * const keystrokeHandler = new KeystrokeHandler();
- *
- * // Activate the keystroke handler.
- * keystrokeHandler.listenTo( sourceOfEvents );
- *
- * const cycler = new FocusCycler( {
- * focusables, focusTracker, keystrokeHandler,
- * actions: {
- * // When arrowup of arrowleft is detected by the #keystrokeHandler,
- * // focusPrevious() will be called on the cycler.
- * focusPrevious: [ 'arrowup', 'arrowleft' ],
- * }
- * } );
- *
- * Check out the {@glink framework/guides/deep-dive/ui/focus-tracking "Deep dive into focus tracking" guide} to learn more.
- */
- class FocusCycler {
- /**
- * Creates an instance of the focus cycler utility.
- *
- * @param {Object} options Configuration options.
- * @param {module:utils/collection~Collection|Object} options.focusables
- * @param {module:utils/focustracker~FocusTracker} options.focusTracker
- * @param {module:utils/keystrokehandler~KeystrokeHandler} [options.keystrokeHandler]
- * @param {Object} [options.actions]
- */
- constructor( options ) {
- Object.assign( this, options );
- /**
- * A {@link module:ui/view~View view} collection that the cycler operates on.
- *
- * @readonly
- * @member {module:utils/collection~Collection} #focusables
- */
- /**
- * A focus tracker instance that the cycler uses to determine the current focus
- * state in {@link #focusables}.
- *
- * @readonly
- * @member {module:utils/focustracker~FocusTracker} #focusTracker
- */
- /**
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}
- * which can respond to certain keystrokes and cycle the focus.
- *
- * @readonly
- * @member {module:utils/keystrokehandler~KeystrokeHandler} #keystrokeHandler
- */
- /**
- * Actions that the cycler can take when a keystroke is pressed. Requires
- * `options.keystrokeHandler` to be passed and working. When an action is
- * performed, `preventDefault` and `stopPropagation` will be called on the event
- * the keystroke fired in the DOM.
- *
- * actions: {
- * // Will call #focusPrevious() when arrowleft or arrowup is pressed.
- * focusPrevious: [ 'arrowleft', 'arrowup' ],
- *
- * // Will call #focusNext() when arrowdown is pressed.
- * focusNext: 'arrowdown'
- * }
- *
- * @readonly
- * @member {Object} #actions
- */
- if ( options.actions && options.keystrokeHandler ) {
- for ( const methodName in options.actions ) {
- let actions = options.actions[ methodName ];
- if ( typeof actions == 'string' ) {
- actions = [ actions ];
- }
- for ( const keystroke of actions ) {
- options.keystrokeHandler.set( keystroke, ( data, cancel ) => {
- this[ methodName ]();
- cancel();
- } );
- }
- }
- }
- }
- /**
- * Returns the first focusable view in {@link #focusables}.
- * Returns `null` if there is none.
- *
- * @readonly
- * @member {module:ui/view~View|null} #first
- */
- get first() {
- return this.focusables.find( isFocusable ) || null;
- }
- /**
- * Returns the last focusable view in {@link #focusables}.
- * Returns `null` if there is none.
- *
- * @readonly
- * @member {module:ui/view~View|null} #last
- */
- get last() {
- return this.focusables.filter( isFocusable ).slice( -1 )[ 0 ] || null;
- }
- /**
- * Returns the next focusable view in {@link #focusables} based on {@link #current}.
- * Returns `null` if there is none.
- *
- * @readonly
- * @member {module:ui/view~View|null} #next
- */
- get next() {
- return this._getFocusableItem( 1 );
- }
- /**
- * Returns the previous focusable view in {@link #focusables} based on {@link #current}.
- * Returns `null` if there is none.
- *
- * @readonly
- * @member {module:ui/view~View|null} #previous
- */
- get previous() {
- return this._getFocusableItem( -1 );
- }
- /**
- * An index of the view in the {@link #focusables} which is focused according
- * to {@link #focusTracker}. Returns `null` when there is no such view.
- *
- * @readonly
- * @member {Number|null} #current
- */
- get current() {
- let index = null;
- // There's no focused view in the focusables.
- if ( this.focusTracker.focusedElement === null ) {
- return null;
- }
- this.focusables.find( ( view, viewIndex ) => {
- const focused = view.element === this.focusTracker.focusedElement;
- if ( focused ) {
- index = viewIndex;
- }
- return focused;
- } );
- return index;
- }
- /**
- * Focuses the {@link #first} item in {@link #focusables}.
- */
- focusFirst() {
- this._focus( this.first );
- }
- /**
- * Focuses the {@link #last} item in {@link #focusables}.
- */
- focusLast() {
- this._focus( this.last );
- }
- /**
- * Focuses the {@link #next} item in {@link #focusables}.
- */
- focusNext() {
- this._focus( this.next );
- }
- /**
- * Focuses the {@link #previous} item in {@link #focusables}.
- */
- focusPrevious() {
- this._focus( this.previous );
- }
- /**
- * Focuses the given view if it exists.
- *
- * @protected
- * @param {module:ui/view~View} view
- */
- _focus( view ) {
- if ( view ) {
- view.focus();
- }
- }
- /**
- * Returns the next or previous focusable view in {@link #focusables} with respect
- * to {@link #current}.
- *
- * @protected
- * @param {Number} step Either `1` for checking forward from {@link #current} or
- * `-1` for checking backwards.
- * @returns {module:ui/view~View|null}
- */
- _getFocusableItem( step ) {
- // Cache for speed.
- const current = this.current;
- const collectionLength = this.focusables.length;
- if ( !collectionLength ) {
- return null;
- }
- // Start from the beginning if no view is focused.
- // https://github.com/ckeditor/ckeditor5-ui/issues/206
- if ( current === null ) {
- return this[ step === 1 ? 'first' : 'last' ];
- }
- // Cycle in both directions.
- let index = ( current + collectionLength + step ) % collectionLength;
- do {
- const view = this.focusables.get( index );
- // TODO: Check if view is visible.
- if ( isFocusable( view ) ) {
- return view;
- }
- // Cycle in both directions.
- index = ( index + collectionLength + step ) % collectionLength;
- } while ( index !== current );
- return null;
- }
- }
- // Checks whether a view is focusable.
- //
- // @private
- // @param {module:ui/view~View} view A view to be checked.
- // @returns {Boolean}
- function isFocusable( view ) {
- return !!( view.focus && _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__["default"].window.getComputedStyle( view.element ).display != 'none' );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FormHeaderView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _theme_components_formheader_formheader_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/components/formheader/formheader.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css");
- /* harmony import */ var _theme_components_formheader_formheader_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_theme_components_formheader_formheader_css__WEBPACK_IMPORTED_MODULE_1__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/formheader/formheaderview
- */
- /**
- * The class component representing a form header view. It should be used in more advanced forms to
- * describe the main purpose of the form.
- *
- * By default the component contains a bolded label view that has to be set. The label is usually a short (at most 3-word) string.
- * The component can also be extended by any other elements, like: icons, dropdowns, etc.
- *
- * It is used i.a.
- * by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}
- * and {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}.
- *
- * The latter is an example, where the component has been extended by {@link module:ui/dropdown/dropdownview~DropdownView} view.
- *
- * @extends module:ui/view~View
- */
- class FormHeaderView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an instance of the form header class.
- *
- * @param {module:utils/locale~Locale} locale The locale instance.
- * @param {Object} options
- * @param {String} options.label A label.
- * @param {String} [options.class] An additional class.
- */
- constructor( locale, options = {} ) {
- super( locale );
- const bind = this.bindTemplate;
- /**
- * The label of the header.
- *
- * @observable
- * @member {String} #label
- */
- this.set( 'label', options.label || '' );
- /**
- * An additional CSS class added to the {@link #element}.
- *
- * @observable
- * @member {String} #class
- */
- this.set( 'class', options.class || null );
- /**
- * A collection of header items.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.children = this.createCollection();
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-form__header',
- bind.to( 'class' )
- ]
- },
- children: this.children
- } );
- const label = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
- label.setTemplate( {
- tag: 'span',
- attributes: {
- class: [
- 'ck',
- 'ck-form__header__label'
- ]
- },
- children: [
- { text: bind.to( 'label' ) }
- ]
- } );
- this.children.add( label );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IconView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _theme_components_icon_icon_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/components/icon/icon.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css");
- /* harmony import */ var _theme_components_icon_icon_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_theme_components_icon_icon_css__WEBPACK_IMPORTED_MODULE_1__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /* global DOMParser */
- /**
- * @module ui/icon/iconview
- */
- /**
- * The icon view class.
- *
- * @extends module:ui/view~View
- */
- class IconView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor() {
- super();
- const bind = this.bindTemplate;
- /**
- * The SVG source of the icon.
- *
- * @observable
- * @member {String} #content
- */
- this.set( 'content', '' );
- /**
- * This attribute specifies the boundaries to which the
- * icon content should stretch.
- *
- * @observable
- * @default '0 0 20 20'
- * @member {String} #viewBox
- */
- this.set( 'viewBox', '0 0 20 20' );
- /**
- * The fill color of the child `path.ck-icon__fill`.
- *
- * @observable
- * @default ''
- * @member {String} #fillColor
- */
- this.set( 'fillColor', '' );
- this.setTemplate( {
- tag: 'svg',
- ns: 'http://www.w3.org/2000/svg',
- attributes: {
- class: [
- 'ck',
- 'ck-icon'
- ],
- viewBox: bind.to( 'viewBox' )
- }
- } );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- this._updateXMLContent();
- this._colorFillPaths();
- // This is a hack for lack of innerHTML binding.
- // See: https://github.com/ckeditor/ckeditor5-ui/issues/99.
- this.on( 'change:content', () => {
- this._updateXMLContent();
- this._colorFillPaths();
- } );
- this.on( 'change:fillColor', () => {
- this._colorFillPaths();
- } );
- }
- /**
- * Updates the {@link #element} with the value of {@link #content}.
- *
- * @private
- */
- _updateXMLContent() {
- if ( this.content ) {
- const parsed = new DOMParser().parseFromString( this.content.trim(), 'image/svg+xml' );
- const svg = parsed.querySelector( 'svg' );
- const viewBox = svg.getAttribute( 'viewBox' );
- if ( viewBox ) {
- this.viewBox = viewBox;
- }
- this.element.innerHTML = '';
- while ( svg.childNodes.length > 0 ) {
- this.element.appendChild( svg.childNodes[ 0 ] );
- }
- }
- }
- /**
- * Fills all child `path.ck-icon__fill` with the `#fillColor`.
- *
- * @private
- */
- _colorFillPaths() {
- if ( this.fillColor ) {
- this.element.querySelectorAll( '.ck-icon__fill' ).forEach( path => {
- path.style.fill = this.fillColor;
- } );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/index.js":
- /*!**********************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/index.js ***!
- \**********************************************************/
- /*! exports provided: clickOutsideHandler, injectCssTransitionDisabler, submitHandler, BodyCollection, ButtonView, SwitchButtonView, getLocalizedColorOptions, normalizeColorOptions, normalizeSingleColorDefinition, ColorGridView, ColorTileView, DropdownButtonView, SplitButtonView, createDropdown, addToolbarToDropdown, addListToDropdown, EditorUIView, BoxedEditorUIView, InlineEditableUIView, FormHeaderView, FocusCycler, IconView, InputTextView, LabelView, LabeledFieldView, createLabeledInputText, createLabeledDropdown, ListItemView, ListView, Notification, Model, BalloonPanelView, ContextualBalloon, StickyPanelView, TooltipView, Template, ToolbarView, ToolbarSeparatorView, enableToolbarKeyboardFocus, normalizeToolbarConfig, BalloonToolbar, BlockToolbar, View, ViewCollection */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bindings/clickoutsidehandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clickOutsideHandler", function() { return _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _bindings_injectcsstransitiondisabler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bindings/injectcsstransitiondisabler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "injectCssTransitionDisabler", function() { return _bindings_injectcsstransitiondisabler__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _bindings_submithandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bindings/submithandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "submitHandler", function() { return _bindings_submithandler__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _editorui_bodycollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editorui/bodycollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BodyCollection", function() { return _editorui_bodycollection__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonView", function() { return _button_buttonview__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./button/switchbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SwitchButtonView", function() { return _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _colorgrid_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./colorgrid/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocalizedColorOptions", function() { return _colorgrid_utils__WEBPACK_IMPORTED_MODULE_6__["getLocalizedColorOptions"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeColorOptions", function() { return _colorgrid_utils__WEBPACK_IMPORTED_MODULE_6__["normalizeColorOptions"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeSingleColorDefinition", function() { return _colorgrid_utils__WEBPACK_IMPORTED_MODULE_6__["normalizeSingleColorDefinition"]; });
- /* harmony import */ var _colorgrid_colorgridview__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./colorgrid/colorgridview */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorGridView", function() { return _colorgrid_colorgridview__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _colorgrid_colortileview__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./colorgrid/colortileview */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorTileView", function() { return _colorgrid_colortileview__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _dropdown_button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dropdown/button/dropdownbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownButtonView", function() { return _dropdown_button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _dropdown_button_splitbuttonview__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./dropdown/button/splitbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SplitButtonView", function() { return _dropdown_button_splitbuttonview__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _dropdown_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createDropdown", function() { return _dropdown_utils__WEBPACK_IMPORTED_MODULE_11__["createDropdown"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addToolbarToDropdown", function() { return _dropdown_utils__WEBPACK_IMPORTED_MODULE_11__["addToolbarToDropdown"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addListToDropdown", function() { return _dropdown_utils__WEBPACK_IMPORTED_MODULE_11__["addListToDropdown"]; });
- /* harmony import */ var _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./editorui/editoruiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorUIView", function() { return _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _editorui_boxed_boxededitoruiview__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./editorui/boxed/boxededitoruiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoxedEditorUIView", function() { return _editorui_boxed_boxededitoruiview__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _editableui_inline_inlineeditableuiview__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./editableui/inline/inlineeditableuiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InlineEditableUIView", function() { return _editableui_inline_inlineeditableuiview__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _formheader_formheaderview__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./formheader/formheaderview */ "./node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormHeaderView", function() { return _formheader_formheaderview__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusCycler", function() { return _focuscycler__WEBPACK_IMPORTED_MODULE_16__["default"]; });
- /* harmony import */ var _icon_iconview__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IconView", function() { return _icon_iconview__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony import */ var _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./inputtext/inputtextview */ "./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InputTextView", function() { return _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_18__["default"]; });
- /* harmony import */ var _label_labelview__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./label/labelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LabelView", function() { return _label_labelview__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _labeledfield_labeledfieldview__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./labeledfield/labeledfieldview */ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LabeledFieldView", function() { return _labeledfield_labeledfieldview__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /* harmony import */ var _labeledfield_utils__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./labeledfield/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLabeledInputText", function() { return _labeledfield_utils__WEBPACK_IMPORTED_MODULE_21__["createLabeledInputText"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLabeledDropdown", function() { return _labeledfield_utils__WEBPACK_IMPORTED_MODULE_21__["createLabeledDropdown"]; });
- /* harmony import */ var _list_listitemview__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./list/listitemview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListItemView", function() { return _list_listitemview__WEBPACK_IMPORTED_MODULE_22__["default"]; });
- /* harmony import */ var _list_listview__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./list/listview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListView", function() { return _list_listview__WEBPACK_IMPORTED_MODULE_23__["default"]; });
- /* harmony import */ var _notification_notification__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./notification/notification */ "./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return _notification_notification__WEBPACK_IMPORTED_MODULE_24__["default"]; });
- /* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./model */ "./node_modules/@ckeditor/ckeditor5-ui/src/model.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Model", function() { return _model__WEBPACK_IMPORTED_MODULE_25__["default"]; });
- /* harmony import */ var _panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./panel/balloon/balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BalloonPanelView", function() { return _panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_26__["default"]; });
- /* harmony import */ var _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./panel/balloon/contextualballoon */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextualBalloon", function() { return _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_27__["default"]; });
- /* harmony import */ var _panel_sticky_stickypanelview__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./panel/sticky/stickypanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StickyPanelView", function() { return _panel_sticky_stickypanelview__WEBPACK_IMPORTED_MODULE_28__["default"]; });
- /* harmony import */ var _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./tooltip/tooltipview */ "./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TooltipView", function() { return _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_29__["default"]; });
- /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Template", function() { return _template__WEBPACK_IMPORTED_MODULE_30__["default"]; });
- /* harmony import */ var _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./toolbar/toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarView", function() { return _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_31__["default"]; });
- /* harmony import */ var _toolbar_toolbarseparatorview__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./toolbar/toolbarseparatorview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarSeparatorView", function() { return _toolbar_toolbarseparatorview__WEBPACK_IMPORTED_MODULE_32__["default"]; });
- /* harmony import */ var _toolbar_enabletoolbarkeyboardfocus__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./toolbar/enabletoolbarkeyboardfocus */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enableToolbarKeyboardFocus", function() { return _toolbar_enabletoolbarkeyboardfocus__WEBPACK_IMPORTED_MODULE_33__["default"]; });
- /* harmony import */ var _toolbar_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./toolbar/normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeToolbarConfig", function() { return _toolbar_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_34__["default"]; });
- /* harmony import */ var _toolbar_balloon_balloontoolbar__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./toolbar/balloon/balloontoolbar */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BalloonToolbar", function() { return _toolbar_balloon_balloontoolbar__WEBPACK_IMPORTED_MODULE_35__["default"]; });
- /* harmony import */ var _toolbar_block_blocktoolbar__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./toolbar/block/blocktoolbar */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockToolbar", function() { return _toolbar_block_blocktoolbar__WEBPACK_IMPORTED_MODULE_36__["default"]; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "View", function() { return _view__WEBPACK_IMPORTED_MODULE_37__["default"]; });
- /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewCollection", function() { return _viewcollection__WEBPACK_IMPORTED_MODULE_38__["default"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InputTextView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
- /* harmony import */ var _theme_components_inputtext_inputtext_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/inputtext/inputtext.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css");
- /* harmony import */ var _theme_components_inputtext_inputtext_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_components_inputtext_inputtext_css__WEBPACK_IMPORTED_MODULE_2__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/inputtext/inputtextview
- */
- /**
- * The text input view class.
- *
- * @extends module:ui/view~View
- */
- class InputTextView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- /**
- * The value of the input.
- *
- * @observable
- * @member {String} #value
- */
- this.set( 'value' );
- /**
- * The `id` attribute of the input (i.e. to pair with a `<label>` element).
- *
- * @observable
- * @member {String} #id
- */
- this.set( 'id' );
- /**
- * The `placeholder` attribute of the input.
- *
- * @observable
- * @member {String} #placeholder
- */
- this.set( 'placeholder' );
- /**
- * Controls whether the input view is in read-only mode.
- *
- * @observable
- * @member {Boolean} #isReadOnly
- */
- this.set( 'isReadOnly', false );
- /**
- * Set to `true` when the field has some error. Usually controlled via
- * {@link module:ui/labeledinput/labeledinputview~LabeledInputView#errorText}.
- *
- * @observable
- * @member {Boolean} #hasError
- */
- this.set( 'hasError', false );
- /**
- * The `id` of the element describing this field, e.g. when it has
- * some error, it helps screen readers read the error text.
- *
- * @observable
- * @member {Boolean} #ariaDescribedById
- */
- this.set( 'ariaDescribedById' );
- /**
- * Stores information about the editor UI focus and propagates it so various plugins and components
- * are unified as a focus group.
- *
- * @readonly
- * @member {module:utils/focustracker~FocusTracker} #focusTracker
- */
- this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
- /**
- * An observable flag set to `true` when the input is currently focused by the user.
- * Set to `false` otherwise.
- *
- * @readonly
- * @observable
- * @member {Boolean} #isFocused
- * @default false
- */
- this.bind( 'isFocused' ).to( this.focusTracker );
- /**
- * An observable flag set to `true` when the input contains no text, i.e.
- * when {@link #value} is `''`, `null`, or `false`.
- *
- * @readonly
- * @observable
- * @member {Boolean} #isEmpty
- * @default true
- */
- this.set( 'isEmpty', true );
- const bind = this.bindTemplate;
- this.setTemplate( {
- tag: 'input',
- attributes: {
- type: 'text',
- class: [
- 'ck',
- 'ck-input',
- 'ck-input-text',
- bind.if( 'isFocused', 'ck-input_focused' ),
- bind.if( 'isEmpty', 'ck-input-text_empty' ),
- bind.if( 'hasError', 'ck-error' )
- ],
- id: bind.to( 'id' ),
- placeholder: bind.to( 'placeholder' ),
- readonly: bind.to( 'isReadOnly' ),
- 'aria-invalid': bind.if( 'hasError', true ),
- 'aria-describedby': bind.to( 'ariaDescribedById' )
- },
- on: {
- input: bind.to( 'input' ),
- change: bind.to( this._updateIsEmpty.bind( this ) )
- }
- } );
- /**
- * Fired when the user types in the input. Corresponds to the native
- * DOM `input` event.
- *
- * @event input
- */
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- this.focusTracker.add( this.element );
- this._setDomElementValue( this.value );
- this._updateIsEmpty();
- // Bind `this.value` to the DOM element's value.
- // We cannot use `value` DOM attribute because removing it on Edge does not clear the DOM element's value property.
- this.on( 'change:value', ( evt, name, value ) => {
- this._setDomElementValue( value );
- this._updateIsEmpty();
- } );
- }
- /**
- * Moves the focus to the input and selects the value.
- */
- select() {
- this.element.select();
- }
- /**
- * Focuses the input.
- */
- focus() {
- this.element.focus();
- }
- /**
- * Updates the {@link #isEmpty} property value on demand.
- *
- * @private
- */
- _updateIsEmpty() {
- this.isEmpty = isInputElementEmpty( this.element );
- }
- /**
- * Sets the `value` property of the {@link #element DOM element} on demand.
- *
- * @private
- */
- _setDomElementValue( value ) {
- this.element.value = ( !value && value !== 0 ) ? '' : value;
- }
- }
- function isInputElementEmpty( domElement ) {
- return !domElement.value;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LabelView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
- /* harmony import */ var _theme_components_label_label_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/label/label.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css");
- /* harmony import */ var _theme_components_label_label_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_components_label_label_css__WEBPACK_IMPORTED_MODULE_2__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/label/labelview
- */
- /**
- * The label view class.
- *
- * @extends module:ui/view~View
- */
- class LabelView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- /**
- * The text of the label.
- *
- * @observable
- * @member {String} #text
- */
- this.set( 'text' );
- /**
- * The `for` attribute of the label (i.e. to pair with an `<input>` element).
- *
- * @observable
- * @member {String} #for
- */
- this.set( 'for' );
- /**
- * An unique id of the label. It can be used by other UI components to reference
- * the label, for instance, using the `aria-describedby` DOM attribute.
- *
- * @member {String} #id
- */
- this.id = `ck-editor__label_${ Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() }`;
- const bind = this.bindTemplate;
- this.setTemplate( {
- tag: 'label',
- attributes: {
- class: [
- 'ck',
- 'ck-label'
- ],
- id: this.id,
- for: bind.to( 'for' )
- },
- children: [
- {
- text: bind.to( 'text' )
- }
- ]
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LabeledFieldView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
- /* harmony import */ var _label_labelview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../label/labelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js");
- /* harmony import */ var _theme_components_labeledfield_labeledfieldview_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/components/labeledfield/labeledfieldview.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css");
- /* harmony import */ var _theme_components_labeledfield_labeledfieldview_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_components_labeledfield_labeledfieldview_css__WEBPACK_IMPORTED_MODULE_3__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/labeledfield/labeledfieldview
- */
- /**
- * The labeled field view class. It can be used to enhance any view with the following features:
- *
- * * a label,
- * * (optional) an error message,
- * * (optional) an info (status) text,
- *
- * all bound logically by proper DOM attributes for UX and accessibility. It also provides an interface
- * (e.g. observable properties) that allows controlling those additional features.
- *
- * The constructor of this class requires a callback that returns a view to be labeled. The callback
- * is called with unique ids that allow binding of DOM properties:
- *
- * const labeledInputView = new LabeledFieldView( locale, ( labeledFieldView, viewUid, statusUid ) => {
- * const inputView = new InputTextView( labeledFieldView.locale );
- *
- * inputView.set( {
- * id: viewUid,
- * ariaDescribedById: statusUid
- * } );
- *
- * inputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );
- * inputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );
- *
- * return inputView;
- * } );
- *
- * labeledInputView.label = 'User name';
- * labeledInputView.infoText = 'Full name like for instance, John Doe.';
- * labeledInputView.render();
- *
- * document.body.append( labeledInputView.element );
- *
- * See {@link module:ui/labeledfield/utils} to discover ready–to–use labeled input helpers for common
- * UI components.
- *
- * @extends module:ui/view~View
- */
- class LabeledFieldView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an instance of the labeled field view class using a provided creator function
- * that provides the view to be labeled.
- *
- * @param {module:utils/locale~Locale} locale The locale instance.
- * @param {Function} viewCreator A function that returns a {@link module:ui/view~View}
- * that will be labeled. The following arguments are passed to the creator function:
- *
- * * an instance of the `LabeledFieldView` to allow binding observable properties,
- * * an UID string that connects the {@link #labelView label} and the labeled field view in DOM,
- * * an UID string that connects the {@link #statusView status} and the labeled field view in DOM.
- */
- constructor( locale, viewCreator ) {
- super( locale );
- const viewUid = `ck-labeled-field-view-${ Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() }`;
- const statusUid = `ck-labeled-field-view-status-${ Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() }`;
- /**
- * The field view that gets labeled.
- *
- * @member {module:ui/view~View} #fieldView
- */
- this.fieldView = viewCreator( this, viewUid, statusUid );
- /**
- * The text of the label.
- *
- * @observable
- * @member {String} #label
- */
- this.set( 'label' );
- /**
- * Controls whether the component is in read-only mode.
- *
- * @observable
- * @member {Boolean} #isEnabled
- */
- this.set( 'isEnabled', true );
- /**
- * An observable flag set to `true` when {@link #fieldView} is empty (`false` otherwise).
- *
- * @readonly
- * @observable
- * @member {Boolean} #isEmpty
- * @default true
- */
- this.set( 'isEmpty', true );
- /**
- * An observable flag set to `true` when {@link #fieldView} is currently focused by
- * the user (`false` otherwise).
- *
- * @readonly
- * @observable
- * @member {Boolean} #isFocused
- * @default false
- */
- this.set( 'isFocused', false );
- /**
- * The validation error text. When set, it will be displayed
- * next to the {@link #fieldView} as a typical validation error message.
- * Set it to `null` to hide the message.
- *
- * **Note:** Setting this property to anything but `null` will automatically
- * make the `hasError` of the {@link #fieldView} `true`.
- *
- * @observable
- * @member {String|null} #errorText
- */
- this.set( 'errorText', null );
- /**
- * The additional information text displayed next to the {@link #fieldView} which can
- * be used to inform the user about its purpose, provide help or hints.
- *
- * Set it to `null` to hide the message.
- *
- * **Note:** This text will be displayed in the same place as {@link #errorText} but the
- * latter always takes precedence: if the {@link #errorText} is set, it replaces
- * {@link #infoText}.
- *
- * @observable
- * @member {String|null} #infoText
- * @default null
- */
- this.set( 'infoText', null );
- /**
- * (Optional) The additional CSS class set on the dropdown {@link #element}.
- *
- * @observable
- * @member {String} #class
- */
- this.set( 'class' );
- /**
- * The content of the `placeholder` attribute of the {@link #fieldView}.
- *
- * @observable
- * @member {String} #placeholder
- */
- this.set( 'placeholder' );
- /**
- * The label view instance that describes the entire view.
- *
- * @member {module:ui/label/labelview~LabelView} #labelView
- */
- this.labelView = this._createLabelView( viewUid );
- /**
- * The status view for the {@link #fieldView}. It displays {@link #errorText} and
- * {@link #infoText}.
- *
- * @member {module:ui/view~View} #statusView
- */
- this.statusView = this._createStatusView( statusUid );
- /**
- * The combined status text made of {@link #errorText} and {@link #infoText}.
- * Note that when present, {@link #errorText} always takes precedence in the
- * status.
- *
- * @see #errorText
- * @see #infoText
- * @see #statusView
- * @private
- * @observable
- * @member {String|null} #_statusText
- */
- this.bind( '_statusText' ).to(
- this, 'errorText',
- this, 'infoText',
- ( errorText, infoText ) => errorText || infoText
- );
- const bind = this.bindTemplate;
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-labeled-field-view',
- bind.to( 'class' ),
- bind.if( 'isEnabled', 'ck-disabled', value => !value ),
- bind.if( 'isEmpty', 'ck-labeled-field-view_empty' ),
- bind.if( 'isFocused', 'ck-labeled-field-view_focused' ),
- bind.if( 'placeholder', 'ck-labeled-field-view_placeholder' ),
- bind.if( 'errorText', 'ck-error' )
- ]
- },
- children: [
- {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-labeled-field-view__input-wrapper'
- ]
- },
- children: [
- this.fieldView,
- this.labelView
- ]
- },
- this.statusView
- ]
- } );
- }
- /**
- * Creates label view class instance and bind with view.
- *
- * @private
- * @param {String} id Unique id to set as labelView#for attribute.
- * @returns {module:ui/label/labelview~LabelView}
- */
- _createLabelView( id ) {
- const labelView = new _label_labelview__WEBPACK_IMPORTED_MODULE_2__["default"]( this.locale );
- labelView.for = id;
- labelView.bind( 'text' ).to( this, 'label' );
- return labelView;
- }
- /**
- * Creates the status view instance. It displays {@link #errorText} and {@link #infoText}
- * next to the {@link #fieldView}. See {@link #_statusText}.
- *
- * @private
- * @param {String} statusUid Unique id of the status, shared with the {@link #fieldView view's}
- * `aria-describedby` attribute.
- * @returns {module:ui/view~View}
- */
- _createStatusView( statusUid ) {
- const statusView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]( this.locale );
- const bind = this.bindTemplate;
- statusView.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-labeled-field-view__status',
- bind.if( 'errorText', 'ck-labeled-field-view__status_error' ),
- bind.if( '_statusText', 'ck-hidden', value => !value )
- ],
- id: statusUid,
- role: bind.if( 'errorText', 'alert' )
- },
- children: [
- {
- text: bind.to( '_statusText' )
- }
- ]
- } );
- return statusView;
- }
- /**
- * Focuses the {@link #fieldView}.
- */
- focus() {
- this.fieldView.focus();
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js ***!
- \***********************************************************************/
- /*! exports provided: createLabeledInputText, createLabeledDropdown */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLabeledInputText", function() { return createLabeledInputText; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLabeledDropdown", function() { return createLabeledDropdown; });
- /* harmony import */ var _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../inputtext/inputtextview */ "./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js");
- /* harmony import */ var _dropdown_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/labeledfield/utils
- */
- /**
- * A helper for creating labeled inputs.
- *
- * It creates an instance of a {@link module:ui/inputtext/inputtextview~InputTextView input text} that is
- * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.
- *
- * The helper does the following:
- *
- * * It sets input's `id` and `ariaDescribedById` attributes.
- * * It binds input's `isReadOnly` to the labeled view.
- * * It binds input's `hasError` to the labeled view.
- * * It enables a logic that cleans up the error when user starts typing in the input..
- *
- * Usage:
- *
- * const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );
- * console.log( labeledInputView.view ); // An input instance.
- *
- * @param {module:ui/labeledfield/labeledfieldview~LabeledFieldView} labeledFieldView The instance of the labeled field view.
- * @param {String} viewUid An UID string that allows DOM logical connection between the
- * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the input.
- * @param {String} statusUid An UID string that allows DOM logical connection between the
- * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the input.
- * @returns {module:ui/inputtext/inputtextview~InputTextView} The input text view instance.
- */
- function createLabeledInputText( labeledFieldView, viewUid, statusUid ) {
- const inputView = new _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_0__["default"]( labeledFieldView.locale );
- inputView.set( {
- id: viewUid,
- ariaDescribedById: statusUid
- } );
- inputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );
- inputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );
- inputView.on( 'input', () => {
- // UX: Make the error text disappear and disable the error indicator as the user
- // starts fixing the errors.
- labeledFieldView.errorText = null;
- } );
- labeledFieldView.bind( 'isEmpty', 'isFocused', 'placeholder' ).to( inputView );
- return inputView;
- }
- /**
- * A helper for creating labeled dropdowns.
- *
- * It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown} that is
- * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled field view}.
- *
- * The helper does the following:
- *
- * * It sets dropdown's `id` and `ariaDescribedById` attributes.
- * * It binds input's `isEnabled` to the labeled view.
- *
- * Usage:
- *
- * const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );
- * console.log( labeledInputView.view ); // A dropdown instance.
- *
- * @param {module:ui/labeledfield/labeledfieldview~LabeledFieldView} labeledFieldView The instance of the labeled field view.
- * @param {String} viewUid An UID string that allows DOM logical connection between the
- * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view label} and the dropdown.
- * @param {String} statusUid An UID string that allows DOM logical connection between the
- * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view status} and the dropdown.
- * @returns {module:ui/dropdown/dropdownview~DropdownView} The dropdown view instance.
- */
- function createLabeledDropdown( labeledFieldView, viewUid, statusUid ) {
- const dropdownView = Object(_dropdown_utils__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( labeledFieldView.locale );
- dropdownView.set( {
- id: viewUid,
- ariaDescribedById: statusUid
- } );
- dropdownView.bind( 'isEnabled' ).to( labeledFieldView );
- return dropdownView;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListItemView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/list/listitemview
- */
- /**
- * The list item view class.
- *
- * @extends module:ui/view~View
- */
- class ListItemView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- /**
- * Collection of the child views inside of the list item {@link #element}.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.children = this.createCollection();
- this.setTemplate( {
- tag: 'li',
- attributes: {
- class: [
- 'ck',
- 'ck-list__item'
- ]
- },
- children: this.children
- } );
- }
- /**
- * Focuses the list item.
- */
- focus() {
- this.children.first.focus();
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListSeparatorView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/list/listseparatorview
- */
- /**
- * The list separator view class.
- *
- * @extends module:ui/view~View
- */
- class ListSeparatorView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- this.setTemplate( {
- tag: 'li',
- attributes: {
- class: [
- 'ck',
- 'ck-list__separator'
- ]
- }
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
- /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
- /* harmony import */ var _theme_components_list_list_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/components/list/list.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css");
- /* harmony import */ var _theme_components_list_list_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_components_list_list_css__WEBPACK_IMPORTED_MODULE_4__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/list/listview
- */
- /**
- * The list view class.
- *
- * @extends module:ui/view~View
- * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
- */
- class ListView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor() {
- super();
- /**
- * Collection of the child list views.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.items = this.createCollection();
- /**
- * Tracks information about DOM focus in the list.
- *
- * @readonly
- * @member {module:utils/focustracker~FocusTracker}
- */
- this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
- /**
- * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
- *
- * @readonly
- * @member {module:utils/keystrokehandler~KeystrokeHandler}
- */
- this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__["default"]();
- /**
- * Helps cycling over focusable {@link #items} in the list.
- *
- * @readonly
- * @protected
- * @member {module:ui/focuscycler~FocusCycler}
- */
- this._focusCycler = new _focuscycler__WEBPACK_IMPORTED_MODULE_2__["default"]( {
- focusables: this.items,
- focusTracker: this.focusTracker,
- keystrokeHandler: this.keystrokes,
- actions: {
- // Navigate list items backwards using the arrowup key.
- focusPrevious: 'arrowup',
- // Navigate toolbar items forwards using the arrowdown key.
- focusNext: 'arrowdown'
- }
- } );
- this.setTemplate( {
- tag: 'ul',
- attributes: {
- class: [
- 'ck',
- 'ck-reset',
- 'ck-list'
- ]
- },
- children: this.items
- } );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- // Items added before rendering should be known to the #focusTracker.
- for ( const item of this.items ) {
- this.focusTracker.add( item.element );
- }
- this.items.on( 'add', ( evt, item ) => {
- this.focusTracker.add( item.element );
- } );
- this.items.on( 'remove', ( evt, item ) => {
- this.focusTracker.remove( item.element );
- } );
- // Start listening for the keystrokes coming from #element.
- this.keystrokes.listenTo( this.element );
- }
- /**
- * Focuses the first focusable in {@link #items}.
- */
- focus() {
- this._focusCycler.focusFirst();
- }
- /**
- * Focuses the last focusable in {@link #items}.
- */
- focusLast() {
- this._focusCycler.focusLast();
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/model.js":
- /*!**********************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/model.js ***!
- \**********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Model; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/model
- */
- /**
- * The base MVC model class.
- *
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class Model {
- /**
- * Creates a new Model instance.
- *
- * @param {Object} [attributes] The model state attributes to be defined during the instance creation.
- * @param {Object} [properties] The (out of state) properties to be appended to the instance during creation.
- */
- constructor( attributes, properties ) {
- // Extend this instance with the additional (out of state) properties.
- if ( properties ) {
- Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["extend"])( this, properties );
- }
- // Initialize the attributes.
- if ( attributes ) {
- this.set( attributes );
- }
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( Model, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Notification; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/notification/notification
- */
- /* globals window */
- /**
- * The Notification plugin.
- *
- * This plugin sends a few types of notifications: `success`, `info` and `warning`. The notifications need to be
- * handled and displayed by a plugin responsible for showing the UI of the notifications. Using this plugin for dispatching
- * notifications makes it possible to switch the notifications UI.
- *
- * Note that every unhandled and not stopped `warning` notification will be displayed as a system alert.
- * See {@link module:ui/notification/notification~Notification#showWarning}.
- *
- * @extends module:core/contextplugin~ContextPlugin
- */
- class Notification extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["ContextPlugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Notification';
- }
- /**
- * @inheritDoc
- */
- init() {
- // Each unhandled and not stopped `show:warning` event is displayed as a system alert.
- this.on( 'show:warning', ( evt, data ) => {
- window.alert( data.message ); // eslint-disable-line no-alert
- }, { priority: 'lowest' } );
- }
- /**
- * Shows a success notification.
- *
- * By default, it fires the {@link #event:show:success `show:success` event} with the given `data`. The event namespace can be extended
- * using the `data.namespace` option. For example:
- *
- * showSuccess( 'Image is uploaded.', {
- * namespace: 'upload:image'
- * } );
- *
- * will fire the `show:success:upload:image` event.
- *
- * You can provide the title of the notification:
- *
- * showSuccess( 'Image is uploaded.', {
- * title: 'Image upload success'
- * } );
- *
- * @param {String} message The content of the notification.
- * @param {Object} [data={}] Additional data.
- * @param {String} [data.namespace] Additional event namespace.
- * @param {String} [data.title] The title of the notification.
- */
- showSuccess( message, data = {} ) {
- this._showNotification( {
- message,
- type: 'success',
- namespace: data.namespace,
- title: data.title
- } );
- }
- /**
- * Shows an information notification.
- *
- * By default, it fires the {@link #event:show:info `show:info` event} with the given `data`. The event namespace can be extended
- * using the `data.namespace` option. For example:
- *
- * showInfo( 'Editor is offline.', {
- * namespace: 'editor:status'
- * } );
- *
- * will fire the `show:info:editor:status` event.
- *
- * You can provide the title of the notification:
- *
- * showInfo( 'Editor is offline.', {
- * title: 'Network information'
- * } );
- *
- * @param {String} message The content of the notification.
- * @param {Object} [data={}] Additional data.
- * @param {String} [data.namespace] Additional event namespace.
- * @param {String} [data.title] The title of the notification.
- */
- showInfo( message, data = {} ) {
- this._showNotification( {
- message,
- type: 'info',
- namespace: data.namespace,
- title: data.title
- } );
- }
- /**
- * Shows a warning notification.
- *
- * By default, it fires the {@link #event:show:warning `show:warning` event}
- * with the given `data`. The event namespace can be extended using the `data.namespace` option. For example:
- *
- * showWarning( 'Image upload error.', {
- * namespace: 'upload:image'
- * } );
- *
- * will fire the `show:warning:upload:image` event.
- *
- * You can provide the title of the notification:
- *
- * showWarning( 'Image upload error.', {
- * title: 'Upload failed'
- * } );
- *
- * Note that each unhandled and not stopped `warning` notification will be displayed as a system alert.
- * The plugin responsible for displaying warnings should `stop()` the event to prevent displaying it as an alert:
- *
- * notifications.on( 'show:warning', ( evt, data ) => {
- * // Do something with the data.
- *
- * // Stop this event to prevent displaying it as an alert.
- * evt.stop();
- * } );
- *
- * You can attach many listeners to the same event and `stop()` this event in a listener with a low priority:
- *
- * notifications.on( 'show:warning', ( evt, data ) => {
- * // Show the warning in the UI, but do not stop it.
- * } );
- *
- * notifications.on( 'show:warning', ( evt, data ) => {
- * // Log the warning to some error tracker.
- *
- * // Stop this event to prevent displaying it as an alert.
- * evt.stop();
- * }, { priority: 'low' } );
- *
- * @param {String} message The content of the notification.
- * @param {Object} [data={}] Additional data.
- * @param {String} [data.namespace] Additional event namespace.
- * @param {String} [data.title] The title of the notification.
- */
- showWarning( message, data = {} ) {
- this._showNotification( {
- message,
- type: 'warning',
- namespace: data.namespace,
- title: data.title
- } );
- }
- /**
- * Fires the `show` event with the specified type, namespace and message.
- *
- * @private
- * @param {Object} data The message data.
- * @param {String} data.message The content of the notification.
- * @param {'success'|'info'|'warning'} data.type The type of the message.
- * @param {String} [data.namespace] Additional event namespace.
- * @param {String} [data.title=''] The title of the notification.
- */
- _showNotification( data ) {
- const event = `show:${ data.type }` + ( data.namespace ? `:${ data.namespace }` : '' );
- this.fire( event, {
- message: data.message,
- type: data.type,
- title: data.title || ''
- } );
- }
- /**
- * Fired when one of the `showSuccess()`, `showInfo()`, `showWarning()` methods is called.
- *
- * @event show
- * @param {Object} data The notification data.
- * @param {String} data.message The content of the notification.
- * @param {String} data.title The title of the notification.
- * @param {'success'|'info'|'warning'} data.type The type of the notification.
- */
- /**
- * Fired when the `showSuccess()` method is called.
- *
- * @event show:success
- * @param {Object} data The notification data.
- * @param {String} data.message The content of the notification.
- * @param {String} data.title The title of the notification.
- * @param {'success'} data.type The type of the notification.
- */
- /**
- * Fired when the `showInfo()` method is called.
- *
- * @event show:info
- * @param {Object} data The notification data.
- * @param {String} data.message The content of the notification.
- * @param {String} data.title The title of the notification.
- * @param {'info'} data.type The type of the notification.
- */
- /**
- * Fired when the `showWarning()` method is called.
- *
- * When this event is not handled or stopped by `event.stop()`, the `data.message` of this event will
- * be automatically displayed as a system alert.
- *
- * @event show:warning
- * @param {Object} data The notification data.
- * @param {String} data.message The content of the notification.
- * @param {String} data.title The title of the notification.
- * @param {'warning'} data.type The type of the notification.
- */
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BalloonPanelView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/position */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_isrange__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/isrange */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /* harmony import */ var _theme_components_panel_balloonpanel_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../theme/components/panel/balloonpanel.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css");
- /* harmony import */ var _theme_components_panel_balloonpanel_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_theme_components_panel_balloonpanel_css__WEBPACK_IMPORTED_MODULE_6__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
- /**
- * @module ui/panel/balloon/balloonpanelview
- */
- const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__["default"])( 'px' );
- const defaultLimiterElement = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].document.body;
- /**
- * The balloon panel view class.
- *
- * A floating container which can
- * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#pin pin} to any
- * {@link module:utils/dom/position~Options#target target} in the DOM and remain in that position
- * e.g. when the web page is scrolled.
- *
- * The balloon panel can be used to display contextual, non-blocking UI like forms, toolbars and
- * the like in its {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#content} view
- * collection.
- *
- * There is a number of {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}
- * that the balloon can use, automatically switching from one to another when the viewport space becomes
- * scarce to keep the balloon visible to the user as long as it is possible. The balloon will also
- * accept any custom position set provided by the user compatible with the
- * {@link module:utils/dom/position~Options options}.
- *
- * const panel = new BalloonPanelView( locale );
- * const childView = new ChildView();
- * const positions = BalloonPanelView.defaultPositions;
- *
- * panel.render();
- *
- * // Add a child view to the panel's content collection.
- * panel.content.add( childView );
- *
- * // Start pinning the panel to an element with the "target" id DOM.
- * // The balloon will remain pinned until unpin() is called.
- * panel.pin( {
- * target: document.querySelector( '#target' ),
- * positions: [
- * positions.northArrowSouth,
- * positions.southArrowNorth
- * ]
- * } );
- *
- * @extends module:ui/view~View
- */
- class BalloonPanelView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- const bind = this.bindTemplate;
- /**
- * The absolute top position of the balloon panel in pixels.
- *
- * @observable
- * @default 0
- * @member {Number} #top
- */
- this.set( 'top', 0 );
- /**
- * The absolute left position of the balloon panel in pixels.
- *
- * @observable
- * @default 0
- * @member {Number} #left
- */
- this.set( 'left', 0 );
- /**
- * The balloon panel's current position. The position name is reflected in the CSS class set
- * to the balloon, i.e. `.ck-balloon-panel_arrow_nw` for the "arrow_nw" position. The class
- * controls the minor aspects of the balloon's visual appearance like the placement
- * of an {@link #withArrow arrow}. To support a new position, an additional CSS must be created.
- *
- * Default position names correspond with
- * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
- *
- * See the {@link #attachTo} and {@link #pin} methods to learn about custom balloon positions.
- *
- * @observable
- * @default 'arrow_nw'
- * @member {'arrow_nw'|'arrow_ne'|'arrow_sw'|'arrow_se'} #position
- */
- this.set( 'position', 'arrow_nw' );
- /**
- * Controls whether the balloon panel is visible or not.
- *
- * @observable
- * @default false
- * @member {Boolean} #isVisible
- */
- this.set( 'isVisible', false );
- /**
- * Controls whether the balloon panel has an arrow. The presence of the arrow
- * is reflected in the `ck-balloon-panel_with-arrow` CSS class.
- *
- * @observable
- * @default true
- * @member {Boolean} #withArrow
- */
- this.set( 'withArrow', true );
- /**
- * An additional CSS class added to the {@link #element}.
- *
- * @observable
- * @member {String} #class
- */
- this.set( 'class' );
- /**
- * A callback that starts pinning the panel when {@link #isVisible} gets
- * `true`. Used by {@link #pin}.
- *
- * @private
- * @member {Function} #_pinWhenIsVisibleCallback
- */
- /**
- * A collection of the child views that creates the balloon panel contents.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.content = this.createCollection();
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-balloon-panel',
- bind.to( 'position', value => `ck-balloon-panel_${ value }` ),
- bind.if( 'isVisible', 'ck-balloon-panel_visible' ),
- bind.if( 'withArrow', 'ck-balloon-panel_with-arrow' ),
- bind.to( 'class' )
- ],
- style: {
- top: bind.to( 'top', toPx ),
- left: bind.to( 'left', toPx )
- }
- },
- children: this.content
- } );
- }
- /**
- * Shows the panel.
- *
- * See {@link #isVisible}.
- */
- show() {
- this.isVisible = true;
- }
- /**
- * Hides the panel.
- *
- * See {@link #isVisible}.
- */
- hide() {
- this.isVisible = false;
- }
- /**
- * Attaches the panel to a specified {@link module:utils/dom/position~Options#target} with a
- * smart positioning heuristics that chooses from available positions to make sure the panel
- * is visible to the user i.e. within the limits of the viewport.
- *
- * This method accepts configuration {@link module:utils/dom/position~Options options}
- * to set the `target`, optional `limiter` and `positions` the balloon should choose from.
- *
- * const panel = new BalloonPanelView( locale );
- * const positions = BalloonPanelView.defaultPositions;
- *
- * panel.render();
- *
- * // Attach the panel to an element with the "target" id DOM.
- * panel.attachTo( {
- * target: document.querySelector( '#target' ),
- * positions: [
- * positions.northArrowSouth,
- * positions.southArrowNorth
- * ]
- * } );
- *
- * **Note**: Attaching the panel will also automatically {@link #show} it.
- *
- * **Note**: An attached panel will not follow its target when the window is scrolled or resized.
- * See the {@link #pin} method for a more permanent positioning strategy.
- *
- * @param {module:utils/dom/position~Options} options Positioning options compatible with
- * {@link module:utils/dom/position~getOptimalPosition}. Default `positions` array is
- * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
- */
- attachTo( options ) {
- this.show();
- const defaultPositions = BalloonPanelView.defaultPositions;
- const positionOptions = Object.assign( {}, {
- element: this.element,
- positions: [
- defaultPositions.southArrowNorth,
- defaultPositions.southArrowNorthMiddleWest,
- defaultPositions.southArrowNorthMiddleEast,
- defaultPositions.southArrowNorthWest,
- defaultPositions.southArrowNorthEast,
- defaultPositions.northArrowSouth,
- defaultPositions.northArrowSouthMiddleWest,
- defaultPositions.northArrowSouthMiddleEast,
- defaultPositions.northArrowSouthWest,
- defaultPositions.northArrowSouthEast
- ],
- limiter: defaultLimiterElement,
- fitInViewport: true
- }, options );
- const optimalPosition = BalloonPanelView._getOptimalPosition( positionOptions );
- // Usually browsers make some problems with super accurate values like 104.345px
- // so it is better to use int values.
- const left = parseInt( optimalPosition.left );
- const top = parseInt( optimalPosition.top );
- const position = optimalPosition.name;
- Object.assign( this, { top, left, position } );
- }
- /**
- * Works the same way as the {@link #attachTo} method except that the position of the panel is
- * continuously updated when:
- *
- * * any ancestor of the {@link module:utils/dom/position~Options#target}
- * or {@link module:utils/dom/position~Options#limiter} is scrolled,
- * * the browser window gets resized or scrolled.
- *
- * Thanks to that, the panel always sticks to the {@link module:utils/dom/position~Options#target}
- * and is immune to the changing environment.
- *
- * const panel = new BalloonPanelView( locale );
- * const positions = BalloonPanelView.defaultPositions;
- *
- * panel.render();
- *
- * // Pin the panel to an element with the "target" id DOM.
- * panel.pin( {
- * target: document.querySelector( '#target' ),
- * positions: [
- * positions.northArrowSouth,
- * positions.southArrowNorth
- * ]
- * } );
- *
- * To leave the pinned state, use the {@link #unpin} method.
- *
- * **Note**: Pinning the panel will also automatically {@link #show} it.
- *
- * @param {module:utils/dom/position~Options} options Positioning options compatible with
- * {@link module:utils/dom/position~getOptimalPosition}. Default `positions` array is
- * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
- */
- pin( options ) {
- this.unpin();
- this._pinWhenIsVisibleCallback = () => {
- if ( this.isVisible ) {
- this._startPinning( options );
- } else {
- this._stopPinning();
- }
- };
- this._startPinning( options );
- // Control the state of the listeners depending on whether the panel is visible
- // or not.
- // TODO: Use on() (https://github.com/ckeditor/ckeditor5-utils/issues/144).
- this.listenTo( this, 'change:isVisible', this._pinWhenIsVisibleCallback );
- }
- /**
- * Stops pinning the panel, as set up by {@link #pin}.
- */
- unpin() {
- if ( this._pinWhenIsVisibleCallback ) {
- // Deactivate listeners attached by pin().
- this._stopPinning();
- // Deactivate the panel pin() control logic.
- // TODO: Use off() (https://github.com/ckeditor/ckeditor5-utils/issues/144).
- this.stopListening( this, 'change:isVisible', this._pinWhenIsVisibleCallback );
- this._pinWhenIsVisibleCallback = null;
- this.hide();
- }
- }
- /**
- * Starts managing the pinned state of the panel. See {@link #pin}.
- *
- * @private
- * @param {module:utils/dom/position~Options} options Positioning options compatible with
- * {@link module:utils/dom/position~getOptimalPosition}.
- */
- _startPinning( options ) {
- this.attachTo( options );
- const targetElement = getDomElement( options.target );
- const limiterElement = options.limiter ? getDomElement( options.limiter ) : defaultLimiterElement;
- // Then we need to listen on scroll event of eny element in the document.
- this.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].document, 'scroll', ( evt, domEvt ) => {
- const scrollTarget = domEvt.target;
- // The position needs to be updated if the positioning target is within the scrolled element.
- const isWithinScrollTarget = targetElement && scrollTarget.contains( targetElement );
- // The position needs to be updated if the positioning limiter is within the scrolled element.
- const isLimiterWithinScrollTarget = limiterElement && scrollTarget.contains( limiterElement );
- // The positioning target and/or limiter can be a Rect, object etc..
- // There's no way to optimize the listener then.
- if ( isWithinScrollTarget || isLimiterWithinScrollTarget || !targetElement || !limiterElement ) {
- this.attachTo( options );
- }
- }, { useCapture: true } );
- // We need to listen on window resize event and update position.
- this.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].window, 'resize', () => {
- this.attachTo( options );
- } );
- }
- /**
- * Stops managing the pinned state of the panel. See {@link #pin}.
- *
- * @private
- */
- _stopPinning() {
- this.stopListening( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].document, 'scroll' );
- this.stopListening( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].window, 'resize' );
- }
- }
- // Returns the DOM element for given object or null, if there is none,
- // e.g. when the passed object is a Rect instance or so.
- //
- // @private
- // @param {*} object
- // @returns {HTMLElement|null}
- function getDomElement( object ) {
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_5__["isElement"])( object ) ) {
- return object;
- }
- if ( Object(_ckeditor_ckeditor5_utils_src_dom_isrange__WEBPACK_IMPORTED_MODULE_2__["default"])( object ) ) {
- return object.commonAncestorContainer;
- }
- if ( typeof object == 'function' ) {
- return getDomElement( object() );
- }
- return null;
- }
- /**
- * A horizontal offset of the arrow tip from the edge of the balloon. Controlled by CSS.
- *
- * +-----|---------...
- * | |
- * | |
- * | |
- * | |
- * +--+ | +------...
- * \ | /
- * \|/
- * >|-----|<---------------- horizontal offset
- *
- * @default 30
- * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHorizontalOffset
- */
- BalloonPanelView.arrowHorizontalOffset = 25;
- /**
- * A vertical offset of the arrow from the edge of the balloon. Controlled by CSS.
- *
- * +-------------...
- * |
- * |
- * | /-- vertical offset
- * | V
- * +--+ +-----... ---------
- * \ / |
- * \/ |
- * -------------------------------
- * ^
- *
- * @default 15
- * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowVerticalOffset
- */
- BalloonPanelView.arrowVerticalOffset = 10;
- /**
- * Function used to calculate the optimal position for the balloon.
- *
- * @protected
- * @member {Function} module:ui/panel/balloon/balloonpanelview~BalloonPanelView._getOptimalPosition
- */
- BalloonPanelView._getOptimalPosition = _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_1__["getOptimalPosition"];
- /**
- * A default set of positioning functions used by the balloon panel view
- * when attaching using the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo} method.
- *
- * The available positioning functions are as follows:
- *
- *
- *
- * **North west**
- *
- * * `northWestArrowSouthWest`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- * * `northWestArrowSouthMiddleWest`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- * * `northWestArrowSouth`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- * * `northWestArrowSouthMiddleEast`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- * * `northWestArrowSouthEast`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- *
- *
- * **North**
- *
- * * `northArrowSouthWest`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- * * `northArrowSouthMiddleWest`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- * * `northArrowSouth`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- * * `northArrowSouthMiddleEast`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- * * `northArrowSouthEast`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- * **North east**
- *
- * * `northEastArrowSouthWest`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- *
- * * `northEastArrowSouthMiddleWest`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- * * `northEastArrowSouth`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- * * `northEastArrowSouthMiddleEast`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- * * `northEastArrowSouthEast`
- *
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * V
- * [ Target ]
- *
- *
- *
- * **South**
- *
- *
- * * `southArrowNorthWest`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- * * `southArrowNorthMiddleWest`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- * * `southArrowNorth`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- * * `southArrowNorthMiddleEast`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- * * `southArrowNorthEast`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- *
- *
- * **South west**
- *
- * * `southWestArrowNorthWest`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- * * `southWestArrowNorthMiddleWest`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- * * `southWestArrowNorth`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- * * `southWestArrowNorthMiddleEast`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- * * `southWestArrowNorthEast`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- *
- *
- * **South east**
- *
- * * `southEastArrowNorthWest`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- * * `southEastArrowNorthMiddleWest`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- * * `southEastArrowNorth`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- * * `southEastArrowNorthMiddleEast`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- * * `southEastArrowNorthEast`
- *
- * [ Target ]
- * ^
- * +-----------------+
- * | Balloon |
- * +-----------------+
- *
- *
- * See {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo}.
- *
- * Positioning functions must be compatible with {@link module:utils/dom/position~Position}.
- *
- * The name that the position function returns will be reflected in the balloon panel's class that
- * controls the placement of the "arrow". See {@link #position} to learn more.
- *
- * @member {Object} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions
- */
- BalloonPanelView.defaultPositions = {
- // ------- North west
- northWestArrowSouthWest: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.left - BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_sw'
- } ),
- northWestArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.left - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_smw'
- } ),
- northWestArrowSouth: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.left - balloonRect.width / 2,
- name: 'arrow_s'
- } ),
- northWestArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.left - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_sme'
- } ),
- northWestArrowSouthEast: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.left - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_se'
- } ),
- // ------- North
- northArrowSouthWest: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.left + targetRect.width / 2 - BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_sw'
- } ),
- northArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_smw'
- } ),
- northArrowSouth: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
- name: 'arrow_s'
- } ),
- northArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_sme'
- } ),
- northArrowSouthEast: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.left + targetRect.width / 2 - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_se'
- } ),
- // ------- North east
- northEastArrowSouthWest: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.right - BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_sw'
- } ),
- northEastArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.right - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_smw'
- } ),
- northEastArrowSouth: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.right - balloonRect.width / 2,
- name: 'arrow_s'
- } ),
- northEastArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.right - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_sme'
- } ),
- northEastArrowSouthEast: ( targetRect, balloonRect ) => ( {
- top: getNorthTop( targetRect, balloonRect ),
- left: targetRect.right - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_se'
- } ),
- // ------- South west
- southWestArrowNorthWest: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.left - BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_nw'
- } ),
- southWestArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.left - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_nmw'
- } ),
- southWestArrowNorth: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.left - balloonRect.width / 2,
- name: 'arrow_n'
- } ),
- southWestArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.left - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_nme'
- } ),
- southWestArrowNorthEast: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.left - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_ne'
- } ),
- // ------- South
- southArrowNorthWest: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.left + targetRect.width / 2 - BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_nw'
- } ),
- southArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * 0.25 ) - BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_nmw'
- } ),
- southArrowNorth: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
- name: 'arrow_n'
- } ),
- southArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * 0.75 ) + BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_nme'
- } ),
- southArrowNorthEast: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.left + targetRect.width / 2 - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_ne'
- } ),
- // ------- South east
- southEastArrowNorthWest: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.right - BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_nw'
- } ),
- southEastArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.right - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_nmw'
- } ),
- southEastArrowNorth: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.right - balloonRect.width / 2,
- name: 'arrow_n'
- } ),
- southEastArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.right - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_nme'
- } ),
- southEastArrowNorthEast: ( targetRect, balloonRect ) => ( {
- top: getSouthTop( targetRect, balloonRect ),
- left: targetRect.right - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
- name: 'arrow_ne'
- } )
- };
- // Returns the top coordinate for positions starting with `north*`.
- //
- // @private
- // @param {utils/dom/rect~Rect} targetRect A rect of the target.
- // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
- // @returns {Number}
- function getNorthTop( targetRect, balloonRect ) {
- return targetRect.top - balloonRect.height - BalloonPanelView.arrowVerticalOffset;
- }
- // Returns the top coordinate for positions starting with `south*`.
- //
- // @private
- // @param {utils/dom/rect~Rect} targetRect A rect of the target.
- // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
- // @returns {Number}
- function getSouthTop( targetRect ) {
- return targetRect.bottom + BalloonPanelView.arrowVerticalOffset;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js ***!
- \************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContextualBalloon; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _balloonpanelview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
- /* harmony import */ var _theme_icons_previous_arrow_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../theme/icons/previous-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg");
- /* harmony import */ var _theme_icons_next_arrow_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../theme/icons/next-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg");
- /* harmony import */ var _theme_components_panel_balloonrotator_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../theme/components/panel/balloonrotator.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css");
- /* harmony import */ var _theme_components_panel_balloonrotator_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_theme_components_panel_balloonrotator_css__WEBPACK_IMPORTED_MODULE_10__);
- /* harmony import */ var _theme_components_panel_fakepanel_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../theme/components/panel/fakepanel.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css");
- /* harmony import */ var _theme_components_panel_fakepanel_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_theme_components_panel_fakepanel_css__WEBPACK_IMPORTED_MODULE_11__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/panel/balloon/contextualballoon
- */
- const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_6__["default"])( 'px' );
- /**
- * Provides the common contextual balloon for the editor.
- *
- * The role of this plugin is to unify the contextual balloons logic, simplify views management and help
- * avoid the unnecessary complexity of handling multiple {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
- * instances in the editor.
- *
- * This plugin allows for creating single or multiple panel stacks.
- *
- * Each stack may have multiple views, with the one on the top being visible. When the visible view is removed from the stack,
- * the previous view becomes visible.
- *
- * It might be useful to implement nested navigation in a balloon. For instance, a toolbar view may contain a link button.
- * When you click it, a link view (which lets you set the URL) is created and put on top of the toolbar view, so the link panel
- * is displayed. When you finish editing the link and close (remove) the link view, the toolbar view is visible again.
- *
- * However, there are cases when there are multiple independent balloons to be displayed, for instance, if the selection
- * is inside two inline comments at the same time. For such cases, you can create two independent panel stacks.
- * The contextual balloon plugin will create a navigation bar to let the users switch between these panel stacks using the "Next"
- * and "Previous" buttons.
- *
- * If there are no views in the current stack, the balloon panel will try to switch to the next stack. If there are no
- * panels in any stack, the balloon panel will be hidden.
- *
- * **Note**: To force the balloon panel to show only one view, even if there are other stacks, use the `singleViewMode=true` option
- * when {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon#add adding} a view to a panel.
- *
- * From the implementation point of view, the contextual ballon plugin is reusing a single
- * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} instance to display multiple contextual balloon
- * panels in the editor. It also creates a special {@link module:ui/panel/balloon/contextualballoon~RotatorView rotator view},
- * used to manage multiple panel stacks. Rotator view is a child of the balloon panel view and the parent of the specific
- * view you want to display. If there is more than one panel stack to be displayed, the rotator view will add a
- * navigation bar. If there is only one stack, the rotator view is transparent (it does not add any UI elements).
- *
- * @extends module:core/plugin~Plugin
- */
- class ContextualBalloon extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'ContextualBalloon';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- /**
- * The {@link module:utils/dom/position~Options#limiter position limiter}
- * for the {@link #view balloon}, used when no `limiter` has been passed into {@link #add}
- * or {@link #updatePosition}.
- *
- * By default, a function that obtains the farthest DOM
- * {@link module:engine/view/rooteditableelement~RootEditableElement}
- * of the {@link module:engine/view/document~Document#selection}.
- *
- * @member {module:utils/dom/position~Options#limiter} #positionLimiter
- */
- this.positionLimiter = () => {
- const view = this.editor.editing.view;
- const viewDocument = view.document;
- const editableElement = viewDocument.selection.editableElement;
- if ( editableElement ) {
- return view.domConverter.mapViewToDom( editableElement.root );
- }
- return null;
- };
- /**
- * The currently visible view or `null` when there are no views in any stack.
- *
- * @readonly
- * @observable
- * @member {module:ui/view~View|null} #visibleView
- */
- this.set( 'visibleView', null );
- /**
- * The common balloon panel view.
- *
- * @readonly
- * @member {module:ui/panel/balloon/balloonpanelview~BalloonPanelView} #view
- */
- this.view = new _balloonpanelview__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.locale );
- editor.ui.view.body.add( this.view );
- editor.ui.focusTracker.add( this.view.element );
- /**
- * The map of views and their stacks.
- *
- * @private
- * @type {Map.<module:ui/view~View,Set>}
- */
- this._viewToStack = new Map();
- /**
- * The map of IDs and stacks.
- *
- * @private
- * @type {Map.<String,Set>}
- */
- this._idToStack = new Map();
- /**
- * A total number of all stacks in the balloon.
- *
- * @private
- * @readonly
- * @observable
- * @member {Number} #_numberOfStacks
- */
- this.set( '_numberOfStacks', 0 );
- /**
- * A flag that controls the single view mode.
- *
- * @private
- * @readonly
- * @observable
- * @member {Boolean} #_singleViewMode
- */
- this.set( '_singleViewMode', false );
- /**
- * Rotator view embedded in the contextual balloon.
- * Displays the currently visible view in the balloon and provides navigation for switching stacks.
- *
- * @private
- * @type {module:ui/panel/balloon/contextualballoon~RotatorView}
- */
- this._rotatorView = this._createRotatorView();
- /**
- * Displays fake panels under the balloon panel view when multiple stacks are added to the balloon.
- *
- * @private
- * @type {module:ui/view~View}
- */
- this._fakePanelsView = this._createFakePanelsView();
- }
- /**
- * Returns `true` when the given view is in one of the stacks. Otherwise returns `false`.
- *
- * @param {module:ui/view~View} view
- * @returns {Boolean}
- */
- hasView( view ) {
- return Array.from( this._viewToStack.keys() ).includes( view );
- }
- /**
- * Adds a new view to the stack and makes it visible if the current stack is visible
- * or it is the first view in the balloon.
- *
- * @param {Object} data The configuration of the view.
- * @param {String} [data.stackId='main'] The ID of the stack that the view is added to.
- * @param {module:ui/view~View} [data.view] The content of the balloon.
- * @param {module:utils/dom/position~Options} [data.position] Positioning options.
- * @param {String} [data.balloonClassName] An additional CSS class added to the {@link #view balloon} when visible.
- * @param {Boolean} [data.withArrow=true] Whether the {@link #view balloon} should be rendered with an arrow.
- * @param {Boolean} [data.singleViewMode=false] Whether the view should be the only visible view even if other stacks were added.
- */
- add( data ) {
- if ( this.hasView( data.view ) ) {
- /**
- * Trying to add configuration of the same view more than once.
- *
- * @error contextualballoon-add-view-exist
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
- 'contextualballoon-add-view-exist',
- [ this, data ]
- );
- }
- const stackId = data.stackId || 'main';
- // If new stack is added, creates it and show view from this stack.
- if ( !this._idToStack.has( stackId ) ) {
- this._idToStack.set( stackId, new Map( [ [ data.view, data ] ] ) );
- this._viewToStack.set( data.view, this._idToStack.get( stackId ) );
- this._numberOfStacks = this._idToStack.size;
- if ( !this._visibleStack || data.singleViewMode ) {
- this.showStack( stackId );
- }
- return;
- }
- const stack = this._idToStack.get( stackId );
- if ( data.singleViewMode ) {
- this.showStack( stackId );
- }
- // Add new view to the stack.
- stack.set( data.view, data );
- this._viewToStack.set( data.view, stack );
- // And display it if is added to the currently visible stack.
- if ( stack === this._visibleStack ) {
- this._showView( data );
- }
- }
- /**
- * Removes the given view from the stack. If the removed view was visible,
- * the view preceding it in the stack will become visible instead.
- * When there is no view in the stack, the next stack will be displayed.
- * When there are no more stacks, the balloon will hide.
- *
- * @param {module:ui/view~View} view A view to be removed from the balloon.
- */
- remove( view ) {
- if ( !this.hasView( view ) ) {
- /**
- * Trying to remove the configuration of the view not defined in the stack.
- *
- * @error contextualballoon-remove-view-not-exist
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
- 'contextualballoon-remove-view-not-exist',
- [ this, view ]
- );
- }
- const stack = this._viewToStack.get( view );
- if ( this._singleViewMode && this.visibleView === view ) {
- this._singleViewMode = false;
- }
- // When visible view will be removed we need to show a preceding view or next stack
- // if a view is the only view in the stack.
- if ( this.visibleView === view ) {
- if ( stack.size === 1 ) {
- if ( this._idToStack.size > 1 ) {
- this._showNextStack();
- } else {
- this.view.hide();
- this.visibleView = null;
- this._rotatorView.hideView();
- }
- } else {
- this._showView( Array.from( stack.values() )[ stack.size - 2 ] );
- }
- }
- if ( stack.size === 1 ) {
- this._idToStack.delete( this._getStackId( stack ) );
- this._numberOfStacks = this._idToStack.size;
- } else {
- stack.delete( view );
- }
- this._viewToStack.delete( view );
- }
- /**
- * Updates the position of the balloon using the position data of the first visible view in the stack.
- * When new position data is given, the position data of the currently visible view will be updated.
- *
- * @param {module:utils/dom/position~Options} [position] position options.
- */
- updatePosition( position ) {
- if ( position ) {
- this._visibleStack.get( this.visibleView ).position = position;
- }
- this.view.pin( this._getBalloonPosition() );
- this._fakePanelsView.updatePosition();
- }
- /**
- * Shows the last view from the stack of a given ID.
- *
- * @param {String} id
- */
- showStack( id ) {
- this.visibleStack = id;
- const stack = this._idToStack.get( id );
- if ( !stack ) {
- /**
- * Trying to show a stack that does not exist.
- *
- * @error contextualballoon-showstack-stack-not-exist
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
- 'contextualballoon-showstack-stack-not-exist',
- this
- );
- }
- if ( this._visibleStack === stack ) {
- return;
- }
- this._showView( Array.from( stack.values() ).pop() );
- }
- /**
- * Returns the stack of the currently visible view.
- *
- * @private
- * @type {Set}
- */
- get _visibleStack() {
- return this._viewToStack.get( this.visibleView );
- }
- /**
- * Returns the ID of the given stack.
- *
- * @private
- * @param {Set} stack
- * @returns {String}
- */
- _getStackId( stack ) {
- const entry = Array.from( this._idToStack.entries() ).find( entry => entry[ 1 ] === stack );
- return entry[ 0 ];
- }
- /**
- * Shows the last view from the next stack.
- *
- * @private
- */
- _showNextStack() {
- const stacks = Array.from( this._idToStack.values() );
- let nextIndex = stacks.indexOf( this._visibleStack ) + 1;
- if ( !stacks[ nextIndex ] ) {
- nextIndex = 0;
- }
- this.showStack( this._getStackId( stacks[ nextIndex ] ) );
- }
- /**
- * Shows the last view from the previous stack.
- *
- * @private
- */
- _showPrevStack() {
- const stacks = Array.from( this._idToStack.values() );
- let nextIndex = stacks.indexOf( this._visibleStack ) - 1;
- if ( !stacks[ nextIndex ] ) {
- nextIndex = stacks.length - 1;
- }
- this.showStack( this._getStackId( stacks[ nextIndex ] ) );
- }
- /**
- * Creates a rotator view.
- *
- * @private
- * @returns {module:ui/panel/balloon/contextualballoon~RotatorView}
- */
- _createRotatorView() {
- const view = new RotatorView( this.editor.locale );
- const t = this.editor.locale.t;
- this.view.content.add( view );
- // Hide navigation when there is only a one stack & not in single view mode.
- view.bind( 'isNavigationVisible' ).to( this, '_numberOfStacks', this, '_singleViewMode', ( value, isSingleViewMode ) => {
- return !isSingleViewMode && value > 1;
- } );
- // Update balloon position after toggling navigation.
- view.on( 'change:isNavigationVisible', () => ( this.updatePosition() ), { priority: 'low' } );
- // Update stacks counter value.
- view.bind( 'counter' ).to( this, 'visibleView', this, '_numberOfStacks', ( visibleView, numberOfStacks ) => {
- if ( numberOfStacks < 2 ) {
- return '';
- }
- const current = Array.from( this._idToStack.values() ).indexOf( this._visibleStack ) + 1;
- return t( '%0 of %1', [ current, numberOfStacks ] );
- } );
- view.buttonNextView.on( 'execute', () => {
- // When current view has a focus then move focus to the editable before removing it,
- // otherwise editor will lost focus.
- if ( view.focusTracker.isFocused ) {
- this.editor.editing.view.focus();
- }
- this._showNextStack();
- } );
- view.buttonPrevView.on( 'execute', () => {
- // When current view has a focus then move focus to the editable before removing it,
- // otherwise editor will lost focus.
- if ( view.focusTracker.isFocused ) {
- this.editor.editing.view.focus();
- }
- this._showPrevStack();
- } );
- return view;
- }
- /**
- * @private
- * @returns {module:ui/view~View}
- */
- _createFakePanelsView() {
- const view = new FakePanelsView( this.editor.locale, this.view );
- view.bind( 'numberOfPanels' ).to( this, '_numberOfStacks', this, '_singleViewMode', ( number, isSingleViewMode ) => {
- const showPanels = !isSingleViewMode && number >= 2;
- return showPanels ? Math.min( number - 1, 2 ) : 0;
- } );
- view.listenTo( this.view, 'change:top', () => view.updatePosition() );
- view.listenTo( this.view, 'change:left', () => view.updatePosition() );
- this.editor.ui.view.body.add( view );
- return view;
- }
- /**
- * Sets the view as the content of the balloon and attaches the balloon using position
- * options of the first view.
- *
- * @private
- * @param {Object} data Configuration.
- * @param {module:ui/view~View} [data.view] The view to show in the balloon.
- * @param {String} [data.balloonClassName=''] Additional class name which will be added to the {@link #view balloon}.
- * @param {Boolean} [data.withArrow=true] Whether the {@link #view balloon} should be rendered with an arrow.
- */
- _showView( { view, balloonClassName = '', withArrow = true, singleViewMode = false } ) {
- this.view.class = balloonClassName;
- this.view.withArrow = withArrow;
- this._rotatorView.showView( view );
- this.visibleView = view;
- this.view.pin( this._getBalloonPosition() );
- this._fakePanelsView.updatePosition();
- if ( singleViewMode ) {
- this._singleViewMode = true;
- }
- }
- /**
- * Returns position options of the last view in the stack.
- * This keeps the balloon in the same position when the view is changed.
- *
- * @private
- * @returns {module:utils/dom/position~Options}
- */
- _getBalloonPosition() {
- let position = Array.from( this._visibleStack.values() ).pop().position;
- // Use the default limiter if none has been specified.
- if ( position && !position.limiter ) {
- // Don't modify the original options object.
- position = Object.assign( {}, position, {
- limiter: this.positionLimiter
- } );
- }
- return position;
- }
- }
- /**
- * Rotator view is a helper class for the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon}.
- * It is used for displaying the last view from the current stack and providing navigation buttons for switching stacks.
- * See the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon} documentation to learn more.
- *
- * @extends module:ui/view~View
- */
- class RotatorView extends _view__WEBPACK_IMPORTED_MODULE_2__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- const t = locale.t;
- const bind = this.bindTemplate;
- /**
- * Defines whether navigation is visible or not.
- *
- * @member {Boolean} #isNavigationVisible
- */
- this.set( 'isNavigationVisible', true );
- /**
- * Used for checking if a view is focused or not.
- *
- * @type {module:utils/focustracker~FocusTracker}
- */
- this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_5__["default"]();
- /**
- * Navigation button for switching the stack to the previous one.
- *
- * @type {module:ui/button/buttonview~ButtonView}
- */
- this.buttonPrevView = this._createButtonView( t( 'Previous' ), _theme_icons_previous_arrow_svg__WEBPACK_IMPORTED_MODULE_8__["default"] );
- /**
- * Navigation button for switching the stack to the next one.
- *
- * @type {module:ui/button/buttonview~ButtonView}
- */
- this.buttonNextView = this._createButtonView( t( 'Next' ), _theme_icons_next_arrow_svg__WEBPACK_IMPORTED_MODULE_9__["default"] );
- /**
- * A collection of the child views that creates the rotator content.
- *
- * @readonly
- * @type {module:ui/viewcollection~ViewCollection}
- */
- this.content = this.createCollection();
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-balloon-rotator'
- ],
- 'z-index': '-1'
- },
- children: [
- {
- tag: 'div',
- attributes: {
- class: [
- 'ck-balloon-rotator__navigation',
- bind.to( 'isNavigationVisible', value => value ? '' : 'ck-hidden' )
- ]
- },
- children: [
- this.buttonPrevView,
- {
- tag: 'span',
- attributes: {
- class: [
- 'ck-balloon-rotator__counter'
- ]
- },
- children: [
- {
- text: bind.to( 'counter' )
- }
- ]
- },
- this.buttonNextView
- ]
- },
- {
- tag: 'div',
- attributes: {
- class: 'ck-balloon-rotator__content'
- },
- children: this.content
- }
- ]
- } );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- this.focusTracker.add( this.element );
- }
- /**
- * Shows a given view.
- *
- * @param {module:ui/view~View} view The view to show.
- */
- showView( view ) {
- this.hideView();
- this.content.add( view );
- }
- /**
- * Hides the currently displayed view.
- */
- hideView() {
- this.content.clear();
- }
- /**
- * Creates a navigation button view.
- *
- * @private
- * @param {String} label The button label.
- * @param {String} icon The button icon.
- * @returns {module:ui/button/buttonview~ButtonView}
- */
- _createButtonView( label, icon ) {
- const view = new _button_buttonview__WEBPACK_IMPORTED_MODULE_3__["default"]( this.locale );
- view.set( {
- label,
- icon,
- tooltip: true
- } );
- return view;
- }
- }
- // Displays additional layers under the balloon when multiple stacks are added to the balloon.
- //
- // @private
- // @extends module:ui/view~View
- class FakePanelsView extends _view__WEBPACK_IMPORTED_MODULE_2__["default"] {
- // @inheritDoc
- constructor( locale, balloonPanelView ) {
- super( locale );
- const bind = this.bindTemplate;
- // Fake panels top offset.
- //
- // @observable
- // @member {Number} #top
- this.set( 'top', 0 );
- // Fake panels left offset.
- //
- // @observable
- // @member {Number} #left
- this.set( 'left', 0 );
- // Fake panels height.
- //
- // @observable
- // @member {Number} #height
- this.set( 'height', 0 );
- // Fake panels width.
- //
- // @observable
- // @member {Number} #width
- this.set( 'width', 0 );
- // Number of rendered fake panels.
- //
- // @observable
- // @member {Number} #numberOfPanels
- this.set( 'numberOfPanels', 0 );
- // Collection of the child views which creates fake panel content.
- //
- // @readonly
- // @type {module:ui/viewcollection~ViewCollection}
- this.content = this.createCollection();
- // Context.
- //
- // @private
- // @type {module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
- this._balloonPanelView = balloonPanelView;
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck-fake-panel',
- bind.to( 'numberOfPanels', number => number ? '' : 'ck-hidden' )
- ],
- style: {
- top: bind.to( 'top', toPx ),
- left: bind.to( 'left', toPx ),
- width: bind.to( 'width', toPx ),
- height: bind.to( 'height', toPx )
- }
- },
- children: this.content
- } );
- this.on( 'change:numberOfPanels', ( evt, name, next, prev ) => {
- if ( next > prev ) {
- this._addPanels( next - prev );
- } else {
- this._removePanels( prev - next );
- }
- this.updatePosition();
- } );
- }
- // @private
- // @param {Number} number
- _addPanels( number ) {
- while ( number-- ) {
- const view = new _view__WEBPACK_IMPORTED_MODULE_2__["default"]();
- view.setTemplate( { tag: 'div' } );
- this.content.add( view );
- this.registerChild( view );
- }
- }
- // @private
- // @param {Number} number
- _removePanels( number ) {
- while ( number-- ) {
- const view = this.content.last;
- this.content.remove( view );
- this.deregisterChild( view );
- view.destroy();
- }
- }
- // Updates coordinates of fake panels.
- updatePosition() {
- if ( this.numberOfPanels ) {
- const { top, left } = this._balloonPanelView;
- const { width, height } = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__["default"]( this._balloonPanelView.element );
- Object.assign( this, { top, left, width, height } );
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StickyPanelView; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
- /* harmony import */ var _theme_components_panel_stickypanel_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../theme/components/panel/stickypanel.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css");
- /* harmony import */ var _theme_components_panel_stickypanel_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_components_panel_stickypanel_css__WEBPACK_IMPORTED_MODULE_4__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/panel/sticky/stickypanelview
- */
- const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__["default"])( 'px' );
- /**
- * The sticky panel view class.
- */
- class StickyPanelView extends _view__WEBPACK_IMPORTED_MODULE_1__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- const bind = this.bindTemplate;
- /**
- * Controls whether the sticky panel should be active.
- *
- * @readonly
- * @observable
- * @member {Boolean} #isActive
- */
- this.set( 'isActive', false );
- /**
- * Controls whether the sticky panel is in the "sticky" state.
- *
- * @readonly
- * @observable
- * @member {Boolean} #isSticky
- */
- this.set( 'isSticky', false );
- /**
- * The limiter element for the sticky panel instance. Its bounding rect limits
- * the "stickyness" of the panel, i.e. when the panel reaches the bottom
- * edge of the limiter, it becomes sticky to that edge and does not float
- * off the limiter. It is mandatory for the panel to work properly and once
- * set, it cannot be changed.
- *
- * @readonly
- * @observable
- * @member {HTMLElement} #limiterElement
- */
- this.set( 'limiterElement', null );
- /**
- * The offset from the bottom edge of {@link #limiterElement}
- * which stops the panel from stickying any further to prevent limiter's content
- * from being completely covered.
- *
- * @readonly
- * @observable
- * @default 50
- * @member {Number} #limiterBottomOffset
- */
- this.set( 'limiterBottomOffset', 50 );
- /**
- * The offset from the top edge of the web browser's viewport which makes the
- * panel become sticky. The default value is `0`, which means the panel becomes
- * sticky when it's upper edge touches the top of the page viewport.
- *
- * This attribute is useful when the web page has UI elements positioned to the top
- * either using `position: fixed` or `position: sticky`, which would cover the
- * sticky panel or vice–versa (depending on the `z-index` hierarchy).
- *
- * @readonly
- * @observable
- * @default 0
- * @member {Number} #viewportTopOffset
- */
- this.set( 'viewportTopOffset', 0 );
- /**
- * Controls the `margin-left` CSS style of the panel.
- *
- * @protected
- * @readonly
- * @observable
- * @member {String} #_marginLeft
- */
- this.set( '_marginLeft', null );
- /**
- * Set `true` if the sticky panel reached the bottom edge of the
- * {@link #limiterElement}.
- *
- * @protected
- * @readonly
- * @observable
- * @member {Boolean} #_isStickyToTheLimiter
- */
- this.set( '_isStickyToTheLimiter', false );
- /**
- * Set `true` if the sticky panel uses the {@link #viewportTopOffset},
- * i.e. not {@link #_isStickyToTheLimiter} and the {@link #viewportTopOffset}
- * is not `0`.
- *
- * @protected
- * @readonly
- * @observable
- * @member {Boolean} #_hasViewportTopOffset
- */
- this.set( '_hasViewportTopOffset', false );
- /**
- * Collection of the child views which creates balloon panel contents.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.content = this.createCollection();
- /**
- * The DOM bounding client rect of the {@link module:ui/view~View#element} of the panel.
- *
- * @protected
- * @member {Object} #_panelRect
- */
- /**
- * The DOM bounding client rect of the {@link #limiterElement}
- * of the panel.
- *
- * @protected
- * @member {Object} #_limiterRect
- */
- /**
- * A dummy element which visually fills the space as long as the
- * actual panel is sticky. It prevents flickering of the UI.
- *
- * @protected
- * @property {HTMLElement}
- */
- this._contentPanelPlaceholder = new _template__WEBPACK_IMPORTED_MODULE_2__["default"]( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-sticky-panel__placeholder'
- ],
- style: {
- display: bind.to( 'isSticky', isSticky => isSticky ? 'block' : 'none' ),
- height: bind.to( 'isSticky', isSticky => {
- return isSticky ? toPx( this._panelRect.height ) : null;
- } )
- }
- }
- } ).render();
- /**
- * The panel which accepts children into {@link #content} collection.
- * Also an element which is positioned when {@link #isSticky}.
- *
- * @protected
- * @property {HTMLElement}
- */
- this._contentPanel = new _template__WEBPACK_IMPORTED_MODULE_2__["default"]( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-sticky-panel__content',
- // Toggle class of the panel when "sticky" state changes in the view.
- bind.if( 'isSticky', 'ck-sticky-panel__content_sticky' ),
- bind.if( '_isStickyToTheLimiter', 'ck-sticky-panel__content_sticky_bottom-limit' )
- ],
- style: {
- width: bind.to( 'isSticky', isSticky => {
- return isSticky ? toPx( this._contentPanelPlaceholder.getBoundingClientRect().width ) : null;
- } ),
- top: bind.to( '_hasViewportTopOffset', _hasViewportTopOffset => {
- return _hasViewportTopOffset ? toPx( this.viewportTopOffset ) : null;
- } ),
- bottom: bind.to( '_isStickyToTheLimiter', _isStickyToTheLimiter => {
- return _isStickyToTheLimiter ? toPx( this.limiterBottomOffset ) : null;
- } ),
- marginLeft: bind.to( '_marginLeft' )
- }
- },
- children: this.content
- } ).render();
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-sticky-panel'
- ]
- },
- children: [
- this._contentPanelPlaceholder,
- this._contentPanel
- ]
- } );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- // Check if the panel should go into the sticky state immediately.
- this._checkIfShouldBeSticky();
- // Update sticky state of the panel as the window is being scrolled.
- this.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__["default"].window, 'scroll', () => {
- this._checkIfShouldBeSticky();
- } );
- // Synchronize with `model.isActive` because sticking an inactive panel is pointless.
- this.listenTo( this, 'change:isActive', () => {
- this._checkIfShouldBeSticky();
- } );
- }
- /**
- * Analyzes the environment to decide whether the panel should
- * be sticky or not.
- *
- * @protected
- */
- _checkIfShouldBeSticky() {
- const panelRect = this._panelRect = this._contentPanel.getBoundingClientRect();
- let limiterRect;
- if ( !this.limiterElement ) {
- this.isSticky = false;
- } else {
- limiterRect = this._limiterRect = this.limiterElement.getBoundingClientRect();
- // The panel must be active to become sticky.
- this.isSticky = this.isActive &&
- // The limiter's top edge must be beyond the upper edge of the visible viewport (+the viewportTopOffset).
- limiterRect.top < this.viewportTopOffset &&
- // The model#limiterElement's height mustn't be smaller than the panel's height and model#limiterBottomOffset.
- // There's no point in entering the sticky mode if the model#limiterElement is very, very small, because
- // it would immediately set model#_isStickyToTheLimiter true and, given model#limiterBottomOffset, the panel
- // would be positioned before the model#limiterElement.
- this._panelRect.height + this.limiterBottomOffset < limiterRect.height;
- }
- // Stick the panel to the top edge of the viewport simulating CSS position:sticky.
- // TODO: Possibly replaced by CSS in the future http://caniuse.com/#feat=css-sticky
- if ( this.isSticky ) {
- this._isStickyToTheLimiter =
- limiterRect.bottom < panelRect.height + this.limiterBottomOffset + this.viewportTopOffset;
- this._hasViewportTopOffset = !this._isStickyToTheLimiter && !!this.viewportTopOffset;
- this._marginLeft = this._isStickyToTheLimiter ? null : toPx( -_ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__["default"].window.scrollX );
- }
- // Detach the panel from the top edge of the viewport.
- else {
- this._isStickyToTheLimiter = false;
- this._hasViewportTopOffset = false;
- this._marginLeft = null;
- }
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/template.js ***!
- \*************************************************************/
- /*! exports provided: default, TemplateBinding, TemplateToBinding, TemplateIfBinding */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Template; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateBinding", function() { return TemplateBinding; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateToBinding", function() { return TemplateToBinding; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateIfBinding", function() { return TemplateIfBinding; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/isnode */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/template
- */
- /* global document */
- const xhtmlNs = 'http://www.w3.org/1999/xhtml';
- /**
- * A basic Template class. It renders a DOM HTML element or text from a
- * {@link module:ui/template~TemplateDefinition definition} and supports element attributes, children,
- * bindings to {@link module:utils/observablemixin~Observable observables} and DOM event propagation.
- *
- * A simple template can look like this:
- *
- * const bind = Template.bind( observable, emitter );
- *
- * new Template( {
- * tag: 'p',
- * attributes: {
- * class: 'foo',
- * style: {
- * backgroundColor: 'yellow'
- * }
- * },
- * on: {
- * click: bind.to( 'clicked' )
- * },
- * children: [
- * 'A paragraph.'
- * ]
- * } ).render();
- *
- * and it will render the following HTML element:
- *
- * <p class="foo" style="background-color: yellow;">A paragraph.</p>
- *
- * Additionally, the `observable` will always fire `clicked` upon clicking `<p>` in the DOM.
- *
- * See {@link module:ui/template~TemplateDefinition} to know more about templates and complex
- * template definitions.
- *
- * @mixes module:utils/emittermixin~EmitterMixin
- */
- class Template {
- /**
- * Creates an instance of the {@link ~Template} class.
- *
- * @param {module:ui/template~TemplateDefinition} def The definition of the template.
- */
- constructor( def ) {
- Object.assign( this, normalize( clone( def ) ) );
- /**
- * Indicates whether this particular Template instance has been
- * {@link #render rendered}.
- *
- * @readonly
- * @protected
- * @member {Boolean}
- */
- this._isRendered = false;
- /**
- * The tag (`tagName`) of this template, e.g. `div`. It also indicates that the template
- * renders to an HTML element.
- *
- * @member {String} #tag
- */
- /**
- * The text of the template. It also indicates that the template renders to a DOM text node.
- *
- * @member {Array.<String|module:ui/template~TemplateValueSchema>} #text
- */
- /**
- * The attributes of the template, e.g. `{ id: [ 'ck-id' ] }`, corresponding with
- * the attributes of an HTML element.
- *
- * **Note**: This property only makes sense when {@link #tag} is defined.
- *
- * @member {Object} #attributes
- */
- /**
- * The children of the template. They can be either:
- * * independent instances of {@link ~Template} (sub–templates),
- * * native DOM Nodes.
- *
- * **Note**: This property only makes sense when {@link #tag} is defined.
- *
- * @member {Array.<module:ui/template~Template|Node>} #children
- */
- /**
- * The DOM event listeners of the template.
- *
- * @member {Object} #eventListeners
- */
- /**
- * The data used by the {@link #revert} method to restore a node to its original state.
- *
- * See: {@link #apply}.
- *
- * @readonly
- * @protected
- * @member {module:ui/template~RenderData}
- */
- this._revertData = null;
- }
- /**
- * Renders a DOM Node (an HTML element or text) out of the template.
- *
- * const domNode = new Template( { ... } ).render();
- *
- * See: {@link #apply}.
- *
- * @returns {HTMLElement|Text}
- */
- render() {
- const node = this._renderNode( {
- intoFragment: true
- } );
- this._isRendered = true;
- return node;
- }
- /**
- * Applies the template to an existing DOM Node, either HTML element or text.
- *
- * **Note:** No new DOM nodes will be created. Applying extends:
- *
- * {@link module:ui/template~TemplateDefinition attributes},
- * {@link module:ui/template~TemplateDefinition event listeners}, and
- * `textContent` of {@link module:ui/template~TemplateDefinition children} only.
- *
- * **Note:** Existing `class` and `style` attributes are extended when a template
- * is applied to an HTML element, while other attributes and `textContent` are overridden.
- *
- * **Note:** The process of applying a template can be easily reverted using the
- * {@link module:ui/template~Template#revert} method.
- *
- * const element = document.createElement( 'div' );
- * const observable = new Model( { divClass: 'my-div' } );
- * const emitter = Object.create( EmitterMixin );
- * const bind = Template.bind( observable, emitter );
- *
- * new Template( {
- * attributes: {
- * id: 'first-div',
- * class: bind.to( 'divClass' )
- * },
- * on: {
- * click: bind( 'elementClicked' ) // Will be fired by the observable.
- * },
- * children: [
- * 'Div text.'
- * ]
- * } ).apply( element );
- *
- * console.log( element.outerHTML ); // -> '<div id="first-div" class="my-div"></div>'
- *
- * @see module:ui/template~Template#render
- * @see module:ui/template~Template#revert
- * @param {Node} node Root node for the template to apply.
- */
- apply( node ) {
- this._revertData = getEmptyRevertData();
- this._renderNode( {
- node,
- isApplying: true,
- revertData: this._revertData
- } );
- return node;
- }
- /**
- * Reverts a template {@link module:ui/template~Template#apply applied} to a DOM node.
- *
- * @param {Node} node The root node for the template to revert. In most of the cases, it is the
- * same node used by {@link module:ui/template~Template#apply}.
- */
- revert( node ) {
- if ( !this._revertData ) {
- /**
- * Attempting to revert a template which has not been applied yet.
- *
- * @error ui-template-revert-not-applied
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'ui-template-revert-not-applied',
- [ this, node ]
- );
- }
- this._revertTemplateFromNode( node, this._revertData );
- }
- /**
- * Returns an iterator which traverses the template in search of {@link module:ui/view~View}
- * instances and returns them one by one.
- *
- * const viewFoo = new View();
- * const viewBar = new View();
- * const viewBaz = new View();
- * const template = new Template( {
- * tag: 'div',
- * children: [
- * viewFoo,
- * {
- * tag: 'div',
- * children: [
- * viewBar
- * ]
- * },
- * viewBaz
- * ]
- * } );
- *
- * // Logs: viewFoo, viewBar, viewBaz
- * for ( const view of template.getViews() ) {
- * console.log( view );
- * }
- *
- * @returns {Iterable.<module:ui/view~View>}
- */
- * getViews() {
- function* search( def ) {
- if ( def.children ) {
- for ( const child of def.children ) {
- if ( isView( child ) ) {
- yield child;
- } else if ( isTemplate( child ) ) {
- yield* search( child );
- }
- }
- }
- }
- yield* search( this );
- }
- /**
- * An entry point to the interface which binds DOM nodes to
- * {@link module:utils/observablemixin~Observable observables}.
- * There are two types of bindings:
- *
- * * HTML element attributes or text `textContent` synchronized with attributes of an
- * {@link module:utils/observablemixin~Observable}. Learn more about {@link module:ui/template~BindChain#to}
- * and {@link module:ui/template~BindChain#if}.
- *
- * const bind = Template.bind( observable, emitter );
- *
- * new Template( {
- * attributes: {
- * // Binds the element "class" attribute to observable#classAttribute.
- * class: bind.to( 'classAttribute' )
- * }
- * } ).render();
- *
- * * DOM events fired on HTML element propagated through
- * {@link module:utils/observablemixin~Observable}. Learn more about {@link module:ui/template~BindChain#to}.
- *
- * const bind = Template.bind( observable, emitter );
- *
- * new Template( {
- * on: {
- * // Will be fired by the observable.
- * click: bind( 'elementClicked' )
- * }
- * } ).render();
- *
- * Also see {@link module:ui/view~View#bindTemplate}.
- *
- * @param {module:utils/observablemixin~Observable} observable An observable which provides boundable attributes.
- * @param {module:utils/emittermixin~Emitter} emitter An emitter that listens to observable attribute
- * changes or DOM Events (depending on the kind of the binding). Usually, a {@link module:ui/view~View} instance.
- * @returns {module:ui/template~BindChain}
- */
- static bind( observable, emitter ) {
- return {
- to( eventNameOrFunctionOrAttribute, callback ) {
- return new TemplateToBinding( {
- eventNameOrFunction: eventNameOrFunctionOrAttribute,
- attribute: eventNameOrFunctionOrAttribute,
- observable, emitter, callback
- } );
- },
- if( attribute, valueIfTrue, callback ) {
- return new TemplateIfBinding( {
- observable, emitter, attribute, valueIfTrue, callback
- } );
- }
- };
- }
- /**
- * Extends an existing {@link module:ui/template~Template} instance with some additional content
- * from another {@link module:ui/template~TemplateDefinition}.
- *
- * const bind = Template.bind( observable, emitter );
- *
- * const template = new Template( {
- * tag: 'p',
- * attributes: {
- * class: 'a',
- * data-x: bind.to( 'foo' )
- * },
- * children: [
- * {
- * tag: 'span',
- * attributes: {
- * class: 'b'
- * },
- * children: [
- * 'Span'
- * ]
- * }
- * ]
- * } );
- *
- * // Instance-level extension.
- * Template.extend( template, {
- * attributes: {
- * class: 'b',
- * data-x: bind.to( 'bar' )
- * },
- * children: [
- * {
- * attributes: {
- * class: 'c'
- * }
- * }
- * ]
- * } );
- *
- * // Child extension.
- * Template.extend( template.children[ 0 ], {
- * attributes: {
- * class: 'd'
- * }
- * } );
- *
- * the `outerHTML` of `template.render()` is:
- *
- * <p class="a b" data-x="{ observable.foo } { observable.bar }">
- * <span class="b c d">Span</span>
- * </p>
- *
- * @param {module:ui/template~Template} template An existing template instance to be extended.
- * @param {module:ui/template~TemplateDefinition} def Additional definition to be applied to a template.
- */
- static extend( template, def ) {
- if ( template._isRendered ) {
- /**
- * Extending a template after rendering may not work as expected. To make sure
- * the {@link module:ui/template~Template.extend extending} works for an element,
- * make sure it happens before {@link #render} is called.
- *
- * @error template-extend-render
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'template-extend-render',
- [ this, template ]
- );
- }
- extendTemplate( template, normalize( clone( def ) ) );
- }
- /**
- * Renders a DOM Node (either an HTML element or text) out of the template.
- *
- * @protected
- * @param {module:ui/template~RenderData} data Rendering data.
- */
- _renderNode( data ) {
- let isInvalid;
- if ( data.node ) {
- // When applying, a definition cannot have "tag" and "text" at the same time.
- isInvalid = this.tag && this.text;
- } else {
- // When rendering, a definition must have either "tag" or "text": XOR( this.tag, this.text ).
- isInvalid = this.tag ? this.text : !this.text;
- }
- if ( isInvalid ) {
- /**
- * Node definition cannot have the "tag" and "text" properties at the same time.
- * Node definition must have either "tag" or "text" when rendering a new Node.
- *
- * @error ui-template-wrong-syntax
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'ui-template-wrong-syntax',
- this
- );
- }
- if ( this.text ) {
- return this._renderText( data );
- } else {
- return this._renderElement( data );
- }
- }
- /**
- * Renders an HTML element out of the template.
- *
- * @protected
- * @param {module:ui/template~RenderData} data Rendering data.
- */
- _renderElement( data ) {
- let node = data.node;
- if ( !node ) {
- node = data.node = document.createElementNS( this.ns || xhtmlNs, this.tag );
- }
- this._renderAttributes( data );
- this._renderElementChildren( data );
- this._setUpListeners( data );
- return node;
- }
- /**
- * Renders a text node out of {@link module:ui/template~Template#text}.
- *
- * @protected
- * @param {module:ui/template~RenderData} data Rendering data.
- */
- _renderText( data ) {
- let node = data.node;
- // Save the original textContent to revert it in #revert().
- if ( node ) {
- data.revertData.text = node.textContent;
- } else {
- node = data.node = document.createTextNode( '' );
- }
- // Check if this Text Node is bound to Observable. Cases:
- //
- // text: [ Template.bind( ... ).to( ... ) ]
- //
- // text: [
- // 'foo',
- // Template.bind( ... ).to( ... ),
- // ...
- // ]
- //
- if ( hasTemplateBinding( this.text ) ) {
- this._bindToObservable( {
- schema: this.text,
- updater: getTextUpdater( node ),
- data
- } );
- }
- // Simply set text. Cases:
- //
- // text: [ 'all', 'are', 'static' ]
- //
- // text: [ 'foo' ]
- //
- else {
- node.textContent = this.text.join( '' );
- }
- return node;
- }
- /**
- * Renders HTML element attributes out of {@link module:ui/template~Template#attributes}.
- *
- * @protected
- * @param {module:ui/template~RenderData} data Rendering data.
- */
- _renderAttributes( data ) {
- let attrName, attrValue, domAttrValue, attrNs;
- if ( !this.attributes ) {
- return;
- }
- const node = data.node;
- const revertData = data.revertData;
- for ( attrName in this.attributes ) {
- // Current attribute value in DOM.
- domAttrValue = node.getAttribute( attrName );
- // The value to be set.
- attrValue = this.attributes[ attrName ];
- // Save revert data.
- if ( revertData ) {
- revertData.attributes[ attrName ] = domAttrValue;
- }
- // Detect custom namespace:
- //
- // class: {
- // ns: 'abc',
- // value: Template.bind( ... ).to( ... )
- // }
- //
- attrNs = ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["isObject"])( attrValue[ 0 ] ) && attrValue[ 0 ].ns ) ? attrValue[ 0 ].ns : null;
- // Activate binding if one is found. Cases:
- //
- // class: [
- // Template.bind( ... ).to( ... )
- // ]
- //
- // class: [
- // 'bar',
- // Template.bind( ... ).to( ... ),
- // 'baz'
- // ]
- //
- // class: {
- // ns: 'abc',
- // value: Template.bind( ... ).to( ... )
- // }
- //
- if ( hasTemplateBinding( attrValue ) ) {
- // Normalize attributes with additional data like namespace:
- //
- // class: {
- // ns: 'abc',
- // value: [ ... ]
- // }
- //
- const valueToBind = attrNs ? attrValue[ 0 ].value : attrValue;
- // Extend the original value of attributes like "style" and "class",
- // don't override them.
- if ( revertData && shouldExtend( attrName ) ) {
- valueToBind.unshift( domAttrValue );
- }
- this._bindToObservable( {
- schema: valueToBind,
- updater: getAttributeUpdater( node, attrName, attrNs ),
- data
- } );
- }
- // Style attribute could be an Object so it needs to be parsed in a specific way.
- //
- // style: {
- // width: '100px',
- // height: Template.bind( ... ).to( ... )
- // }
- //
- else if ( attrName == 'style' && typeof attrValue[ 0 ] !== 'string' ) {
- this._renderStyleAttribute( attrValue[ 0 ], data );
- }
- // Otherwise simply set the static attribute:
- //
- // class: [ 'foo' ]
- //
- // class: [ 'all', 'are', 'static' ]
- //
- // class: [
- // {
- // ns: 'abc',
- // value: [ 'foo' ]
- // }
- // ]
- //
- else {
- // Extend the original value of attributes like "style" and "class",
- // don't override them.
- if ( revertData && domAttrValue && shouldExtend( attrName ) ) {
- attrValue.unshift( domAttrValue );
- }
- attrValue = attrValue
- // Retrieve "values" from:
- //
- // class: [
- // {
- // ns: 'abc',
- // value: [ ... ]
- // }
- // ]
- //
- .map( val => val ? ( val.value || val ) : val )
- // Flatten the array.
- .reduce( ( prev, next ) => prev.concat( next ), [] )
- // Convert into string.
- .reduce( arrayValueReducer, '' );
- if ( !isFalsy( attrValue ) ) {
- node.setAttributeNS( attrNs, attrName, attrValue );
- }
- }
- }
- }
- /**
- * Renders the `style` attribute of an HTML element based on
- * {@link module:ui/template~Template#attributes}.
- *
- * A style attribute is an {Object} with static values:
- *
- * attributes: {
- * style: {
- * color: 'red'
- * }
- * }
- *
- * or values bound to {@link module:ui/model~Model} properties:
- *
- * attributes: {
- * style: {
- * color: bind.to( ... )
- * }
- * }
- *
- * Note: The `style` attribute is rendered without setting the namespace. It does not seem to be
- * needed.
- *
- * @private
- * @param {Object} styles Styles located in `attributes.style` of {@link module:ui/template~TemplateDefinition}.
- * @param {module:ui/template~RenderData} data Rendering data.
- */
- _renderStyleAttribute( styles, data ) {
- const node = data.node;
- for ( const styleName in styles ) {
- const styleValue = styles[ styleName ];
- // Cases:
- //
- // style: {
- // color: bind.to( 'attribute' )
- // }
- //
- if ( hasTemplateBinding( styleValue ) ) {
- this._bindToObservable( {
- schema: [ styleValue ],
- updater: getStyleUpdater( node, styleName ),
- data
- } );
- }
- // Cases:
- //
- // style: {
- // color: 'red'
- // }
- //
- else {
- node.style[ styleName ] = styleValue;
- }
- }
- }
- /**
- * Recursively renders HTML element's children from {@link module:ui/template~Template#children}.
- *
- * @protected
- * @param {module:ui/template~RenderData} data Rendering data.
- */
- _renderElementChildren( data ) {
- const node = data.node;
- const container = data.intoFragment ? document.createDocumentFragment() : node;
- const isApplying = data.isApplying;
- let childIndex = 0;
- for ( const child of this.children ) {
- if ( isViewCollection( child ) ) {
- if ( !isApplying ) {
- child.setParent( node );
- // Note: ViewCollection renders its children.
- for ( const view of child ) {
- container.appendChild( view.element );
- }
- }
- } else if ( isView( child ) ) {
- if ( !isApplying ) {
- if ( !child.isRendered ) {
- child.render();
- }
- container.appendChild( child.element );
- }
- } else if ( Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_5__["default"])( child ) ) {
- container.appendChild( child );
- } else {
- if ( isApplying ) {
- const revertData = data.revertData;
- const childRevertData = getEmptyRevertData();
- revertData.children.push( childRevertData );
- child._renderNode( {
- node: container.childNodes[ childIndex++ ],
- isApplying: true,
- revertData: childRevertData
- } );
- } else {
- container.appendChild( child.render() );
- }
- }
- }
- if ( data.intoFragment ) {
- node.appendChild( container );
- }
- }
- /**
- * Activates `on` event listeners from the {@link module:ui/template~TemplateDefinition}
- * on an HTML element.
- *
- * @protected
- * @param {module:ui/template~RenderData} data Rendering data.
- */
- _setUpListeners( data ) {
- if ( !this.eventListeners ) {
- return;
- }
- for ( const key in this.eventListeners ) {
- const revertBindings = this.eventListeners[ key ].map( schemaItem => {
- const [ domEvtName, domSelector ] = key.split( '@' );
- return schemaItem.activateDomEventListener( domEvtName, domSelector, data );
- } );
- if ( data.revertData ) {
- data.revertData.bindings.push( revertBindings );
- }
- }
- }
- /**
- * For a given {@link module:ui/template~TemplateValueSchema} containing {@link module:ui/template~TemplateBinding}
- * activates the binding and sets its initial value.
- *
- * Note: {@link module:ui/template~TemplateValueSchema} can be for HTML element attributes or
- * text node `textContent`.
- *
- * @protected
- * @param {Object} options Binding options.
- * @param {module:ui/template~TemplateValueSchema} options.schema
- * @param {Function} options.updater A function which updates the DOM (like attribute or text).
- * @param {module:ui/template~RenderData} options.data Rendering data.
- */
- _bindToObservable( { schema, updater, data } ) {
- const revertData = data.revertData;
- // Set initial values.
- syncValueSchemaValue( schema, updater, data );
- const revertBindings = schema
- // Filter "falsy" (false, undefined, null, '') value schema components out.
- .filter( item => !isFalsy( item ) )
- // Filter inactive bindings from schema, like static strings ('foo'), numbers (42), etc.
- .filter( item => item.observable )
- // Once only the actual binding are left, let the emitter listen to observable change:attribute event.
- // TODO: Reduce the number of listeners attached as many bindings may listen
- // to the same observable attribute.
- .map( templateBinding => templateBinding.activateAttributeListener( schema, updater, data ) );
- if ( revertData ) {
- revertData.bindings.push( revertBindings );
- }
- }
- /**
- * Reverts {@link module:ui/template~RenderData#revertData template data} from a node to
- * return it to the original state.
- *
- * @protected
- * @param {HTMLElement|Text} node A node to be reverted.
- * @param {Object} revertData An object that stores information about what changes have been made by
- * {@link #apply} to the node. See {@link module:ui/template~RenderData#revertData} for more information.
- */
- _revertTemplateFromNode( node, revertData ) {
- for ( const binding of revertData.bindings ) {
- // Each binding may consist of several observable+observable#attribute.
- // like the following has 2:
- //
- // class: [
- // 'x',
- // bind.to( 'foo' ),
- // 'y',
- // bind.to( 'bar' )
- // ]
- //
- for ( const revertBinding of binding ) {
- revertBinding();
- }
- }
- if ( revertData.text ) {
- node.textContent = revertData.text;
- return;
- }
- for ( const attrName in revertData.attributes ) {
- const attrValue = revertData.attributes[ attrName ];
- // When the attribute has **not** been set before #apply().
- if ( attrValue === null ) {
- node.removeAttribute( attrName );
- } else {
- node.setAttribute( attrName, attrValue );
- }
- }
- for ( let i = 0; i < revertData.children.length; ++i ) {
- this._revertTemplateFromNode( node.childNodes[ i ], revertData.children[ i ] );
- }
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Template, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
- /**
- * Describes a binding created by the {@link module:ui/template~Template.bind} interface.
- *
- * @protected
- */
- class TemplateBinding {
- /**
- * Creates an instance of the {@link module:ui/template~TemplateBinding} class.
- *
- * @param {module:ui/template~TemplateDefinition} def The definition of the binding.
- */
- constructor( def ) {
- Object.assign( this, def );
- /**
- * An observable instance of the binding. It either:
- *
- * * provides the attribute with the value,
- * * or passes the event when a corresponding DOM event is fired.
- *
- * @member {module:utils/observablemixin~ObservableMixin} module:ui/template~TemplateBinding#observable
- */
- /**
- * An {@link module:utils/emittermixin~Emitter} used by the binding to:
- *
- * * listen to the attribute change in the {@link module:ui/template~TemplateBinding#observable},
- * * or listen to the event in the DOM.
- *
- * @member {module:utils/emittermixin~EmitterMixin} module:ui/template~TemplateBinding#emitter
- */
- /**
- * The name of the {@link module:ui/template~TemplateBinding#observable observed attribute}.
- *
- * @member {String} module:ui/template~TemplateBinding#attribute
- */
- /**
- * A custom function to process the value of the {@link module:ui/template~TemplateBinding#attribute}.
- *
- * @member {Function} [module:ui/template~TemplateBinding#callback]
- */
- }
- /**
- * Returns the value of the binding. It is the value of the {@link module:ui/template~TemplateBinding#attribute} in
- * {@link module:ui/template~TemplateBinding#observable}. The value may be processed by the
- * {@link module:ui/template~TemplateBinding#callback}, if such has been passed to the binding.
- *
- * @param {Node} [node] A native DOM node, passed to the custom {@link module:ui/template~TemplateBinding#callback}.
- * @returns {*} The value of {@link module:ui/template~TemplateBinding#attribute} in
- * {@link module:ui/template~TemplateBinding#observable}.
- */
- getValue( node ) {
- const value = this.observable[ this.attribute ];
- return this.callback ? this.callback( value, node ) : value;
- }
- /**
- * Activates the listener which waits for changes of the {@link module:ui/template~TemplateBinding#attribute} in
- * {@link module:ui/template~TemplateBinding#observable}, then updates the DOM with the aggregated
- * value of {@link module:ui/template~TemplateValueSchema}.
- *
- * @param {module:ui/template~TemplateValueSchema} schema A full schema to generate an attribute or text in the DOM.
- * @param {Function} updater A DOM updater function used to update the native DOM attribute or text.
- * @param {module:ui/template~RenderData} data Rendering data.
- * @returns {Function} A function to sever the listener binding.
- */
- activateAttributeListener( schema, updater, data ) {
- const callback = () => syncValueSchemaValue( schema, updater, data );
- this.emitter.listenTo( this.observable, 'change:' + this.attribute, callback );
- // Allows revert of the listener.
- return () => {
- this.emitter.stopListening( this.observable, 'change:' + this.attribute, callback );
- };
- }
- }
- /**
- * Describes either:
- *
- * * a binding to an {@link module:utils/observablemixin~Observable},
- * * or a native DOM event binding.
- *
- * It is created by the {@link module:ui/template~BindChain#to} method.
- *
- * @protected
- */
- class TemplateToBinding extends TemplateBinding {
- /**
- * Activates the listener for the native DOM event, which when fired, is propagated by
- * the {@link module:ui/template~TemplateBinding#emitter}.
- *
- * @param {String} domEvtName The name of the native DOM event.
- * @param {String} domSelector The selector in the DOM to filter delegated events.
- * @param {module:ui/template~RenderData} data Rendering data.
- * @returns {Function} A function to sever the listener binding.
- */
- activateDomEventListener( domEvtName, domSelector, data ) {
- const callback = ( evt, domEvt ) => {
- if ( !domSelector || domEvt.target.matches( domSelector ) ) {
- if ( typeof this.eventNameOrFunction == 'function' ) {
- this.eventNameOrFunction( domEvt );
- } else {
- this.observable.fire( this.eventNameOrFunction, domEvt );
- }
- }
- };
- this.emitter.listenTo( data.node, domEvtName, callback );
- // Allows revert of the listener.
- return () => {
- this.emitter.stopListening( data.node, domEvtName, callback );
- };
- }
- }
- /**
- * Describes a binding to {@link module:utils/observablemixin~ObservableMixin} created by the {@link module:ui/template~BindChain#if}
- * method.
- *
- * @protected
- */
- class TemplateIfBinding extends TemplateBinding {
- /**
- * @inheritDoc
- */
- getValue( node ) {
- const value = super.getValue( node );
- return isFalsy( value ) ? false : ( this.valueIfTrue || true );
- }
- /**
- * The value of the DOM attribute or text to be set if the {@link module:ui/template~TemplateBinding#attribute} in
- * {@link module:ui/template~TemplateBinding#observable} is `true`.
- *
- * @member {String} [module:ui/template~TemplateIfBinding#valueIfTrue]
- */
- }
- // Checks whether given {@link module:ui/template~TemplateValueSchema} contains a
- // {@link module:ui/template~TemplateBinding}.
- //
- // @param {module:ui/template~TemplateValueSchema} schema
- // @returns {Boolean}
- function hasTemplateBinding( schema ) {
- if ( !schema ) {
- return false;
- }
- // Normalize attributes with additional data like namespace:
- //
- // class: {
- // ns: 'abc',
- // value: [ ... ]
- // }
- //
- if ( schema.value ) {
- schema = schema.value;
- }
- if ( Array.isArray( schema ) ) {
- return schema.some( hasTemplateBinding );
- } else if ( schema instanceof TemplateBinding ) {
- return true;
- }
- return false;
- }
- // Assembles the value using {@link module:ui/template~TemplateValueSchema} and stores it in a form of
- // an Array. Each entry of the Array corresponds to one of {@link module:ui/template~TemplateValueSchema}
- // items.
- //
- // @param {module:ui/template~TemplateValueSchema} schema
- // @param {Node} node DOM Node updated when {@link module:utils/observablemixin~ObservableMixin} changes.
- // @returns {Array}
- function getValueSchemaValue( schema, node ) {
- return schema.map( schemaItem => {
- // Process {@link module:ui/template~TemplateBinding} bindings.
- if ( schemaItem instanceof TemplateBinding ) {
- return schemaItem.getValue( node );
- }
- // All static values like strings, numbers, and "falsy" values (false, null, undefined, '', etc.) just pass.
- return schemaItem;
- } );
- }
- // A function executed each time the bound Observable attribute changes, which updates the DOM with a value
- // constructed from {@link module:ui/template~TemplateValueSchema}.
- //
- // @param {module:ui/template~TemplateValueSchema} schema
- // @param {Function} updater A function which updates the DOM (like attribute or text).
- // @param {Node} node DOM Node updated when {@link module:utils/observablemixin~ObservableMixin} changes.
- function syncValueSchemaValue( schema, updater, { node } ) {
- let value = getValueSchemaValue( schema, node );
- // Check if schema is a single Template.bind.if, like:
- //
- // class: Template.bind.if( 'foo' )
- //
- if ( schema.length == 1 && schema[ 0 ] instanceof TemplateIfBinding ) {
- value = value[ 0 ];
- } else {
- value = value.reduce( arrayValueReducer, '' );
- }
- if ( isFalsy( value ) ) {
- updater.remove();
- } else {
- updater.set( value );
- }
- }
- // Returns an object consisting of `set` and `remove` functions, which
- // can be used in the context of DOM Node to set or reset `textContent`.
- // @see module:ui/view~View#_bindToObservable
- //
- // @param {Node} node DOM Node to be modified.
- // @returns {Object}
- function getTextUpdater( node ) {
- return {
- set( value ) {
- node.textContent = value;
- },
- remove() {
- node.textContent = '';
- }
- };
- }
- // Returns an object consisting of `set` and `remove` functions, which
- // can be used in the context of DOM Node to set or reset an attribute.
- // @see module:ui/view~View#_bindToObservable
- //
- // @param {Node} node DOM Node to be modified.
- // @param {String} attrName Name of the attribute to be modified.
- // @param {String} [ns=null] Namespace to use.
- // @returns {Object}
- function getAttributeUpdater( el, attrName, ns ) {
- return {
- set( value ) {
- el.setAttributeNS( ns, attrName, value );
- },
- remove() {
- el.removeAttributeNS( ns, attrName );
- }
- };
- }
- // Returns an object consisting of `set` and `remove` functions, which
- // can be used in the context of CSSStyleDeclaration to set or remove a style.
- // @see module:ui/view~View#_bindToObservable
- //
- // @param {Node} node DOM Node to be modified.
- // @param {String} styleName Name of the style to be modified.
- // @returns {Object}
- function getStyleUpdater( el, styleName ) {
- return {
- set( value ) {
- el.style[ styleName ] = value;
- },
- remove() {
- el.style[ styleName ] = null;
- }
- };
- }
- // Clones definition of the template.
- //
- // @param {module:ui/template~TemplateDefinition} def
- // @returns {module:ui/template~TemplateDefinition}
- function clone( def ) {
- const clone = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeepWith"])( def, value => {
- // Don't clone the `Template.bind`* bindings because of the references to Observable
- // and DomEmitterMixin instances inside, which would also be traversed and cloned by greedy
- // cloneDeepWith algorithm. There's no point in cloning Observable/DomEmitterMixins
- // along with the definition.
- //
- // Don't clone Template instances if provided as a child. They're simply #render()ed
- // and nothing should interfere.
- //
- // Also don't clone View instances if provided as a child of the Template. The template
- // instance will be extracted from the View during the normalization and there's no need
- // to clone it.
- if ( value && ( value instanceof TemplateBinding || isTemplate( value ) || isView( value ) || isViewCollection( value ) ) ) {
- return value;
- }
- } );
- return clone;
- }
- // Normalizes given {@link module:ui/template~TemplateDefinition}.
- //
- // See:
- // * {@link normalizeAttributes}
- // * {@link normalizeListeners}
- // * {@link normalizePlainTextDefinition}
- // * {@link normalizeTextDefinition}
- //
- // @param {module:ui/template~TemplateDefinition} def
- // @returns {module:ui/template~TemplateDefinition} Normalized definition.
- function normalize( def ) {
- if ( typeof def == 'string' ) {
- def = normalizePlainTextDefinition( def );
- } else if ( def.text ) {
- normalizeTextDefinition( def );
- }
- if ( def.on ) {
- def.eventListeners = normalizeListeners( def.on );
- // Template mixes EmitterMixin, so delete #on to avoid collision.
- delete def.on;
- }
- if ( !def.text ) {
- if ( def.attributes ) {
- normalizeAttributes( def.attributes );
- }
- const children = [];
- if ( def.children ) {
- if ( isViewCollection( def.children ) ) {
- children.push( def.children );
- } else {
- for ( const child of def.children ) {
- if ( isTemplate( child ) || isView( child ) || Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_5__["default"])( child ) ) {
- children.push( child );
- } else {
- children.push( new Template( child ) );
- }
- }
- }
- }
- def.children = children;
- }
- return def;
- }
- // Normalizes "attributes" section of {@link module:ui/template~TemplateDefinition}.
- //
- // attributes: {
- // a: 'bar',
- // b: {@link module:ui/template~TemplateBinding},
- // c: {
- // value: 'bar'
- // }
- // }
- //
- // becomes
- //
- // attributes: {
- // a: [ 'bar' ],
- // b: [ {@link module:ui/template~TemplateBinding} ],
- // c: {
- // value: [ 'bar' ]
- // }
- // }
- //
- // @param {Object} attributes
- function normalizeAttributes( attributes ) {
- for ( const a in attributes ) {
- if ( attributes[ a ].value ) {
- attributes[ a ].value = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_7__["default"])( attributes[ a ].value );
- }
- arrayify( attributes, a );
- }
- }
- // Normalizes "on" section of {@link module:ui/template~TemplateDefinition}.
- //
- // on: {
- // a: 'bar',
- // b: {@link module:ui/template~TemplateBinding},
- // c: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]
- // }
- //
- // becomes
- //
- // on: {
- // a: [ 'bar' ],
- // b: [ {@link module:ui/template~TemplateBinding} ],
- // c: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]
- // }
- //
- // @param {Object} listeners
- // @returns {Object} Object containing normalized listeners.
- function normalizeListeners( listeners ) {
- for ( const l in listeners ) {
- arrayify( listeners, l );
- }
- return listeners;
- }
- // Normalizes "string" {@link module:ui/template~TemplateDefinition}.
- //
- // "foo"
- //
- // becomes
- //
- // { text: [ 'foo' ] },
- //
- // @param {String} def
- // @returns {module:ui/template~TemplateDefinition} Normalized template definition.
- function normalizePlainTextDefinition( def ) {
- return {
- text: [ def ]
- };
- }
- // Normalizes text {@link module:ui/template~TemplateDefinition}.
- //
- // children: [
- // { text: 'def' },
- // { text: {@link module:ui/template~TemplateBinding} }
- // ]
- //
- // becomes
- //
- // children: [
- // { text: [ 'def' ] },
- // { text: [ {@link module:ui/template~TemplateBinding} ] }
- // ]
- //
- // @param {module:ui/template~TemplateDefinition} def
- function normalizeTextDefinition( def ) {
- def.text = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_7__["default"])( def.text );
- }
- // Wraps an entry in Object in an Array, if not already one.
- //
- // {
- // x: 'y',
- // a: [ 'b' ]
- // }
- //
- // becomes
- //
- // {
- // x: [ 'y' ],
- // a: [ 'b' ]
- // }
- //
- // @param {Object} obj
- // @param {String} key
- function arrayify( obj, key ) {
- obj[ key ] = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_7__["default"])( obj[ key ] );
- }
- // A helper which concatenates the value avoiding unwanted
- // leading white spaces.
- //
- // @param {String} prev
- // @param {String} cur
- // @returns {String}
- function arrayValueReducer( prev, cur ) {
- if ( isFalsy( cur ) ) {
- return prev;
- } else if ( isFalsy( prev ) ) {
- return cur;
- } else {
- return `${ prev } ${ cur }`;
- }
- }
- // Extends one object defined in the following format:
- //
- // {
- // key1: [Array1],
- // key2: [Array2],
- // ...
- // keyN: [ArrayN]
- // }
- //
- // with another object of the same data format.
- //
- // @param {Object} obj Base object.
- // @param {Object} ext Object extending base.
- // @returns {String}
- function extendObjectValueArray( obj, ext ) {
- for ( const a in ext ) {
- if ( obj[ a ] ) {
- obj[ a ].push( ...ext[ a ] );
- } else {
- obj[ a ] = ext[ a ];
- }
- }
- }
- // A helper for {@link module:ui/template~Template#extend}. Recursively extends {@link module:ui/template~Template} instance
- // with content from {@link module:ui/template~TemplateDefinition}. See {@link module:ui/template~Template#extend} to learn more.
- //
- // @param {module:ui/template~Template} def A template instance to be extended.
- // @param {module:ui/template~TemplateDefinition} def A definition which is to extend the template instance.
- // @param {Object} Error context.
- function extendTemplate( template, def ) {
- if ( def.attributes ) {
- if ( !template.attributes ) {
- template.attributes = {};
- }
- extendObjectValueArray( template.attributes, def.attributes );
- }
- if ( def.eventListeners ) {
- if ( !template.eventListeners ) {
- template.eventListeners = {};
- }
- extendObjectValueArray( template.eventListeners, def.eventListeners );
- }
- if ( def.text ) {
- template.text.push( ...def.text );
- }
- if ( def.children && def.children.length ) {
- if ( template.children.length != def.children.length ) {
- /**
- * The number of children in extended definition does not match.
- *
- * @error ui-template-extend-children-mismatch
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'ui-template-extend-children-mismatch',
- template
- );
- }
- let childIndex = 0;
- for ( const childDef of def.children ) {
- extendTemplate( template.children[ childIndex++ ], childDef );
- }
- }
- }
- // Checks if value is "falsy".
- // Note: 0 (Number) is not "falsy" in this context.
- //
- // @private
- // @param {*} value Value to be checked.
- function isFalsy( value ) {
- return !value && value !== 0;
- }
- // Checks if the item is an instance of {@link module:ui/view~View}
- //
- // @private
- // @param {*} value Value to be checked.
- function isView( item ) {
- return item instanceof _view__WEBPACK_IMPORTED_MODULE_3__["default"];
- }
- // Checks if the item is an instance of {@link module:ui/template~Template}
- //
- // @private
- // @param {*} value Value to be checked.
- function isTemplate( item ) {
- return item instanceof Template;
- }
- // Checks if the item is an instance of {@link module:ui/viewcollection~ViewCollection}
- //
- // @private
- // @param {*} value Value to be checked.
- function isViewCollection( item ) {
- return item instanceof _viewcollection__WEBPACK_IMPORTED_MODULE_4__["default"];
- }
- // Creates an empty skeleton for {@link module:ui/template~Template#revert}
- // data.
- //
- // @private
- function getEmptyRevertData() {
- return {
- children: [],
- bindings: [],
- attributes: {}
- };
- }
- // Checks whether an attribute should be extended when
- // {@link module:ui/template~Template#apply} is called.
- //
- // @private
- // @param {String} attrName Attribute name to check.
- function shouldExtend( attrName ) {
- return attrName == 'class' || attrName == 'style';
- }
- /**
- * A definition of the {@link module:ui/template~Template}. It describes what kind of
- * node a template will render (HTML element or text), attributes of an element, DOM event
- * listeners and children.
- *
- * Also see:
- * * {@link module:ui/template~TemplateValueSchema} to learn about HTML element attributes,
- * * {@link module:ui/template~TemplateListenerSchema} to learn about DOM event listeners.
- *
- * A sample definition on an HTML element can look like this:
- *
- * new Template( {
- * tag: 'p',
- * children: [
- * {
- * tag: 'span',
- * attributes: { ... },
- * children: [ ... ],
- * },
- * {
- * text: 'static–text'
- * },
- * 'also-static–text',
- * ],
- * attributes: {
- * class: {@link module:ui/template~TemplateValueSchema},
- * id: {@link module:ui/template~TemplateValueSchema},
- * style: {@link module:ui/template~TemplateValueSchema}
- *
- * // ...
- * },
- * on: {
- * 'click': {@link module:ui/template~TemplateListenerSchema}
- *
- * // Document.querySelector format is also accepted.
- * 'keyup@a.some-class': {@link module:ui/template~TemplateListenerSchema}
- *
- * // ...
- * }
- * } );
- *
- * A {@link module:ui/view~View}, another {@link module:ui/template~Template} or a native DOM node
- * can also become a child of a template. When a view is passed, its {@link module:ui/view~View#element} is used:
- *
- * const view = new SomeView();
- * const childTemplate = new Template( { ... } );
- * const childNode = document.createElement( 'b' );
- *
- * new Template( {
- * tag: 'p',
- *
- * children: [
- * // view#element will be added as a child of this <p>.
- * view,
- *
- * // The output of childTemplate.render() will be added here.
- * childTemplate,
- *
- * // Native DOM nodes are included directly in the rendered output.
- * childNode
- * ]
- * } );
- *
- * An entire {@link module:ui/viewcollection~ViewCollection} can be used as a child in the definition:
- *
- * const collection = new ViewCollection();
- * collection.add( someView );
- *
- * new Template( {
- * tag: 'p',
- *
- * children: collection
- * } );
- *
- * @typedef module:ui/template~TemplateDefinition
- * @type Object
- *
- * @property {String} tag See the template {@link module:ui/template~Template#tag} property.
- *
- * @property {Array.<module:ui/template~TemplateDefinition>} [children]
- * See the template {@link module:ui/template~Template#children} property.
- *
- * @property {Object.<String, module:ui/template~TemplateValueSchema>} [attributes]
- * See the template {@link module:ui/template~Template#attributes} property.
- *
- * @property {String|module:ui/template~TemplateValueSchema|Array.<String|module:ui/template~TemplateValueSchema>} [text]
- * See the template {@link module:ui/template~Template#text} property.
- *
- * @property {Object.<String, module:ui/template~TemplateListenerSchema>} [on]
- * See the template {@link module:ui/template~Template#eventListeners} property.
- */
- /**
- * Describes a value of an HTML element attribute or `textContent`. It allows combining multiple
- * data sources like static values and {@link module:utils/observablemixin~Observable} attributes.
- *
- * Also see:
- * * {@link module:ui/template~TemplateDefinition} to learn where to use it,
- * * {@link module:ui/template~Template.bind} to learn how to configure
- * {@link module:utils/observablemixin~Observable} attribute bindings,
- * * {@link module:ui/template~Template#render} to learn how to render a template,
- * * {@link module:ui/template~BindChain#to `to()`} and {@link module:ui/template~BindChain#if `if()`}
- * methods to learn more about bindings.
- *
- * Attribute values can be described in many different ways:
- *
- * // Bind helper will create bindings to attributes of the observable.
- * const bind = Template.bind( observable, emitter );
- *
- * new Template( {
- * tag: 'p',
- * attributes: {
- * // A plain string schema.
- * 'class': 'static-text',
- *
- * // An object schema, binds to the "foo" attribute of the
- * // observable and follows its value.
- * 'class': bind.to( 'foo' ),
- *
- * // An array schema, combines the above.
- * 'class': [
- * 'static-text',
- * bind.to( 'bar', () => { ... } ),
- *
- * // Bindings can also be conditional.
- * bind.if( 'baz', 'class-when-baz-is-true' )
- * ],
- *
- * // An array schema, with a custom namespace, e.g. useful for creating SVGs.
- * 'class': {
- * ns: 'http://ns.url',
- * value: [
- * bind.if( 'baz', 'value-when-true' ),
- * 'static-text'
- * ]
- * },
- *
- * // An object schema, specific for styles.
- * style: {
- * color: 'red',
- * backgroundColor: bind.to( 'qux', () => { ... } )
- * }
- * }
- * } );
- *
- * Text nodes can also have complex values:
- *
- * const bind = Template.bind( observable, emitter );
- *
- * // Will render a "foo" text node.
- * new Template( {
- * text: 'foo'
- * } );
- *
- * // Will render a "static text: {observable.foo}" text node.
- * // The text of the node will be updated as the "foo" attribute changes.
- * new Template( {
- * text: [
- * 'static text: ',
- * bind.to( 'foo', () => { ... } )
- * ]
- * } );
- *
- * @typedef module:ui/template~TemplateValueSchema
- * @type {Object|String|Array}
- */
- /**
- * Describes an event listener attached to an HTML element. Such listener can propagate DOM events
- * through an {@link module:utils/observablemixin~Observable} instance, execute custom callbacks
- * or both, if necessary.
- *
- * Also see:
- * * {@link module:ui/template~TemplateDefinition} to learn more about template definitions,
- * * {@link module:ui/template~BindChain#to `to()`} method to learn more about bindings.
- *
- * Check out different ways of attaching event listeners below:
- *
- * // Bind helper will propagate events through the observable.
- * const bind = Template.bind( observable, emitter );
- *
- * new Template( {
- * tag: 'p',
- * on: {
- * // An object schema. The observable will fire the "clicked" event upon DOM "click".
- * click: bind.to( 'clicked' )
- *
- * // An object schema. It will work for "click" event on "a.foo" children only.
- * 'click@a.foo': bind.to( 'clicked' )
- *
- * // An array schema, makes the observable propagate multiple events.
- * click: [
- * bind.to( 'clicked' ),
- * bind.to( 'executed' )
- * ],
- *
- * // An array schema with a custom callback.
- * 'click@a.foo': {
- * bind.to( 'clicked' ),
- * bind.to( evt => {
- * console.log( `${ evt.target } has been clicked!` );
- * } }
- * }
- * }
- * } );
- *
- * @typedef module:ui/template~TemplateListenerSchema
- * @type {Object|String|Array}
- */
- /**
- * The return value of {@link ~Template.bind `Template.bind()`}. It provides `to()` and `if()`
- * methods to create the {@link module:utils/observablemixin~Observable observable} attribute and event bindings.
- *
- * @interface module:ui/template~BindChain
- */
- /**
- * Binds an {@link module:utils/observablemixin~Observable observable} to either:
- *
- * * an HTML element attribute or a text node `textContent`, so it remains in sync with the observable
- * attribute as it changes,
- * * or an HTML element DOM event, so the DOM events are propagated through an observable.
- *
- * Some common use cases of `to()` bindings are presented below:
- *
- * const bind = Template.bind( observable, emitter );
- *
- * new Template( {
- * tag: 'p',
- * attributes: {
- * // class="..." attribute gets bound to `observable#a`
- * class: bind.to( 'a' )
- * },
- * children: [
- * // <p>...</p> gets bound to observable#b; always `toUpperCase()`.
- * {
- * text: bind.to( 'b', ( value, node ) => value.toUpperCase() )
- * }
- * ],
- * on: {
- * click: [
- * // An observable will fire "clicked" upon "click" in the DOM.
- * bind.to( 'clicked' ),
- *
- * // A custom callback will be executed upon "click" in the DOM.
- * bind.to( () => {
- * ...
- * } )
- * ]
- * }
- * } ).render();
- *
- * Learn more about using `to()` in the {@link module:ui/template~TemplateValueSchema} and
- * {@link module:ui/template~TemplateListenerSchema}.
- *
- * @method #to
- * @param {String|Function} eventNameOrFunctionOrAttribute An attribute name of
- * {@link module:utils/observablemixin~Observable} or a DOM event name or an event callback.
- * @param {Function} [callback] Allows for processing of the value. Accepts `Node` and `value` as arguments.
- * @returns {module:ui/template~TemplateBinding}
- */
- /**
- * Binds an {@link module:utils/observablemixin~Observable observable} to an HTML element attribute or a text
- * node `textContent` so it remains in sync with the observable attribute as it changes.
- *
- * Unlike {@link module:ui/template~BindChain#to}, it controls the presence of the attribute or `textContent`
- * depending on the "falseness" of an {@link module:utils/observablemixin~Observable} attribute.
- *
- * const bind = Template.bind( observable, emitter );
- *
- * new Template( {
- * tag: 'input',
- * attributes: {
- * // <input checked> when `observable#a` is not undefined/null/false/''
- * // <input> when `observable#a` is undefined/null/false
- * checked: bind.if( 'a' )
- * },
- * children: [
- * {
- * // <input>"b-is-not-set"</input> when `observable#b` is undefined/null/false/''
- * // <input></input> when `observable#b` is not "falsy"
- * text: bind.if( 'b', 'b-is-not-set', ( value, node ) => !value )
- * }
- * ]
- * } ).render();
- *
- * Learn more about using `if()` in the {@link module:ui/template~TemplateValueSchema}.
- *
- * @method #if
- * @param {String} attribute An attribute name of {@link module:utils/observablemixin~Observable} used in the binding.
- * @param {String} [valueIfTrue] Value set when the {@link module:utils/observablemixin~Observable} attribute is not
- * undefined/null/false/'' (empty string).
- * @param {Function} [callback] Allows for processing of the value. Accepts `Node` and `value` as arguments.
- * @returns {module:ui/template~TemplateBinding}
- */
- /**
- * The {@link module:ui/template~Template#_renderNode} configuration.
- *
- * @private
- * @interface module:ui/template~RenderData
- */
- /**
- * Tells {@link module:ui/template~Template#_renderNode} to render
- * children into `DocumentFragment` first and then append the fragment
- * to the parent element. It is a speed optimization.
- *
- * @member {Boolean} #intoFragment
- */
- /**
- * A node which is being rendered.
- *
- * @member {HTMLElement|Text} #node
- */
- /**
- * Indicates whether the {@module:ui/template~RenderNodeOptions#node} has
- * been provided by {@module:ui/template~Template#apply}.
- *
- * @member {Boolean} #isApplying
- */
- /**
- * An object storing the data that helps {@module:ui/template~Template#revert}
- * bringing back an element to its initial state, i.e. before
- * {@module:ui/template~Template#apply} was called.
- *
- * @member {Object} #revertData
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BalloonToolbar; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../panel/balloon/contextualballoon */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js");
- /* harmony import */ var _toolbarview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
- /* harmony import */ var _panel_balloon_balloonpanelview_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../panel/balloon/balloonpanelview.js */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
- /* harmony import */ var _normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/toolbar/balloon/balloontoolbar
- */
- const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_9__["default"])( 'px' );
- /**
- * The contextual toolbar.
- *
- * It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
- *
- * @extends module:core/plugin~Plugin
- */
- class BalloonToolbar extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'BalloonToolbar';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__["default"] ];
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- /**
- * A cached and normalized `config.balloonToolbar` object.
- *
- * @type {module:core/editor/editorconfig~EditorConfig#balloonToolbar}
- * @private
- */
- this._balloonConfig = Object(_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_6__["default"])( editor.config.get( 'balloonToolbar' ) );
- /**
- * The toolbar view displayed in the balloon.
- *
- * @type {module:ui/toolbar/toolbarview~ToolbarView}
- */
- this.toolbarView = this._createToolbarView();
- /**
- * Tracks the focus of the {@link module:core/editor/editorui~EditorUI#getEditableElement editable element}
- * and the {@link #toolbarView}. When both are blurred then the toolbar should hide.
- *
- * @readonly
- * @type {module:utils:focustracker~FocusTracker}
- */
- this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_4__["default"]();
- // Wait for the EditorUI#init. EditableElement is not available before.
- editor.ui.once( 'ready', () => {
- this.focusTracker.add( editor.ui.getEditableElement() );
- this.focusTracker.add( this.toolbarView.element );
- } );
- /**
- * An instance of the resize observer that allows to respond to changes in editable's geometry
- * so the toolbar can stay within its boundaries (and group toolbar items that do not fit).
- *
- * **Note**: Used only when `shouldNotGroupWhenFull` was **not** set in the
- * {@link module:core/editor/editorconfig~EditorConfig#balloonToolbar configuration}.
- *
- * **Note:** Created in {@link #init}.
- *
- * @protected
- * @member {module:utils/dom/resizeobserver~ResizeObserver}
- */
- this._resizeObserver = null;
- /**
- * The contextual balloon plugin instance.
- *
- * @private
- * @type {module:ui/panel/balloon/contextualballoon~ContextualBalloon}
- */
- this._balloon = editor.plugins.get( _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /**
- * Fires {@link #event:_selectionChangeDebounced} event using `lodash#debounce`.
- *
- * This function is stored as a plugin property to make possible to cancel
- * trailing debounced invocation on destroy.
- *
- * @private
- * @type {Function}
- */
- this._fireSelectionChangeDebounced = Object(lodash_es__WEBPACK_IMPORTED_MODULE_7__["debounce"])( () => this.fire( '_selectionChangeDebounced' ), 200 );
- // The appearance of the BalloonToolbar method is event–driven.
- // It is possible to stop the #show event and this prevent the toolbar from showing up.
- this.decorate( 'show' );
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const selection = editor.model.document.selection;
- // Show/hide the toolbar on editable focus/blur.
- this.listenTo( this.focusTracker, 'change:isFocused', ( evt, name, isFocused ) => {
- const isToolbarVisible = this._balloon.visibleView === this.toolbarView;
- if ( !isFocused && isToolbarVisible ) {
- this.hide();
- } else if ( isFocused ) {
- this.show();
- }
- } );
- // Hide the toolbar when the selection is changed by a direct change or has changed to collapsed.
- this.listenTo( selection, 'change:range', ( evt, data ) => {
- if ( data.directChange || selection.isCollapsed ) {
- this.hide();
- }
- // Fire internal `_selectionChangeDebounced` event to use it for showing
- // the toolbar after the selection stops changing.
- this._fireSelectionChangeDebounced();
- } );
- // Show the toolbar when the selection stops changing.
- this.listenTo( this, '_selectionChangeDebounced', () => {
- if ( this.editor.editing.view.document.isFocused ) {
- this.show();
- }
- } );
- if ( !this._balloonConfig.shouldNotGroupWhenFull ) {
- this.listenTo( editor, 'ready', () => {
- const editableElement = editor.ui.view.editable.element;
- // Set #toolbarView's max-width on the initialization and update it on the editable resize.
- this._resizeObserver = new _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_8__["default"]( editableElement, () => {
- // The max-width equals 90% of the editable's width for the best user experience.
- // The value keeps the balloon very close to the boundaries of the editable and limits the cases
- // when the balloon juts out from the editable element it belongs to.
- this.toolbarView.maxWidth = toPx( new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_5__["default"]( editableElement ).width * .9 );
- } );
- } );
- }
- // Listen to the toolbar view and whenever it changes its geometry due to some items being
- // grouped or ungrouped, update the position of the balloon because a shorter/longer toolbar
- // means the balloon could be pointing at the wrong place. Once updated, the balloon will point
- // at the right selection in the content again.
- // https://github.com/ckeditor/ckeditor5/issues/6444
- this.listenTo( this.toolbarView, 'groupedItemsUpdate', () => {
- this._updatePosition();
- } );
- }
- /**
- * Creates toolbar components based on given configuration.
- * This needs to be done when all plugins are ready.
- *
- * @inheritDoc
- */
- afterInit() {
- const factory = this.editor.ui.componentFactory;
- this.toolbarView.fillFromConfig( this._balloonConfig, factory );
- }
- /**
- * Creates the toolbar view instance.
- *
- * @private
- * @returns {module:ui/toolbar/toolbarview~ToolbarView}
- */
- _createToolbarView() {
- const shouldGroupWhenFull = !this._balloonConfig.shouldNotGroupWhenFull;
- const toolbarView = new _toolbarview__WEBPACK_IMPORTED_MODULE_2__["default"]( this.editor.locale, {
- shouldGroupWhenFull,
- isFloating: true
- } );
- toolbarView.render();
- return toolbarView;
- }
- /**
- * Shows the toolbar and attaches it to the selection.
- *
- * Fires {@link #event:show} event which can be stopped to prevent the toolbar from showing up.
- */
- show() {
- const editor = this.editor;
- const selection = editor.model.document.selection;
- const schema = editor.model.schema;
- // Do not add the toolbar to the balloon stack twice.
- if ( this._balloon.hasView( this.toolbarView ) ) {
- return;
- }
- // Do not show the toolbar when the selection is collapsed.
- if ( selection.isCollapsed ) {
- return;
- }
- // Do not show the toolbar when there is more than one range in the selection and they fully contain selectable elements.
- // See https://github.com/ckeditor/ckeditor5/issues/6443.
- if ( selectionContainsOnlyMultipleSelectables( selection, schema ) ) {
- return;
- }
- // Don not show the toolbar when all components inside are disabled
- // see https://github.com/ckeditor/ckeditor5-ui/issues/269.
- if ( Array.from( this.toolbarView.items ).every( item => item.isEnabled !== undefined && !item.isEnabled ) ) {
- return;
- }
- // Update the toolbar position when the editor ui should be refreshed.
- this.listenTo( this.editor.ui, 'update', () => {
- this._updatePosition();
- } );
- // Add the toolbar to the common editor contextual balloon.
- this._balloon.add( {
- view: this.toolbarView,
- position: this._getBalloonPositionData(),
- balloonClassName: 'ck-toolbar-container'
- } );
- }
- /**
- * Hides the toolbar.
- */
- hide() {
- if ( this._balloon.hasView( this.toolbarView ) ) {
- this.stopListening( this.editor.ui, 'update' );
- this._balloon.remove( this.toolbarView );
- }
- }
- /**
- * Returns positioning options for the {@link #_balloon}. They control the way balloon is attached
- * to the selection.
- *
- * @private
- * @returns {module:utils/dom/position~Options}
- */
- _getBalloonPositionData() {
- const editor = this.editor;
- const view = editor.editing.view;
- const viewDocument = view.document;
- const viewSelection = viewDocument.selection;
- // Get direction of the selection.
- const isBackward = viewDocument.selection.isBackward;
- return {
- // Because the target for BalloonPanelView is a Rect (not DOMRange), it's geometry will stay fixed
- // as the window scrolls. To let the BalloonPanelView follow such Rect, is must be continuously
- // computed and hence, the target is defined as a function instead of a static value.
- // https://github.com/ckeditor/ckeditor5-ui/issues/195
- target: () => {
- const range = isBackward ? viewSelection.getFirstRange() : viewSelection.getLastRange();
- const rangeRects = _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_5__["default"].getDomRangeRects( view.domConverter.viewRangeToDom( range ) );
- // Select the proper range rect depending on the direction of the selection.
- if ( isBackward ) {
- return rangeRects[ 0 ];
- } else {
- // Ditch the zero-width "orphan" rect in the next line for the forward selection if there's
- // another one preceding it. It is not rendered as a selection by the web browser anyway.
- // https://github.com/ckeditor/ckeditor5-ui/issues/308
- if ( rangeRects.length > 1 && rangeRects[ rangeRects.length - 1 ].width === 0 ) {
- rangeRects.pop();
- }
- return rangeRects[ rangeRects.length - 1 ];
- }
- },
- positions: getBalloonPositions( isBackward )
- };
- }
- /**
- * Updates the position of the {@link #_balloon} to make up for changes:
- *
- * * in the geometry of the selection it is attached to (e.g. the selection moved in the viewport or expanded or shrunk),
- * * or the geometry of the balloon toolbar itself (e.g. the toolbar has grouped or ungrouped some items and it is shorter or longer).
- *
- * @private
- */
- _updatePosition() {
- this._balloon.updatePosition( this._getBalloonPositionData() );
- }
- /**
- * @inheritDoc
- */
- destroy() {
- super.destroy();
- this.stopListening();
- this._fireSelectionChangeDebounced.cancel();
- this.toolbarView.destroy();
- this.focusTracker.destroy();
- if ( this._resizeObserver ) {
- this._resizeObserver.destroy();
- }
- }
- /**
- * This event is fired just before the toolbar shows up. Stopping this event will prevent this.
- *
- * @event show
- */
- /**
- * This is internal plugin event which is fired 200 ms after model selection last change.
- * This is to makes easy test debounced action without need to use `setTimeout`.
- *
- * @protected
- * @event _selectionChangeDebounced
- */
- }
- // Returns toolbar positions for the given direction of the selection.
- //
- // @private
- // @param {Boolean} isBackward
- // @returns {Array.<module:utils/dom/position~Position>}
- function getBalloonPositions( isBackward ) {
- const defaultPositions = _panel_balloon_balloonpanelview_js__WEBPACK_IMPORTED_MODULE_3__["default"].defaultPositions;
- return isBackward ? [
- defaultPositions.northWestArrowSouth,
- defaultPositions.northWestArrowSouthWest,
- defaultPositions.northWestArrowSouthEast,
- defaultPositions.northWestArrowSouthMiddleEast,
- defaultPositions.northWestArrowSouthMiddleWest,
- defaultPositions.southWestArrowNorth,
- defaultPositions.southWestArrowNorthWest,
- defaultPositions.southWestArrowNorthEast,
- defaultPositions.southWestArrowNorthMiddleWest,
- defaultPositions.southWestArrowNorthMiddleEast
- ] : [
- defaultPositions.southEastArrowNorth,
- defaultPositions.southEastArrowNorthEast,
- defaultPositions.southEastArrowNorthWest,
- defaultPositions.southEastArrowNorthMiddleEast,
- defaultPositions.southEastArrowNorthMiddleWest,
- defaultPositions.northEastArrowSouth,
- defaultPositions.northEastArrowSouthEast,
- defaultPositions.northEastArrowSouthWest,
- defaultPositions.northEastArrowSouthMiddleEast,
- defaultPositions.northEastArrowSouthMiddleWest
- ];
- }
- // Returns "true" when the selection has multiple ranges and each range contains a selectable element
- // and nothing else.
- //
- // @private
- // @param {module:engine/model/selection~Selection} selection
- // @param {module:engine/model/schema~Schema} schema
- // @returns {Boolean}
- function selectionContainsOnlyMultipleSelectables( selection, schema ) {
- // It doesn't contain multiple objects if there is only one range.
- if ( selection.rangeCount === 1 ) {
- return false;
- }
- return [ ...selection.getRanges() ].every( range => {
- const element = range.getContainedElement();
- return element && schema.isSelectable( element );
- } );
- }
- /**
- * Contextual toolbar configuration. Used by the {@link module:ui/toolbar/balloon/balloontoolbar~BalloonToolbar}
- * feature.
- *
- * ## Configuring toolbar items
- *
- * const config = {
- * balloonToolbar: [ 'bold', 'italic', 'undo', 'redo' ]
- * };
- *
- * You can also use `'|'` to create a separator between groups of items:
- *
- * const config = {
- * balloonToolbar: [ 'bold', 'italic', | 'undo', 'redo' ]
- * };
- *
- * Read also about configuring the main editor toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
- *
- * ## Configuring items grouping
- *
- * You can prevent automatic items grouping by setting the `shouldNotGroupWhenFull` option:
- *
- * const config = {
- * balloonToolbar: {
- * items: [ 'bold', 'italic', 'undo', 'redo' ],
- * shouldNotGroupWhenFull: true
- * },
- * };
- *
- * @member {Array.<String>|Object} module:core/editor/editorconfig~EditorConfig#balloonToolbar
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blockbuttonview.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blockbuttonview.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockButtonView; });
- /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
- /* harmony import */ var _theme_components_toolbar_blocktoolbar_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../theme/components/toolbar/blocktoolbar.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css");
- /* harmony import */ var _theme_components_toolbar_blocktoolbar_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_components_toolbar_blocktoolbar_css__WEBPACK_IMPORTED_MODULE_2__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/toolbar/block/blockbuttonview
- */
- const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_1__["default"])( 'px' );
- /**
- * The block button view class.
- *
- * This view represents a button attached next to block element where the selection is anchored.
- *
- * See {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar}.
- *
- * @extends {module:ui/button/buttonview~ButtonView}
- */
- class BlockButtonView extends _button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- const bind = this.bindTemplate;
- // Hide button on init.
- this.isVisible = false;
- this.isToggleable = true;
- /**
- * Top offset.
- *
- * @member {Number} #top
- */
- this.set( 'top', 0 );
- /**
- * Left offset.
- *
- * @member {Number} #left
- */
- this.set( 'left', 0 );
- this.extendTemplate( {
- attributes: {
- class: 'ck-block-toolbar-button',
- style: {
- top: bind.to( 'top', val => toPx( val ) ),
- left: bind.to( 'left', val => toPx( val ) )
- }
- }
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js ***!
- \*******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockToolbar; });
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _blockbuttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blockbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blockbuttonview.js");
- /* harmony import */ var _panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../panel/balloon/balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
- /* harmony import */ var _toolbarview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
- /* harmony import */ var _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../bindings/clickoutsidehandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/position */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
- /* harmony import */ var _normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/toolbar/block/blocktoolbar
- */
- /* global window */
- const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_9__["default"])( 'px' );
- /**
- * The block toolbar plugin.
- *
- * This plugin provides a button positioned next to the block of content where the selection is anchored.
- * Upon clicking the button, a dropdown providing access to editor features shows up, as configured in
- * {@link module:core/editor/editorconfig~EditorConfig#blockToolbar}.
- *
- * By default, the button is displayed next to all elements marked in {@link module:engine/model/schema~Schema}
- * as `$block` for which the toolbar provides at least one option.
- *
- * By default, the button is attached so its right boundary is touching the
- * {@link module:engine/view/editableelement~EditableElement}:
- *
- * __ |
- * | || This is a block of content that the
- * ¯¯ | button is attached to. This is a
- * | block of content that the button is
- * | attached to.
- *
- * The position of the button can be adjusted using the CSS `transform` property:
- *
- * .ck-block-toolbar-button {
- * transform: translateX( -10px );
- * }
- *
- * __ |
- * | | | This is a block of content that the
- * ¯¯ | button is attached to. This is a
- * | block of content that the button is
- * | attached to.
- *
- * **Note**: If you plan to run the editor in a right–to–left (RTL) language, keep in mind the button
- * will be attached to the **right** boundary of the editable area. In that case, make sure the
- * CSS position adjustment works properly by adding the following styles:
- *
- * .ck[dir="rtl"] .ck-block-toolbar-button {
- * transform: translateX( 10px );
- * }
- *
- * @extends module:core/plugin~Plugin
- */
- class BlockToolbar extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'BlockToolbar';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- /**
- * A cached and normalized `config.blockToolbar` object.
- *
- * @type {module:core/editor/editorconfig~EditorConfig#blockToolbar}
- * @private
- */
- this._blockToolbarConfig = Object(_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_7__["default"])( this.editor.config.get( 'blockToolbar' ) );
- /**
- * The toolbar view.
- *
- * @type {module:ui/toolbar/toolbarview~ToolbarView}
- */
- this.toolbarView = this._createToolbarView();
- /**
- * The balloon panel view, containing the {@link #toolbarView}.
- *
- * @type {module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
- */
- this.panelView = this._createPanelView();
- /**
- * The button view that opens the {@link #toolbarView}.
- *
- * @type {module:ui/toolbar/block/blockbuttonview~BlockButtonView}
- */
- this.buttonView = this._createButtonView();
- /**
- * An instance of the resize observer that allows to respond to changes in editable's geometry
- * so the toolbar can stay within its boundaries (and group toolbar items that do not fit).
- *
- * **Note**: Used only when `shouldNotGroupWhenFull` was **not** set in the
- * {@link module:core/editor/editorconfig~EditorConfig#blockToolbar configuration}.
- *
- * **Note:** Created in {@link #afterInit}.
- *
- * @protected
- * @member {module:utils/dom/resizeobserver~ResizeObserver}
- */
- this._resizeObserver = null;
- // Close the #panelView upon clicking outside of the plugin UI.
- Object(_bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_4__["default"])( {
- emitter: this.panelView,
- contextElements: [ this.panelView.element, this.buttonView.element ],
- activator: () => this.panelView.isVisible,
- callback: () => this._hidePanel()
- } );
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Hides panel on a direct selection change.
- this.listenTo( editor.model.document.selection, 'change:range', ( evt, data ) => {
- if ( data.directChange ) {
- this._hidePanel();
- }
- } );
- this.listenTo( editor.ui, 'update', () => this._updateButton() );
- // `low` priority is used because of https://github.com/ckeditor/ckeditor5-core/issues/133.
- this.listenTo( editor, 'change:isReadOnly', () => this._updateButton(), { priority: 'low' } );
- this.listenTo( editor.ui.focusTracker, 'change:isFocused', () => this._updateButton() );
- // Reposition button on resize.
- this.listenTo( this.buttonView, 'change:isVisible', ( evt, name, isVisible ) => {
- if ( isVisible ) {
- // Keep correct position of button and panel on window#resize.
- this.buttonView.listenTo( window, 'resize', () => this._updateButton() );
- } else {
- // Stop repositioning button when is hidden.
- this.buttonView.stopListening( window, 'resize' );
- // Hide the panel when the button disappears.
- this._hidePanel();
- }
- } );
- }
- /**
- * Fills the toolbar with its items based on the configuration.
- *
- * **Note:** This needs to be done after all plugins are ready.
- *
- * @inheritDoc
- */
- afterInit() {
- const factory = this.editor.ui.componentFactory;
- const config = this._blockToolbarConfig;
- this.toolbarView.fillFromConfig( config, factory );
- // Hide panel before executing each button in the panel.
- for ( const item of this.toolbarView.items ) {
- item.on( 'execute', () => this._hidePanel( true ), { priority: 'high' } );
- }
- if ( !config.shouldNotGroupWhenFull ) {
- this.listenTo( this.editor, 'ready', () => {
- const editableElement = this.editor.ui.view.editable.element;
- // Set #toolbarView's max-width just after the initialization and update it on the editable resize.
- this._resizeObserver = new _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_8__["default"]( editableElement, () => {
- this.toolbarView.maxWidth = this._getToolbarMaxWidth();
- } );
- } );
- }
- }
- /**
- * @inheritDoc
- */
- destroy() {
- super.destroy();
- // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
- this.panelView.destroy();
- this.buttonView.destroy();
- this.toolbarView.destroy();
- if ( this._resizeObserver ) {
- this._resizeObserver.destroy();
- }
- }
- /**
- * Creates the {@link #toolbarView}.
- *
- * @private
- * @returns {module:ui/toolbar/toolbarview~ToolbarView}
- */
- _createToolbarView() {
- const shouldGroupWhenFull = !this._blockToolbarConfig.shouldNotGroupWhenFull;
- const toolbarView = new _toolbarview__WEBPACK_IMPORTED_MODULE_3__["default"]( this.editor.locale, {
- shouldGroupWhenFull,
- isFloating: true
- } );
- // When toolbar lost focus then panel should hide.
- toolbarView.focusTracker.on( 'change:isFocused', ( evt, name, is ) => {
- if ( !is ) {
- this._hidePanel();
- }
- } );
- return toolbarView;
- }
- /**
- * Creates the {@link #panelView}.
- *
- * @private
- * @returns {module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
- */
- _createPanelView() {
- const editor = this.editor;
- const panelView = new _panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.locale );
- panelView.content.add( this.toolbarView );
- panelView.class = 'ck-toolbar-container';
- editor.ui.view.body.add( panelView );
- editor.ui.focusTracker.add( panelView.element );
- // Close #panelView on `Esc` press.
- this.toolbarView.keystrokes.set( 'Esc', ( evt, cancel ) => {
- this._hidePanel( true );
- cancel();
- } );
- return panelView;
- }
- /**
- * Creates the {@link #buttonView}.
- *
- * @private
- * @returns {module:ui/toolbar/block/blockbuttonview~BlockButtonView}
- */
- _createButtonView() {
- const editor = this.editor;
- const t = editor.t;
- const buttonView = new _blockbuttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.locale );
- buttonView.set( {
- label: t( 'Edit block' ),
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].pilcrow,
- withText: false
- } );
- // Bind the panelView observable properties to the buttonView.
- buttonView.bind( 'isOn' ).to( this.panelView, 'isVisible' );
- buttonView.bind( 'tooltip' ).to( this.panelView, 'isVisible', isVisible => !isVisible );
- // Toggle the panelView upon buttonView#execute.
- this.listenTo( buttonView, 'execute', () => {
- if ( !this.panelView.isVisible ) {
- this._showPanel();
- } else {
- this._hidePanel( true );
- }
- } );
- editor.ui.view.body.add( buttonView );
- editor.ui.focusTracker.add( buttonView.element );
- return buttonView;
- }
- /**
- * Shows or hides the button.
- * When all the conditions for displaying the button are matched, it shows the button. Hides otherwise.
- *
- * @private
- */
- _updateButton() {
- const editor = this.editor;
- const model = editor.model;
- const view = editor.editing.view;
- // Hides the button when the editor is not focused.
- if ( !editor.ui.focusTracker.isFocused ) {
- this._hideButton();
- return;
- }
- // Hides the button when the editor switches to the read-only mode.
- if ( editor.isReadOnly ) {
- this._hideButton();
- return;
- }
- // Get the first selected block, button will be attached to this element.
- const modelTarget = Array.from( model.document.selection.getSelectedBlocks() )[ 0 ];
- // Hides the button when there is no enabled item in toolbar for the current block element.
- if ( !modelTarget || Array.from( this.toolbarView.items ).every( item => !item.isEnabled ) ) {
- this._hideButton();
- return;
- }
- // Get DOM target element.
- const domTarget = view.domConverter.mapViewToDom( editor.editing.mapper.toViewElement( modelTarget ) );
- // Show block button.
- this.buttonView.isVisible = true;
- // Attach block button to target DOM element.
- this._attachButtonToElement( domTarget );
- // When panel is opened then refresh it position to be properly aligned with block button.
- if ( this.panelView.isVisible ) {
- this._showPanel();
- }
- }
- /**
- * Hides the button.
- *
- * @private
- */
- _hideButton() {
- this.buttonView.isVisible = false;
- }
- /**
- * Shows the {@link #toolbarView} attached to the {@link #buttonView}.
- * If the toolbar is already visible, then it simply repositions it.
- *
- * @private
- */
- _showPanel() {
- const wasVisible = this.panelView.isVisible;
- // So here's the thing: If there was no initial panelView#show() or these two were in different order, the toolbar
- // positioning will break in RTL editors. Weird, right? What you show know is that the toolbar
- // grouping works thanks to:
- //
- // * the ResizeObserver, which kicks in as soon as the toolbar shows up in DOM (becomes visible again).
- // * the observable ToolbarView#maxWidth, which triggers re-grouping when changed.
- //
- // Here are the possible scenarios:
- //
- // 1. (WRONG ❌) If the #maxWidth is set when the toolbar is invisible, it won't affect item grouping (no DOMRects, no grouping).
- // Then, when panelView.pin() is called, the position of the toolbar will be calculated for the old
- // items grouping state, and when finally ResizeObserver kicks in (hey, the toolbar is visible now, right?)
- // it will group/ungroup some items and the length of the toolbar will change. But since in RTL the toolbar
- // is attached on the right side and the positioning uses CSS "left", it will result in the toolbar shifting
- // to the left and being displayed in the wrong place.
- // 2. (WRONG ❌) If the panelView.pin() is called first and #maxWidth set next, then basically the story repeats. The balloon
- // calculates the position for the old toolbar grouping state, then the toolbar re-groups items and because
- // it is positioned using CSS "left" it will move.
- // 3. (RIGHT ✅) We show the panel first (the toolbar does re-grouping but it does not matter), then the #maxWidth
- // is set allowing the toolbar to re-group again and finally panelView.pin() does the positioning when the
- // items grouping state is stable and final.
- //
- // https://github.com/ckeditor/ckeditor5/issues/6449, https://github.com/ckeditor/ckeditor5/issues/6575
- this.panelView.show();
- this.toolbarView.maxWidth = this._getToolbarMaxWidth();
- this.panelView.pin( {
- target: this.buttonView.element,
- limiter: this.editor.ui.getEditableElement()
- } );
- if ( !wasVisible ) {
- this.toolbarView.items.get( 0 ).focus();
- }
- }
- /**
- * Hides the {@link #toolbarView}.
- *
- * @private
- * @param {Boolean} [focusEditable=false] When `true`, the editable will be focused after hiding the panel.
- */
- _hidePanel( focusEditable ) {
- this.panelView.isVisible = false;
- if ( focusEditable ) {
- this.editor.editing.view.focus();
- }
- }
- /**
- * Attaches the {@link #buttonView} to the target block of content.
- *
- * @protected
- * @param {HTMLElement} targetElement Target element.
- */
- _attachButtonToElement( targetElement ) {
- const contentStyles = window.getComputedStyle( targetElement );
- const editableRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_6__["default"]( this.editor.ui.getEditableElement() );
- const contentPaddingTop = parseInt( contentStyles.paddingTop, 10 );
- // When line height is not an integer then thread it as "normal".
- // MDN says that 'normal' == ~1.2 on desktop browsers.
- const contentLineHeight = parseInt( contentStyles.lineHeight, 10 ) || parseInt( contentStyles.fontSize, 10 ) * 1.2;
- const position = Object(_ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_5__["getOptimalPosition"])( {
- element: this.buttonView.element,
- target: targetElement,
- positions: [
- ( contentRect, buttonRect ) => {
- let left;
- if ( this.editor.locale.uiLanguageDirection === 'ltr' ) {
- left = editableRect.left - buttonRect.width;
- } else {
- left = editableRect.right;
- }
- return {
- top: contentRect.top + contentPaddingTop + ( contentLineHeight - buttonRect.height ) / 2,
- left
- };
- }
- ]
- } );
- this.buttonView.top = position.top;
- this.buttonView.left = position.left;
- }
- /**
- * Gets the {@link #toolbarView} max-width, based on
- * editable width plus distance between farthest edge of the {@link #buttonView} and the editable.
- *
- * @private
- * @returns {String} maxWidth A maximum width that toolbar can have, in pixels.
- */
- _getToolbarMaxWidth() {
- const editableElement = this.editor.ui.view.editable.element;
- const editableRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_6__["default"]( editableElement );
- const buttonRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_6__["default"]( this.buttonView.element );
- const isRTL = this.editor.locale.uiLanguageDirection === 'rtl';
- const offset = isRTL ? ( buttonRect.left - editableRect.right ) + buttonRect.width : editableRect.left - buttonRect.left;
- return toPx( editableRect.width + offset );
- }
- }
- /**
- * The block toolbar configuration. Used by the {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar}
- * feature.
- *
- * const config = {
- * blockToolbar: [ 'paragraph', 'heading1', 'heading2', 'bulletedList', 'numberedList' ]
- * };
- *
- * You can also use `'|'` to create a separator between groups of items:
- *
- * const config = {
- * blockToolbar: [ 'paragraph', 'heading1', 'heading2', '|', 'bulletedList', 'numberedList' ]
- * };
- *
- * ## Configuring items grouping
- *
- * You can prevent automatic items grouping by setting the `shouldNotGroupWhenFull` option:
- *
- * const config = {
- * blockToolbar: {
- * items: [ 'paragraph', 'heading1', 'heading2', '|', 'bulletedList', 'numberedList' ],
- * shouldNotGroupWhenFull: true
- * },
- * };
- *
- * Read more about configuring the main editor toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
- *
- * @member {Array.<String>|Object} module:core/editor/editorconfig~EditorConfig#blockToolbar
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js ***!
- \***************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return enableToolbarKeyboardFocus; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/toolbar/enabletoolbarkeyboardfocus
- */
- /**
- * Enables focus/blur toolbar navigation using `Alt+F10` and `Esc` keystrokes.
- *
- * @param {Object} options Options of the utility.
- * @param {*} options.origin A view to which the focus will return when `Esc` is pressed and
- * `options.toolbar` is focused.
- * @param {module:utils/keystrokehandler~KeystrokeHandler} options.originKeystrokeHandler A keystroke
- * handler to register `Alt+F10` keystroke.
- * @param {module:utils/focustracker~FocusTracker} options.originFocusTracker A focus tracker
- * for `options.origin`.
- * @param {module:ui/toolbar/toolbarview~ToolbarView} options.toolbar A toolbar which is to gain
- * focus when `Alt+F10` is pressed.
- * @param {Function} [options.beforeFocus] A callback executed before the `options.toolbar` gains focus
- * upon the `Alt+F10` keystroke.
- * @param {Function} [options.afterBlur] A callback executed after `options.toolbar` loses focus upon
- * `Esc` keystroke but before the focus goes back to `options.origin`.
- */
- function enableToolbarKeyboardFocus( {
- origin,
- originKeystrokeHandler,
- originFocusTracker,
- toolbar,
- beforeFocus,
- afterBlur
- } ) {
- // Because toolbar items can get focus, the overall state of the toolbar must
- // also be tracked.
- originFocusTracker.add( toolbar.element );
- // Focus the toolbar on the keystroke, if not already focused.
- originKeystrokeHandler.set( 'Alt+F10', ( data, cancel ) => {
- if ( originFocusTracker.isFocused && !toolbar.focusTracker.isFocused ) {
- if ( beforeFocus ) {
- beforeFocus();
- }
- toolbar.focus();
- cancel();
- }
- } );
- // Blur the toolbar and bring the focus back to origin.
- toolbar.keystrokes.set( 'Esc', ( data, cancel ) => {
- if ( toolbar.focusTracker.isFocused ) {
- origin.focus();
- if ( afterBlur ) {
- afterBlur();
- }
- cancel();
- }
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js":
- /*!***********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js ***!
- \***********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeToolbarConfig; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/toolbar/normalizetoolbarconfig
- */
- /**
- * Normalizes the toolbar configuration (`config.toolbar`), which:
- *
- * * may be defined as an `Array`:
- *
- * toolbar: [ 'heading', 'bold', 'italic', 'link', ... ]
- *
- * * or an `Object`:
- *
- * toolbar: {
- * items: [ 'heading', 'bold', 'italic', 'link', ... ],
- * removeItems: [ 'bold' ],
- * ...
- * }
- *
- * * or may not be defined at all (`undefined`)
- *
- * and returns it in the object form.
- *
- * @param {Array|Object|undefined} config The value of `config.toolbar`.
- * @returns {Object} A normalized toolbar config object.
- */
- function normalizeToolbarConfig( config ) {
- if ( Array.isArray( config ) ) {
- return {
- items: config,
- removeItems: []
- };
- }
- if ( !config ) {
- return {
- items: [],
- removeItems: []
- };
- }
- return Object.assign( {
- items: [],
- removeItems: []
- }, config );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToolbarLineBreakView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/toolbar/toolbarlinebreakview
- */
- /**
- * The toolbar line break view class.
- *
- * @extends module:ui/view~View
- */
- class ToolbarLineBreakView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- this.setTemplate( {
- tag: 'span',
- attributes: {
- class: [
- 'ck',
- 'ck-toolbar__line-break'
- ]
- }
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToolbarSeparatorView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/toolbar/toolbarseparatorview
- */
- /**
- * The toolbar separator view class.
- *
- * @extends module:ui/view~View
- */
- class ToolbarSeparatorView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- this.setTemplate( {
- tag: 'span',
- attributes: {
- class: [
- 'ck',
- 'ck-toolbar__separator'
- ]
- }
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToolbarView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
- /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
- /* harmony import */ var _toolbarseparatorview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toolbarseparatorview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js");
- /* harmony import */ var _toolbarlinebreakview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./toolbarlinebreakview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
- /* harmony import */ var _bindings_preventdefault_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../bindings/preventdefault.js */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
- /* harmony import */ var _dropdown_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
- /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
- /* harmony import */ var _theme_components_toolbar_toolbar_css__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../theme/components/toolbar/toolbar.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css");
- /* harmony import */ var _theme_components_toolbar_toolbar_css__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_theme_components_toolbar_toolbar_css__WEBPACK_IMPORTED_MODULE_14__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/toolbar/toolbarview
- */
- /**
- * The toolbar view class.
- *
- * @extends module:ui/view~View
- * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
- */
- class ToolbarView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Creates an instance of the {@link module:ui/toolbar/toolbarview~ToolbarView} class.
- *
- * Also see {@link #render}.
- *
- * @param {module:utils/locale~Locale} locale The localization services instance.
- * @param {module:ui/toolbar/toolbarview~ToolbarOptions} [options] Configuration options of the toolbar.
- */
- constructor( locale, options ) {
- super( locale );
- const bind = this.bindTemplate;
- const t = this.t;
- /**
- * A reference to the options object passed to the constructor.
- *
- * @readonly
- * @member {module:ui/toolbar/toolbarview~ToolbarOptions}
- */
- this.options = options || {};
- /**
- * Label used by assistive technologies to describe this toolbar element.
- *
- * @default 'Editor toolbar'
- * @member {String} #ariaLabel
- */
- this.set( 'ariaLabel', t( 'Editor toolbar' ) );
- /**
- * The maximum width of the toolbar element.
- *
- * **Note**: When set to a specific value (e.g. `'200px'`), the value will affect the behavior of the
- * {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull}
- * option by changing the number of {@link #items} that will be displayed in the toolbar at a time.
- *
- * @observable
- * @default 'auto'
- * @member {String} #maxWidth
- */
- this.set( 'maxWidth', 'auto' );
- /**
- * A collection of toolbar items (buttons, dropdowns, etc.).
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.items = this.createCollection();
- /**
- * Tracks information about the DOM focus in the toolbar.
- *
- * @readonly
- * @member {module:utils/focustracker~FocusTracker}
- */
- this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
- /**
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}
- * to handle keyboard navigation in the toolbar.
- *
- * @readonly
- * @member {module:utils/keystrokehandler~KeystrokeHandler}
- */
- this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__["default"]();
- /**
- * An additional CSS class added to the {@link #element}.
- *
- * @observable
- * @member {String} #class
- */
- this.set( 'class' );
- /**
- * When set true, makes the toolbar look compact with {@link #element}.
- *
- * @observable
- * @default false
- * @member {String} #isCompact
- */
- this.set( 'isCompact', false );
- /**
- * A (child) view containing {@link #items toolbar items}.
- *
- * @readonly
- * @member {module:ui/toolbar/toolbarview~ItemsView}
- */
- this.itemsView = new ItemsView( locale );
- /**
- * A top–level collection aggregating building blocks of the toolbar.
- *
- * ┌───────────────── ToolbarView ─────────────────┐
- * | ┌──────────────── #children ────────────────┐ |
- * | | ┌──────────── #itemsView ───────────┐ | |
- * | | | [ item1 ] [ item2 ] ... [ itemN ] | | |
- * | | └──────────────────────────────────-┘ | |
- * | └───────────────────────────────────────────┘ |
- * └───────────────────────────────────────────────┘
- *
- * By default, it contains the {@link #itemsView} but it can be extended with additional
- * UI elements when necessary.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.children = this.createCollection();
- this.children.add( this.itemsView );
- /**
- * A collection of {@link #items} that take part in the focus cycling
- * (i.e. navigation using the keyboard). Usually, it contains a subset of {@link #items} with
- * some optional UI elements that also belong to the toolbar and should be focusable
- * by the user.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.focusables = this.createCollection();
- /**
- * Controls the orientation of toolbar items. Only available when
- * {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull dynamic items grouping}
- * is **disabled**.
- *
- * @observable
- * @member {Boolean} #isVertical
- */
- /**
- * Helps cycling over {@link #focusables focusable items} in the toolbar.
- *
- * @readonly
- * @protected
- * @member {module:ui/focuscycler~FocusCycler}
- */
- const isRtl = locale.uiLanguageDirection === 'rtl';
- this._focusCycler = new _focuscycler__WEBPACK_IMPORTED_MODULE_2__["default"]( {
- focusables: this.focusables,
- focusTracker: this.focusTracker,
- keystrokeHandler: this.keystrokes,
- actions: {
- // Navigate toolbar items backwards using the arrow[left,up] keys.
- focusPrevious: [ isRtl ? 'arrowright' : 'arrowleft', 'arrowup' ],
- // Navigate toolbar items forwards using the arrow[right,down] keys.
- focusNext: [ isRtl ? 'arrowleft' : 'arrowright', 'arrowdown' ]
- }
- } );
- const classes = [
- 'ck',
- 'ck-toolbar',
- bind.to( 'class' ),
- bind.if( 'isCompact', 'ck-toolbar_compact' )
- ];
- if ( this.options.shouldGroupWhenFull && this.options.isFloating ) {
- classes.push( 'ck-toolbar_floating' );
- }
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: classes,
- role: 'toolbar',
- 'aria-label': bind.to( 'ariaLabel' ),
- style: {
- maxWidth: bind.to( 'maxWidth' )
- }
- },
- children: this.children,
- on: {
- // https://github.com/ckeditor/ckeditor5-ui/issues/206
- mousedown: Object(_bindings_preventdefault_js__WEBPACK_IMPORTED_MODULE_7__["default"])( this )
- }
- } );
- /**
- * An instance of the active toolbar behavior that shapes its look and functionality.
- *
- * See {@link module:ui/toolbar/toolbarview~ToolbarBehavior} to learn more.
- *
- * @protected
- * @readonly
- * @member {module:ui/toolbar/toolbarview~ToolbarBehavior}
- */
- this._behavior = this.options.shouldGroupWhenFull ? new DynamicGrouping( this ) : new StaticLayout( this );
- }
- /**
- * @inheritDoc
- */
- render() {
- super.render();
- // Children added before rendering should be known to the #focusTracker.
- for ( const item of this.items ) {
- this.focusTracker.add( item.element );
- }
- this.items.on( 'add', ( evt, item ) => {
- this.focusTracker.add( item.element );
- } );
- this.items.on( 'remove', ( evt, item ) => {
- this.focusTracker.remove( item.element );
- } );
- // Start listening for the keystrokes coming from #element.
- this.keystrokes.listenTo( this.element );
- this._behavior.render( this );
- }
- /**
- * @inheritDoc
- */
- destroy() {
- this._behavior.destroy();
- return super.destroy();
- }
- /**
- * Focuses the first focusable in {@link #focusables}.
- */
- focus() {
- this._focusCycler.focusFirst();
- }
- /**
- * Focuses the last focusable in {@link #focusables}.
- */
- focusLast() {
- this._focusCycler.focusLast();
- }
- /**
- * A utility that expands the plain toolbar configuration into
- * {@link module:ui/toolbar/toolbarview~ToolbarView#items} using a given component factory.
- *
- * @param {Array.<String>|Object} itemsOrConfig The toolbar items or the entire toolbar configuration object.
- * @param {module:ui/componentfactory~ComponentFactory} factory A factory producing toolbar items.
- */
- fillFromConfig( itemsOrConfig, factory ) {
- const config = Object(_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_12__["default"])( itemsOrConfig );
- const itemsToClean = config.items
- .filter( ( name, idx, items ) => {
- if ( name === '|' ) {
- return true;
- }
- // Items listed in `config.removeItems` should not be added to the toolbar.
- if ( config.removeItems.indexOf( name ) !== -1 ) {
- return false;
- }
- if ( name === '-' ) {
- // The toolbar line breaks must not be rendered when toolbar grouping is enabled.
- // (https://github.com/ckeditor/ckeditor5/issues/8582)
- if ( this.options.shouldGroupWhenFull ) {
- /**
- * The toolbar multiline breaks (`-` items) only work when the automatic button grouping
- * is disabled in the toolbar configuration.
- * To do this, set the `shouldNotGroupWhenFull` option to `true` in the editor configuration:
- *
- * const config = {
- * toolbar: {
- * items: [ ... ],
- * shouldNotGroupWhenFull: true
- * }
- * }
- *
- * Learn more about {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar configuration}.
- *
- * @error toolbarview-line-break-ignored-when-grouping-items
- */
- Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["logWarning"])( 'toolbarview-line-break-ignored-when-grouping-items', items );
- return false;
- }
- return true;
- }
- // For the items that cannot be instantiated we are sending warning message. We also filter them out.
- if ( !factory.has( name ) ) {
- /**
- * There was a problem processing the configuration of the toolbar. The item with the given
- * name does not exist so it was omitted when rendering the toolbar.
- *
- * This warning usually shows up when the {@link module:core/plugin~Plugin} which is supposed
- * to provide a toolbar item has not been loaded or there is a typo in the configuration.
- *
- * Make sure the plugin responsible for this toolbar item is loaded and the toolbar configuration
- * is correct, e.g. {@link module:basic-styles/bold~Bold} is loaded for the `'bold'` toolbar item.
- *
- * You can use the following snippet to retrieve all available toolbar items:
- *
- * Array.from( editor.ui.componentFactory.names() );
- *
- * @error toolbarview-item-unavailable
- * @param {String} name The name of the component.
- */
- Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["logWarning"])( 'toolbarview-item-unavailable', { name } );
- return false;
- }
- return true;
- } );
- const itemsToAdd = this._cleanSeparators( itemsToClean )
- // Instantiate toolbar items.
- .map( name => {
- if ( name === '|' ) {
- return new _toolbarseparatorview__WEBPACK_IMPORTED_MODULE_4__["default"]();
- } else if ( name === '-' ) {
- return new _toolbarlinebreakview__WEBPACK_IMPORTED_MODULE_5__["default"]();
- }
- return factory.create( name );
- } );
- this.items.addMany( itemsToAdd );
- }
- /**
- * Remove leading, trailing, and duplicated separators (`-` and `|`).
- *
- * @private
- * @param {Array.<String>} items
- */
- _cleanSeparators( items ) {
- const nonSeparatorPredicate = item => ( item !== '-' && item !== '|' );
- const count = items.length;
- // Find an index of the first item that is not a separator.
- const firstCommandItem = items.findIndex( nonSeparatorPredicate );
- // Search from the end of the list, then convert found index back to the original direction.
- const lastCommandItem = count - items
- .slice()
- .reverse()
- .findIndex( nonSeparatorPredicate );
- return items
- // Return items without the leading and trailing separators.
- .slice( firstCommandItem, lastCommandItem )
- // Remove duplicated separators.
- .filter( ( name, idx, items ) => {
- // Filter only separators.
- if ( nonSeparatorPredicate( name ) ) {
- return true;
- }
- const isDuplicated = idx > 0 && items[ idx - 1 ] === name;
- return !isDuplicated;
- } );
- }
- /**
- * Fired when some toolbar {@link #items} were grouped or ungrouped as a result of some change
- * in the toolbar geometry.
- *
- * **Note**: This event is always fired **once** regardless of the number of items that were be
- * grouped or ungrouped at a time.
- *
- * **Note**: This event is fired only if the items grouping functionality was enabled in
- * the first place (see {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull}).
- *
- * @event groupedItemsUpdate
- */
- }
- /**
- * An inner block of the {@link module:ui/toolbar/toolbarview~ToolbarView} hosting its
- * {@link module:ui/toolbar/toolbarview~ToolbarView#items}.
- *
- * @private
- * @extends module:ui/view~View
- */
- class ItemsView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- /**
- * A collection of items (buttons, dropdowns, etc.).
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.children = this.createCollection();
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-toolbar__items'
- ]
- },
- children: this.children
- } );
- }
- }
- /**
- * A toolbar behavior that makes it static and unresponsive to the changes of the environment.
- * At the same time, it also makes it possible to display a toolbar with a vertical layout
- * using the {@link module:ui/toolbar/toolbarview~ToolbarView#isVertical} property.
- *
- * @private
- * @implements module:ui/toolbar/toolbarview~ToolbarBehavior
- */
- class StaticLayout {
- /**
- * Creates an instance of the {@link module:ui/toolbar/toolbarview~StaticLayout} toolbar
- * behavior.
- *
- * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior
- * is added to.
- */
- constructor( view ) {
- const bind = view.bindTemplate;
- // Static toolbar can be vertical when needed.
- view.set( 'isVertical', false );
- // 1:1 pass–through binding, all ToolbarView#items are visible.
- view.itemsView.children.bindTo( view.items ).using( item => item );
- // 1:1 pass–through binding, all ToolbarView#items are focusable.
- view.focusables.bindTo( view.items ).using( item => item );
- view.extendTemplate( {
- attributes: {
- class: [
- // When vertical, the toolbar has an additional CSS class.
- bind.if( 'isVertical', 'ck-toolbar_vertical' )
- ]
- }
- } );
- }
- /**
- * @inheritDoc
- */
- render() {}
- /**
- * @inheritDoc
- */
- destroy() {}
- }
- /**
- * A toolbar behavior that makes the items respond to changes in the geometry.
- *
- * In a nutshell, it groups {@link module:ui/toolbar/toolbarview~ToolbarView#items}
- * that do not fit visually into a single row of the toolbar (due to limited space).
- * Items that do not fit are aggregated in a dropdown displayed at the end of the toolbar.
- *
- * ┌──────────────────────────────────────── ToolbarView ──────────────────────────────────────────┐
- * | ┌─────────────────────────────────────── #children ─────────────────────────────────────────┐ |
- * | | ┌─────── #itemsView ────────┐ ┌──────────────────────┐ ┌── #groupedItemsDropdown ───┐ | |
- * | | | #ungroupedItems | | ToolbarSeparatorView | | #groupedItems | | |
- * | | └──────────────────────────-┘ └──────────────────────┘ └────────────────────────────┘ | |
- * | | \---------- only when toolbar items overflow --------/ | |
- * | └───────────────────────────────────────────────────────────────────────────────────────────┘ |
- * └───────────────────────────────────────────────────────────────────────────────────────────────┘
- *
- * @private
- * @implements module:ui/toolbar/toolbarview~ToolbarBehavior
- */
- class DynamicGrouping {
- /**
- * Creates an instance of the {@link module:ui/toolbar/toolbarview~DynamicGrouping} toolbar
- * behavior.
- *
- * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior
- * is added to.
- */
- constructor( view ) {
- /**
- * A toolbar view this behavior belongs to.
- *
- * @readonly
- * @member {module:ui/toolbar~ToolbarView}
- */
- this.view = view;
- /**
- * A collection of toolbar children.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.viewChildren = view.children;
- /**
- * A collection of focusable toolbar elements.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.viewFocusables = view.focusables;
- /**
- * A view containing toolbar items.
- *
- * @readonly
- * @member {module:ui/toolbar/toolbarview~ItemsView}
- */
- this.viewItemsView = view.itemsView;
- /**
- * Toolbar focus tracker.
- *
- * @readonly
- * @member {module:utils/focustracker~FocusTracker}
- */
- this.viewFocusTracker = view.focusTracker;
- /**
- * Toolbar locale.
- *
- * @readonly
- * @member {module:utils/locale~Locale}
- */
- this.viewLocale = view.locale;
- /**
- * Toolbar element.
- *
- * @readonly
- * @member {HTMLElement} #viewElement
- */
- /**
- * A subset of toolbar {@link module:ui/toolbar/toolbarview~ToolbarView#items}.
- * Aggregates items that fit into a single row of the toolbar and were not {@link #groupedItems grouped}
- * into a {@link #groupedItemsDropdown dropdown}. Items of this collection are displayed in the
- * {@link module:ui/toolbar/toolbarview~ToolbarView#itemsView}.
- *
- * When none of the {@link module:ui/toolbar/toolbarview~ToolbarView#items} were grouped, it
- * matches the {@link module:ui/toolbar/toolbarview~ToolbarView#items} collection in size and order.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.ungroupedItems = view.createCollection();
- /**
- * A subset of toolbar {@link module:ui/toolbar/toolbarview~ToolbarView#items}.
- * A collection of the toolbar items that do not fit into a single row of the toolbar.
- * Grouped items are displayed in a dedicated {@link #groupedItemsDropdown dropdown}.
- *
- * When none of the {@link module:ui/toolbar/toolbarview~ToolbarView#items} were grouped,
- * this collection is empty.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.groupedItems = view.createCollection();
- /**
- * The dropdown that aggregates {@link #groupedItems grouped items} that do not fit into a single
- * row of the toolbar. It is displayed on demand as the last of
- * {@link module:ui/toolbar/toolbarview~ToolbarView#children toolbar children} and offers another
- * (nested) toolbar which displays items that would normally overflow.
- *
- * @readonly
- * @member {module:ui/dropdown/dropdownview~DropdownView}
- */
- this.groupedItemsDropdown = this._createGroupedItemsDropdown();
- /**
- * An instance of the resize observer that helps dynamically determine the geometry of the toolbar
- * and manage items that do not fit into a single row.
- *
- * **Note:** Created in {@link #_enableGroupingOnResize}.
- *
- * @readonly
- * @member {module:utils/dom/resizeobserver~ResizeObserver}
- */
- this.resizeObserver = null;
- /**
- * A cached value of the horizontal padding style used by {@link #_updateGrouping}
- * to manage the {@link module:ui/toolbar/toolbarview~ToolbarView#items} that do not fit into
- * a single toolbar line. This value can be reused between updates because it is unlikely that
- * the padding will change and re–using `Window.getComputedStyle()` is expensive.
- *
- * @readonly
- * @member {Number}
- */
- this.cachedPadding = null;
- /**
- * A flag indicating that an items grouping update has been queued (e.g. due to the toolbar being visible)
- * and should be executed immediately the next time the toolbar shows up.
- *
- * @readonly
- * @member {Boolean}
- */
- this.shouldUpdateGroupingOnNextResize = false;
- // Only those items that were not grouped are visible to the user.
- view.itemsView.children.bindTo( this.ungroupedItems ).using( item => item );
- // Make sure all #items visible in the main space of the toolbar are "focuscycleable".
- this.ungroupedItems.on( 'add', this._updateFocusCycleableItems.bind( this ) );
- this.ungroupedItems.on( 'remove', this._updateFocusCycleableItems.bind( this ) );
- // Make sure the #groupedItemsDropdown is also included in cycling when it appears.
- view.children.on( 'add', this._updateFocusCycleableItems.bind( this ) );
- view.children.on( 'remove', this._updateFocusCycleableItems.bind( this ) );
- // ToolbarView#items is dynamic. When an item is added or removed, it should be automatically
- // represented in either grouped or ungrouped items at the right index.
- // In other words #items == concat( #ungroupedItems, #groupedItems )
- // (in length and order).
- view.items.on( 'change', ( evt, changeData ) => {
- const index = changeData.index;
- // Removing.
- for ( const removedItem of changeData.removed ) {
- if ( index >= this.ungroupedItems.length ) {
- this.groupedItems.remove( removedItem );
- } else {
- this.ungroupedItems.remove( removedItem );
- }
- }
- // Adding.
- for ( let currentIndex = index; currentIndex < index + changeData.added.length; currentIndex++ ) {
- const addedItem = changeData.added[ currentIndex - index ];
- if ( currentIndex > this.ungroupedItems.length ) {
- this.groupedItems.add( addedItem, currentIndex - this.ungroupedItems.length );
- } else {
- this.ungroupedItems.add( addedItem, currentIndex );
- }
- }
- // When new ungrouped items join in and land in #ungroupedItems, there's a chance it causes
- // the toolbar to overflow.
- // Consequently if removed from grouped or ungrouped items, there is a chance
- // some new space is available and we could do some ungrouping.
- this._updateGrouping();
- } );
- view.extendTemplate( {
- attributes: {
- class: [
- // To group items dynamically, the toolbar needs a dedicated CSS class.
- 'ck-toolbar_grouping'
- ]
- }
- } );
- }
- /**
- * Enables dynamic items grouping based on the dimensions of the toolbar.
- *
- * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior
- * is added to.
- */
- render( view ) {
- this.viewElement = view.element;
- this._enableGroupingOnResize();
- this._enableGroupingOnMaxWidthChange( view );
- }
- /**
- * Cleans up the internals used by this behavior.
- */
- destroy() {
- // The dropdown may not be in ToolbarView#children at the moment of toolbar destruction
- // so let's make sure it's actually destroyed along with the toolbar.
- this.groupedItemsDropdown.destroy();
- this.resizeObserver.destroy();
- }
- /**
- * When called, it will check if any of the {@link #ungroupedItems} do not fit into a single row of the toolbar,
- * and it will move them to the {@link #groupedItems} when it happens.
- *
- * At the same time, it will also check if there is enough space in the toolbar for the first of the
- * {@link #groupedItems} to be returned back to {@link #ungroupedItems} and still fit into a single row
- * without the toolbar wrapping.
- *
- * @protected
- */
- _updateGrouping() {
- // Do no grouping–related geometry analysis when the toolbar is detached from visible DOM,
- // for instance before #render(), or after render but without a parent or a parent detached
- // from DOM. DOMRects won't work anyway and there will be tons of warning in the console and
- // nothing else. This happens, for instance, when the toolbar is detached from DOM and
- // some logic adds or removes its #items.
- if ( !this.viewElement.ownerDocument.body.contains( this.viewElement ) ) {
- return;
- }
- // Do not update grouping when the element is invisible. Such toolbar has DOMRect filled with zeros
- // and that would cause all items to be grouped. Instead, queue the grouping so it runs next time
- // the toolbar is visible (the next ResizeObserver callback execution). This is handy because
- // the grouping could be caused by increasing the #maxWidth when the toolbar was invisible and the next
- // time it shows up, some items could actually be ungrouped (https://github.com/ckeditor/ckeditor5/issues/6575).
- if ( !this.viewElement.offsetParent ) {
- this.shouldUpdateGroupingOnNextResize = true;
- return;
- }
- // Remember how many items were initially grouped so at the it is possible to figure out if the number
- // of grouped items has changed. If the number has changed, geometry of the toolbar has also changed.
- const initialGroupedItemsCount = this.groupedItems.length;
- let wereItemsGrouped;
- // Group #items as long as some wrap to the next row. This will happen, for instance,
- // when the toolbar is getting narrow and there is not enough space to display all items in
- // a single row.
- while ( this._areItemsOverflowing ) {
- this._groupLastItem();
- wereItemsGrouped = true;
- }
- // If none were grouped now but there were some items already grouped before,
- // then, what the hell, maybe let's see if some of them can be ungrouped. This happens when,
- // for instance, the toolbar is stretching and there's more space in it than before.
- if ( !wereItemsGrouped && this.groupedItems.length ) {
- // Ungroup items as long as none are overflowing or there are none to ungroup left.
- while ( this.groupedItems.length && !this._areItemsOverflowing ) {
- this._ungroupFirstItem();
- }
- // If the ungrouping ended up with some item wrapping to the next row,
- // put it back to the group toolbar ("undo the last ungroup"). We don't know whether
- // an item will wrap or not until we ungroup it (that's a DOM/CSS thing) so this
- // clean–up is vital for the algorithm.
- if ( this._areItemsOverflowing ) {
- this._groupLastItem();
- }
- }
- if ( this.groupedItems.length !== initialGroupedItemsCount ) {
- this.view.fire( 'groupedItemsUpdate' );
- }
- }
- /**
- * Returns `true` when {@link module:ui/toolbar/toolbarview~ToolbarView#element} children visually overflow,
- * for instance if the toolbar is narrower than its members. Returns `false` otherwise.
- *
- * @private
- * @type {Boolean}
- */
- get _areItemsOverflowing() {
- // An empty toolbar cannot overflow.
- if ( !this.ungroupedItems.length ) {
- return false;
- }
- const element = this.viewElement;
- const uiLanguageDirection = this.viewLocale.uiLanguageDirection;
- const lastChildRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_8__["default"]( element.lastChild );
- const toolbarRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_8__["default"]( element );
- if ( !this.cachedPadding ) {
- const computedStyle = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__["default"].window.getComputedStyle( element );
- const paddingProperty = uiLanguageDirection === 'ltr' ? 'paddingRight' : 'paddingLeft';
- // parseInt() is essential because of quirky floating point numbers logic and DOM.
- // If the padding turned out too big because of that, the grouped items dropdown would
- // always look (from the Rect perspective) like it overflows (while it's not).
- this.cachedPadding = Number.parseInt( computedStyle[ paddingProperty ] );
- }
- if ( uiLanguageDirection === 'ltr' ) {
- return lastChildRect.right > toolbarRect.right - this.cachedPadding;
- } else {
- return lastChildRect.left < toolbarRect.left + this.cachedPadding;
- }
- }
- /**
- * Enables the functionality that prevents {@link #ungroupedItems} from overflowing (wrapping to the next row)
- * upon resize when there is little space available. Instead, the toolbar items are moved to the
- * {@link #groupedItems} collection and displayed in a dropdown at the end of the row (which has its own nested toolbar).
- *
- * When called, the toolbar will automatically analyze the location of its {@link #ungroupedItems} and "group"
- * them in the dropdown if necessary. It will also observe the browser window for size changes in
- * the future and respond to them by grouping more items or reverting already grouped back, depending
- * on the visual space available.
- *
- * @private
- */
- _enableGroupingOnResize() {
- let previousWidth;
- // TODO: Consider debounce.
- this.resizeObserver = new _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_6__["default"]( this.viewElement, entry => {
- if ( !previousWidth || previousWidth !== entry.contentRect.width || this.shouldUpdateGroupingOnNextResize ) {
- this.shouldUpdateGroupingOnNextResize = false;
- this._updateGrouping();
- previousWidth = entry.contentRect.width;
- }
- } );
- this._updateGrouping();
- }
- /**
- * Enables the grouping functionality, just like {@link #_enableGroupingOnResize} but the difference is that
- * it listens to the changes of {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth} instead.
- *
- * @private
- */
- _enableGroupingOnMaxWidthChange( view ) {
- view.on( 'change:maxWidth', () => {
- this._updateGrouping();
- } );
- }
- /**
- * When called, it will remove the last item from {@link #ungroupedItems} and move it back
- * to the {@link #groupedItems} collection.
- *
- * The opposite of {@link #_ungroupFirstItem}.
- *
- * @private
- */
- _groupLastItem() {
- if ( !this.groupedItems.length ) {
- this.viewChildren.add( new _toolbarseparatorview__WEBPACK_IMPORTED_MODULE_4__["default"]() );
- this.viewChildren.add( this.groupedItemsDropdown );
- this.viewFocusTracker.add( this.groupedItemsDropdown.element );
- }
- this.groupedItems.add( this.ungroupedItems.remove( this.ungroupedItems.last ), 0 );
- }
- /**
- * Moves the very first item belonging to {@link #groupedItems} back
- * to the {@link #ungroupedItems} collection.
- *
- * The opposite of {@link #_groupLastItem}.
- *
- * @private
- */
- _ungroupFirstItem() {
- this.ungroupedItems.add( this.groupedItems.remove( this.groupedItems.first ) );
- if ( !this.groupedItems.length ) {
- this.viewChildren.remove( this.groupedItemsDropdown );
- this.viewChildren.remove( this.viewChildren.last );
- this.viewFocusTracker.remove( this.groupedItemsDropdown.element );
- }
- }
- /**
- * Creates the {@link #groupedItemsDropdown} that hosts the members of the {@link #groupedItems}
- * collection when there is not enough space in the toolbar to display all items in a single row.
- *
- * @private
- * @returns {module:ui/dropdown/dropdownview~DropdownView}
- */
- _createGroupedItemsDropdown() {
- const locale = this.viewLocale;
- const t = locale.t;
- const dropdown = Object(_dropdown_utils__WEBPACK_IMPORTED_MODULE_10__["createDropdown"])( locale );
- dropdown.class = 'ck-toolbar__grouped-dropdown';
- // Make sure the dropdown never sticks out to the left/right. It should be under the main toolbar.
- // (https://github.com/ckeditor/ckeditor5/issues/5608)
- dropdown.panelPosition = locale.uiLanguageDirection === 'ltr' ? 'sw' : 'se';
- Object(_dropdown_utils__WEBPACK_IMPORTED_MODULE_10__["addToolbarToDropdown"])( dropdown, [] );
- dropdown.buttonView.set( {
- label: t( 'Show more items' ),
- tooltip: true,
- tooltipPosition: locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw',
- icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_13__["icons"].threeVerticalDots
- } );
- // 1:1 pass–through binding.
- dropdown.toolbarView.items.bindTo( this.groupedItems ).using( item => item );
- return dropdown;
- }
- /**
- * Updates the {@link module:ui/toolbar/toolbarview~ToolbarView#focusables focus–cycleable items}
- * collection so it represents the up–to–date state of the UI from the perspective of the user.
- *
- * For instance, the {@link #groupedItemsDropdown} can show up and hide but when it is visible,
- * it must be subject to focus cycling in the toolbar.
- *
- * See the {@link module:ui/toolbar/toolbarview~ToolbarView#focusables collection} documentation
- * to learn more about the purpose of this method.
- *
- * @private
- */
- _updateFocusCycleableItems() {
- this.viewFocusables.clear();
- this.ungroupedItems.map( item => {
- this.viewFocusables.add( item );
- } );
- if ( this.groupedItems.length ) {
- this.viewFocusables.add( this.groupedItemsDropdown );
- }
- }
- }
- /**
- * Options passed to the {@link module:ui/toolbar/toolbarview~ToolbarView#constructor} of the toolbar.
- *
- * @interface module:ui/toolbar/toolbarview~ToolbarOptions
- */
- /**
- * When set to `true`, the toolbar will automatically group {@link module:ui/toolbar/toolbarview~ToolbarView#items} that
- * would normally wrap to the next line when there is not enough space to display them in a single row, for
- * instance, if the parent container of the toolbar is narrow. For toolbars in absolutely positioned containers
- * without width restrictions also the {@link module:ui/toolbar/toolbarview~ToolbarOptions#isFloating} option is required to be `true`.
- *
- * See also: {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth}.
- *
- * @member {Boolean} module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull
- */
- /**
- * This option should be enabled for toolbars in absolutely positioned containers without width restrictions
- * to enable automatic {@link module:ui/toolbar/toolbarview~ToolbarView#items} grouping.
- * When this option is set to `true`, the items will stop wrapping to the next line
- * and together with {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull},
- * this will allow grouping them when there is not enough space in a single row.
- *
- * @member {Boolean} module:ui/toolbar/toolbarview~ToolbarOptions#isFloating
- */
- /**
- * A class interface defining the behavior of the {@link module:ui/toolbar/toolbarview~ToolbarView}.
- *
- * Toolbar behaviors extend its look and functionality and have an impact on the
- * {@link module:ui/toolbar/toolbarview~ToolbarView#element} template or
- * {@link module:ui/toolbar/toolbarview~ToolbarView#render rendering}. They can be enabled
- * conditionally, e.g. depending on the configuration of the toolbar.
- *
- * @private
- * @interface module:ui/toolbar/toolbarview~ToolbarBehavior
- */
- /**
- * Creates a new toolbar behavior instance.
- *
- * The instance is created in the {@link module:ui/toolbar/toolbarview~ToolbarView#constructor} of the toolbar.
- * This is the right place to extend the {@link module:ui/toolbar/toolbarview~ToolbarView#template} of
- * the toolbar, define extra toolbar properties, etc.
- *
- * @method #constructor
- * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior is added to.
- */
- /**
- * A method called after the toolbar has been {@link module:ui/toolbar/toolbarview~ToolbarView#render rendered}.
- * It can be used to, for example, customize the behavior of the toolbar when its {@link module:ui/toolbar/toolbarview~ToolbarView#element}
- * is available.
- *
- * @readonly
- * @member {Function} #render
- * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar being rendered.
- */
- /**
- * A method called after the toolbar has been {@link module:ui/toolbar/toolbarview~ToolbarView#destroy destroyed}.
- * It allows cleaning up after the toolbar behavior, for instance, this is the right place to detach
- * event listeners, free up references, etc.
- *
- * @readonly
- * @member {Function} #destroy
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TooltipView; });
- /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _theme_components_tooltip_tooltip_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/components/tooltip/tooltip.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css");
- /* harmony import */ var _theme_components_tooltip_tooltip_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_theme_components_tooltip_tooltip_css__WEBPACK_IMPORTED_MODULE_1__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/tooltip/tooltipview
- */
- /**
- * The tooltip view class.
- *
- * @extends module:ui/view~View
- */
- class TooltipView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- /**
- * The text of the tooltip visible to the user.
- *
- * @observable
- * @member {String} #text
- */
- this.set( 'text', '' );
- /**
- * The position of the tooltip (south, south-west, south-east, or north).
- *
- * +-----------+
- * | north |
- * +-----------+
- * V
- * [element]
- *
- * [element]
- * ^
- * +-----------+
- * | south |
- * +-----------+
- *
- * +----------+
- * [element] < | east |
- * +----------+
- *
- * +----------+
- * | west | > [element]
- * +----------+
- *
- * [element]
- * ^
- * +--------------+
- * | south west |
- * +--------------+
- *
- * [element]
- * ^
- * +--------------+
- * | south east |
- * +--------------+
- * @observable
- * @default 's'
- * @member {'s'|'n'|'e'|'w'|'sw'|'se'} #position
- */
- this.set( 'position', 's' );
- const bind = this.bindTemplate;
- this.setTemplate( {
- tag: 'span',
- attributes: {
- class: [
- 'ck',
- 'ck-tooltip',
- bind.to( 'position', position => 'ck-tooltip_' + position ),
- bind.if( 'text', 'ck-hidden', value => !value.trim() )
- ]
- },
- children: [
- {
- tag: 'span',
- attributes: {
- class: [
- 'ck',
- 'ck-tooltip__text'
- ]
- },
- children: [
- {
- text: bind.to( 'text' )
- }
- ]
- }
- ]
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js":
- /*!*********************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/view.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return View; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
- /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
- /* harmony import */ var _theme_globals_globals_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/globals/globals.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css");
- /* harmony import */ var _theme_globals_globals_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_theme_globals_globals_css__WEBPACK_IMPORTED_MODULE_8__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/view
- */
- /**
- * The basic view class, which represents an HTML element created out of a
- * {@link module:ui/view~View#template}. Views are building blocks of the user interface and handle
- * interaction
- *
- * Views {@link module:ui/view~View#registerChild aggregate} children in
- * {@link module:ui/view~View#createCollection collections} and manage the life cycle of DOM
- * listeners e.g. by handling rendering and destruction.
- *
- * See the {@link module:ui/template~TemplateDefinition} syntax to learn more about shaping view
- * elements, attributes and listeners.
- *
- * class SampleView extends View {
- * constructor( locale ) {
- * super( locale );
- *
- * const bind = this.bindTemplate;
- *
- * // Views define their interface (state) using observable attributes.
- * this.set( 'elementClass', 'bar' );
- *
- * this.setTemplate( {
- * tag: 'p',
- *
- * // The element of the view can be defined with its children.
- * children: [
- * 'Hello',
- * {
- * tag: 'b',
- * children: [ 'world!' ]
- * }
- * ],
- * attributes: {
- * class: [
- * 'foo',
- *
- * // Observable attributes control the state of the view in DOM.
- * bind.to( 'elementClass' )
- * ]
- * },
- * on: {
- * // Views listen to DOM events and propagate them.
- * click: bind.to( 'clicked' )
- * }
- * } );
- * }
- * }
- *
- * const view = new SampleView( locale );
- *
- * view.render();
- *
- * // Append <p class="foo bar">Hello<b>world</b></p> to the <body>
- * document.body.appendChild( view.element );
- *
- * // Change the class attribute to <p class="foo baz">Hello<b>world</b></p>
- * view.elementClass = 'baz';
- *
- * // Respond to the "click" event in DOM by executing a custom action.
- * view.on( 'clicked', () => {
- * console.log( 'The view has been clicked!' );
- * } );
- *
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class View {
- /**
- * Creates an instance of the {@link module:ui/view~View} class.
- *
- * Also see {@link #render}.
- *
- * @param {module:utils/locale~Locale} [locale] The localization services instance.
- */
- constructor( locale ) {
- /**
- * An HTML element of the view. `null` until {@link #render rendered}
- * from the {@link #template}.
- *
- * class SampleView extends View {
- * constructor() {
- * super();
- *
- * // A template instance the #element will be created from.
- * this.setTemplate( {
- * tag: 'p'
- *
- * // ...
- * } );
- * }
- * }
- *
- * const view = new SampleView();
- *
- * // Renders the #template.
- * view.render();
- *
- * // Append the HTML element of the view to <body>.
- * document.body.appendChild( view.element );
- *
- * **Note**: The element of the view can also be assigned directly:
- *
- * view.element = document.querySelector( '#my-container' );
- *
- * @member {HTMLElement}
- */
- this.element = null;
- /**
- * Set `true` when the view has already been {@link module:ui/view~View#render rendered}.
- *
- * @readonly
- * @member {Boolean} #isRendered
- */
- this.isRendered = false;
- /**
- * A set of tools to localize the user interface.
- *
- * Also see {@link module:core/editor/editor~Editor#locale}.
- *
- * @readonly
- * @member {module:utils/locale~Locale}
- */
- this.locale = locale;
- /**
- * Shorthand for {@link module:utils/locale~Locale#t}.
- *
- * Note: If {@link #locale} instance hasn't been passed to the view this method may not
- * be available.
- *
- * @see module:utils/locale~Locale#t
- * @method
- */
- this.t = locale && locale.t;
- /**
- * Collections registered with {@link #createCollection}.
- *
- * @protected
- * @member {Set.<module:ui/viewcollection~ViewCollection>}
- */
- this._viewCollections = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_5__["default"]();
- /**
- * A collection of view instances, which have been added directly
- * into the {@link module:ui/template~Template#children}.
- *
- * @protected
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this._unboundChildren = this.createCollection();
- // Pass parent locale to its children.
- this._viewCollections.on( 'add', ( evt, collection ) => {
- collection.locale = locale;
- } );
- /**
- * Template of this view. It provides the {@link #element} representing
- * the view in DOM, which is {@link #render rendered}.
- *
- * @member {module:ui/template~Template} #template
- */
- /**
- * Cached {@link module:ui/template~BindChain bind chain} object created by the
- * {@link #template}. See {@link #bindTemplate}.
- *
- * @private
- * @member {Object} #_bindTemplate
- */
- this.decorate( 'render' );
- }
- /**
- * Shorthand for {@link module:ui/template~Template.bind}, a binding
- * {@link module:ui/template~BindChain interface} pre–configured for the view instance.
- *
- * It provides {@link module:ui/template~BindChain#to `to()`} and
- * {@link module:ui/template~BindChain#if `if()`} methods that initialize bindings with
- * observable attributes and attach DOM listeners.
- *
- * class SampleView extends View {
- * constructor( locale ) {
- * super( locale );
- *
- * const bind = this.bindTemplate;
- *
- * // These {@link module:utils/observablemixin~Observable observable} attributes will control
- * // the state of the view in DOM.
- * this.set( {
- * elementClass: 'foo',
- * isEnabled: true
- * } );
- *
- * this.setTemplate( {
- * tag: 'p',
- *
- * attributes: {
- * // The class HTML attribute will follow elementClass
- * // and isEnabled view attributes.
- * class: [
- * bind.to( 'elementClass' )
- * bind.if( 'isEnabled', 'present-when-enabled' )
- * ]
- * },
- *
- * on: {
- * // The view will fire the "clicked" event upon clicking <p> in DOM.
- * click: bind.to( 'clicked' )
- * }
- * } );
- * }
- * }
- *
- * @method #bindTemplate
- */
- get bindTemplate() {
- if ( this._bindTemplate ) {
- return this._bindTemplate;
- }
- return ( this._bindTemplate = _template__WEBPACK_IMPORTED_MODULE_2__["default"].bind( this, this ) );
- }
- /**
- * Creates a new collection of views, which can be used as
- * {@link module:ui/template~Template#children} of this view.
- *
- * class SampleView extends View {
- * constructor( locale ) {
- * super( locale );
- *
- * const child = new ChildView( locale );
- * this.items = this.createCollection( [ child ] );
- *
- * this.setTemplate( {
- * tag: 'p',
- *
- * // `items` collection will render here.
- * children: this.items
- * } );
- * }
- * }
- *
- * const view = new SampleView( locale );
- * view.render();
- *
- * // It will append <p><child#element></p> to the <body>.
- * document.body.appendChild( view.element );
- *
- * @param {Iterable.<module:ui/view~View>} [views] Initial views of the collection.
- * @returns {module:ui/viewcollection~ViewCollection} A new collection of view instances.
- */
- createCollection( views ) {
- const collection = new _viewcollection__WEBPACK_IMPORTED_MODULE_1__["default"]( views );
- this._viewCollections.add( collection );
- return collection;
- }
- /**
- * Registers a new child view under the view instance. Once registered, a child
- * view is managed by its parent, including {@link #render rendering}
- * and {@link #destroy destruction}.
- *
- * To revert this, use {@link #deregisterChild}.
- *
- * class SampleView extends View {
- * constructor( locale ) {
- * super( locale );
- *
- * this.childA = new SomeChildView( locale );
- * this.childB = new SomeChildView( locale );
- *
- * this.setTemplate( { tag: 'p' } );
- *
- * // Register the children.
- * this.registerChild( [ this.childA, this.childB ] );
- * }
- *
- * render() {
- * super.render();
- *
- * this.element.appendChild( this.childA.element );
- * this.element.appendChild( this.childB.element );
- * }
- * }
- *
- * const view = new SampleView( locale );
- *
- * view.render();
- *
- * // Will append <p><childA#element><b></b><childB#element></p>.
- * document.body.appendChild( view.element );
- *
- * **Note**: There's no need to add child views if they're already referenced in the
- * {@link #template}:
- *
- * class SampleView extends View {
- * constructor( locale ) {
- * super( locale );
- *
- * this.childA = new SomeChildView( locale );
- * this.childB = new SomeChildView( locale );
- *
- * this.setTemplate( {
- * tag: 'p',
- *
- * // These children will be added automatically. There's no
- * // need to call {@link #registerChild} for any of them.
- * children: [ this.childA, this.childB ]
- * } );
- * }
- *
- * // ...
- * }
- *
- * @param {module:ui/view~View|Iterable.<module:ui/view~View>} children Children views to be registered.
- */
- registerChild( children ) {
- if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__["default"])( children ) ) {
- children = [ children ];
- }
- for ( const child of children ) {
- this._unboundChildren.add( child );
- }
- }
- /**
- * The opposite of {@link #registerChild}. Removes a child view from this view instance.
- * Once removed, the child is no longer managed by its parent, e.g. it can safely
- * become a child of another parent view.
- *
- * @see #registerChild
- * @param {module:ui/view~View|Iterable.<module:ui/view~View>} children Child views to be removed.
- */
- deregisterChild( children ) {
- if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__["default"])( children ) ) {
- children = [ children ];
- }
- for ( const child of children ) {
- this._unboundChildren.remove( child );
- }
- }
- /**
- * Sets the {@link #template} of the view with with given definition.
- *
- * A shorthand for:
- *
- * view.setTemplate( definition );
- *
- * @param {module:ui/template~TemplateDefinition} definition Definition of view's template.
- */
- setTemplate( definition ) {
- this.template = new _template__WEBPACK_IMPORTED_MODULE_2__["default"]( definition );
- }
- /**
- * {@link module:ui/template~Template.extend Extends} the {@link #template} of the view with
- * with given definition.
- *
- * A shorthand for:
- *
- * Template.extend( view.template, definition );
- *
- * **Note**: Is requires the {@link #template} to be already set. See {@link #setTemplate}.
- *
- * @param {module:ui/template~TemplateDefinition} definition Definition which
- * extends the {@link #template}.
- */
- extendTemplate( definition ) {
- _template__WEBPACK_IMPORTED_MODULE_2__["default"].extend( this.template, definition );
- }
- /**
- * Recursively renders the view.
- *
- * Once the view is rendered:
- * * the {@link #element} becomes an HTML element out of {@link #template},
- * * the {@link #isRendered} flag is set `true`.
- *
- * **Note**: The children of the view:
- * * defined directly in the {@link #template}
- * * residing in collections created by the {@link #createCollection} method,
- * * and added by {@link #registerChild}
- * are also rendered in the process.
- *
- * In general, `render()` method is the right place to keep the code which refers to the
- * {@link #element} and should be executed at the very beginning of the view's life cycle.
- *
- * It is possible to {@link module:ui/template~Template.extend} the {@link #template} before
- * the view is rendered. To allow an early customization of the view (e.g. by its parent),
- * such references should be done in `render()`.
- *
- * class SampleView extends View {
- * constructor() {
- * this.setTemplate( {
- * // ...
- * } );
- * },
- *
- * render() {
- * // View#element becomes available.
- * super.render();
- *
- * // The "scroll" listener depends on #element.
- * this.listenTo( window, 'scroll', () => {
- * // A reference to #element would render the #template and make it non-extendable.
- * if ( window.scrollY > 0 ) {
- * this.element.scrollLeft = 100;
- * } else {
- * this.element.scrollLeft = 0;
- * }
- * } );
- * }
- * }
- *
- * const view = new SampleView();
- *
- * // Let's customize the view before it gets rendered.
- * view.extendTemplate( {
- * attributes: {
- * class: [
- * 'additional-class'
- * ]
- * }
- * } );
- *
- * // Late rendering allows customization of the view.
- * view.render();
- */
- render() {
- if ( this.isRendered ) {
- /**
- * This View has already been rendered.
- *
- * @error ui-view-render-already-rendered
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'ui-view-render-already-rendered', this );
- }
- // Render #element of the view.
- if ( this.template ) {
- this.element = this.template.render();
- // Auto–register view children from #template.
- this.registerChild( this.template.getViews() );
- }
- this.isRendered = true;
- }
- /**
- * Recursively destroys the view instance and child views added by {@link #registerChild} and
- * residing in collections created by the {@link #createCollection}.
- *
- * Destruction disables all event listeners:
- * * created on the view, e.g. `view.on( 'event', () => {} )`,
- * * defined in the {@link #template} for DOM events.
- */
- destroy() {
- this.stopListening();
- this._viewCollections.map( c => c.destroy() );
- // Template isn't obligatory for views.
- if ( this.template && this.template._revertData ) {
- this.template.revert( this.element );
- }
- }
- /**
- * Event fired by the {@link #render} method. Actual rendering is executed as a listener to
- * this event with the default priority.
- *
- * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
- *
- * @event render
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( View, _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( View, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ViewCollection; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ui/viewcollection
- */
- /**
- * Collects {@link module:ui/view~View} instances.
- *
- * const parentView = new ParentView( locale );
- * const collection = new ViewCollection( locale );
- *
- * collection.setParent( parentView.element );
- *
- * const viewA = new ChildView( locale );
- * const viewB = new ChildView( locale );
- *
- * View collection renders and manages view {@link module:ui/view~View#element elements}:
- *
- * collection.add( viewA );
- * collection.add( viewB );
- *
- * console.log( parentView.element.firsChild ); // -> viewA.element
- * console.log( parentView.element.lastChild ); // -> viewB.element
- *
- * It {@link module:ui/viewcollection~ViewCollection#delegate propagates} DOM events too:
- *
- * // Delegate #click and #keydown events from viewA and viewB to the parentView.
- * collection.delegate( 'click' ).to( parentView );
- *
- * parentView.on( 'click', ( evt ) => {
- * console.log( `${ evt.source } has been clicked.` );
- * } );
- *
- * // This event will be delegated to the parentView.
- * viewB.fire( 'click' );
- *
- * **Note**: A view collection can be used directly in the {@link module:ui/template~TemplateDefinition definition}
- * of a {@link module:ui/template~Template template}.
- *
- * @extends module:utils/collection~Collection
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class ViewCollection extends _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__["default"] {
- /**
- * Creates a new instance of the {@link module:ui/viewcollection~ViewCollection}.
- *
- * @param {Iterable.<module:ui/view~View>} [initialItems] The initial items of the collection.
- */
- constructor( initialItems = [] ) {
- super( initialItems, {
- // An #id Number attribute should be legal and not break the `ViewCollection` instance.
- // https://github.com/ckeditor/ckeditor5-ui/issues/93
- idProperty: 'viewUid'
- } );
- // Handle {@link module:ui/view~View#element} in DOM when a new view is added to the collection.
- this.on( 'add', ( evt, view, index ) => {
- this._renderViewIntoCollectionParent( view, index );
- } );
- // Handle {@link module:ui/view~View#element} in DOM when a view is removed from the collection.
- this.on( 'remove', ( evt, view ) => {
- if ( view.element && this._parentElement ) {
- view.element.remove();
- }
- } );
- /**
- * A parent element within which child views are rendered and managed in DOM.
- *
- * @protected
- * @member {HTMLElement}
- */
- this._parentElement = null;
- }
- /**
- * Destroys the view collection along with child views.
- * See the view {@link module:ui/view~View#destroy} method.
- */
- destroy() {
- this.map( view => view.destroy() );
- }
- /**
- * Sets the parent HTML element of this collection. When parent is set, {@link #add adding} and
- * {@link #remove removing} views in the collection synchronizes their
- * {@link module:ui/view~View#element elements} in the parent element.
- *
- * @param {HTMLElement} element A new parent element.
- */
- setParent( elementOrDocFragment ) {
- this._parentElement = elementOrDocFragment;
- // Take care of the initial collection items passed to the constructor.
- for ( const view of this ) {
- this._renderViewIntoCollectionParent( view );
- }
- }
- /**
- * Delegates selected events coming from within views in the collection to any
- * {@link module:utils/emittermixin~Emitter}.
- *
- * For the following views and collection:
- *
- * const viewA = new View();
- * const viewB = new View();
- * const viewC = new View();
- *
- * const views = parentView.createCollection();
- *
- * views.delegate( 'eventX' ).to( viewB );
- * views.delegate( 'eventX', 'eventY' ).to( viewC );
- *
- * views.add( viewA );
- *
- * the `eventX` is delegated (fired by) `viewB` and `viewC` along with `customData`:
- *
- * viewA.fire( 'eventX', customData );
- *
- * and `eventY` is delegated (fired by) `viewC` along with `customData`:
- *
- * viewA.fire( 'eventY', customData );
- *
- * See {@link module:utils/emittermixin~Emitter#delegate}.
- *
- * @param {...String} events {@link module:ui/view~View} event names to be delegated to another
- * {@link module:utils/emittermixin~Emitter}.
- * @returns {Object}
- * @returns {Function} return.to A function which accepts the destination of
- * {@link module:utils/emittermixin~Emitter#delegate delegated} events.
- */
- delegate( ...events ) {
- if ( !events.length || !isStringArray( events ) ) {
- /**
- * All event names must be strings.
- *
- * @error ui-viewcollection-delegate-wrong-events
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'ui-viewcollection-delegate-wrong-events',
- this
- );
- }
- return {
- /**
- * Selects destination for {@link module:utils/emittermixin~Emitter#delegate} events.
- *
- * @memberOf module:ui/viewcollection~ViewCollection#delegate
- * @function module:ui/viewcollection~ViewCollection#delegate.to
- * @param {module:utils/emittermixin~Emitter} dest An `Emitter` instance which is
- * the destination for delegated events.
- */
- to: dest => {
- // Activate delegating on existing views in this collection.
- for ( const view of this ) {
- for ( const evtName of events ) {
- view.delegate( evtName ).to( dest );
- }
- }
- // Activate delegating on future views in this collection.
- this.on( 'add', ( evt, view ) => {
- for ( const evtName of events ) {
- view.delegate( evtName ).to( dest );
- }
- } );
- // Deactivate delegating when view is removed from this collection.
- this.on( 'remove', ( evt, view ) => {
- for ( const evtName of events ) {
- view.stopDelegating( evtName, dest );
- }
- } );
- }
- };
- }
- /**
- * This method {@link module:ui/view~View#render renders} a new view added to the collection.
- *
- * If the {@link #_parentElement parent element} of the collection is set, this method also adds
- * the view's {@link module:ui/view~View#element} as a child of the parent in DOM at a specified index.
- *
- * **Note**: If index is not specified, the view's element is pushed as the last child
- * of the parent element.
- *
- * @private
- * @param {module:ui/view~View} view A new view added to the collection.
- * @param {Number} [index] An index the view holds in the collection. When not specified,
- * the view is added at the end.
- */
- _renderViewIntoCollectionParent( view, index ) {
- if ( !view.isRendered ) {
- view.render();
- }
- if ( view.element && this._parentElement ) {
- this._parentElement.insertBefore( view.element, this._parentElement.children[ index ] );
- }
- }
- /**
- * Removes a child view from the collection. If the {@link #setParent parent element} of the
- * collection has been set, the {@link module:ui/view~View#element element} of the view is also removed
- * in DOM, reflecting the order of the collection.
- *
- * See the {@link #add} method.
- *
- * @method #remove
- * @param {module:ui/view~View|Number|String} subject The view to remove, its id or index in the collection.
- * @returns {Object} The removed view.
- */
- }
- // Check if all entries of the array are of `String` type.
- //
- // @private
- // @param {Array} arr An array to be checked.
- // @returns {Boolean}
- function isStringArray( arr ) {
- return arr.every( a => typeof a == 'string' );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css ***!
- \********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./button.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css ***!
- \**************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./switchbutton.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css ***!
- \**************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./colorgrid.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css ***!
- \************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./dropdown.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css ***!
- \****************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./listdropdown.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css ***!
- \***************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./splitbutton.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css":
- /*!*******************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css ***!
- \*******************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./toolbardropdown.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css ***!
- \************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./editorui.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css ***!
- \****************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./formheader.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./icon.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css":
- /*!**************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css ***!
- \**************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./inputtext.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css ***!
- \******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./label.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css":
- /*!************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css ***!
- \************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./labeledfieldview.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./list.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css":
- /*!*************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css ***!
- \*************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./balloonpanel.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css ***!
- \***************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./balloonrotator.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css ***!
- \**********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./fakepanel.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css":
- /*!************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css ***!
- \************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./stickypanel.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css":
- /*!*************************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css ***!
- \*************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./responsiveform.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css":
- /*!***************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css ***!
- \***************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./blocktoolbar.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css ***!
- \**********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./toolbar.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css ***!
- \**********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./tooltip.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css ***!
- \***********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../../postcss-loader/src??ref--5-1!./globals.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path class=\"ck-icon__fill\" d=\"M16.935 5.328a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.829 0L3.5 13.107a1.999 1.999 0 1 1 2.828-2.829l.707.707a1 1 0 0 0 1.414 0l5.658-5.657a2 2 0 0 1 2.828 0z\"/><path d=\"M14.814 6.035 8.448 12.4a1 1 0 0 1-1.414 0l-1.413-1.415A1 1 0 1 0 4.207 12.4l2.829 2.829a1 1 0 0 0 1.414 0l7.778-7.778a1 1 0 1 0-1.414-1.415z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BaseCommand; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_model_operation_transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/model/operation/transform */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module undo/basecommand
- */
- /**
- * Base class for undo feature commands: {@link module:undo/undocommand~UndoCommand} and {@link module:undo/redocommand~RedoCommand}.
- *
- * @protected
- * @extends module:core/command~Command
- */
- class BaseCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
- constructor( editor ) {
- super( editor );
- /**
- * Stack of items stored by the command. These are pairs of:
- *
- * * {@link module:engine/model/batch~Batch batch} saved by the command,
- * * {@link module:engine/model/selection~Selection selection} state at the moment of saving the batch.
- *
- * @protected
- * @member {Array} #_stack
- */
- this._stack = [];
- /**
- * Stores all batches that were created by this command.
- *
- * @protected
- * @member {WeakSet.<module:engine/model/batch~Batch>} #_createdBatches
- */
- this._createdBatches = new WeakSet();
- // Refresh state, so the command is inactive right after initialization.
- this.refresh();
- this.listenTo( editor.data, 'set', () => this.clearStack() );
- }
- /**
- * @inheritDoc
- */
- refresh() {
- this.isEnabled = this._stack.length > 0;
- }
- /**
- * Stores a batch in the command, together with the selection state of the {@link module:engine/model/document~Document document}
- * created by the editor which this command is registered to.
- *
- * @param {module:engine/model/batch~Batch} batch The batch to add.
- */
- addBatch( batch ) {
- const docSelection = this.editor.model.document.selection;
- const selection = {
- ranges: docSelection.hasOwnRange ? Array.from( docSelection.getRanges() ) : [],
- isBackward: docSelection.isBackward
- };
- this._stack.push( { batch, selection } );
- this.refresh();
- }
- /**
- * Removes all items from the stack.
- */
- clearStack() {
- this._stack = [];
- this.refresh();
- }
- /**
- * Restores the {@link module:engine/model/document~Document#selection document selection} state after a batch was undone.
- *
- * @protected
- * @param {Array.<module:engine/model/range~Range>} ranges Ranges to be restored.
- * @param {Boolean} isBackward A flag describing whether the restored range was selected forward or backward.
- * @param {Array.<module:engine/model/operation/operation~Operation>} operations Operations which has been applied
- * since selection has been stored.
- */
- _restoreSelection( ranges, isBackward, operations ) {
- const model = this.editor.model;
- const document = model.document;
- // This will keep the transformed selection ranges.
- const selectionRanges = [];
- // Transform all ranges from the restored selection.
- const transformedRangeGroups = ranges.map( range => range.getTransformedByOperations( operations ) );
- const allRanges = transformedRangeGroups.flat();
- for ( const rangeGroup of transformedRangeGroups ) {
- // While transforming there could appear ranges that are contained by other ranges, we shall ignore them.
- const transformed = rangeGroup
- .filter( range => range.root != document.graveyard )
- .filter( range => !isRangeContainedByAnyOtherRange( range, allRanges ) );
- // All the transformed ranges ended up in graveyard.
- if ( !transformed.length ) {
- continue;
- }
- // After the range got transformed, we have an array of ranges. Some of those
- // ranges may be "touching" -- they can be next to each other and could be merged.
- normalizeRanges( transformed );
- // For each `range` from `ranges`, we take only one transformed range.
- // This is because we want to prevent situation where single-range selection
- // got transformed to multi-range selection.
- selectionRanges.push( transformed[ 0 ] );
- }
- // @if CK_DEBUG_ENGINE // console.log( `Restored selection by undo: ${ selectionRanges.join( ', ' ) }` );
- // `selectionRanges` may be empty if all ranges ended up in graveyard. If that is the case, do not restore selection.
- if ( selectionRanges.length ) {
- model.change( writer => {
- writer.setSelection( selectionRanges, { backward: isBackward } );
- } );
- }
- }
- /**
- * Undoes a batch by reversing that batch, transforming reversed batch and finally applying it.
- * This is a helper method for {@link #execute}.
- *
- * @protected
- * @param {module:engine/model/batch~Batch} batchToUndo The batch to be undone.
- * @param {module:engine/model/batch~Batch} undoingBatch The batch that will contain undoing changes.
- */
- _undo( batchToUndo, undoingBatch ) {
- const model = this.editor.model;
- const document = model.document;
- // All changes done by the command execution will be saved as one batch.
- this._createdBatches.add( undoingBatch );
- const operationsToUndo = batchToUndo.operations.slice().filter( operation => operation.isDocumentOperation );
- operationsToUndo.reverse();
- // We will process each operation from `batchToUndo`, in reverse order. If there were operations A, B and C in undone batch,
- // we need to revert them in reverse order, so first C' (reversed C), then B', then A'.
- for ( const operationToUndo of operationsToUndo ) {
- const nextBaseVersion = operationToUndo.baseVersion + 1;
- const historyOperations = Array.from( document.history.getOperations( nextBaseVersion ) );
- const transformedSets = Object(_ckeditor_ckeditor5_engine_src_model_operation_transform__WEBPACK_IMPORTED_MODULE_1__["transformSets"])(
- [ operationToUndo.getReversed() ],
- historyOperations,
- {
- useRelations: true,
- document: this.editor.model.document,
- padWithNoOps: false,
- forceWeakRemove: true
- }
- );
- const reversedOperations = transformedSets.operationsA;
- // After reversed operation has been transformed by all history operations, apply it.
- for ( const operation of reversedOperations ) {
- // Before applying, add the operation to the `undoingBatch`.
- undoingBatch.addOperation( operation );
- model.applyOperation( operation );
- document.history.setOperationAsUndone( operationToUndo, operation );
- }
- }
- }
- }
- // Normalizes list of ranges by joining intersecting or "touching" ranges.
- //
- // @param {Array.<module:engine/model/range~Range>} ranges
- //
- function normalizeRanges( ranges ) {
- ranges.sort( ( a, b ) => a.start.isBefore( b.start ) ? -1 : 1 );
- for ( let i = 1; i < ranges.length; i++ ) {
- const previousRange = ranges[ i - 1 ];
- const joinedRange = previousRange.getJoined( ranges[ i ], true );
- if ( joinedRange ) {
- // Replace the ranges on the list with the new joined range.
- i--;
- ranges.splice( i, 2, joinedRange );
- }
- }
- }
- function isRangeContainedByAnyOtherRange( range, ranges ) {
- return ranges.some( otherRange => otherRange !== range && otherRange.containsRange( range, true ) );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/index.js":
- /*!************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-undo/src/index.js ***!
- \************************************************************/
- /*! exports provided: Undo, UndoEditing, UndoUi */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _undo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./undo */ "./node_modules/@ckeditor/ckeditor5-undo/src/undo.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Undo", function() { return _undo__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _undoediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./undoediting */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoEditing", function() { return _undoediting__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _undoui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./undoui */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoUi", function() { return _undoui__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module undo
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RedoCommand; });
- /* harmony import */ var _basecommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basecommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module undo/redocommand
- */
- /**
- * The redo command stores {@link module:engine/model/batch~Batch batches} that were used to undo a batch by
- * {@link module:undo/undocommand~UndoCommand}. It is able to redo a previously undone batch by reversing the undoing
- * batches created by `UndoCommand`. The reversed batch is transformed by all the batches from
- * {@link module:engine/model/document~Document#history history} that happened after the reversed undo batch.
- *
- * The redo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.
- *
- * @extends module:undo/basecommand~BaseCommand
- */
- class RedoCommand extends _basecommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Executes the command. This method reverts the last {@link module:engine/model/batch~Batch batch} added to
- * the command's stack, applies the reverted and transformed version on the
- * {@link module:engine/model/document~Document document} and removes the batch from the stack.
- * Then, it restores the {@link module:engine/model/document~Document#selection document selection}.
- *
- * @fires execute
- */
- execute() {
- const item = this._stack.pop();
- const redoingBatch = this.editor.model.createBatch( 'transparent' );
- // All changes have to be done in one `enqueueChange` callback so other listeners will not step between consecutive
- // operations, or won't do changes to the document before selection is properly restored.
- this.editor.model.enqueueChange( redoingBatch, () => {
- const lastOperation = item.batch.operations[ item.batch.operations.length - 1 ];
- const nextBaseVersion = lastOperation.baseVersion + 1;
- const operations = this.editor.model.document.history.getOperations( nextBaseVersion );
- this._restoreSelection( item.selection.ranges, item.selection.isBackward, operations );
- this._undo( item.batch, redoingBatch );
- } );
- this.refresh();
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undo.js":
- /*!***********************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undo.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Undo; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _undoediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./undoediting */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js");
- /* harmony import */ var _undoui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./undoui */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module undo/undo
- */
- /**
- * The undo feature.
- *
- * This is a "glue" plugin which loads the {@link module:undo/undoediting~UndoEditing undo editing feature}
- * and {@link module:undo/undoui~UndoUI undo UI feature}.
- *
- * Below is the explanation of the undo mechanism working together with {@link module:engine/model/history~History History}:
- *
- * Whenever a {@link module:engine/model/operation/operation~Operation operation} is applied to the
- * {@link module:engine/model/document~Document document}, it is saved to `History` as is.
- * The {@link module:engine/model/batch~Batch batch} that owns that operation is also saved, in
- * {@link module:undo/undocommand~UndoCommand}, together with the selection that was present in the document before the
- * operation was applied. A batch is saved instead of the operation because changes are undone batch-by-batch, not operation-by-operation
- * and a batch is seen as one undo step.
- *
- * After some changes happen to the document, the `History` and `UndoCommand` stack can be represented as follows:
- *
- * History Undo stack
- * ============== ==================================
- * [operation A1] [batch A]
- * [operation B1] [batch B]
- * [operation B2] [batch C]
- * [operation C1]
- * [operation C2]
- * [operation B3]
- * [operation C3]
- *
- * Where operations starting with the same letter are from same batch.
- *
- * Undoing a batch means that a set of operations which will reverse the effects of that batch needs to be generated.
- * For example, if a batch added several letters, undoing the batch should remove them. It is important to apply undoing
- * operations in the reversed order, so if a batch has operation `X`, `Y`, `Z`, reversed operations `Zr`, `Yr` and `Xr`
- * need to be applied. Otherwise reversed operation `Xr` would operate on a wrong document state, because operation `X`
- * does not know that operations `Y` and `Z` happened.
- *
- * After operations from an undone batch got {@link module:engine/model/operation/operation~Operation#getReversed reversed},
- * one needs to make sure if they are ready to be applied. In the scenario above, operation `C3` is the last operation and `C3r`
- * bases on up-to-date document state, so it can be applied to the document.
- *
- * History Undo stack
- * ================= ==================================
- * [ operation A1 ] [ batch A ]
- * [ operation B1 ] [ batch B ]
- * [ operation B2 ] [ processing undoing batch C ]
- * [ operation C1 ]
- * [ operation C2 ]
- * [ operation B3 ]
- * [ operation C3 ]
- * [ operation C3r ]
- *
- * Next is operation `C2`, reversed to `C2r`. `C2r` bases on `C2`, so it bases on the wrong document state. It needs to be
- * transformed by operations from history that happened after it, so it "knows" about them. Let us assume that `C2' = C2r * B3 * C3 * C3r`,
- * where `*` means "transformed by". Rest of operations from that batch are processed in the same fashion.
- *
- * History Undo stack Redo stack
- * ================= ================================== ==================================
- * [ operation A1 ] [ batch A ] [ batch Cr ]
- * [ operation B1 ] [ batch B ]
- * [ operation B2 ]
- * [ operation C1 ]
- * [ operation C2 ]
- * [ operation B3 ]
- * [ operation C3 ]
- * [ operation C3r ]
- * [ operation C2' ]
- * [ operation C1' ]
- *
- * Selective undo works on the same basis, however, instead of undoing the last batch in the undo stack, any batch can be undone.
- * The same algorithm applies: operations from a batch (i.e. `A1`) are reversed and then transformed by operations stored in history.
- *
- * Redo also is very similar to undo. It has its own stack that is filled with undoing (reversed batches). Operations from
- * batch that is re-done are reversed-back, transformed in proper order and applied to the document.
- *
- * History Undo stack Redo stack
- * ================= ================================== ==================================
- * [ operation A1 ] [ batch A ]
- * [ operation B1 ] [ batch B ]
- * [ operation B2 ] [ batch Crr ]
- * [ operation C1 ]
- * [ operation C2 ]
- * [ operation B3 ]
- * [ operation C3 ]
- * [ operation C3r ]
- * [ operation C2' ]
- * [ operation C1' ]
- * [ operation C1'r]
- * [ operation C2'r]
- * [ operation C3rr]
- *
- * @extends module:core/plugin~Plugin
- */
- class Undo extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _undoediting__WEBPACK_IMPORTED_MODULE_1__["default"], _undoui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Undo';
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UndoCommand; });
- /* harmony import */ var _basecommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basecommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module undo/undocommand
- */
- /**
- * The undo command stores {@link module:engine/model/batch~Batch batches} applied to the
- * {@link module:engine/model/document~Document document} and is able to undo a batch by reversing it and transforming by
- * batches from {@link module:engine/model/document~Document#history history} that happened after the reversed batch.
- *
- * The undo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.
- *
- * @extends module:undo/basecommand~BaseCommand
- */
- class UndoCommand extends _basecommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * Executes the command. This method reverts a {@link module:engine/model/batch~Batch batch} added to the command's stack, transforms
- * and applies the reverted version on the {@link module:engine/model/document~Document document} and removes the batch from the stack.
- * Then, it restores the {@link module:engine/model/document~Document#selection document selection}.
- *
- * @fires execute
- * @fires revert
- * @param {module:engine/model/batch~Batch} [batch] A batch that should be undone. If not set, the last added batch will be undone.
- */
- execute( batch = null ) {
- // If batch is not given, set `batchIndex` to the last index in command stack.
- const batchIndex = batch ? this._stack.findIndex( a => a.batch == batch ) : this._stack.length - 1;
- const item = this._stack.splice( batchIndex, 1 )[ 0 ];
- const undoingBatch = this.editor.model.createBatch( 'transparent' );
- // All changes has to be done in one `enqueueChange` callback so other listeners will not
- // step between consecutive operations, or won't do changes to the document before selection is properly restored.
- this.editor.model.enqueueChange( undoingBatch, () => {
- this._undo( item.batch, undoingBatch );
- const operations = this.editor.model.document.history.getOperations( item.batch.baseVersion );
- this._restoreSelection( item.selection.ranges, item.selection.isBackward, operations );
- this.fire( 'revert', item.batch, undoingBatch );
- } );
- this.refresh();
- }
- }
- /**
- * Fired when execution of the command reverts some batch.
- *
- * @event revert
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UndoEditing; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _undocommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./undocommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js");
- /* harmony import */ var _redocommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./redocommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module undo/undoediting
- */
- /**
- * The undo engine feature.
- *
- * It introduces the `'undo'` and `'redo'` commands to the editor.
- *
- * @extends module:core/plugin~Plugin
- */
- class UndoEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'UndoEditing';
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- /**
- * The command that manages undo {@link module:engine/model/batch~Batch batches} stack (history).
- * Created and registered during the {@link #init feature initialization}.
- *
- * @private
- * @member {module:undo/undocommand~UndoCommand} #_undoCommand
- */
- /**
- * The command that manages redo {@link module:engine/model/batch~Batch batches} stack (history).
- * Created and registered during the {@link #init feature initialization}.
- *
- * @private
- * @member {module:undo/undocommand~UndoCommand} #_redoCommand
- */
- /**
- * Keeps track of which batches were registered in undo.
- *
- * @private
- * @member {WeakSet.<module:engine/model/batch~Batch>}
- */
- this._batchRegistry = new WeakSet();
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Create commands.
- this._undoCommand = new _undocommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor );
- this._redoCommand = new _redocommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor );
- // Register command to the editor.
- editor.commands.add( 'undo', this._undoCommand );
- editor.commands.add( 'redo', this._redoCommand );
- this.listenTo( editor.model, 'applyOperation', ( evt, args ) => {
- const operation = args[ 0 ];
- // Do not register batch if the operation is not a document operation.
- // This prevents from creating empty undo steps, where all operations where non-document operations.
- // Non-document operations creates and alters content in detached tree fragments (for example, document fragments).
- // Most of time this is preparing data before it is inserted into actual tree (for example during copy & paste).
- // Such operations should not be reversed.
- if ( !operation.isDocumentOperation ) {
- return;
- }
- const batch = operation.batch;
- const isRedoBatch = this._redoCommand._createdBatches.has( batch );
- const isUndoBatch = this._undoCommand._createdBatches.has( batch );
- const isRegisteredBatch = this._batchRegistry.has( batch );
- // If changes are not a part of a batch or this is not a new batch, omit those changes.
- if ( isRegisteredBatch || ( batch.type == 'transparent' && !isRedoBatch && !isUndoBatch ) ) {
- return;
- } else {
- if ( isRedoBatch ) {
- // If this batch comes from `redoCommand`, add it to `undoCommand` stack.
- this._undoCommand.addBatch( batch );
- } else if ( !isUndoBatch ) {
- // A default batch - these are new changes in the document, not introduced by undo feature.
- // Add them to `undoCommand` stack and clear `redoCommand` stack.
- this._undoCommand.addBatch( batch );
- this._redoCommand.clearStack();
- }
- }
- // Add the batch to the registry so it will not be processed again.
- this._batchRegistry.add( batch );
- }, { priority: 'highest' } );
- this.listenTo( this._undoCommand, 'revert', ( evt, undoneBatch, undoingBatch ) => {
- this._redoCommand.addBatch( undoingBatch );
- } );
- editor.keystrokes.set( 'CTRL+Z', 'undo' );
- editor.keystrokes.set( 'CTRL+Y', 'redo' );
- editor.keystrokes.set( 'CTRL+SHIFT+Z', 'redo' );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UndoUI; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
- /* harmony import */ var _theme_icons_undo_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/undo.svg */ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg");
- /* harmony import */ var _theme_icons_redo_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/icons/redo.svg */ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module undo/undoui
- */
- /**
- * The undo UI feature. It introduces the `'undo'` and `'redo'` buttons to the editor.
- *
- * @extends module:core/plugin~Plugin
- */
- class UndoUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'UndoUI';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const locale = editor.locale;
- const t = editor.t;
- const localizedUndoIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_undo_svg__WEBPACK_IMPORTED_MODULE_2__["default"] : _theme_icons_redo_svg__WEBPACK_IMPORTED_MODULE_3__["default"];
- const localizedRedoIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_redo_svg__WEBPACK_IMPORTED_MODULE_3__["default"] : _theme_icons_undo_svg__WEBPACK_IMPORTED_MODULE_2__["default"];
- this._addButton( 'undo', t( 'Undo' ), 'CTRL+Z', localizedUndoIcon );
- this._addButton( 'redo', t( 'Redo' ), 'CTRL+Y', localizedRedoIcon );
- }
- /**
- * Creates a button for the specified command.
- *
- * @private
- * @param {String} name Command name.
- * @param {String} label Button label.
- * @param {String} keystroke Command keystroke.
- * @param {String} Icon Source of the icon.
- */
- _addButton( name, label, keystroke, Icon ) {
- const editor = this.editor;
- editor.ui.componentFactory.add( name, locale => {
- const command = editor.commands.get( name );
- const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
- view.set( {
- label,
- icon: Icon,
- keystroke,
- tooltip: true
- } );
- view.bind( 'isEnabled' ).to( command, 'isEnabled' );
- this.listenTo( view, 'execute', () => {
- editor.execute( name );
- editor.editing.view.focus();
- } );
- return view;
- } );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter.js":
- /*!*************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter.js ***!
- \*************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Base64UploadAdapter; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _filerepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module upload/adapters/base64uploadadapter
- */
- /* globals window */
- /**
- * A plugin that converts images inserted into the editor into [Base64 strings](https://en.wikipedia.org/wiki/Base64)
- * in the {@glink builds/guides/integration/saving-data editor output}.
- *
- * This kind of image upload does not require server processing – images are stored with the rest of the text and
- * displayed by the web browser without additional requests.
- *
- * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload overview"} to learn about
- * other ways to upload images into CKEditor 5.
- *
- * @extends module:core/plugin~Plugin
- */
- class Base64UploadAdapter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Base64UploadAdapter';
- }
- /**
- * @inheritDoc
- */
- init() {
- this.editor.plugins.get( _filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ).createUploadAdapter = loader => new Adapter( loader );
- }
- }
- /**
- * The upload adapter that converts images inserted into the editor into Base64 strings.
- *
- * @private
- * @implements module:upload/filerepository~UploadAdapter
- */
- class Adapter {
- /**
- * Creates a new adapter instance.
- *
- * @param {module:upload/filerepository~FileLoader} loader
- */
- constructor( loader ) {
- /**
- * `FileLoader` instance to use during the upload.
- *
- * @member {module:upload/filerepository~FileLoader} #loader
- */
- this.loader = loader;
- }
- /**
- * Starts the upload process.
- *
- * @see module:upload/filerepository~UploadAdapter#upload
- * @returns {Promise}
- */
- upload() {
- return new Promise( ( resolve, reject ) => {
- const reader = this.reader = new window.FileReader();
- reader.addEventListener( 'load', () => {
- resolve( { default: reader.result } );
- } );
- reader.addEventListener( 'error', err => {
- reject( err );
- } );
- reader.addEventListener( 'abort', () => {
- reject();
- } );
- this.loader.file.then( file => {
- reader.readAsDataURL( file );
- } );
- } );
- }
- /**
- * Aborts the upload process.
- *
- * @see module:upload/filerepository~UploadAdapter#abort
- * @returns {Promise}
- */
- abort() {
- this.reader.abort();
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js":
- /*!*************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js ***!
- \*************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SimpleUploadAdapter; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _filerepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module upload/adapters/simpleuploadadapter
- */
- /* globals XMLHttpRequest, FormData */
- /**
- * The Simple upload adapter allows uploading images to an application running on your server using
- * the [`XMLHttpRequest`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) API with a
- * minimal {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig editor configuration}.
- *
- * ClassicEditor
- * .create( document.querySelector( '#editor' ), {
- * simpleUpload: {
- * uploadUrl: 'http://example.com',
- * headers: {
- * ...
- * }
- * }
- * } )
- * .then( ... )
- * .catch( ... );
- *
- * See the {@glink features/image-upload/simple-upload-adapter "Simple upload adapter"} guide to learn how to
- * learn more about the feature (configuration, server–side requirements, etc.).
- *
- * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload overview"} to learn about
- * other ways to upload images into CKEditor 5.
- *
- * @extends module:core/plugin~Plugin
- */
- class SimpleUploadAdapter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'SimpleUploadAdapter';
- }
- /**
- * @inheritDoc
- */
- init() {
- const options = this.editor.config.get( 'simpleUpload' );
- if ( !options ) {
- return;
- }
- if ( !options.uploadUrl ) {
- /**
- * The {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl `config.simpleUpload.uploadUrl`}
- * configuration required by the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter `SimpleUploadAdapter`}
- * is missing. Make sure the correct URL is specified for the image upload to work properly.
- *
- * @error simple-upload-adapter-missing-uploadurl
- */
- Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["logWarning"])( 'simple-upload-adapter-missing-uploadurl' );
- return;
- }
- this.editor.plugins.get( _filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ).createUploadAdapter = loader => {
- return new Adapter( loader, options );
- };
- }
- }
- /**
- * Upload adapter.
- *
- * @private
- * @implements module:upload/filerepository~UploadAdapter
- */
- class Adapter {
- /**
- * Creates a new adapter instance.
- *
- * @param {module:upload/filerepository~FileLoader} loader
- * @param {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} options
- */
- constructor( loader, options ) {
- /**
- * FileLoader instance to use during the upload.
- *
- * @member {module:upload/filerepository~FileLoader} #loader
- */
- this.loader = loader;
- /**
- * The configuration of the adapter.
- *
- * @member {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} #options
- */
- this.options = options;
- }
- /**
- * Starts the upload process.
- *
- * @see module:upload/filerepository~UploadAdapter#upload
- * @returns {Promise}
- */
- upload() {
- return this.loader.file
- .then( file => new Promise( ( resolve, reject ) => {
- this._initRequest();
- this._initListeners( resolve, reject, file );
- this._sendRequest( file );
- } ) );
- }
- /**
- * Aborts the upload process.
- *
- * @see module:upload/filerepository~UploadAdapter#abort
- * @returns {Promise}
- */
- abort() {
- if ( this.xhr ) {
- this.xhr.abort();
- }
- }
- /**
- * Initializes the `XMLHttpRequest` object using the URL specified as
- * {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl `simpleUpload.uploadUrl`} in the editor's
- * configuration.
- *
- * @private
- */
- _initRequest() {
- const xhr = this.xhr = new XMLHttpRequest();
- xhr.open( 'POST', this.options.uploadUrl, true );
- xhr.responseType = 'json';
- }
- /**
- * Initializes XMLHttpRequest listeners
- *
- * @private
- * @param {Function} resolve Callback function to be called when the request is successful.
- * @param {Function} reject Callback function to be called when the request cannot be completed.
- * @param {File} file Native File object.
- */
- _initListeners( resolve, reject, file ) {
- const xhr = this.xhr;
- const loader = this.loader;
- const genericErrorText = `Couldn't upload file: ${ file.name }.`;
- xhr.addEventListener( 'error', () => reject( genericErrorText ) );
- xhr.addEventListener( 'abort', () => reject() );
- xhr.addEventListener( 'load', () => {
- const response = xhr.response;
- if ( !response || response.error ) {
- return reject( response && response.error && response.error.message ? response.error.message : genericErrorText );
- }
- const urls = response.url ? { default: response.url } : response.urls;
- // Resolve with the normalized `urls` property and pass the rest of the response
- // to allow customizing the behavior of features relying on the upload adapters.
- resolve( {
- ...response,
- urls
- } );
- } );
- // Upload progress when it is supported.
- /* istanbul ignore else */
- if ( xhr.upload ) {
- xhr.upload.addEventListener( 'progress', evt => {
- if ( evt.lengthComputable ) {
- loader.uploadTotal = evt.total;
- loader.uploaded = evt.loaded;
- }
- } );
- }
- }
- /**
- * Prepares the data and sends the request.
- *
- * @private
- * @param {File} file File instance to be uploaded.
- */
- _sendRequest( file ) {
- // Set headers if specified.
- const headers = this.options.headers || {};
- // Use the withCredentials flag if specified.
- const withCredentials = this.options.withCredentials || false;
- for ( const headerName of Object.keys( headers ) ) {
- this.xhr.setRequestHeader( headerName, headers[ headerName ] );
- }
- this.xhr.withCredentials = withCredentials;
- // Prepare the form data.
- const data = new FormData();
- data.append( 'upload', file );
- // Send the request.
- this.xhr.send( data );
- }
- }
- /**
- * The configuration of the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter simple upload adapter}.
- *
- * ClassicEditor
- * .create( editorElement, {
- * simpleUpload: {
- * // The URL the images are uploaded to.
- * uploadUrl: 'http://example.com',
- *
- * // Headers sent along with the XMLHttpRequest to the upload server.
- * headers: {
- * ...
- * }
- * }
- * } );
- * .then( ... )
- * .catch( ... );
- *
- * See the {@glink features/image-upload/simple-upload-adapter "Simple upload adapter"} guide to learn more.
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
- *
- * @interface SimpleUploadConfig
- */
- /**
- * The configuration of the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter simple upload adapter}.
- *
- * Read more in {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig}.
- *
- * @member {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} module:core/editor/editorconfig~EditorConfig#simpleUpload
- */
- /**
- * The path (URL) to the server (application) which handles the file upload. When specified, enables the automatic
- * upload of resources (images) inserted into the editor content.
- *
- * Learn more about the server application requirements in the
- * {@glink features/image-upload/simple-upload-adapter#server-side-configuration "Server-side configuration"} section
- * of the feature guide.
- *
- * @member {String} module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl
- */
- /**
- * An object that defines additional [headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers) sent with
- * the request to the server during the upload. This is the right place to implement security mechanisms like
- * authentication and [CSRF](https://developer.mozilla.org/en-US/docs/Glossary/CSRF) protection.
- *
- * ClassicEditor
- * .create( editorElement, {
- * simpleUpload: {
- * headers: {
- * 'X-CSRF-TOKEN': 'CSRF-Token',
- * Authorization: 'Bearer <JSON Web Token>'
- * }
- * }
- * } );
- * .then( ... )
- * .catch( ... );
- *
- * Learn more about the server application requirements in the
- * {@glink features/image-upload/simple-upload-adapter#server-side-configuration "Server-side configuration"} section
- * of the feature guide.
- *
- * @member {Object.<String, String>} module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#headers
- */
- /**
- * This flag enables the
- * [`withCredentials`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials)
- * property of the request sent to the server during the upload. It affects cross-site requests only and, for instance,
- * allows credentials such as cookies to be sent along with the request.
- *
- * ClassicEditor
- * .create( editorElement, {
- * simpleUpload: {
- * withCredentials: true
- * }
- * } );
- * .then( ... )
- * .catch( ... );
- *
- * Learn more about the server application requirements in the
- * {@glink features/image-upload/simple-upload-adapter#server-side-configuration "Server-side configuration"} section
- * of the feature guide.
- *
- * @member {Boolean} [module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#withCredentials=false]
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileReader; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module upload/filereader
- */
- /* globals window */
- /**
- * Wrapper over the native `FileReader`.
- */
- class FileReader {
- /**
- * Creates an instance of the FileReader.
- */
- constructor() {
- const reader = new window.FileReader();
- /**
- * Instance of native FileReader.
- *
- * @private
- * @member {FileReader} #_reader
- */
- this._reader = reader;
- this._data = undefined;
- /**
- * Number of bytes loaded.
- *
- * @readonly
- * @observable
- * @member {Number} #loaded
- */
- this.set( 'loaded', 0 );
- reader.onprogress = evt => {
- this.loaded = evt.loaded;
- };
- }
- /**
- * Returns error that occurred during file reading.
- *
- * @returns {Error}
- */
- get error() {
- return this._reader.error;
- }
- /**
- * Holds the data of an already loaded file. The file must be first loaded
- * by using {@link module:upload/filereader~FileReader#read `read()`}.
- *
- * @type {File|undefined}
- */
- get data() {
- return this._data;
- }
- /**
- * Reads the provided file.
- *
- * @param {File} file Native File object.
- * @returns {Promise.<String>} Returns a promise that will be resolved with file's content.
- * The promise will be rejected in case of an error or when the reading process is aborted.
- */
- read( file ) {
- const reader = this._reader;
- this.total = file.size;
- return new Promise( ( resolve, reject ) => {
- reader.onload = () => {
- const result = reader.result;
- this._data = result;
- resolve( result );
- };
- reader.onerror = () => {
- reject( 'error' );
- };
- reader.onabort = () => {
- reject( 'aborted' );
- };
- this._reader.readAsDataURL( file );
- } );
- }
- /**
- * Aborts file reader.
- */
- abort() {
- this._reader.abort();
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( FileReader, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileRepository; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _ckeditor_ckeditor5_core_src_pendingactions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/pendingactions */ "./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _filereader_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./filereader.js */ "./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid.js */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module upload/filerepository
- */
- /**
- * File repository plugin. A central point for managing file upload.
- *
- * To use it, first you need an upload adapter. Upload adapter's job is to handle communication with the server
- * (sending the file and handling server's response). You can use one of the existing plugins introducing upload adapters
- * (e.g. {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter} or
- * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}) or write your own one – see
- * the {@glink framework/guides/deep-dive/upload-adapter "Custom image upload adapter" deep dive guide}.
- *
- * Then, you can use {@link module:upload/filerepository~FileRepository#createLoader `createLoader()`} and the returned
- * {@link module:upload/filerepository~FileLoader} instance to load and upload files.
- *
- * @extends module:core/plugin~Plugin
- */
- class FileRepository extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'FileRepository';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _ckeditor_ckeditor5_core_src_pendingactions__WEBPACK_IMPORTED_MODULE_1__["default"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- /**
- * Collection of loaders associated with this repository.
- *
- * @member {module:utils/collection~Collection} #loaders
- */
- this.loaders = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__["default"]();
- // Keeps upload in a sync with pending actions.
- this.loaders.on( 'add', () => this._updatePendingAction() );
- this.loaders.on( 'remove', () => this._updatePendingAction() );
- /**
- * Loaders mappings used to retrieve loaders references.
- *
- * @private
- * @member {Map<File|Promise, FileLoader>} #_loadersMap
- */
- this._loadersMap = new Map();
- /**
- * Reference to a pending action registered in a {@link module:core/pendingactions~PendingActions} plugin
- * while upload is in progress. When there is no upload then value is `null`.
- *
- * @private
- * @member {Object} #_pendingAction
- */
- this._pendingAction = null;
- /**
- * A factory function which should be defined before using `FileRepository`.
- *
- * It should return a new instance of {@link module:upload/filerepository~UploadAdapter} that will be used to upload files.
- * {@link module:upload/filerepository~FileLoader} instance associated with the adapter
- * will be passed to that function.
- *
- * For more information and example see {@link module:upload/filerepository~UploadAdapter}.
- *
- * @member {Function} #createUploadAdapter
- */
- /**
- * Number of bytes uploaded.
- *
- * @readonly
- * @observable
- * @member {Number} #uploaded
- */
- this.set( 'uploaded', 0 );
- /**
- * Number of total bytes to upload.
- *
- * It might be different than the file size because of headers and additional data.
- * It contains `null` if value is not available yet, so it's better to use {@link #uploadedPercent} to monitor
- * the progress.
- *
- * @readonly
- * @observable
- * @member {Number|null} #uploadTotal
- */
- this.set( 'uploadTotal', null );
- /**
- * Upload progress in percents.
- *
- * @readonly
- * @observable
- * @member {Number} #uploadedPercent
- */
- this.bind( 'uploadedPercent' ).to( this, 'uploaded', this, 'uploadTotal', ( uploaded, total ) => {
- return total ? ( uploaded / total * 100 ) : 0;
- } );
- }
- /**
- * Returns the loader associated with specified file or promise.
- *
- * To get loader by id use `fileRepository.loaders.get( id )`.
- *
- * @param {File|Promise.<File>} fileOrPromise Native file or promise handle.
- * @returns {module:upload/filerepository~FileLoader|null}
- */
- getLoader( fileOrPromise ) {
- return this._loadersMap.get( fileOrPromise ) || null;
- }
- /**
- * Creates a loader instance for the given file.
- *
- * Requires {@link #createUploadAdapter} factory to be defined.
- *
- * @param {File|Promise.<File>} fileOrPromise Native File object or native Promise object which resolves to a File.
- * @returns {module:upload/filerepository~FileLoader|null}
- */
- createLoader( fileOrPromise ) {
- if ( !this.createUploadAdapter ) {
- /**
- * You need to enable an upload adapter in order to be able to upload files.
- *
- * This warning shows up when {@link module:upload/filerepository~FileRepository} is being used
- * without {@link #createUploadAdapter defining an upload adapter}.
- *
- * **If you see this warning when using one of the {@glink builds/index CKEditor 5 Builds}**
- * it means that you did not configure any of the upload adapters available by default in those builds.
- *
- * See the {@glink features/image-upload/image-upload comprehensive "Image upload overview"} to learn which upload
- * adapters are available in the builds and how to configure them.
- *
- * **If you see this warning when using a custom build** there is a chance that you enabled
- * a feature like {@link module:image/imageupload~ImageUpload},
- * or {@link module:image/imageupload/imageuploadui~ImageUploadUI} but you did not enable any upload adapter.
- * You can choose one of the existing upload adapters listed in the
- * {@glink features/image-upload/image-upload "Image upload overview"}.
- *
- * You can also implement your {@glink framework/guides/deep-dive/upload-adapter own image upload adapter}.
- *
- * @error filerepository-no-upload-adapter
- */
- Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["logWarning"])( 'filerepository-no-upload-adapter' );
- return null;
- }
- const loader = new FileLoader( Promise.resolve( fileOrPromise ), this.createUploadAdapter );
- this.loaders.add( loader );
- this._loadersMap.set( fileOrPromise, loader );
- // Store also file => loader mapping so loader can be retrieved by file instance returned upon Promise resolution.
- if ( fileOrPromise instanceof Promise ) {
- loader.file
- .then( file => {
- this._loadersMap.set( file, loader );
- } )
- // Every then() must have a catch().
- // File loader state (and rejections) are handled in read() and upload().
- // Also, see the "does not swallow the file promise rejection" test.
- .catch( () => {} );
- }
- loader.on( 'change:uploaded', () => {
- let aggregatedUploaded = 0;
- for ( const loader of this.loaders ) {
- aggregatedUploaded += loader.uploaded;
- }
- this.uploaded = aggregatedUploaded;
- } );
- loader.on( 'change:uploadTotal', () => {
- let aggregatedTotal = 0;
- for ( const loader of this.loaders ) {
- if ( loader.uploadTotal ) {
- aggregatedTotal += loader.uploadTotal;
- }
- }
- this.uploadTotal = aggregatedTotal;
- } );
- return loader;
- }
- /**
- * Destroys the given loader.
- *
- * @param {File|Promise|module:upload/filerepository~FileLoader} fileOrPromiseOrLoader File or Promise associated
- * with that loader or loader itself.
- */
- destroyLoader( fileOrPromiseOrLoader ) {
- const loader = fileOrPromiseOrLoader instanceof FileLoader ? fileOrPromiseOrLoader : this.getLoader( fileOrPromiseOrLoader );
- loader._destroy();
- this.loaders.remove( loader );
- this._loadersMap.forEach( ( value, key ) => {
- if ( value === loader ) {
- this._loadersMap.delete( key );
- }
- } );
- }
- /**
- * Registers or deregisters pending action bound with upload progress.
- *
- * @private
- */
- _updatePendingAction() {
- const pendingActions = this.editor.plugins.get( _ckeditor_ckeditor5_core_src_pendingactions__WEBPACK_IMPORTED_MODULE_1__["default"] );
- if ( this.loaders.length ) {
- if ( !this._pendingAction ) {
- const t = this.editor.t;
- const getMessage = value => `${ t( 'Upload in progress' ) } ${ parseInt( value ) }%.`;
- this._pendingAction = pendingActions.add( getMessage( this.uploadedPercent ) );
- this._pendingAction.bind( 'message' ).to( this, 'uploadedPercent', getMessage );
- }
- } else {
- pendingActions.remove( this._pendingAction );
- this._pendingAction = null;
- }
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( FileRepository, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
- /**
- * File loader class.
- *
- * It is used to control the process of reading the file and uploading it using the specified upload adapter.
- */
- class FileLoader {
- /**
- * Creates a new instance of `FileLoader`.
- *
- * @param {Promise.<File>} filePromise A promise which resolves to a file instance.
- * @param {Function} uploadAdapterCreator The function which returns {@link module:upload/filerepository~UploadAdapter} instance.
- */
- constructor( filePromise, uploadAdapterCreator ) {
- /**
- * Unique id of FileLoader instance.
- *
- * @readonly
- * @member {Number}
- */
- this.id = Object(_ckeditor_ckeditor5_utils_src_uid_js__WEBPACK_IMPORTED_MODULE_7__["default"])();
- /**
- * Additional wrapper over the initial file promise passed to this loader.
- *
- * @protected
- * @member {module:upload/filerepository~FilePromiseWrapper}
- */
- this._filePromiseWrapper = this._createFilePromiseWrapper( filePromise );
- /**
- * Adapter instance associated with this file loader.
- *
- * @private
- * @member {module:upload/filerepository~UploadAdapter}
- */
- this._adapter = uploadAdapterCreator( this );
- /**
- * FileReader used by FileLoader.
- *
- * @protected
- * @member {module:upload/filereader~FileReader}
- */
- this._reader = new _filereader_js__WEBPACK_IMPORTED_MODULE_6__["default"]();
- /**
- * Current status of FileLoader. It can be one of the following:
- *
- * * 'idle',
- * * 'reading',
- * * 'uploading',
- * * 'aborted',
- * * 'error'.
- *
- * When reading status can change in a following way:
- *
- * `idle` -> `reading` -> `idle`
- * `idle` -> `reading -> `aborted`
- * `idle` -> `reading -> `error`
- *
- * When uploading status can change in a following way:
- *
- * `idle` -> `uploading` -> `idle`
- * `idle` -> `uploading` -> `aborted`
- * `idle` -> `uploading` -> `error`
- *
- * @readonly
- * @observable
- * @member {String} #status
- */
- this.set( 'status', 'idle' );
- /**
- * Number of bytes uploaded.
- *
- * @readonly
- * @observable
- * @member {Number} #uploaded
- */
- this.set( 'uploaded', 0 );
- /**
- * Number of total bytes to upload.
- *
- * @readonly
- * @observable
- * @member {Number|null} #uploadTotal
- */
- this.set( 'uploadTotal', null );
- /**
- * Upload progress in percents.
- *
- * @readonly
- * @observable
- * @member {Number} #uploadedPercent
- */
- this.bind( 'uploadedPercent' ).to( this, 'uploaded', this, 'uploadTotal', ( uploaded, total ) => {
- return total ? ( uploaded / total * 100 ) : 0;
- } );
- /**
- * Response of the upload.
- *
- * @readonly
- * @observable
- * @member {Object|null} #uploadResponse
- */
- this.set( 'uploadResponse', null );
- }
- /**
- * A `Promise` which resolves to a `File` instance associated with this file loader.
- *
- * @type {Promise.<File|null>}
- */
- get file() {
- if ( !this._filePromiseWrapper ) {
- // Loader was destroyed, return promise which resolves to null.
- return Promise.resolve( null );
- } else {
- // The `this._filePromiseWrapper.promise` is chained and not simply returned to handle a case when:
- //
- // * The `loader.file.then( ... )` is called by external code (returned promise is pending).
- // * Then `loader._destroy()` is called (call is synchronous) which destroys the `loader`.
- // * Promise returned by the first `loader.file.then( ... )` call is resolved.
- //
- // Returning `this._filePromiseWrapper.promise` will still resolve to a `File` instance so there
- // is an additional check needed in the chain to see if `loader` was destroyed in the meantime.
- return this._filePromiseWrapper.promise.then( file => this._filePromiseWrapper ? file : null );
- }
- }
- /**
- * Returns the file data. To read its data, you need for first load the file
- * by using the {@link module:upload/filerepository~FileLoader#read `read()`} method.
- *
- * @type {File|undefined}
- */
- get data() {
- return this._reader.data;
- }
- /**
- * Reads file using {@link module:upload/filereader~FileReader}.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `filerepository-read-wrong-status` when status
- * is different than `idle`.
- *
- * Example usage:
- *
- * fileLoader.read()
- * .then( data => { ... } )
- * .catch( err => {
- * if ( err === 'aborted' ) {
- * console.log( 'Reading aborted.' );
- * } else {
- * console.log( 'Reading error.', err );
- * }
- * } );
- *
- * @returns {Promise.<String>} Returns promise that will be resolved with read data. Promise will be rejected if error
- * occurs or if read process is aborted.
- */
- read() {
- if ( this.status != 'idle' ) {
- /**
- * You cannot call read if the status is different than idle.
- *
- * @error filerepository-read-wrong-status
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'filerepository-read-wrong-status', this );
- }
- this.status = 'reading';
- return this.file
- .then( file => this._reader.read( file ) )
- .then( data => {
- // Edge case: reader was aborted after file was read - double check for proper status.
- // It can happen when image was deleted during its upload.
- if ( this.status !== 'reading' ) {
- throw this.status;
- }
- this.status = 'idle';
- return data;
- } )
- .catch( err => {
- if ( err === 'aborted' ) {
- this.status = 'aborted';
- throw 'aborted';
- }
- this.status = 'error';
- throw this._reader.error ? this._reader.error : err;
- } );
- }
- /**
- * Reads file using the provided {@link module:upload/filerepository~UploadAdapter}.
- *
- * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `filerepository-upload-wrong-status` when status
- * is different than `idle`.
- * Example usage:
- *
- * fileLoader.upload()
- * .then( data => { ... } )
- * .catch( e => {
- * if ( e === 'aborted' ) {
- * console.log( 'Uploading aborted.' );
- * } else {
- * console.log( 'Uploading error.', e );
- * }
- * } );
- *
- * @returns {Promise.<Object>} Returns promise that will be resolved with response data. Promise will be rejected if error
- * occurs or if read process is aborted.
- */
- upload() {
- if ( this.status != 'idle' ) {
- /**
- * You cannot call upload if the status is different than idle.
- *
- * @error filerepository-upload-wrong-status
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'filerepository-upload-wrong-status', this );
- }
- this.status = 'uploading';
- return this.file
- .then( () => this._adapter.upload() )
- .then( data => {
- this.uploadResponse = data;
- this.status = 'idle';
- return data;
- } )
- .catch( err => {
- if ( this.status === 'aborted' ) {
- throw 'aborted';
- }
- this.status = 'error';
- throw err;
- } );
- }
- /**
- * Aborts loading process.
- */
- abort() {
- const status = this.status;
- this.status = 'aborted';
- if ( !this._filePromiseWrapper.isFulfilled ) {
- // Edge case: file loader is aborted before read() is called
- // so it might happen that no one handled the rejection of this promise.
- // See https://github.com/ckeditor/ckeditor5-upload/pull/100
- this._filePromiseWrapper.promise.catch( () => {} );
- this._filePromiseWrapper.rejecter( 'aborted' );
- } else if ( status == 'reading' ) {
- this._reader.abort();
- } else if ( status == 'uploading' && this._adapter.abort ) {
- this._adapter.abort();
- }
- this._destroy();
- }
- /**
- * Performs cleanup.
- *
- * @private
- */
- _destroy() {
- this._filePromiseWrapper = undefined;
- this._reader = undefined;
- this._adapter = undefined;
- this.uploadResponse = undefined;
- }
- /**
- * Wraps a given file promise into another promise giving additional
- * control (resolving, rejecting, checking if fulfilled) over it.
- *
- * @private
- * @param filePromise The initial file promise to be wrapped.
- * @returns {module:upload/filerepository~FilePromiseWrapper}
- */
- _createFilePromiseWrapper( filePromise ) {
- const wrapper = {};
- wrapper.promise = new Promise( ( resolve, reject ) => {
- wrapper.rejecter = reject;
- wrapper.isFulfilled = false;
- filePromise
- .then( file => {
- wrapper.isFulfilled = true;
- resolve( file );
- } )
- .catch( err => {
- wrapper.isFulfilled = true;
- reject( err );
- } );
- } );
- return wrapper;
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( FileLoader, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
- /**
- * Upload adapter interface used by the {@link module:upload/filerepository~FileRepository file repository}
- * to handle file upload. An upload adapter is a bridge between the editor and server that handles file uploads.
- * It should contain a logic necessary to initiate an upload process and monitor its progress.
- *
- * Learn how to develop your own upload adapter for CKEditor 5 in the
- * {@glink framework/guides/deep-dive/upload-adapter "Custom upload adapter" guide}.
- *
- * @interface UploadAdapter
- */
- /**
- * Executes the upload process.
- * This method should return a promise that will resolve when data will be uploaded to server. Promise should be
- * resolved with an object containing information about uploaded file:
- *
- * {
- * default: 'http://server/default-size.image.png'
- * }
- *
- * Additionally, other image sizes can be provided:
- *
- * {
- * default: 'http://server/default-size.image.png',
- * '160': 'http://server/size-160.image.png',
- * '500': 'http://server/size-500.image.png',
- * '1000': 'http://server/size-1000.image.png',
- * '1052': 'http://server/default-size.image.png'
- * }
- *
- * You can also pass additional properties from the server. In this case you need to wrap URLs
- * in the `urls` object and pass additional properties along the `urls` property.
- *
- * {
- * myCustomProperty: 'foo',
- * urls: {
- * default: 'http://server/default-size.image.png',
- * '160': 'http://server/size-160.image.png',
- * '500': 'http://server/size-500.image.png',
- * '1000': 'http://server/size-1000.image.png',
- * '1052': 'http://server/default-size.image.png'
- * }
- * }
- *
- * NOTE: When returning multiple images, the widest returned one should equal the default one. It is essential to
- * correctly set `width` attribute of the image. See this discussion:
- * https://github.com/ckeditor/ckeditor5-easy-image/issues/4 for more information.
- *
- * Take a look at {@link module:upload/filerepository~UploadAdapter example Adapter implementation} and
- * {@link module:upload/filerepository~FileRepository#createUploadAdapter createUploadAdapter method}.
- *
- * @method module:upload/filerepository~UploadAdapter#upload
- * @returns {Promise.<Object>} Promise that should be resolved when data is uploaded.
- */
- /**
- * Aborts the upload process.
- * After aborting it should reject promise returned from {@link #upload upload()}.
- *
- * Take a look at {@link module:upload/filerepository~UploadAdapter example Adapter implementation} and
- * {@link module:upload/filerepository~FileRepository#createUploadAdapter createUploadAdapter method}.
- *
- * @method module:upload/filerepository~UploadAdapter#abort
- */
- /**
- * Object returned by {@link module:upload/filerepository~FileLoader#_createFilePromiseWrapper} method
- * to add more control over the initial file promise passed to {@link module:upload/filerepository~FileLoader}.
- *
- * @protected
- * @typedef {Object} module:upload/filerepository~FilePromiseWrapper
- * @property {Promise.<File>} promise Wrapper promise which can be chained for further processing.
- * @property {Function} rejecter Rejects the promise when called.
- * @property {Boolean} isFulfilled Whether original promise is already fulfilled.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/index.js":
- /*!**************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-upload/src/index.js ***!
- \**************************************************************/
- /*! exports provided: FileRepository, FileDialogButtonView, Base64UploadAdapter, SimpleUploadAdapter */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _filerepository__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileRepository", function() { return _filerepository__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _ui_filedialogbuttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ui/filedialogbuttonview */ "./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileDialogButtonView", function() { return _ui_filedialogbuttonview__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _adapters_base64uploadadapter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./adapters/base64uploadadapter */ "./node_modules/@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Base64UploadAdapter", function() { return _adapters_base64uploadadapter__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _adapters_simpleuploadadapter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./adapters/simpleuploadadapter */ "./node_modules/@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleUploadAdapter", function() { return _adapters_simpleuploadadapter__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module upload
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileDialogButtonView; });
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module upload/ui/filedialogbuttonview
- */
- /**
- * The file dialog button view.
- *
- * This component provides a button that opens the native file selection dialog.
- * It can be used to implement the UI of a file upload feature.
- *
- * const view = new FileDialogButtonView( locale );
- *
- * view.set( {
- * acceptedType: 'image/*',
- * allowMultipleFiles: true
- * } );
- *
- * view.buttonView.set( {
- * label: t( 'Insert image' ),
- * icon: imageIcon,
- * tooltip: true
- * } );
- *
- * view.on( 'done', ( evt, files ) => {
- * for ( const file of Array.from( files ) ) {
- * console.log( 'Selected file', file );
- * }
- * } );
- *
- * @extends module:ui/view~View
- */
- class FileDialogButtonView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_1__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- /**
- * The button view of the component.
- *
- * @member {module:ui/button/buttonview~ButtonView}
- */
- this.buttonView = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
- /**
- * A hidden `<input>` view used to execute file dialog.
- *
- * @protected
- * @member {module:upload/ui/filedialogbuttonview~FileInputView}
- */
- this._fileInputView = new FileInputView( locale );
- /**
- * Accepted file types. Can be provided in form of file extensions, media type or one of:
- * * `audio/*`,
- * * `video/*`,
- * * `image/*`.
- *
- * @observable
- * @member {String} #acceptedType
- */
- this._fileInputView.bind( 'acceptedType' ).to( this );
- /**
- * Indicates if multiple files can be selected. Defaults to `true`.
- *
- * @observable
- * @member {Boolean} #allowMultipleFiles
- */
- this._fileInputView.bind( 'allowMultipleFiles' ).to( this );
- /**
- * Fired when file dialog is closed with file selected.
- *
- * view.on( 'done', ( evt, files ) => {
- * for ( const file of files ) {
- * console.log( 'Selected file', file );
- * }
- * }
- *
- * @event done
- * @param {Array.<File>} files Array of selected files.
- */
- this._fileInputView.delegate( 'done' ).to( this );
- this.setTemplate( {
- tag: 'span',
- attributes: {
- class: 'ck-file-dialog-button'
- },
- children: [
- this.buttonView,
- this._fileInputView
- ]
- } );
- this.buttonView.on( 'execute', () => {
- this._fileInputView.open();
- } );
- }
- /**
- * Focuses the {@link #buttonView}.
- */
- focus() {
- this.buttonView.focus();
- }
- }
- /**
- * The hidden file input view class.
- *
- * @private
- * @extends module:ui/view~View
- */
- class FileInputView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_1__["default"] {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- /**
- * Accepted file types. Can be provided in form of file extensions, media type or one of:
- * * `audio/*`,
- * * `video/*`,
- * * `image/*`.
- *
- * @observable
- * @member {String} #acceptedType
- */
- this.set( 'acceptedType' );
- /**
- * Indicates if multiple files can be selected. Defaults to `false`.
- *
- * @observable
- * @member {Boolean} #allowMultipleFiles
- */
- this.set( 'allowMultipleFiles', false );
- const bind = this.bindTemplate;
- this.setTemplate( {
- tag: 'input',
- attributes: {
- class: [
- 'ck-hidden'
- ],
- type: 'file',
- tabindex: '-1',
- accept: bind.to( 'acceptedType' ),
- multiple: bind.to( 'allowMultipleFiles' )
- },
- on: {
- // Removing from code coverage since we cannot programmatically set input element files.
- change: bind.to( /* istanbul ignore next */ () => {
- if ( this.element && this.element.files && this.element.files.length ) {
- this.fire( 'done', this.element.files );
- }
- this.element.value = '';
- } )
- }
- } );
- }
- /**
- * Opens file dialog.
- */
- open() {
- this.element.click();
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js ***!
- \*********************************************************************/
- /*! exports provided: DOCUMENTATION_URL, default, logWarning, logError */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOCUMENTATION_URL", function() { return DOCUMENTATION_URL; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKEditorError; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logWarning", function() { return logWarning; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logError", function() { return logError; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/ckeditorerror
- */
- /* globals console */
- /**
- * URL to the documentation with error codes.
- */
- const DOCUMENTATION_URL =
- 'https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html';
- /**
- * The CKEditor error class.
- *
- * You should throw `CKEditorError` when:
- *
- * * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be handled
- * by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),
- * * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give
- * feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not
- * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use
- * {@link module:utils/ckeditorerror~logWarning `logWarning()`} and
- * {@link module:utils/ckeditorerror~logError `logError()`}
- * to improve developers experience and let them see the a working editor as soon as possible.
- *
- * /**
- * * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.
- * *
- * * @error plugin-load
- * * @param pluginName The name of the plugin that could not be loaded.
- * * @param moduleName The name of the module which tried to load this plugin.
- * * /
- * throw new CKEditorError( 'plugin-load', {
- * pluginName: 'foo',
- * moduleName: 'bar'
- * } );
- *
- * @extends Error
- */
- class CKEditorError extends Error {
- /**
- * Creates an instance of the CKEditorError class.
- *
- * @param {String} errorName The error id in an `error-name` format. A link to this error documentation page will be added
- * to the thrown error's `message`.
- * @param {Object|null} context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}
- * is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also
- * a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).
- * The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility
- * to check if the object works as the context.
- * @param {Object} [data] Additional data describing the error. A stringified version of this object
- * will be appended to the error message, so the data are quickly visible in the console. The original
- * data object will also be later available under the {@link #data} property.
- */
- constructor( errorName, context, data ) {
- const message = `${ errorName }${ ( data ? ` ${ JSON.stringify( data ) }` : '' ) }${ getLinkToDocumentationMessage( errorName ) }`;
- super( message );
- /**
- * @type {String}
- */
- this.name = 'CKEditorError';
- /**
- * A context of the error by which the Watchdog is able to determine which editor crashed.
- *
- * @type {Object|null}
- */
- this.context = context;
- /**
- * The additional error data passed to the constructor. Undefined if none was passed.
- *
- * @type {Object|undefined}
- */
- this.data = data;
- }
- /**
- * Checks if the error is of the `CKEditorError` type.
- */
- is( type ) {
- return type === 'CKEditorError';
- }
- /**
- * A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.
- * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case
- * of a {@link module:utils/ckeditorerror~CKEditorError} error.
- *
- * @static
- * @param {Error} err The error to rethrow.
- * @param {Object} context An object connected through properties with the editor instance. This context will be used
- * by the watchdog to verify which editor should be restarted.
- */
- static rethrowUnexpectedError( err, context ) {
- if ( err.is && err.is( 'CKEditorError' ) ) {
- throw err;
- }
- /**
- * An unexpected error occurred inside the CKEditor 5 codebase. This error will look like the original one
- * to make the debugging easier.
- *
- * This error is only useful when the editor is initialized using the {@link module:watchdog/watchdog~Watchdog} feature.
- * In case of such error (or any {@link module:utils/ckeditorerror~CKEditorError} error) the watchdog should restart the editor.
- *
- * @error unexpected-error
- */
- const error = new CKEditorError( err.message, context );
- // Restore the original stack trace to make the error look like the original one.
- // See https://github.com/ckeditor/ckeditor5/issues/5595 for more details.
- error.stack = err.stack;
- throw error;
- }
- }
- /**
- * Logs a warning to the console with a properly formatted message and adds a link to the documentation.
- * Use whenever you want to log a warning to the console.
- *
- * /**
- * * There was a problem processing the configuration of the toolbar. The item with the given
- * * name does not exist, so it was omitted when rendering the toolbar.
- * *
- * * @error toolbarview-item-unavailable
- * * @param {String} name The name of the component.
- * * /
- * logWarning( 'toolbarview-item-unavailable', { name } );
- *
- * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log
- * a warning or an error to the console.
- *
- * @param {String} errorName The error name to be logged.
- * @param {Object} [data] Additional data to be logged.
- * @returns {String}
- */
- function logWarning( errorName, data ) {
- console.warn( ...formatConsoleArguments( errorName, data ) );
- }
- /**
- * Logs an error to the console with a properly formatted message and adds a link to the documentation.
- * Use whenever you want to log an error to the console.
- *
- * /**
- * * There was a problem processing the configuration of the toolbar. The item with the given
- * * name does not exist, so it was omitted when rendering the toolbar.
- * *
- * * @error toolbarview-item-unavailable
- * * @param {String} name The name of the component.
- * * /
- * logError( 'toolbarview-item-unavailable', { name } );
- *
- * **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.
- *
- * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.
- *
- * @param {String} errorName The error name to be logged.
- * @param {Object} [data] Additional data to be logged.
- * @returns {String}
- */
- function logError( errorName, data ) {
- console.error( ...formatConsoleArguments( errorName, data ) );
- }
- function getLinkToDocumentationMessage( errorName ) {
- return `\nRead more: ${ DOCUMENTATION_URL }#error-${ errorName }`;
- }
- function formatConsoleArguments( errorName, data ) {
- const documentationMessage = getLinkToDocumentationMessage( errorName );
- return data ? [ errorName, data, documentationMessage ] : [ errorName, documentationMessage ];
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/collection.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Collection; });
- /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
- /* harmony import */ var _isiterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
- /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/collection
- */
- /**
- * Collections are ordered sets of objects. Items in the collection can be retrieved by their indexes
- * in the collection (like in an array) or by their ids.
- *
- * If an object without an `id` property is being added to the collection, the `id` property will be generated
- * automatically. Note that the automatically generated id is unique only within this single collection instance.
- *
- * By default an item in the collection is identified by its `id` property. The name of the identifier can be
- * configured through the constructor of the collection.
- *
- * @mixes module:utils/emittermixin~EmitterMixin
- */
- class Collection {
- /**
- * Creates a new Collection instance.
- *
- * You can provide an iterable of initial items the collection will be created with:
- *
- * const collection = new Collection( [ { id: 'John' }, { id: 'Mike' } ] );
- *
- * console.log( collection.get( 0 ) ); // -> { id: 'John' }
- * console.log( collection.get( 1 ) ); // -> { id: 'Mike' }
- * console.log( collection.get( 'Mike' ) ); // -> { id: 'Mike' }
- *
- * Or you can first create a collection and then add new items using the {@link #add} method:
- *
- * const collection = new Collection();
- *
- * collection.add( { id: 'John' } );
- * console.log( collection.get( 0 ) ); // -> { id: 'John' }
- *
- * Whatever option you choose, you can always pass a configuration object as the last argument
- * of the constructor:
- *
- * const emptyCollection = new Collection( { idProperty: 'name' } );
- * emptyCollection.add( { name: 'John' } );
- * console.log( collection.get( 'John' ) ); // -> { name: 'John' }
- *
- * const nonEmptyCollection = new Collection( [ { name: 'John' } ], { idProperty: 'name' } );
- * nonEmptyCollection.add( { name: 'George' } );
- * console.log( collection.get( 'George' ) ); // -> { name: 'George' }
- * console.log( collection.get( 'John' ) ); // -> { name: 'John' }
- *
- * @param {Iterable.<Object>|Object} initialItemsOrOptions The initial items of the collection or
- * the options object.
- * @param {Object} [options={}] The options object, when the first argument is an array of initial items.
- * @param {String} [options.idProperty='id'] The name of the property which is used to identify an item.
- * Items that do not have such a property will be assigned one when added to the collection.
- */
- constructor( initialItemsOrOptions = {}, options = {} ) {
- const hasInitialItems = Object(_isiterable__WEBPACK_IMPORTED_MODULE_3__["default"])( initialItemsOrOptions );
- if ( !hasInitialItems ) {
- options = initialItemsOrOptions;
- }
- /**
- * The internal list of items in the collection.
- *
- * @private
- * @member {Object[]}
- */
- this._items = [];
- /**
- * The internal map of items in the collection.
- *
- * @private
- * @member {Map}
- */
- this._itemMap = new Map();
- /**
- * The name of the property which is considered to identify an item.
- *
- * @private
- * @member {String}
- */
- this._idProperty = options.idProperty || 'id';
- /**
- * A helper mapping external items of a bound collection ({@link #bindTo})
- * and actual items of this collection. It provides information
- * necessary to properly remove items bound to another collection.
- *
- * See {@link #_bindToInternalToExternalMap}.
- *
- * @protected
- * @member {WeakMap}
- */
- this._bindToExternalToInternalMap = new WeakMap();
- /**
- * A helper mapping items of this collection to external items of a bound collection
- * ({@link #bindTo}). It provides information necessary to manage the bindings, e.g.
- * to avoid loops in two–way bindings.
- *
- * See {@link #_bindToExternalToInternalMap}.
- *
- * @protected
- * @member {WeakMap}
- */
- this._bindToInternalToExternalMap = new WeakMap();
- /**
- * Stores indexes of skipped items from bound external collection.
- *
- * @private
- * @member {Array}
- */
- this._skippedIndexesFromExternal = [];
- // Set the initial content of the collection (if provided in the constructor).
- if ( hasInitialItems ) {
- for ( const item of initialItemsOrOptions ) {
- this._items.push( item );
- this._itemMap.set( this._getItemIdBeforeAdding( item ), item );
- }
- }
- /**
- * A collection instance this collection is bound to as a result
- * of calling {@link #bindTo} method.
- *
- * @protected
- * @member {module:utils/collection~Collection} #_bindToCollection
- */
- }
- /**
- * The number of items available in the collection.
- *
- * @member {Number} #length
- */
- get length() {
- return this._items.length;
- }
- /**
- * Returns the first item from the collection or null when collection is empty.
- *
- * @returns {Object|null} The first item or `null` if collection is empty.
- */
- get first() {
- return this._items[ 0 ] || null;
- }
- /**
- * Returns the last item from the collection or null when collection is empty.
- *
- * @returns {Object|null} The last item or `null` if collection is empty.
- */
- get last() {
- return this._items[ this.length - 1 ] || null;
- }
- /**
- * Adds an item into the collection.
- *
- * If the item does not have an id, then it will be automatically generated and set on the item.
- *
- * @chainable
- * @param {Object} item
- * @param {Number} [index] The position of the item in the collection. The item
- * is pushed to the collection when `index` not specified.
- * @fires add
- * @fires change
- */
- add( item, index ) {
- return this.addMany( [ item ], index );
- }
- /**
- * Adds multiple items into the collection.
- *
- * Any item not containing an id will get an automatically generated one.
- *
- * @chainable
- * @param {Iterable.<Object>} item
- * @param {Number} [index] The position of the insertion. Items will be appended if no `index` is specified.
- * @fires add
- * @fires change
- */
- addMany( items, index ) {
- if ( index === undefined ) {
- index = this._items.length;
- } else if ( index > this._items.length || index < 0 ) {
- /**
- * The `index` passed to {@link module:utils/collection~Collection#addMany `Collection#addMany()`}
- * is invalid. It must be a number between 0 and the collection's length.
- *
- * @error collection-add-item-invalid-index
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-add-item-invalid-index', this );
- }
- for ( let offset = 0; offset < items.length; offset++ ) {
- const item = items[ offset ];
- const itemId = this._getItemIdBeforeAdding( item );
- const currentItemIndex = index + offset;
- this._items.splice( currentItemIndex, 0, item );
- this._itemMap.set( itemId, item );
- this.fire( 'add', item, currentItemIndex );
- }
- this.fire( 'change', {
- added: items,
- removed: [],
- index
- } );
- return this;
- }
- /**
- * Gets an item by its ID or index.
- *
- * @param {String|Number} idOrIndex The item ID or index in the collection.
- * @returns {Object|null} The requested item or `null` if such item does not exist.
- */
- get( idOrIndex ) {
- let item;
- if ( typeof idOrIndex == 'string' ) {
- item = this._itemMap.get( idOrIndex );
- } else if ( typeof idOrIndex == 'number' ) {
- item = this._items[ idOrIndex ];
- } else {
- /**
- * An index or ID must be given.
- *
- * @error collection-get-invalid-arg
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-get-invalid-arg', this );
- }
- return item || null;
- }
- /**
- * Returns a Boolean indicating whether the collection contains an item.
- *
- * @param {Object|String} itemOrId The item or its ID in the collection.
- * @returns {Boolean} `true` if the collection contains the item, `false` otherwise.
- */
- has( itemOrId ) {
- if ( typeof itemOrId == 'string' ) {
- return this._itemMap.has( itemOrId );
- } else { // Object
- const idProperty = this._idProperty;
- const id = itemOrId[ idProperty ];
- return this._itemMap.has( id );
- }
- }
- /**
- * Gets an index of an item in the collection.
- * When an item is not defined in the collection, the index will equal -1.
- *
- * @param {Object|String} itemOrId The item or its ID in the collection.
- * @returns {Number} The index of a given item.
- */
- getIndex( itemOrId ) {
- let item;
- if ( typeof itemOrId == 'string' ) {
- item = this._itemMap.get( itemOrId );
- } else {
- item = itemOrId;
- }
- return this._items.indexOf( item );
- }
- /**
- * Removes an item from the collection.
- *
- * @param {Object|Number|String} subject The item to remove, its ID or index in the collection.
- * @returns {Object} The removed item.
- * @fires remove
- * @fires change
- */
- remove( subject ) {
- const [ item, index ] = this._remove( subject );
- this.fire( 'change', {
- added: [],
- removed: [ item ],
- index
- } );
- return item;
- }
- /**
- * Executes the callback for each item in the collection and composes an array or values returned by this callback.
- *
- * @param {Function} callback
- * @param {Object} callback.item
- * @param {Number} callback.index
- * @param {Object} ctx Context in which the `callback` will be called.
- * @returns {Array} The result of mapping.
- */
- map( callback, ctx ) {
- return this._items.map( callback, ctx );
- }
- /**
- * Finds the first item in the collection for which the `callback` returns a true value.
- *
- * @param {Function} callback
- * @param {Object} callback.item
- * @param {Number} callback.index
- * @param {Object} ctx Context in which the `callback` will be called.
- * @returns {Object} The item for which `callback` returned a true value.
- */
- find( callback, ctx ) {
- return this._items.find( callback, ctx );
- }
- /**
- * Returns an array with items for which the `callback` returned a true value.
- *
- * @param {Function} callback
- * @param {Object} callback.item
- * @param {Number} callback.index
- * @param {Object} ctx Context in which the `callback` will be called.
- * @returns {Object[]} The array with matching items.
- */
- filter( callback, ctx ) {
- return this._items.filter( callback, ctx );
- }
- /**
- * Removes all items from the collection and destroys the binding created using
- * {@link #bindTo}.
- *
- * @fires remove
- * @fires change
- */
- clear() {
- if ( this._bindToCollection ) {
- this.stopListening( this._bindToCollection );
- this._bindToCollection = null;
- }
- const removedItems = Array.from( this._items );
- while ( this.length ) {
- this._remove( 0 );
- }
- this.fire( 'change', {
- added: [],
- removed: removedItems,
- index: 0
- } );
- }
- /**
- * Binds and synchronizes the collection with another one.
- *
- * The binding can be a simple factory:
- *
- * class FactoryClass {
- * constructor( data ) {
- * this.label = data.label;
- * }
- * }
- *
- * const source = new Collection( { idProperty: 'label' } );
- * const target = new Collection();
- *
- * target.bindTo( source ).as( FactoryClass );
- *
- * source.add( { label: 'foo' } );
- * source.add( { label: 'bar' } );
- *
- * console.log( target.length ); // 2
- * console.log( target.get( 1 ).label ); // 'bar'
- *
- * source.remove( 0 );
- * console.log( target.length ); // 1
- * console.log( target.get( 0 ).label ); // 'bar'
- *
- * or the factory driven by a custom callback:
- *
- * class FooClass {
- * constructor( data ) {
- * this.label = data.label;
- * }
- * }
- *
- * class BarClass {
- * constructor( data ) {
- * this.label = data.label;
- * }
- * }
- *
- * const source = new Collection( { idProperty: 'label' } );
- * const target = new Collection();
- *
- * target.bindTo( source ).using( ( item ) => {
- * if ( item.label == 'foo' ) {
- * return new FooClass( item );
- * } else {
- * return new BarClass( item );
- * }
- * } );
- *
- * source.add( { label: 'foo' } );
- * source.add( { label: 'bar' } );
- *
- * console.log( target.length ); // 2
- * console.log( target.get( 0 ) instanceof FooClass ); // true
- * console.log( target.get( 1 ) instanceof BarClass ); // true
- *
- * or the factory out of property name:
- *
- * const source = new Collection( { idProperty: 'label' } );
- * const target = new Collection();
- *
- * target.bindTo( source ).using( 'label' );
- *
- * source.add( { label: { value: 'foo' } } );
- * source.add( { label: { value: 'bar' } } );
- *
- * console.log( target.length ); // 2
- * console.log( target.get( 0 ).value ); // 'foo'
- * console.log( target.get( 1 ).value ); // 'bar'
- *
- * It's possible to skip specified items by returning falsy value:
- *
- * const source = new Collection();
- * const target = new Collection();
- *
- * target.bindTo( source ).using( item => {
- * if ( item.hidden ) {
- * return null;
- * }
- *
- * return item;
- * } );
- *
- * source.add( { hidden: true } );
- * source.add( { hidden: false } );
- *
- * console.log( source.length ); // 2
- * console.log( target.length ); // 1
- *
- * **Note**: {@link #clear} can be used to break the binding.
- *
- * @param {module:utils/collection~Collection} externalCollection A collection to be bound.
- * @returns {Object}
- * @returns {module:utils/collection~CollectionBindToChain} The binding chain object.
- */
- bindTo( externalCollection ) {
- if ( this._bindToCollection ) {
- /**
- * The collection cannot be bound more than once.
- *
- * @error collection-bind-to-rebind
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-bind-to-rebind', this );
- }
- this._bindToCollection = externalCollection;
- return {
- as: Class => {
- this._setUpBindToBinding( item => new Class( item ) );
- },
- using: callbackOrProperty => {
- if ( typeof callbackOrProperty == 'function' ) {
- this._setUpBindToBinding( item => callbackOrProperty( item ) );
- } else {
- this._setUpBindToBinding( item => item[ callbackOrProperty ] );
- }
- }
- };
- }
- /**
- * Finalizes and activates a binding initiated by {#bindTo}.
- *
- * @protected
- * @param {Function} factory A function which produces collection items.
- */
- _setUpBindToBinding( factory ) {
- const externalCollection = this._bindToCollection;
- // Adds the item to the collection once a change has been done to the external collection.
- //
- // @private
- const addItem = ( evt, externalItem, index ) => {
- const isExternalBoundToThis = externalCollection._bindToCollection == this;
- const externalItemBound = externalCollection._bindToInternalToExternalMap.get( externalItem );
- // If an external collection is bound to this collection, which makes it a 2–way binding,
- // and the particular external collection item is already bound, don't add it here.
- // The external item has been created **out of this collection's item** and (re)adding it will
- // cause a loop.
- if ( isExternalBoundToThis && externalItemBound ) {
- this._bindToExternalToInternalMap.set( externalItem, externalItemBound );
- this._bindToInternalToExternalMap.set( externalItemBound, externalItem );
- } else {
- const item = factory( externalItem );
- // When there is no item we need to remember skipped index first and then we can skip this item.
- if ( !item ) {
- this._skippedIndexesFromExternal.push( index );
- return;
- }
- // Lets try to put item at the same index as index in external collection
- // but when there are a skipped items in one or both collections we need to recalculate this index.
- let finalIndex = index;
- // When we try to insert item after some skipped items from external collection we need
- // to include this skipped items and decrease index.
- //
- // For the following example:
- // external -> [ 'A', 'B - skipped for internal', 'C - skipped for internal' ]
- // internal -> [ A ]
- //
- // Another item is been added at the end of external collection:
- // external.add( 'D' )
- // external -> [ 'A', 'B - skipped for internal', 'C - skipped for internal', 'D' ]
- //
- // We can't just add 'D' to internal at the same index as index in external because
- // this will produce empty indexes what is invalid:
- // internal -> [ 'A', empty, empty, 'D' ]
- //
- // So we need to include skipped items and decrease index
- // internal -> [ 'A', 'D' ]
- for ( const skipped of this._skippedIndexesFromExternal ) {
- if ( index > skipped ) {
- finalIndex--;
- }
- }
- // We need to take into consideration that external collection could skip some items from
- // internal collection.
- //
- // For the following example:
- // internal -> [ 'A', 'B - skipped for external', 'C - skipped for external' ]
- // external -> [ A ]
- //
- // Another item is been added at the end of external collection:
- // external.add( 'D' )
- // external -> [ 'A', 'D' ]
- //
- // We need to include skipped items and place new item after them:
- // internal -> [ 'A', 'B - skipped for external', 'C - skipped for external', 'D' ]
- for ( const skipped of externalCollection._skippedIndexesFromExternal ) {
- if ( finalIndex >= skipped ) {
- finalIndex++;
- }
- }
- this._bindToExternalToInternalMap.set( externalItem, item );
- this._bindToInternalToExternalMap.set( item, externalItem );
- this.add( item, finalIndex );
- // After adding new element to internal collection we need update indexes
- // of skipped items in external collection.
- for ( let i = 0; i < externalCollection._skippedIndexesFromExternal.length; i++ ) {
- if ( finalIndex <= externalCollection._skippedIndexesFromExternal[ i ] ) {
- externalCollection._skippedIndexesFromExternal[ i ]++;
- }
- }
- }
- };
- // Load the initial content of the collection.
- for ( const externalItem of externalCollection ) {
- addItem( null, externalItem, externalCollection.getIndex( externalItem ) );
- }
- // Synchronize the with collection as new items are added.
- this.listenTo( externalCollection, 'add', addItem );
- // Synchronize the with collection as new items are removed.
- this.listenTo( externalCollection, 'remove', ( evt, externalItem, index ) => {
- const item = this._bindToExternalToInternalMap.get( externalItem );
- if ( item ) {
- this.remove( item );
- }
- // After removing element from external collection we need update/remove indexes
- // of skipped items in internal collection.
- this._skippedIndexesFromExternal = this._skippedIndexesFromExternal.reduce( ( result, skipped ) => {
- if ( index < skipped ) {
- result.push( skipped - 1 );
- }
- if ( index > skipped ) {
- result.push( skipped );
- }
- return result;
- }, [] );
- } );
- }
- /**
- * Returns an unique id property for a given `item`.
- *
- * The method will generate new id and assign it to the `item` if it doesn't have any.
- *
- * @private
- * @param {Object} item Item to be added.
- * @returns {String}
- */
- _getItemIdBeforeAdding( item ) {
- const idProperty = this._idProperty;
- let itemId;
- if ( ( idProperty in item ) ) {
- itemId = item[ idProperty ];
- if ( typeof itemId != 'string' ) {
- /**
- * This item's ID should be a string.
- *
- * @error collection-add-invalid-id
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-add-invalid-id', this );
- }
- if ( this.get( itemId ) ) {
- /**
- * This item already exists in the collection.
- *
- * @error collection-add-item-already-exists
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-add-item-already-exists', this );
- }
- } else {
- item[ idProperty ] = itemId = Object(_uid__WEBPACK_IMPORTED_MODULE_2__["default"])();
- }
- return itemId;
- }
- /**
- * Core {@link #remove} method implementation shared in other functions.
- *
- * In contrast this method **does not** fire the {@link #event:change} event.
- *
- * @private
- * @param {Object} subject The item to remove, its id or index in the collection.
- * @returns {Array} Returns an array with the removed item and its index.
- * @fires remove
- */
- _remove( subject ) {
- let index, id, item;
- let itemDoesNotExist = false;
- const idProperty = this._idProperty;
- if ( typeof subject == 'string' ) {
- id = subject;
- item = this._itemMap.get( id );
- itemDoesNotExist = !item;
- if ( item ) {
- index = this._items.indexOf( item );
- }
- } else if ( typeof subject == 'number' ) {
- index = subject;
- item = this._items[ index ];
- itemDoesNotExist = !item;
- if ( item ) {
- id = item[ idProperty ];
- }
- } else {
- item = subject;
- id = item[ idProperty ];
- index = this._items.indexOf( item );
- itemDoesNotExist = ( index == -1 || !this._itemMap.get( id ) );
- }
- if ( itemDoesNotExist ) {
- /**
- * Item not found.
- *
- * @error collection-remove-404
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-remove-404', this );
- }
- this._items.splice( index, 1 );
- this._itemMap.delete( id );
- const externalItem = this._bindToInternalToExternalMap.get( item );
- this._bindToInternalToExternalMap.delete( item );
- this._bindToExternalToInternalMap.delete( externalItem );
- this.fire( 'remove', item, index );
- return [ item, index ];
- }
- /**
- * Iterable interface.
- *
- * @returns {Iterable.<*>}
- */
- [ Symbol.iterator ]() {
- return this._items[ Symbol.iterator ]();
- }
- /**
- * Fired when an item is added to the collection.
- *
- * @event add
- * @param {Object} item The added item.
- */
- /**
- * Fired when the collection was changed due to adding or removing items.
- *
- * @event change
- * @param {Iterable.<Object>} added A list of added items.
- * @param {Iterable.<Object>} removed A list of removed items.
- * @param {Number} index An index where the addition or removal occurred.
- */
- /**
- * Fired when an item is removed from the collection.
- *
- * @event remove
- * @param {Object} item The removed item.
- * @param {Number} index Index from which item was removed.
- */
- }
- Object(_mix__WEBPACK_IMPORTED_MODULE_4__["default"])( Collection, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
- /**
- * An object returned by the {@link module:utils/collection~Collection#bindTo `bindTo()`} method
- * providing functions that specify the type of the binding.
- *
- * See the {@link module:utils/collection~Collection#bindTo `bindTo()`} documentation for examples.
- *
- * @interface module:utils/collection~CollectionBindToChain
- */
- /**
- * Creates a callback or a property binding.
- *
- * @method #using
- * @param {Function|String} callbackOrProperty When the function is passed, it should return
- * the collection items. When the string is provided, the property value is used to create the bound collection items.
- */
- /**
- * Creates the class factory binding in which items of the source collection are passed to
- * the constructor of the specified class.
- *
- * @method #as
- * @param {Function} Class The class constructor used to create instances in the factory.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return compareArrays; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/comparearrays
- */
- /**
- * Compares how given arrays relate to each other. One array can be: same as another array, prefix of another array
- * or completely different. If arrays are different, first index at which they differ is returned. Otherwise,
- * a flag specifying the relation is returned. Flags are negative numbers, so whenever a number >= 0 is returned
- * it means that arrays differ.
- *
- * compareArrays( [ 0, 2 ], [ 0, 2 ] ); // 'same'
- * compareArrays( [ 0, 2 ], [ 0, 2, 1 ] ); // 'prefix'
- * compareArrays( [ 0, 2 ], [ 0 ] ); // 'extension'
- * compareArrays( [ 0, 2 ], [ 1, 2 ] ); // 0
- * compareArrays( [ 0, 2 ], [ 0, 1 ] ); // 1
- *
- * @param {Array} a Array that is compared.
- * @param {Array} b Array to compare with.
- * @returns {module:utils/comparearrays~ArrayRelation} How array `a` is related to `b`.
- */
- function compareArrays( a, b ) {
- const minLen = Math.min( a.length, b.length );
- for ( let i = 0; i < minLen; i++ ) {
- if ( a[ i ] != b[ i ] ) {
- // The arrays are different.
- return i;
- }
- }
- // Both arrays were same at all points.
- if ( a.length == b.length ) {
- // If their length is also same, they are the same.
- return 'same';
- } else if ( a.length < b.length ) {
- // Compared array is shorter so it is a prefix of the other array.
- return 'prefix';
- } else {
- // Compared array is longer so it is an extension of the other array.
- return 'extension';
- }
- }
- /**
- * @typedef {'extension'|'same'|'prefix'} module:utils/comparearrays~ArrayRelation
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/config.js":
- /*!**************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/config.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Config; });
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/config
- */
- /**
- * Handles a configuration dictionary.
- */
- class Config {
- /**
- * Creates an instance of the {@link ~Config} class.
- *
- * @param {Object} [configurations] The initial configurations to be set. Usually, provided by the user.
- * @param {Object} [defaultConfigurations] The default configurations. Usually, provided by the system.
- */
- constructor( configurations, defaultConfigurations ) {
- /**
- * Store for the whole configuration.
- *
- * @private
- * @member {Object}
- */
- this._config = {};
- // Set default configuration.
- if ( defaultConfigurations ) {
- // Clone the configuration to make sure that the properties will not be shared
- // between editors and make the watchdog feature work correctly.
- this.define( cloneConfig( defaultConfigurations ) );
- }
- // Set initial configuration.
- if ( configurations ) {
- this._setObjectToTarget( this._config, configurations );
- }
- }
- /**
- * Set configuration values.
- *
- * It accepts both a name/value pair or an object, which properties and values will be used to set
- * configurations.
- *
- * It also accepts setting a "deep configuration" by using dots in the name. For example, `'resize.width'` sets
- * the value for the `width` configuration in the `resize` subset.
- *
- * config.set( 'width', 500 );
- * config.set( 'toolbar.collapsed', true );
- *
- * // Equivalent to:
- * config.set( {
- * width: 500
- * toolbar: {
- * collapsed: true
- * }
- * } );
- *
- * Passing an object as the value will amend the configuration, not replace it.
- *
- * config.set( 'toolbar', {
- * collapsed: true,
- * } );
- *
- * config.set( 'toolbar', {
- * color: 'red',
- * } );
- *
- * config.get( 'toolbar.collapsed' ); // true
- * config.get( 'toolbar.color' ); // 'red'
- *
- * @param {String|Object} name The configuration name or an object from which take properties as
- * configuration entries. Configuration names are case-sensitive.
- * @param {*} value The configuration value. Used if a name is passed.
- */
- set( name, value ) {
- this._setToTarget( this._config, name, value );
- }
- /**
- * Does exactly the same as {@link #set} with one exception – passed configuration extends
- * existing one, but does not overwrite already defined values.
- *
- * This method is supposed to be called by plugin developers to setup plugin's configurations. It would be
- * rarely used for other needs.
- *
- * @param {String|Object} name The configuration name or an object from which take properties as
- * configuration entries. Configuration names are case-sensitive.
- * @param {*} value The configuration value. Used if a name is passed.
- */
- define( name, value ) {
- const isDefine = true;
- this._setToTarget( this._config, name, value, isDefine );
- }
- /**
- * Gets the value for a configuration entry.
- *
- * config.get( 'name' );
- *
- * Deep configurations can be retrieved by separating each part with a dot.
- *
- * config.get( 'toolbar.collapsed' );
- *
- * @param {String} name The configuration name. Configuration names are case-sensitive.
- * @returns {*} The configuration value or `undefined` if the configuration entry was not found.
- */
- get( name ) {
- return this._getFromSource( this._config, name );
- }
- /**
- * Iterates over all top level configuration names.
- *
- * @returns {Iterable.<String>}
- */
- * names() {
- for ( const name of Object.keys( this._config ) ) {
- yield name;
- }
- }
- /**
- * Saves passed configuration to the specified target (nested object).
- *
- * @private
- * @param {Object} target Nested config object.
- * @param {String|Object} name The configuration name or an object from which take properties as
- * configuration entries. Configuration names are case-sensitive.
- * @param {*} value The configuration value. Used if a name is passed.
- * @param {Boolean} [isDefine=false] Define if passed configuration should overwrite existing one.
- */
- _setToTarget( target, name, value, isDefine = false ) {
- // In case of an object, iterate through it and call `_setToTarget` again for each property.
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( name ) ) {
- this._setObjectToTarget( target, name, isDefine );
- return;
- }
- // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].
- const parts = name.split( '.' );
- // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.
- name = parts.pop();
- // Iterate over parts to check if currently stored configuration has proper structure.
- for ( const part of parts ) {
- // If there is no object for specified part then create one.
- if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( target[ part ] ) ) {
- target[ part ] = {};
- }
- // Nested object becomes a target.
- target = target[ part ];
- }
- // In case of value is an object.
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( value ) ) {
- // We take care of proper config structure.
- if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( target[ name ] ) ) {
- target[ name ] = {};
- }
- target = target[ name ];
- // And iterate through this object calling `_setToTarget` again for each property.
- this._setObjectToTarget( target, value, isDefine );
- return;
- }
- // Do nothing if we are defining configuration for non empty name.
- if ( isDefine && typeof target[ name ] != 'undefined' ) {
- return;
- }
- target[ name ] = value;
- }
- /**
- * Get specified configuration from specified source (nested object).
- *
- * @private
- * @param {Object} source level of nested object.
- * @param {String} name The configuration name. Configuration names are case-sensitive.
- * @returns {*} The configuration value or `undefined` if the configuration entry was not found.
- */
- _getFromSource( source, name ) {
- // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].
- const parts = name.split( '.' );
- // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.
- name = parts.pop();
- // Iterate over parts to check if currently stored configuration has proper structure.
- for ( const part of parts ) {
- if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( source[ part ] ) ) {
- source = null;
- break;
- }
- // Nested object becomes a source.
- source = source[ part ];
- }
- // Always returns undefined for non existing configuration.
- return source ? cloneConfig( source[ name ] ) : undefined;
- }
- /**
- * Iterates through passed object and calls {@link #_setToTarget} method with object key and value for each property.
- *
- * @private
- * @param {Object} target Nested config object.
- * @param {Object} configuration Configuration data set
- * @param {Boolean} [isDefine] Defines if passed configuration is default configuration or not.
- */
- _setObjectToTarget( target, configuration, isDefine ) {
- Object.keys( configuration ).forEach( key => {
- this._setToTarget( target, key, configuration[ key ], isDefine );
- } );
- }
- }
- // Clones configuration object or value.
- // @param {*} source Source configuration
- // @returns {*} Cloned configuration value.
- function cloneConfig( source ) {
- return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["cloneDeepWith"])( source, leaveDOMReferences );
- }
- // A customized function for cloneDeepWith.
- // It will leave references to DOM Elements instead of cloning them.
- //
- // @param {*} value
- // @returns {Element|undefined}
- function leaveDOMReferences( value ) {
- return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isElement"])( value ) ? value : undefined;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/count.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/count.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return count; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/count
- */
- /**
- * Returns the number of items return by the iterator.
- *
- * count( [ 1, 2, 3, 4, 5 ] ); // 5;
- *
- * @param {Iterable.<*>} iterator Any iterator.
- * @returns {Number} Number of items returned by that iterator.
- */
- function count( iterator ) {
- let count = 0;
- for ( const _ of iterator ) { // eslint-disable-line no-unused-vars
- count++;
- }
- return count;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js":
- /*!************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/diff.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return diff; });
- /* harmony import */ var _src_fastdiff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/fastdiff */ "./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/diff
- */
- // The following code is based on the "O(NP) Sequence Comparison Algorithm"
- // by Sun Wu, Udi Manber, Gene Myers, Webb Miller.
- /**
- * Calculates the difference between two arrays or strings producing an array containing a list of changes
- * necessary to transform input into output.
- *
- * diff( 'aba', 'acca' ); // [ 'equal', 'insert', 'insert', 'delete', 'equal' ]
- *
- * This function is based on the "O(NP) Sequence Comparison Algorithm" by Sun Wu, Udi Manber, Gene Myers, Webb Miller.
- * Unfortunately, while it gives the most precise results, its to complex for longer strings/arrow (above 200 items).
- * Therefore, `diff()` automatically switches to {@link module:utils/fastdiff~fastDiff `fastDiff()`} when detecting
- * such a scenario. The return formats of both functions are identical.
- *
- * @param {Array|String} a Input array or string.
- * @param {Array|String} b Output array or string.
- * @param {Function} [cmp] Optional function used to compare array values, by default === is used.
- * @returns {Array} Array of changes.
- */
- function diff( a, b, cmp ) {
- // Set the comparator function.
- cmp = cmp || function( a, b ) {
- return a === b;
- };
- const aLength = a.length;
- const bLength = b.length;
- // Perform `fastDiff` for longer strings/arrays (see #269).
- if ( aLength > 200 || bLength > 200 || aLength + bLength > 300 ) {
- return diff.fastDiff( a, b, cmp, true );
- }
- // Temporary action type statics.
- let _insert, _delete;
- // Swapped the arrays to use the shorter one as the first one.
- if ( bLength < aLength ) {
- const tmp = a;
- a = b;
- b = tmp;
- // We swap the action types as well.
- _insert = 'delete';
- _delete = 'insert';
- } else {
- _insert = 'insert';
- _delete = 'delete';
- }
- const m = a.length;
- const n = b.length;
- const delta = n - m;
- // Edit scripts, for each diagonal.
- const es = {};
- // Furthest points, the furthest y we can get on each diagonal.
- const fp = {};
- function snake( k ) {
- // We use -1 as an alternative below to handle initial values ( instead of filling the fp with -1 first ).
- // Furthest points (y) on the diagonal below k.
- const y1 = ( fp[ k - 1 ] !== undefined ? fp[ k - 1 ] : -1 ) + 1;
- // Furthest points (y) on the diagonal above k.
- const y2 = fp[ k + 1 ] !== undefined ? fp[ k + 1 ] : -1;
- // The way we should go to get further.
- const dir = y1 > y2 ? -1 : 1;
- // Clone previous changes array (if any).
- if ( es[ k + dir ] ) {
- es[ k ] = es[ k + dir ].slice( 0 );
- }
- // Create changes array.
- if ( !es[ k ] ) {
- es[ k ] = [];
- }
- // Push the action.
- es[ k ].push( y1 > y2 ? _insert : _delete );
- // Set the beginning coordinates.
- let y = Math.max( y1, y2 );
- let x = y - k;
- // Traverse the diagonal as long as the values match.
- while ( x < m && y < n && cmp( a[ x ], b[ y ] ) ) {
- x++;
- y++;
- // Push no change action.
- es[ k ].push( 'equal' );
- }
- return y;
- }
- let p = 0;
- let k;
- // Traverse the graph until we reach the end of the longer string.
- do {
- // Updates furthest points and edit scripts for diagonals below delta.
- for ( k = -p; k < delta; k++ ) {
- fp[ k ] = snake( k );
- }
- // Updates furthest points and edit scripts for diagonals above delta.
- for ( k = delta + p; k > delta; k-- ) {
- fp[ k ] = snake( k );
- }
- // Updates furthest point and edit script for the delta diagonal.
- // note that the delta diagonal is the one which goes through the sink (m, n).
- fp[ delta ] = snake( delta );
- p++;
- } while ( fp[ delta ] !== n );
- // Return the final list of edit changes.
- // We remove the first item that represents the action for the injected nulls.
- return es[ delta ].slice( 1 );
- }
- // Store the API in static property to easily overwrite it in tests.
- // Too bad dependency injection does not work in Webpack + ES 6 (const) + Babel.
- diff.fastDiff = _src_fastdiff__WEBPACK_IMPORTED_MODULE_0__["default"];
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/difftochanges.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/difftochanges.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return diffToChanges; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/difftochanges
- */
- /**
- * Creates a set of changes which need to be applied to the input in order to transform
- * it into the output. This function can be used with strings or arrays.
- *
- * const input = Array.from( 'abc' );
- * const output = Array.from( 'xaby' );
- * const changes = diffToChanges( diff( input, output ), output );
- *
- * changes.forEach( change => {
- * if ( change.type == 'insert' ) {
- * input.splice( change.index, 0, ...change.values );
- * } else if ( change.type == 'delete' ) {
- * input.splice( change.index, change.howMany );
- * }
- * } );
- *
- * input.join( '' ) == output.join( '' ); // -> true
- *
- * @param {Array.<'equal'|'insert'|'delete'>} diff Result of {@link module:utils/diff~diff}.
- * @param {String|Array} output The string or array which was passed as diff's output.
- * @returns {Array.<Object>} Set of changes (insert or delete) which need to be applied to the input
- * in order to transform it into the output.
- */
- function diffToChanges( diff, output ) {
- const changes = [];
- let index = 0;
- let lastOperation;
- diff.forEach( change => {
- if ( change == 'equal' ) {
- pushLast();
- index++;
- } else if ( change == 'insert' ) {
- if ( isContinuationOf( 'insert' ) ) {
- lastOperation.values.push( output[ index ] );
- } else {
- pushLast();
- lastOperation = {
- type: 'insert',
- index,
- values: [ output[ index ] ]
- };
- }
- index++;
- } else /* if ( change == 'delete' ) */ {
- if ( isContinuationOf( 'delete' ) ) {
- lastOperation.howMany++;
- } else {
- pushLast();
- lastOperation = {
- type: 'delete',
- index,
- howMany: 1
- };
- }
- }
- } );
- pushLast();
- return changes;
- function pushLast() {
- if ( lastOperation ) {
- changes.push( lastOperation );
- lastOperation = null;
- }
- }
- function isContinuationOf( expected ) {
- return lastOperation && lastOperation.type == expected;
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js ***!
- \*************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createElement; });
- /* harmony import */ var _isiterable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/createelement
- */
- /**
- * Creates element with attributes and children.
- *
- * createElement( document, 'p' ); // <p>
- * createElement( document, 'p', { class: 'foo' } ); // <p class="foo">
- * createElement( document, 'p', null, 'foo' ); // <p>foo</p>
- * createElement( document, 'p', null, [ 'foo', createElement( document, 'img' ) ] ); // <p>foo<img></p>
- *
- * @param {Document} doc Document used to create element.
- * @param {String} name Name of the element.
- * @param {Object} [attributes] Object keys will become attributes keys and object values will became attributes values.
- * @param {Node|String|Array.<Node|String>} [children] Child or array of children. Strings will be automatically turned
- * into Text nodes.
- * @returns {Element} Created element.
- */
- function createElement( doc, name, attributes = {}, children = [] ) {
- const namespace = attributes && attributes.xmlns;
- const element = namespace ? doc.createElementNS( namespace, name ) : doc.createElement( name );
- for ( const key in attributes ) {
- element.setAttribute( key, attributes[ key ] );
- }
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_1__["isString"])( children ) || !Object(_isiterable__WEBPACK_IMPORTED_MODULE_0__["default"])( children ) ) {
- children = [ children ];
- }
- for ( let child of children ) {
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_1__["isString"])( child ) ) {
- child = doc.createTextNode( child );
- }
- element.appendChild( child );
- }
- return element;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
- /* harmony import */ var _isnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isnode */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js");
- /* harmony import */ var _iswindow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./iswindow */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/emittermixin
- */
- /**
- * Mixin that injects the DOM events API into its host. It provides the API
- * compatible with {@link module:utils/emittermixin~EmitterMixin}.
- *
- * DOM emitter mixin is by default available in the {@link module:ui/view~View} class,
- * but it can also be mixed into any other class:
- *
- * import mix from '../utils/mix.js';
- * import DomEmitterMixin from '../utils/dom/emittermixin.js';
- *
- * class SomeView {}
- * mix( SomeView, DomEmitterMixin );
- *
- * const view = new SomeView();
- * view.listenTo( domElement, ( evt, domEvt ) => {
- * console.log( evt, domEvt );
- * } );
- *
- * @mixin EmitterMixin
- * @mixes module:utils/emittermixin~EmitterMixin
- * @implements module:utils/dom/emittermixin~Emitter
- */
- const DomEmitterMixin = Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["extend"])( {}, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"], {
- /**
- * Registers a callback function to be executed when an event is fired in a specific Emitter or DOM Node.
- * It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#listenTo}.
- *
- * @param {module:utils/emittermixin~Emitter|Node} emitter The object that fires the event.
- * @param {String} event The name of the event.
- * @param {Function} callback The function to be called on event.
- * @param {Object} [options={}] Additional options.
- * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
- * the priority value the sooner the callback will be fired. Events having the same priority are called in the
- * order they were added.
- * @param {Boolean} [options.useCapture=false] Indicates that events of this type will be dispatched to the registered
- * listener before being dispatched to any EventTarget beneath it in the DOM tree.
- * @param {Boolean} [options.usePassive=false] Indicates that the function specified by listener will never call preventDefault()
- * and prevents blocking browser's main thread by this event handler.
- */
- listenTo( emitter, ...rest ) {
- // Check if emitter is an instance of DOM Node. If so, replace the argument with
- // corresponding ProxyEmitter (or create one if not existing).
- if ( Object(_isnode__WEBPACK_IMPORTED_MODULE_2__["default"])( emitter ) || Object(_iswindow__WEBPACK_IMPORTED_MODULE_3__["default"])( emitter ) ) {
- const proxy = this._getProxyEmitter( emitter ) || new ProxyEmitter( emitter );
- proxy.attach( ...rest );
- emitter = proxy;
- }
- // Execute parent class method with Emitter (or ProxyEmitter) instance.
- _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"].listenTo.call( this, emitter, ...rest );
- },
- /**
- * Stops listening for events. It can be used at different levels:
- * It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#listenTo}.
- *
- * * To stop listening to a specific callback.
- * * To stop listening to a specific event.
- * * To stop listening to all events fired by a specific object.
- * * To stop listening to all events fired by all object.
- *
- * @param {module:utils/emittermixin~Emitter|Node} [emitter] The object to stop listening to. If omitted, stops it for all objects.
- * @param {String} [event] (Requires the `emitter`) The name of the event to stop listening to. If omitted, stops it
- * for all events from `emitter`.
- * @param {Function} [callback] (Requires the `event`) The function to be removed from the call list for the given
- * `event`.
- */
- stopListening( emitter, event, callback ) {
- // Check if emitter is an instance of DOM Node. If so, replace the argument with corresponding ProxyEmitter.
- if ( Object(_isnode__WEBPACK_IMPORTED_MODULE_2__["default"])( emitter ) || Object(_iswindow__WEBPACK_IMPORTED_MODULE_3__["default"])( emitter ) ) {
- const proxy = this._getProxyEmitter( emitter );
- // Element has no listeners.
- if ( !proxy ) {
- return;
- }
- emitter = proxy;
- }
- // Execute parent class method with Emitter (or ProxyEmitter) instance.
- _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"].stopListening.call( this, emitter, event, callback );
- if ( emitter instanceof ProxyEmitter ) {
- emitter.detach( event );
- }
- },
- /**
- * Retrieves ProxyEmitter instance for given DOM Node residing in this Host.
- *
- * @private
- * @param {Node} node DOM Node of the ProxyEmitter.
- * @returns {module:utils/dom/emittermixin~ProxyEmitter} ProxyEmitter instance or null.
- */
- _getProxyEmitter( node ) {
- return Object(_emittermixin__WEBPACK_IMPORTED_MODULE_0__["_getEmitterListenedTo"])( this, getNodeUID( node ) );
- }
- } );
- /* harmony default export */ __webpack_exports__["default"] = (DomEmitterMixin);
- /**
- * Creates a ProxyEmitter instance. Such an instance is a bridge between a DOM Node firing events
- * and any Host listening to them. It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#on}.
- *
- * listenTo( click, ... )
- * +-----------------------------------------+
- * | stopListening( ... ) |
- * +----------------------------+ | addEventListener( click, ... )
- * | Host | | +---------------------------------------------+
- * +----------------------------+ | | removeEventListener( click, ... ) |
- * | _listeningTo: { | +----------v-------------+ |
- * | UID: { | | ProxyEmitter | |
- * | emitter: ProxyEmitter, | +------------------------+ +------------v----------+
- * | callbacks: { | | events: { | | Node (HTMLElement) |
- * | click: [ callbacks ] | | click: [ callbacks ] | +-----------------------+
- * | } | | }, | | data-ck-expando: UID |
- * | } | | _domNode: Node, | +-----------------------+
- * | } | | _domListeners: {}, | |
- * | +------------------------+ | | _emitterId: UID | |
- * | | DomEmitterMixin | | +--------------^---------+ |
- * | +------------------------+ | | | |
- * +--------------^-------------+ | +---------------------------------------------+
- * | | click (DOM Event)
- * +-----------------------------------------+
- * fire( click, DOM Event )
- *
- * @mixes module:utils/emittermixin~EmitterMixin
- * @implements module:utils/dom/emittermixin~Emitter
- * @private
- */
- class ProxyEmitter {
- /**
- * @param {Node} node DOM Node that fires events.
- * @returns {Object} ProxyEmitter instance bound to the DOM Node.
- */
- constructor( node ) {
- // Set emitter ID to match DOM Node "expando" property.
- Object(_emittermixin__WEBPACK_IMPORTED_MODULE_0__["_setEmitterId"])( this, getNodeUID( node ) );
- // Remember the DOM Node this ProxyEmitter is bound to.
- this._domNode = node;
- }
- }
- Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["extend"])( ProxyEmitter.prototype, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"], {
- /**
- * Collection of native DOM listeners.
- *
- * @private
- * @member {Object} module:utils/dom/emittermixin~ProxyEmitter#_domListeners
- */
- /**
- * Registers a callback function to be executed when an event is fired.
- *
- * It attaches a native DOM listener to the DOM Node. When fired,
- * a corresponding Emitter event will also fire with DOM Event object as an argument.
- *
- * @method module:utils/dom/emittermixin~ProxyEmitter#attach
- * @param {String} event The name of the event.
- * @param {Function} callback The function to be called on event.
- * @param {Object} [options={}] Additional options.
- * @param {Boolean} [options.useCapture=false] Indicates that events of this type will be dispatched to the registered
- * listener before being dispatched to any EventTarget beneath it in the DOM tree.
- * @param {Boolean} [options.usePassive=false] Indicates that the function specified by listener will never call preventDefault()
- * and prevents blocking browser's main thread by this event handler.
- */
- attach( event, callback, options = {} ) {
- // If the DOM Listener for given event already exist it is pointless
- // to attach another one.
- if ( this._domListeners && this._domListeners[ event ] ) {
- return;
- }
- const listenerOptions = {
- capture: !!options.useCapture,
- passive: !!options.usePassive
- };
- const domListener = this._createDomListener( event, listenerOptions );
- // Attach the native DOM listener to DOM Node.
- this._domNode.addEventListener( event, domListener, listenerOptions );
- if ( !this._domListeners ) {
- this._domListeners = {};
- }
- // Store the native DOM listener in this ProxyEmitter. It will be helpful
- // when stopping listening to the event.
- this._domListeners[ event ] = domListener;
- },
- /**
- * Stops executing the callback on the given event.
- *
- * @method module:utils/dom/emittermixin~ProxyEmitter#detach
- * @param {String} event The name of the event.
- */
- detach( event ) {
- let events;
- // Remove native DOM listeners which are orphans. If no callbacks
- // are awaiting given event, detach native DOM listener from DOM Node.
- // See: {@link attach}.
- if ( this._domListeners[ event ] && ( !( events = this._events[ event ] ) || !events.callbacks.length ) ) {
- this._domListeners[ event ].removeListener();
- }
- },
- /**
- * Creates a native DOM listener callback. When the native DOM event
- * is fired it will fire corresponding event on this ProxyEmitter.
- * Note: A native DOM Event is passed as an argument.
- *
- * @private
- * @method module:utils/dom/emittermixin~ProxyEmitter#_createDomListener
- * @param {String} event The name of the event.
- * @param {Object} [options] Additional options.
- * @param {Boolean} [options.capture=false] Indicates whether the listener was created for capturing event.
- * @param {Boolean} [options.passive=false] Indicates that the function specified by listener will never call preventDefault()
- * and prevents blocking browser's main thread by this event handler.
- * @returns {Function} The DOM listener callback.
- */
- _createDomListener( event, options ) {
- const domListener = domEvt => {
- this.fire( event, domEvt );
- };
- // Supply the DOM listener callback with a function that will help
- // detach it from the DOM Node, when it is no longer necessary.
- // See: {@link detach}.
- domListener.removeListener = () => {
- this._domNode.removeEventListener( event, domListener, options );
- delete this._domListeners[ event ];
- };
- return domListener;
- }
- } );
- // Gets an unique DOM Node identifier. The identifier will be set if not defined.
- //
- // @private
- // @param {Node} node
- // @returns {String} UID for given DOM Node.
- function getNodeUID( node ) {
- return node[ 'data-ck-expando' ] || ( node[ 'data-ck-expando' ] = Object(_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() );
- }
- /**
- * Interface representing classes which mix in {@link module:utils/dom/emittermixin~EmitterMixin}.
- *
- * @interface Emitter
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getAncestors; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /* globals Node */
- /**
- * @module utils/dom/getancestors
- */
- /**
- * Returns all ancestors of given DOM node, starting from the top-most (root). Includes the given node itself. If the
- * node is a part of `DocumentFragment` that `DocumentFragment` will be returned. In contrary, if the node is
- * appended to a `Document`, that `Document` will not be returned (algorithms operating on DOM tree care for `Document#documentElement`
- * at most, which will be returned).
- *
- * @param {Node} node DOM node.
- * @returns {Array.<Node|DocumentFragment>} Array of given `node` parents.
- */
- function getAncestors( node ) {
- const nodes = [];
- // We are interested in `Node`s `DocumentFragment`s only.
- while ( node && node.nodeType != Node.DOCUMENT_NODE ) {
- nodes.unshift( node );
- node = node.parentNode;
- }
- return nodes;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getBorderWidths; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/getborderwidths
- */
- /**
- * Returns an object containing CSS border widths of a specified HTML element.
- *
- * @param {HTMLElement} element An element which has CSS borders.
- * @returns {Object} An object containing `top`, `left`, `right` and `bottom` properties
- * with numerical values of the `border-[top,left,right,bottom]-width` CSS styles.
- */
- function getBorderWidths( element ) {
- // Call getComputedStyle on the window the element document belongs to.
- const style = element.ownerDocument.defaultView.getComputedStyle( element );
- return {
- top: parseInt( style.borderTopWidth, 10 ),
- right: parseInt( style.borderRightWidth, 10 ),
- bottom: parseInt( style.borderBottomWidth, 10 ),
- left: parseInt( style.borderLeftWidth, 10 )
- };
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getcommonancestor.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getcommonancestor.js ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getCommonAncestor; });
- /* harmony import */ var _getancestors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getancestors */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/getcommonancestor
- */
- /**
- * Searches and returns the lowest common ancestor of two given nodes.
- *
- * @param {Node} nodeA First node.
- * @param {Node} nodeB Second node.
- * @returns {Node|DocumentFragment|Document|null} Lowest common ancestor of both nodes or `null` if nodes do not have a common ancestor.
- */
- function getCommonAncestor( nodeA, nodeB ) {
- const ancestorsA = Object(_getancestors__WEBPACK_IMPORTED_MODULE_0__["default"])( nodeA );
- const ancestorsB = Object(_getancestors__WEBPACK_IMPORTED_MODULE_0__["default"])( nodeB );
- let i = 0;
- // It does not matter which array is shorter.
- while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
- i++;
- }
- return i === 0 ? null : ancestorsA[ i - 1 ];
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getDataFromElement; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /* globals HTMLTextAreaElement */
- /**
- * @module utils/dom/getdatafromelement
- */
- /**
- * Gets data from a given source element.
- *
- * @param {HTMLElement} el The element from which the data will be retrieved.
- * @returns {String} The data string.
- */
- function getDataFromElement( el ) {
- if ( el instanceof HTMLTextAreaElement ) {
- return el.value;
- }
- return el.innerHTML;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getPositionedAncestor; });
- /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/getpositionedancestor
- */
- /**
- * For a given element, returns the nearest ancestor element which CSS position is not "static".
- *
- * @param {HTMLElement} element The native DOM element to be checked.
- * @returns {HTMLElement|null}
- */
- function getPositionedAncestor( element ) {
- if ( !element || !element.parentNode ) {
- return null;
- }
- if ( element.offsetParent === _global__WEBPACK_IMPORTED_MODULE_0__["default"].document.body ) {
- return null;
- }
- return element.offsetParent;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /* globals window, document */
- /**
- * @module utils/dom/global
- */
- /**
- * A helper (module) giving an access to the global DOM objects such as `window` and
- * `document`. Accessing these objects using this helper allows easy and bulletproof
- * testing, i.e. stubbing native properties:
- *
- * import global from 'ckeditor5/utils/dom/global.js';
- *
- * // This stub will work for any code using global module.
- * testUtils.sinon.stub( global, 'window', {
- * innerWidth: 10000
- * } );
- *
- * console.log( global.window.innerWidth );
- */
- /* harmony default export */ __webpack_exports__["default"] = ({ window, document });
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return indexOf; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/indexof
- */
- /**
- * Returns index of the node in the parent element.
- *
- * @param {Node} node Node which index is tested.
- * @returns {Number} Index of the node in the parent element. Returns 0 if node has no parent.
- */
- function indexOf( node ) {
- let index = 0;
- while ( node.previousSibling ) {
- node = node.previousSibling;
- index++;
- }
- return index;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return insertAt; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/insertat
- */
- /**
- * Inserts node to the parent at given index.
- *
- * @param {Element} parentElement Parent element.
- * @param {Number} index Insertions index.
- * @param {Node} nodeToInsert Node to insert.
- */
- function insertAt( parentElement, index, nodeToInsert ) {
- parentElement.insertBefore( nodeToInsert, parentElement.childNodes[ index ] || null );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isNode; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/isnode
- */
- /**
- * Checks if the object is a native DOM Node.
- *
- * @param {*} obj
- * @returns {Boolean}
- */
- function isNode( obj ) {
- if ( obj ) {
- if ( obj.defaultView ) {
- return obj instanceof obj.defaultView.Document;
- } else if ( obj.ownerDocument && obj.ownerDocument.defaultView ) {
- return obj instanceof obj.ownerDocument.defaultView.Node;
- }
- }
- return false;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isRange; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/isrange
- */
- /**
- * Checks if the object is a native DOM Range.
- *
- * @param {*} obj
- * @returns {Boolean}
- */
- function isRange( obj ) {
- return Object.prototype.toString.apply( obj ) == '[object Range]';
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isText; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/istext
- */
- /**
- * Checks if the object is a native DOM Text node.
- *
- * @param {*} obj
- * @returns {Boolean}
- */
- function isText( obj ) {
- return Object.prototype.toString.call( obj ) == '[object Text]';
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isWindow; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/iswindow
- */
- /**
- * Checks if the object is a native DOM Window.
- *
- * @param {*} obj
- * @returns {Boolean}
- */
- function isWindow( obj ) {
- const stringifiedObject = Object.prototype.toString.apply( obj );
- // Returns `true` for the `window` object in browser environments.
- if ( stringifiedObject == '[object Window]' ) {
- return true;
- }
- // Returns `true` for the `window` object in the Electron environment.
- if ( stringifiedObject == '[object global]' ) {
- return true;
- }
- return false;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js ***!
- \********************************************************************/
- /*! exports provided: getOptimalPosition */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOptimalPosition", function() { return getOptimalPosition; });
- /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
- /* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
- /* harmony import */ var _getpositionedancestor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getpositionedancestor */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js");
- /* harmony import */ var _getborderwidths__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getborderwidths */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/position
- */
- /**
- * Calculates the `position: absolute` coordinates of a given element so it can be positioned with respect to the
- * target in the visually most efficient way, taking various restrictions like viewport or limiter geometry
- * into consideration.
- *
- * // The element which is to be positioned.
- * const element = document.body.querySelector( '#toolbar' );
- *
- * // A target to which the element is positioned relatively.
- * const target = document.body.querySelector( '#container' );
- *
- * // Finding the optimal coordinates for the positioning.
- * const { left, top, name } = getOptimalPosition( {
- * element: element,
- * target: target,
- *
- * // The algorithm will chose among these positions to meet the requirements such
- * // as "limiter" element or "fitInViewport", set below. The positions are considered
- * // in the order of the array.
- * positions: [
- * //
- * // [ Target ]
- * // +-----------------+
- * // | Element |
- * // +-----------------+
- * //
- * targetRect => ( {
- * top: targetRect.bottom,
- * left: targetRect.left,
- * name: 'mySouthEastPosition'
- * } ),
- *
- * //
- * // +-----------------+
- * // | Element |
- * // +-----------------+
- * // [ Target ]
- * //
- * ( targetRect, elementRect ) => ( {
- * top: targetRect.top - elementRect.height,
- * left: targetRect.left,
- * name: 'myNorthEastPosition'
- * } )
- * ],
- *
- * // Find a position such guarantees the element remains within visible boundaries of <body>.
- * limiter: document.body,
- *
- * // Find a position such guarantees the element remains within visible boundaries of the browser viewport.
- * fitInViewport: true
- * } );
- *
- * // The best position which fits into document.body and the viewport. May be useful
- * // to set proper class on the `element`.
- * console.log( name ); // -> "myNorthEastPosition"
- *
- * // Using the absolute coordinates which has been found to position the element
- * // as in the diagram depicting the "myNorthEastPosition" position.
- * element.style.top = top;
- * element.style.left = left;
- *
- * @param {module:utils/dom/position~Options} options Positioning options object.
- * @returns {module:utils/dom/position~Position}
- */
- function getOptimalPosition( { element, target, positions, limiter, fitInViewport } ) {
- // If the {@link module:utils/dom/position~Options#target} is a function, use what it returns.
- // https://github.com/ckeditor/ckeditor5-utils/issues/157
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isFunction"])( target ) ) {
- target = target();
- }
- // If the {@link module:utils/dom/position~Options#limiter} is a function, use what it returns.
- // https://github.com/ckeditor/ckeditor5-ui/issues/260
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isFunction"])( limiter ) ) {
- limiter = limiter();
- }
- const positionedElementAncestor = Object(_getpositionedancestor__WEBPACK_IMPORTED_MODULE_2__["default"])( element );
- const elementRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( element );
- const targetRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( target );
- let bestPositionRect;
- let bestPositionName;
- // If there are no limits, just grab the very first position and be done with that drama.
- if ( !limiter && !fitInViewport ) {
- [ bestPositionName, bestPositionRect ] = getPositionNameAndRect( positions[ 0 ], targetRect, elementRect );
- } else {
- const limiterRect = limiter && new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( limiter ).getVisible();
- const viewportRect = fitInViewport && new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( _global__WEBPACK_IMPORTED_MODULE_0__["default"].window );
- const bestPosition = getBestPositionNameAndRect( positions, { targetRect, elementRect, limiterRect, viewportRect } );
- // If there's no best position found, i.e. when all intersections have no area because
- // rects have no width or height, then just use the first available position.
- [ bestPositionName, bestPositionRect ] = bestPosition || getPositionNameAndRect( positions[ 0 ], targetRect, elementRect );
- }
- let absoluteRectCoordinates = getAbsoluteRectCoordinates( bestPositionRect );
- if ( positionedElementAncestor ) {
- absoluteRectCoordinates = shiftRectCoordinatesDueToPositionedAncestor( absoluteRectCoordinates, positionedElementAncestor );
- }
- return {
- left: absoluteRectCoordinates.left,
- top: absoluteRectCoordinates.top,
- name: bestPositionName
- };
- }
- // For given position function, returns a corresponding `Rect` instance.
- //
- // @private
- // @param {Function} position A function returning {@link module:utils/dom/position~Position}.
- // @param {utils/dom/rect~Rect} targetRect A rect of the target.
- // @param {utils/dom/rect~Rect} elementRect A rect of positioned element.
- // @returns {Array|null} An array containing position name and its Rect (or null if position should be ignored).
- function getPositionNameAndRect( position, targetRect, elementRect ) {
- const positionData = position( targetRect, elementRect );
- if ( !positionData ) {
- return null;
- }
- const { left, top, name } = positionData;
- return [ name, elementRect.clone().moveTo( left, top ) ];
- }
- // For a given array of positioning functions, returns such that provides the best
- // fit of the `elementRect` into the `limiterRect` and `viewportRect`.
- //
- // @private
- //
- // @param {Object} options
- // @param {module:utils/dom/position~Options#positions} positions Functions returning {@link module:utils/dom/position~Position}
- // to be checked, in the order of preference.
- // @param {Object} options
- // @param {utils/dom/rect~Rect} options.targetRect A rect of the {@link module:utils/dom/position~Options#target}.
- // @param {utils/dom/rect~Rect} options.elementRect A rect of positioned {@link module:utils/dom/position~Options#element}.
- // @param {utils/dom/rect~Rect} options.limiterRect A rect of the {@link module:utils/dom/position~Options#limiter}.
- // @param {utils/dom/rect~Rect} options.viewportRect A rect of the viewport.
- //
- // @returns {Array} An array containing the name of the position and it's rect.
- function getBestPositionNameAndRect( positions, options ) {
- const { elementRect, viewportRect } = options;
- // This is when element is fully visible.
- const elementRectArea = elementRect.getArea();
- // Let's calculate intersection areas for positions. It will end early if best match is found.
- const processedPositions = processPositionsToAreas( positions, options );
- // First let's check all positions that fully fit in the viewport.
- if ( viewportRect ) {
- const processedPositionsInViewport = processedPositions.filter( ( { viewportIntersectArea } ) => {
- return viewportIntersectArea === elementRectArea;
- } );
- // Try to find best position from those which fit completely in viewport.
- const bestPositionData = getBestOfProcessedPositions( processedPositionsInViewport, elementRectArea );
- if ( bestPositionData ) {
- return bestPositionData;
- }
- }
- // Either there is no viewportRect or there is no position that fits completely in the viewport.
- return getBestOfProcessedPositions( processedPositions, elementRectArea );
- }
- // For a given array of positioning functions, calculates intersection areas for them.
- //
- // Note: If some position fully fits into the `limiterRect`, it will be returned early, without further consideration
- // of other positions.
- //
- // @private
- //
- // @param {module:utils/dom/position~Options#positions} positions Functions returning {@link module:utils/dom/position~Position}
- // to be checked, in the order of preference.
- // @param {Object} options
- // @param {utils/dom/rect~Rect} options.targetRect A rect of the {@link module:utils/dom/position~Options#target}.
- // @param {utils/dom/rect~Rect} options.elementRect A rect of positioned {@link module:utils/dom/position~Options#element}.
- // @param {utils/dom/rect~Rect} options.limiterRect A rect of the {@link module:utils/dom/position~Options#limiter}.
- // @param {utils/dom/rect~Rect} options.viewportRect A rect of the viewport.
- //
- // @returns {Array.<Object>} Array of positions with calculated intersection areas. Each item is an object containing:
- // * {String} positionName Name of position.
- // * {utils/dom/rect~Rect} positionRect Rect of position.
- // * {Number} limiterIntersectArea Area of intersection of the position with limiter part that is in the viewport.
- // * {Number} viewportIntersectArea Area of intersection of the position with viewport.
- function processPositionsToAreas( positions, { targetRect, elementRect, limiterRect, viewportRect } ) {
- const processedPositions = [];
- // This is when element is fully visible.
- const elementRectArea = elementRect.getArea();
- for ( const position of positions ) {
- const positionData = getPositionNameAndRect( position, targetRect, elementRect );
- if ( !positionData ) {
- continue;
- }
- const [ positionName, positionRect ] = positionData;
- let limiterIntersectArea = 0;
- let viewportIntersectArea = 0;
- if ( limiterRect ) {
- if ( viewportRect ) {
- // Consider only the part of the limiter which is visible in the viewport. So the limiter is getting limited.
- const limiterViewportIntersectRect = limiterRect.getIntersection( viewportRect );
- if ( limiterViewportIntersectRect ) {
- // If the limiter is within the viewport, then check the intersection between that part of the
- // limiter and actual position.
- limiterIntersectArea = limiterViewportIntersectRect.getIntersectionArea( positionRect );
- }
- } else {
- limiterIntersectArea = limiterRect.getIntersectionArea( positionRect );
- }
- }
- if ( viewportRect ) {
- viewportIntersectArea = viewportRect.getIntersectionArea( positionRect );
- }
- const processedPosition = {
- positionName,
- positionRect,
- limiterIntersectArea,
- viewportIntersectArea
- };
- // If a such position is found that element is fully contained by the limiter then, obviously,
- // there will be no better one, so finishing.
- if ( limiterIntersectArea === elementRectArea ) {
- return [ processedPosition ];
- }
- processedPositions.push( processedPosition );
- }
- return processedPositions;
- }
- // For a given array of processed position data (with calculated Rects for positions and intersection areas)
- // returns such that provides the best fit of the `elementRect` into the `limiterRect` and `viewportRect` at the same time.
- //
- // **Note**: It will return early if some position fully fits into the `limiterRect`.
- //
- // @private
- // @param {Array.<Object>} Array of positions with calculated intersection areas (in order of preference).
- // Each item is an object containing:
- //
- // * {String} positionName Name of position.
- // * {utils/dom/rect~Rect} positionRect Rect of position.
- // * {Number} limiterIntersectArea Area of intersection of the position with limiter part that is in the viewport.
- // * {Number} viewportIntersectArea Area of intersection of the position with viewport.
- //
- // @param {Number} elementRectArea Area of positioned {@link module:utils/dom/position~Options#element}.
- // @returns {Array|null} An array containing the name of the position and it's rect, or null if not found.
- function getBestOfProcessedPositions( processedPositions, elementRectArea ) {
- let maxFitFactor = 0;
- let bestPositionRect;
- let bestPositionName;
- for ( const { positionName, positionRect, limiterIntersectArea, viewportIntersectArea } of processedPositions ) {
- // If a such position is found that element is fully container by the limiter then, obviously,
- // there will be no better one, so finishing.
- if ( limiterIntersectArea === elementRectArea ) {
- return [ positionName, positionRect ];
- }
- // To maximize both viewport and limiter intersection areas we use distance on viewportIntersectArea
- // and limiterIntersectArea plane (without sqrt because we are looking for max value).
- const fitFactor = viewportIntersectArea ** 2 + limiterIntersectArea ** 2;
- if ( fitFactor > maxFitFactor ) {
- maxFitFactor = fitFactor;
- bestPositionRect = positionRect;
- bestPositionName = positionName;
- }
- }
- return bestPositionRect ? [ bestPositionName, bestPositionRect ] : null;
- }
- // For a given absolute Rect coordinates object and a positioned element ancestor, it returns an object with
- // new Rect coordinates that make up for the position and the scroll of the ancestor.
- //
- // This is necessary because while Rects (and DOMRects) are relative to the browser's viewport, their coordinates
- // are used in real–life to position elements with `position: absolute`, which are scoped by any positioned
- // (and scrollable) ancestors.
- //
- // @private
- //
- // @param {Object} absoluteRectCoordinates An object with absolute rect coordinates.
- // @param {Object} absoluteRectCoordinates.top
- // @param {Object} absoluteRectCoordinates.left
- // @param {HTMLElement} positionedElementAncestor An ancestor element that should be considered.
- //
- // @returns {Object} An object corresponding to `absoluteRectCoordinates` input but with values shifted
- // to make up for the positioned element ancestor.
- function shiftRectCoordinatesDueToPositionedAncestor( { left, top }, positionedElementAncestor ) {
- const ancestorPosition = getAbsoluteRectCoordinates( new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( positionedElementAncestor ) );
- const ancestorBorderWidths = Object(_getborderwidths__WEBPACK_IMPORTED_MODULE_3__["default"])( positionedElementAncestor );
- // (https://github.com/ckeditor/ckeditor5-ui-default/issues/126)
- // If there's some positioned ancestor of the panel, then its `Rect` must be taken into
- // consideration. `Rect` is always relative to the viewport while `position: absolute` works
- // with respect to that positioned ancestor.
- left -= ancestorPosition.left;
- top -= ancestorPosition.top;
- // (https://github.com/ckeditor/ckeditor5-utils/issues/139)
- // If there's some positioned ancestor of the panel, not only its position must be taken into
- // consideration (see above) but also its internal scrolls. Scroll have an impact here because `Rect`
- // is relative to the viewport (it doesn't care about scrolling), while `position: absolute`
- // must compensate that scrolling.
- left += positionedElementAncestor.scrollLeft;
- top += positionedElementAncestor.scrollTop;
- // (https://github.com/ckeditor/ckeditor5-utils/issues/139)
- // If there's some positioned ancestor of the panel, then its `Rect` includes its CSS `borderWidth`
- // while `position: absolute` positioning does not consider it.
- // E.g. `{ position: absolute, top: 0, left: 0 }` means upper left corner of the element,
- // not upper-left corner of its border.
- left -= ancestorBorderWidths.left;
- top -= ancestorBorderWidths.top;
- return { left, top };
- }
- // DOMRect (also Rect) works in a scroll–independent geometry but `position: absolute` doesn't.
- // This function converts Rect to `position: absolute` coordinates.
- //
- // @private
- // @param {utils/dom/rect~Rect} rect A rect to be converted.
- // @returns {Object} Object containing `left` and `top` properties, in absolute coordinates.
- function getAbsoluteRectCoordinates( { left, top } ) {
- const { scrollX, scrollY } = _global__WEBPACK_IMPORTED_MODULE_0__["default"].window;
- return {
- left: left + scrollX,
- top: top + scrollY
- };
- }
- /**
- * The `getOptimalPosition()` helper options.
- *
- * @interface module:utils/dom/position~Options
- */
- /**
- * Element that is to be positioned.
- *
- * @member {HTMLElement} #element
- */
- /**
- * Target with respect to which the `element` is to be positioned.
- *
- * @member {HTMLElement|Range|ClientRect|Rect|Function} #target
- */
- /**
- * An array of functions which return {@link module:utils/dom/position~Position} relative
- * to the `target`, in the order of preference.
- *
- * **Note**: If a function returns `null`, it is ignored by the `getOptimalPosition()`.
- *
- * @member {Array.<Function>} #positions
- */
- /**
- * When set, the algorithm will chose position which fits the most in the
- * limiter's bounding rect.
- *
- * @member {HTMLElement|Range|ClientRect|Rect|Function} #limiter
- */
- /**
- * When set, the algorithm will chose such a position which fits `element`
- * the most inside visible viewport.
- *
- * @member {Boolean} #fitInViewport
- */
- /**
- * An object describing a position in `position: absolute` coordinate
- * system, along with position name.
- *
- * @typedef {Object} module:utils/dom/position~Position
- *
- * @property {Number} top Top position offset.
- * @property {Number} left Left position offset.
- * @property {String} name Name of the position.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js":
- /*!****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Rect; });
- /* harmony import */ var _isrange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isrange */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js");
- /* harmony import */ var _iswindow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iswindow */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js");
- /* harmony import */ var _getborderwidths__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getborderwidths */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js");
- /* harmony import */ var _istext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/rect
- */
- const rectProperties = [ 'top', 'right', 'bottom', 'left', 'width', 'height' ];
- /**
- * A helper class representing a `ClientRect` object, e.g. value returned by
- * the native `object.getBoundingClientRect()` method. Provides a set of methods
- * to manipulate the rect and compare it against other rect instances.
- */
- class Rect {
- /**
- * Creates an instance of rect.
- *
- * // Rect of an HTMLElement.
- * const rectA = new Rect( document.body );
- *
- * // Rect of a DOM Range.
- * const rectB = new Rect( document.getSelection().getRangeAt( 0 ) );
- *
- * // Rect of a window (web browser viewport).
- * const rectC = new Rect( window );
- *
- * // Rect out of an object.
- * const rectD = new Rect( { top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10 } );
- *
- * // Rect out of another Rect instance.
- * const rectE = new Rect( rectD );
- *
- * // Rect out of a ClientRect.
- * const rectF = new Rect( document.body.getClientRects().item( 0 ) );
- *
- * **Note**: By default a rect of an HTML element includes its CSS borders and scrollbars (if any)
- * ant the rect of a `window` includes scrollbars too. Use {@link #excludeScrollbarsAndBorders}
- * to get the inner part of the rect.
- *
- * @param {HTMLElement|Range|Window|ClientRect|module:utils/dom/rect~Rect|Object} source A source object to create the rect.
- */
- constructor( source ) {
- const isSourceRange = Object(_isrange__WEBPACK_IMPORTED_MODULE_0__["default"])( source );
- /**
- * The object this rect is for.
- *
- * @protected
- * @readonly
- * @member {HTMLElement|Range|ClientRect|module:utils/dom/rect~Rect|Object} #_source
- */
- Object.defineProperty( this, '_source', {
- // If the source is a Rect instance, copy it's #_source.
- value: source._source || source,
- writable: true,
- enumerable: false
- } );
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isElement"])( source ) || isSourceRange ) {
- // The `Rect` class depends on `getBoundingClientRect` and `getClientRects` DOM methods. If the source
- // of a rect in an HTML element or a DOM range but it does not belong to any rendered DOM tree, these methods
- // will fail to obtain the geometry and the rect instance makes little sense to the features using it.
- // To get rid of this warning make sure the source passed to the constructor is a descendant of `window.document.body`.
- // @if CK_DEBUG // const sourceNode = isSourceRange ? source.startContainer : source;
- // @if CK_DEBUG // if ( !sourceNode.ownerDocument || !sourceNode.ownerDocument.body.contains( sourceNode ) ) {
- // @if CK_DEBUG // console.warn(
- // @if CK_DEBUG // 'rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.',
- // @if CK_DEBUG // { source } );
- // @if CK_DEBUG // }
- if ( isSourceRange ) {
- const rangeRects = Rect.getDomRangeRects( source );
- copyRectProperties( this, Rect.getBoundingRect( rangeRects ) );
- } else {
- copyRectProperties( this, source.getBoundingClientRect() );
- }
- } else if ( Object(_iswindow__WEBPACK_IMPORTED_MODULE_1__["default"])( source ) ) {
- const { innerWidth, innerHeight } = source;
- copyRectProperties( this, {
- top: 0,
- right: innerWidth,
- bottom: innerHeight,
- left: 0,
- width: innerWidth,
- height: innerHeight
- } );
- } else {
- copyRectProperties( this, source );
- }
- /**
- * The "top" value of the rect.
- *
- * @readonly
- * @member {Number} #top
- */
- /**
- * The "right" value of the rect.
- *
- * @readonly
- * @member {Number} #right
- */
- /**
- * The "bottom" value of the rect.
- *
- * @readonly
- * @member {Number} #bottom
- */
- /**
- * The "left" value of the rect.
- *
- * @readonly
- * @member {Number} #left
- */
- /**
- * The "width" value of the rect.
- *
- * @readonly
- * @member {Number} #width
- */
- /**
- * The "height" value of the rect.
- *
- * @readonly
- * @member {Number} #height
- */
- }
- /**
- * Returns a clone of the rect.
- *
- * @returns {module:utils/dom/rect~Rect} A cloned rect.
- */
- clone() {
- return new Rect( this );
- }
- /**
- * Moves the rect so that its upper–left corner lands in desired `[ x, y ]` location.
- *
- * @param {Number} x Desired horizontal location.
- * @param {Number} y Desired vertical location.
- * @returns {module:utils/dom/rect~Rect} A rect which has been moved.
- */
- moveTo( x, y ) {
- this.top = y;
- this.right = x + this.width;
- this.bottom = y + this.height;
- this.left = x;
- return this;
- }
- /**
- * Moves the rect in–place by a dedicated offset.
- *
- * @param {Number} x A horizontal offset.
- * @param {Number} y A vertical offset
- * @returns {module:utils/dom/rect~Rect} A rect which has been moved.
- */
- moveBy( x, y ) {
- this.top += y;
- this.right += x;
- this.left += x;
- this.bottom += y;
- return this;
- }
- /**
- * Returns a new rect a a result of intersection with another rect.
- *
- * @param {module:utils/dom/rect~Rect} anotherRect
- * @returns {module:utils/dom/rect~Rect}
- */
- getIntersection( anotherRect ) {
- const rect = {
- top: Math.max( this.top, anotherRect.top ),
- right: Math.min( this.right, anotherRect.right ),
- bottom: Math.min( this.bottom, anotherRect.bottom ),
- left: Math.max( this.left, anotherRect.left )
- };
- rect.width = rect.right - rect.left;
- rect.height = rect.bottom - rect.top;
- if ( rect.width < 0 || rect.height < 0 ) {
- return null;
- } else {
- return new Rect( rect );
- }
- }
- /**
- * Returns the area of intersection with another rect.
- *
- * @param {module:utils/dom/rect~Rect} anotherRect [description]
- * @returns {Number} Area of intersection.
- */
- getIntersectionArea( anotherRect ) {
- const rect = this.getIntersection( anotherRect );
- if ( rect ) {
- return rect.getArea();
- } else {
- return 0;
- }
- }
- /**
- * Returns the area of the rect.
- *
- * @returns {Number}
- */
- getArea() {
- return this.width * this.height;
- }
- /**
- * Returns a new rect, a part of the original rect, which is actually visible to the user,
- * e.g. an original rect cropped by parent element rects which have `overflow` set in CSS
- * other than `"visible"`.
- *
- * If there's no such visible rect, which is when the rect is limited by one or many of
- * the ancestors, `null` is returned.
- *
- * @returns {module:utils/dom/rect~Rect|null} A visible rect instance or `null`, if there's none.
- */
- getVisible() {
- const source = this._source;
- let visibleRect = this.clone();
- // There's no ancestor to crop <body> with the overflow.
- if ( !isBody( source ) ) {
- let parent = source.parentNode || source.commonAncestorContainer;
- // Check the ancestors all the way up to the <body>.
- while ( parent && !isBody( parent ) ) {
- const parentRect = new Rect( parent );
- const intersectionRect = visibleRect.getIntersection( parentRect );
- if ( intersectionRect ) {
- if ( intersectionRect.getArea() < visibleRect.getArea() ) {
- // Reduce the visible rect to the intersection.
- visibleRect = intersectionRect;
- }
- } else {
- // There's no intersection, the rect is completely invisible.
- return null;
- }
- parent = parent.parentNode;
- }
- }
- return visibleRect;
- }
- /**
- * Checks if all property values ({@link #top}, {@link #left}, {@link #right},
- * {@link #bottom}, {@link #width} and {@link #height}) are the equal in both rect
- * instances.
- *
- * @param {module:utils/dom/rect~Rect} rect A rect instance to compare with.
- * @returns {Boolean} `true` when Rects are equal. `false` otherwise.
- */
- isEqual( anotherRect ) {
- for ( const prop of rectProperties ) {
- if ( this[ prop ] !== anotherRect[ prop ] ) {
- return false;
- }
- }
- return true;
- }
- /**
- * Checks whether a rect fully contains another rect instance.
- *
- * @param {module:utils/dom/rect~Rect} anotherRect
- * @returns {Boolean} `true` if contains, `false` otherwise.
- */
- contains( anotherRect ) {
- const intersectRect = this.getIntersection( anotherRect );
- return !!( intersectRect && intersectRect.isEqual( anotherRect ) );
- }
- /**
- * Excludes scrollbars and CSS borders from the rect.
- *
- * * Borders are removed when {@link #_source} is an HTML element.
- * * Scrollbars are excluded from HTML elements and the `window`.
- *
- * @returns {module:utils/dom/rect~Rect} A rect which has been updated.
- */
- excludeScrollbarsAndBorders() {
- const source = this._source;
- let scrollBarWidth, scrollBarHeight, direction;
- if ( Object(_iswindow__WEBPACK_IMPORTED_MODULE_1__["default"])( source ) ) {
- scrollBarWidth = source.innerWidth - source.document.documentElement.clientWidth;
- scrollBarHeight = source.innerHeight - source.document.documentElement.clientHeight;
- direction = source.getComputedStyle( source.document.documentElement ).direction;
- } else {
- const borderWidths = Object(_getborderwidths__WEBPACK_IMPORTED_MODULE_2__["default"])( this._source );
- scrollBarWidth = source.offsetWidth - source.clientWidth - borderWidths.left - borderWidths.right;
- scrollBarHeight = source.offsetHeight - source.clientHeight - borderWidths.top - borderWidths.bottom;
- direction = source.ownerDocument.defaultView.getComputedStyle( source ).direction;
- this.left += borderWidths.left;
- this.top += borderWidths.top;
- this.right -= borderWidths.right;
- this.bottom -= borderWidths.bottom;
- this.width = this.right - this.left;
- this.height = this.bottom - this.top;
- }
- this.width -= scrollBarWidth;
- if ( direction === 'ltr' ) {
- this.right -= scrollBarWidth;
- } else {
- this.left += scrollBarWidth;
- }
- this.height -= scrollBarHeight;
- this.bottom -= scrollBarHeight;
- return this;
- }
- /**
- * Returns an array of rects of the given native DOM Range.
- *
- * @param {Range} range A native DOM range.
- * @returns {Array.<module:utils/dom/rect~Rect>} DOM Range rects.
- */
- static getDomRangeRects( range ) {
- const rects = [];
- // Safari does not iterate over ClientRectList using for...of loop.
- const clientRects = Array.from( range.getClientRects() );
- if ( clientRects.length ) {
- for ( const rect of clientRects ) {
- rects.push( new Rect( rect ) );
- }
- }
- // If there's no client rects for the Range, use parent container's bounding rect
- // instead and adjust rect's width to simulate the actual geometry of such range.
- // https://github.com/ckeditor/ckeditor5-utils/issues/153
- // https://github.com/ckeditor/ckeditor5-ui/issues/317
- else {
- let startContainer = range.startContainer;
- if ( Object(_istext__WEBPACK_IMPORTED_MODULE_3__["default"])( startContainer ) ) {
- startContainer = startContainer.parentNode;
- }
- const rect = new Rect( startContainer.getBoundingClientRect() );
- rect.right = rect.left;
- rect.width = 0;
- rects.push( rect );
- }
- return rects;
- }
- /**
- * Returns a bounding rectangle that contains all the given `rects`.
- *
- * @param {Iterable.<module:utils/dom/rect~Rect>} rects A list of rectangles that should be contained in the result rectangle.
- * @returns {module:utils/dom/rect~Rect|null} Bounding rectangle or `null` if no `rects` were given.
- */
- static getBoundingRect( rects ) {
- const boundingRectData = {
- left: Number.POSITIVE_INFINITY,
- top: Number.POSITIVE_INFINITY,
- right: Number.NEGATIVE_INFINITY,
- bottom: Number.NEGATIVE_INFINITY
- };
- let rectangleCount = 0;
- for ( const rect of rects ) {
- rectangleCount++;
- boundingRectData.left = Math.min( boundingRectData.left, rect.left );
- boundingRectData.top = Math.min( boundingRectData.top, rect.top );
- boundingRectData.right = Math.max( boundingRectData.right, rect.right );
- boundingRectData.bottom = Math.max( boundingRectData.bottom, rect.bottom );
- }
- if ( rectangleCount == 0 ) {
- return null;
- }
- boundingRectData.width = boundingRectData.right - boundingRectData.left;
- boundingRectData.height = boundingRectData.bottom - boundingRectData.top;
- return new Rect( boundingRectData );
- }
- }
- // Acquires all the rect properties from the passed source.
- //
- // @private
- // @param {module:utils/dom/rect~Rect} rect
- // @param {ClientRect|module:utils/dom/rect~Rect|Object} source
- function copyRectProperties( rect, source ) {
- for ( const p of rectProperties ) {
- rect[ p ] = source[ p ];
- }
- }
- // Checks if provided object is a <body> HTML element.
- //
- // @private
- // @param {HTMLElement|Range} elementOrRange
- // @returns {Boolean}
- function isBody( elementOrRange ) {
- if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isElement"])( elementOrRange ) ) {
- return false;
- }
- return elementOrRange === elementOrRange.ownerDocument.body;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return remove; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/remove
- */
- /**
- * Removes given node from parent.
- *
- * @param {Node} node Node to remove.
- */
- function remove( node ) {
- const parent = node.parentNode;
- if ( parent ) {
- parent.removeChild( node );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ResizeObserver; });
- /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
- /* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
- /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/resizeobserver
- */
- /* globals setTimeout, clearTimeout */
- const RESIZE_CHECK_INTERVAL = 100;
- /**
- * A helper class which instances allow performing custom actions when native DOM elements are resized.
- *
- * const editableElement = editor.editing.view.getDomRoot();
- *
- * const observer = new ResizeObserver( editableElement, entry => {
- * console.log( 'The editable element has been resized in DOM.' );
- * console.log( entry.target ); // -> editableElement
- * console.log( entry.contentRect.width ); // -> e.g. '423px'
- * } );
- *
- * By default, it uses the [native DOM resize observer](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)
- * under the hood and in browsers that do not support the native API yet, a polyfilled observer is
- * used instead.
- */
- class ResizeObserver {
- /**
- * Creates an instance of the `ResizeObserver` class.
- *
- * @param {HTMLElement} element A DOM element that is to be observed for resizing. Note that
- * the element must be visible (i.e. not detached from DOM) for the observer to work.
- * @param {Function} callback A function called when the observed element was resized. It passes
- * the [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)
- * object with information about the resize event.
- */
- constructor( element, callback ) {
- // **Note**: For the maximum performance, this class ensures only a single instance of the native
- // (or polyfilled) observer is used no matter how many instances of this class were created.
- if ( !ResizeObserver._observerInstance ) {
- ResizeObserver._createObserver();
- }
- /**
- * The element observer by this observer.
- *
- * @readonly
- * @private
- * @member {HTMLElement}
- */
- this._element = element;
- /**
- * The callback executed each time {@link #_element} is resized.
- *
- * @readonly
- * @private
- * @member {Function}
- */
- this._callback = callback;
- ResizeObserver._addElementCallback( element, callback );
- ResizeObserver._observerInstance.observe( element );
- }
- /**
- * Destroys the observer which disables the `callback` passed to the {@link #constructor}.
- */
- destroy() {
- ResizeObserver._deleteElementCallback( this._element, this._callback );
- }
- /**
- * Registers a new resize callback for the DOM element.
- *
- * @private
- * @static
- * @param {HTMLElement} element
- * @param {Function} callback
- */
- static _addElementCallback( element, callback ) {
- if ( !ResizeObserver._elementCallbacks ) {
- ResizeObserver._elementCallbacks = new Map();
- }
- let callbacks = ResizeObserver._elementCallbacks.get( element );
- if ( !callbacks ) {
- callbacks = new Set();
- ResizeObserver._elementCallbacks.set( element, callbacks );
- }
- callbacks.add( callback );
- }
- /**
- * Removes a resize callback from the DOM element. If no callbacks are left
- * for the element, it removes the element from the native observer.
- *
- * @private
- * @static
- * @param {HTMLElement} element
- * @param {Function} callback
- */
- static _deleteElementCallback( element, callback ) {
- const callbacks = ResizeObserver._getElementCallbacks( element );
- // Remove the element callback. Check if exist first in case someone
- // called destroy() twice.
- if ( callbacks ) {
- callbacks.delete( callback );
- // If no callbacks left for the element, also remove the element.
- if ( !callbacks.size ) {
- ResizeObserver._elementCallbacks.delete( element );
- ResizeObserver._observerInstance.unobserve( element );
- }
- }
- if ( ResizeObserver._elementCallbacks && !ResizeObserver._elementCallbacks.size ) {
- ResizeObserver._observerInstance = null;
- ResizeObserver._elementCallbacks = null;
- }
- }
- /**
- * Returns are registered resize callbacks for the DOM element.
- *
- * @private
- * @static
- * @param {HTMLElement} element
- * @returns {Set.<HTMLElement>|null}
- */
- static _getElementCallbacks( element ) {
- if ( !ResizeObserver._elementCallbacks ) {
- return null;
- }
- return ResizeObserver._elementCallbacks.get( element );
- }
- /**
- * Creates the single native observer shared across all `ResizeObserver` instances.
- * If the browser does not support the native API, it creates a polyfill.
- *
- * @private
- * @static
- */
- static _createObserver() {
- let ObserverConstructor;
- // TODO: One day, the `ResizeObserver` API will be supported in all modern web browsers.
- // When it happens, this module will no longer make sense and should be removed and
- // the native implementation should be used across the project to save bytes.
- // Check out https://caniuse.com/#feat=resizeobserver.
- if ( typeof _global__WEBPACK_IMPORTED_MODULE_1__["default"].window.ResizeObserver === 'function' ) {
- ObserverConstructor = _global__WEBPACK_IMPORTED_MODULE_1__["default"].window.ResizeObserver;
- } else {
- ObserverConstructor = ResizeObserverPolyfill;
- }
- ResizeObserver._observerInstance = new ObserverConstructor( entries => {
- for ( const entry of entries ) {
- const callbacks = ResizeObserver._getElementCallbacks( entry.target );
- if ( callbacks ) {
- for ( const callback of callbacks ) {
- callback( entry );
- }
- }
- }
- } );
- }
- }
- /**
- * The single native observer instance (or polyfill in browsers that do not support the API)
- * shared across all {@link module:utils/dom/resizeobserver~ResizeObserver} instances.
- *
- * @static
- * @protected
- * @readonly
- * @property {Object|null} module:utils/dom/resizeobserver~ResizeObserver#_observerInstance
- */
- ResizeObserver._observerInstance = null;
- /**
- * A mapping of native DOM elements and their callbacks shared across all
- * {@link module:utils/dom/resizeobserver~ResizeObserver} instances.
- *
- * @static
- * @private
- * @readonly
- * @property {Map.<HTMLElement,Set>|null} module:utils/dom/resizeobserver~ResizeObserver#_elementCallbacks
- */
- ResizeObserver._elementCallbacks = null;
- /**
- * A polyfill class for the native [`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).
- *
- * @private
- * @mixes module:utils/domemittermixin~DomEmitterMixin
- */
- class ResizeObserverPolyfill {
- /**
- * Creates an instance of the {@link module:utils/dom/resizeobserver~ResizeObserverPolyfill} class.
- *
- * It synchronously reacts to resize of the window to check if observed elements' geometry changed.
- *
- * Additionally, the polyfilled observer uses a timeout to check if observed elements' geometry has changed
- * in some other way (dynamic layouts, scrollbars showing up, etc.), so its response can also be asynchronous.
- *
- * @param {Function} callback A function called when any observed element was resized. Refer to the
- * native [`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) API to
- * learn more.
- */
- constructor( callback ) {
- /**
- * A function called when any observed {@link #_elements element} was resized.
- *
- * @readonly
- * @protected
- * @member {Function}
- */
- this._callback = callback;
- /**
- * DOM elements currently observed by the observer instance.
- *
- * @readonly
- * @protected
- * @member {Set}
- */
- this._elements = new Set();
- /**
- * Cached DOM {@link #_elements elements} bounding rects to compare to upon the next check.
- *
- * @readonly
- * @protected
- * @member {Map.<HTMLElement,module:utils/dom/rect~Rect>}
- */
- this._previousRects = new Map();
- /**
- * An UID of the current timeout upon which the observed elements rects
- * will be compared to the {@link #_previousRects previous rects} from the past.
- *
- * @readonly
- * @protected
- * @member {Map.<HTMLElement,module:utils/dom/rect~Rect>}
- */
- this._periodicCheckTimeout = null;
- }
- /**
- * Starts observing a DOM element.
- *
- * Learn more in the
- * [native method documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe).
- *
- * @param {HTMLElement} element
- */
- observe( element ) {
- this._elements.add( element );
- this._checkElementRectsAndExecuteCallback();
- if ( this._elements.size === 1 ) {
- this._startPeriodicCheck();
- }
- }
- /**
- * Stops observing a DOM element.
- *
- * Learn more in the
- * [native method documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/unobserve).
- *
- * @param {HTMLElement} element
- */
- unobserve( element ) {
- this._elements.delete( element );
- this._previousRects.delete( element );
- if ( !this._elements.size ) {
- this._stopPeriodicCheck();
- }
- }
- /**
- * When called, the observer calls the {@link #_callback resize callback} for all observed
- * {@link #_elements elements} but also starts checking periodically for changes in the elements' geometry.
- * If some are detected, {@link #_callback resize callback} is called for relevant elements that were resized.
- *
- * @protected
- */
- _startPeriodicCheck() {
- const periodicCheck = () => {
- this._checkElementRectsAndExecuteCallback();
- this._periodicCheckTimeout = setTimeout( periodicCheck, RESIZE_CHECK_INTERVAL );
- };
- this.listenTo( _global__WEBPACK_IMPORTED_MODULE_1__["default"].window, 'resize', () => {
- this._checkElementRectsAndExecuteCallback();
- } );
- this._periodicCheckTimeout = setTimeout( periodicCheck, RESIZE_CHECK_INTERVAL );
- }
- /**
- * Stops checking for changes in all observed {@link #_elements elements} geometry.
- *
- * @protected
- */
- _stopPeriodicCheck() {
- clearTimeout( this._periodicCheckTimeout );
- this.stopListening();
- this._previousRects.clear();
- }
- /**
- * Checks if the geometry of any of the {@link #_elements element} has changed. If so, executes
- * the {@link #_callback resize callback} with element geometry data.
- *
- * @protected
- */
- _checkElementRectsAndExecuteCallback() {
- const entries = [];
- for ( const element of this._elements ) {
- if ( this._hasRectChanged( element ) ) {
- entries.push( {
- target: element,
- contentRect: this._previousRects.get( element )
- } );
- }
- }
- if ( entries.length ) {
- this._callback( entries );
- }
- }
- /**
- * Compares the DOM element geometry to the {@link #_previousRects cached geometry} from the past.
- * Returns `true` if geometry has changed or the element is checked for the first time.
- *
- * @protected
- * @param {HTMLElement} element
- * @returns {Boolean}
- */
- _hasRectChanged( element ) {
- if ( !element.ownerDocument.body.contains( element ) ) {
- return false;
- }
- const currentRect = new _rect__WEBPACK_IMPORTED_MODULE_2__["default"]( element );
- const previousRect = this._previousRects.get( element );
- // The first check should always yield true despite no Previous rect to compare to.
- // The native ResizeObserver does that and... that makes sense. Sort of.
- const hasChanged = !previousRect || !previousRect.isEqual( currentRect );
- this._previousRects.set( element, currentRect );
- return hasChanged;
- }
- }
- Object(_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( ResizeObserverPolyfill, _emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js ***!
- \******************************************************************/
- /*! exports provided: scrollViewportToShowTarget, scrollAncestorsToShowTarget */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollViewportToShowTarget", function() { return scrollViewportToShowTarget; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollAncestorsToShowTarget", function() { return scrollAncestorsToShowTarget; });
- /* harmony import */ var _isrange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isrange */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js");
- /* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
- /* harmony import */ var _istext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/scroll
- */
- const utils = {};
- /**
- * Makes any page `HTMLElement` or `Range` (`target`) visible inside the browser viewport.
- * This helper will scroll all `target` ancestors and the web browser viewport to reveal the target to
- * the user. If the `target` is already visible, nothing will happen.
- *
- * @param {HTMLElement|Range} options.target A target, which supposed to become visible to the user.
- * @param {Number} [options.viewportOffset] An offset from the edge of the viewport (in pixels)
- * the `target` will be moved by when the viewport is scrolled. It enhances the user experience
- * by keeping the `target` some distance from the edge of the viewport and thus making it easier to
- * read or edit by the user.
- */
- function scrollViewportToShowTarget( { target, viewportOffset = 0 } ) {
- const targetWindow = getWindow( target );
- let currentWindow = targetWindow;
- let currentFrame = null;
- // Iterate over all windows, starting from target's parent window up to window#top.
- while ( currentWindow ) {
- let firstAncestorToScroll;
- // Let's scroll target's ancestors first to reveal it. Then, once the ancestor scrolls
- // settled down, the algorithm can eventually scroll the viewport of the current window.
- //
- // Note: If the current window is target's **original** window (e.g. the first one),
- // start scrolling the closest parent of the target. If not, scroll the closest parent
- // of an iframe that resides in the current window.
- if ( currentWindow == targetWindow ) {
- firstAncestorToScroll = getParentElement( target );
- } else {
- firstAncestorToScroll = getParentElement( currentFrame );
- }
- // Scroll the target's ancestors first. Once done, scrolling the viewport is easy.
- scrollAncestorsToShowRect( firstAncestorToScroll, () => {
- // Note: If the target does not belong to the current window **directly**,
- // i.e. it resides in an iframe belonging to the window, obtain the target's rect
- // in the coordinates of the current window. By default, a Rect returns geometry
- // relative to the current window's viewport. To make it work in a parent window,
- // it must be shifted.
- return getRectRelativeToWindow( target, currentWindow );
- } );
- // Obtain the rect of the target after it has been scrolled within its ancestors.
- // It's time to scroll the viewport.
- const targetRect = getRectRelativeToWindow( target, currentWindow );
- scrollWindowToShowRect( currentWindow, targetRect, viewportOffset );
- if ( currentWindow.parent != currentWindow ) {
- // Keep the reference to the <iframe> element the "previous current window" was
- // rendered within. It will be useful to re–calculate the rect of the target
- // in the parent window's relative geometry. The target's rect must be shifted
- // by it's iframe's position.
- currentFrame = currentWindow.frameElement;
- currentWindow = currentWindow.parent;
- // If the current window has some parent but frameElement is inaccessible, then they have
- // different domains/ports and, due to security reasons, accessing and scrolling
- // the parent window won't be possible.
- // See https://github.com/ckeditor/ckeditor5/issues/930.
- if ( !currentFrame ) {
- return;
- }
- } else {
- currentWindow = null;
- }
- }
- }
- /**
- * Makes any page `HTMLElement` or `Range` (target) visible within its scrollable ancestors,
- * e.g. if they have `overflow: scroll` CSS style.
- *
- * @param {HTMLElement|Range} target A target, which supposed to become visible to the user.
- */
- function scrollAncestorsToShowTarget( target ) {
- const targetParent = getParentElement( target );
- scrollAncestorsToShowRect( targetParent, () => {
- return new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( target );
- } );
- }
- // TODO: Using a property value shorthand in the top of the file
- // causes JSDoc to throw errors. See https://github.com/cksource/docs-builder/issues/75.
- Object.assign( utils, {
- scrollViewportToShowTarget,
- scrollAncestorsToShowTarget
- } );
- // Makes a given rect visible within its parent window.
- //
- // Note: Avoid the situation where the caret is still in the viewport, but totally
- // at the edge of it. In such situation, if it moved beyond the viewport in the next
- // action e.g. after paste, the scrolling would move it to the viewportOffset level
- // and it all would look like the caret visually moved up/down:
- //
- // 1.
- // | foo[]
- // | <--- N px of space below the caret
- // +---------------------------------...
- //
- // 2. *paste*
- // 3.
- // |
- // |
- // +-foo-----------------------------...
- // bar[] <--- caret below viewport, scrolling...
- //
- // 4. *scrolling*
- // 5.
- // |
- // | foo
- // | bar[] <--- caret precisely at the edge
- // +---------------------------------...
- //
- // To prevent this, this method checks the rects moved by the viewportOffset to cover
- // the upper/lower edge of the viewport. It makes sure if the action repeats, there's
- // no twitching – it's a purely visual improvement:
- //
- // 5. (after fix)
- // |
- // | foo
- // | bar[]
- // | <--- N px of space below the caret
- // +---------------------------------...
- //
- // @private
- // @param {Window} window A window which is scrolled to reveal the rect.
- // @param {module:utils/dom/rect~Rect} rect A rect which is to be revealed.
- // @param {Number} viewportOffset See scrollViewportToShowTarget.
- function scrollWindowToShowRect( window, rect, viewportOffset ) {
- const targetShiftedDownRect = rect.clone().moveBy( 0, viewportOffset );
- const targetShiftedUpRect = rect.clone().moveBy( 0, -viewportOffset );
- const viewportRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( window ).excludeScrollbarsAndBorders();
- const rects = [ targetShiftedUpRect, targetShiftedDownRect ];
- if ( !rects.every( rect => viewportRect.contains( rect ) ) ) {
- let { scrollX, scrollY } = window;
- if ( isAbove( targetShiftedUpRect, viewportRect ) ) {
- scrollY -= viewportRect.top - rect.top + viewportOffset;
- } else if ( isBelow( targetShiftedDownRect, viewportRect ) ) {
- scrollY += rect.bottom - viewportRect.bottom + viewportOffset;
- }
- // TODO: Web browsers scroll natively to place the target in the middle
- // of the viewport. It's not a very popular case, though.
- if ( isLeftOf( rect, viewportRect ) ) {
- scrollX -= viewportRect.left - rect.left + viewportOffset;
- } else if ( isRightOf( rect, viewportRect ) ) {
- scrollX += rect.right - viewportRect.right + viewportOffset;
- }
- window.scrollTo( scrollX, scrollY );
- }
- }
- // Recursively scrolls element ancestors to visually reveal a rect.
- //
- // @private
- // @param {HTMLElement} A parent The first ancestors to start scrolling.
- // @param {Function} getRect A function which returns the Rect, which is to be revealed.
- function scrollAncestorsToShowRect( parent, getRect ) {
- const parentWindow = getWindow( parent );
- let parentRect, targetRect;
- while ( parent != parentWindow.document.body ) {
- targetRect = getRect();
- parentRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( parent ).excludeScrollbarsAndBorders();
- if ( !parentRect.contains( targetRect ) ) {
- if ( isAbove( targetRect, parentRect ) ) {
- parent.scrollTop -= parentRect.top - targetRect.top;
- } else if ( isBelow( targetRect, parentRect ) ) {
- parent.scrollTop += targetRect.bottom - parentRect.bottom;
- }
- if ( isLeftOf( targetRect, parentRect ) ) {
- parent.scrollLeft -= parentRect.left - targetRect.left;
- } else if ( isRightOf( targetRect, parentRect ) ) {
- parent.scrollLeft += targetRect.right - parentRect.right;
- }
- }
- parent = parent.parentNode;
- }
- }
- // Determines if a given `Rect` extends beyond the bottom edge of the second `Rect`.
- //
- // @private
- // @param {module:utils/dom/rect~Rect} firstRect
- // @param {module:utils/dom/rect~Rect} secondRect
- function isBelow( firstRect, secondRect ) {
- return firstRect.bottom > secondRect.bottom;
- }
- // Determines if a given `Rect` extends beyond the top edge of the second `Rect`.
- //
- // @private
- // @param {module:utils/dom/rect~Rect} firstRect
- // @param {module:utils/dom/rect~Rect} secondRect
- function isAbove( firstRect, secondRect ) {
- return firstRect.top < secondRect.top;
- }
- // Determines if a given `Rect` extends beyond the left edge of the second `Rect`.
- //
- // @private
- // @param {module:utils/dom/rect~Rect} firstRect
- // @param {module:utils/dom/rect~Rect} secondRect
- function isLeftOf( firstRect, secondRect ) {
- return firstRect.left < secondRect.left;
- }
- // Determines if a given `Rect` extends beyond the right edge of the second `Rect`.
- //
- // @private
- // @param {module:utils/dom/rect~Rect} firstRect
- // @param {module:utils/dom/rect~Rect} secondRect
- function isRightOf( firstRect, secondRect ) {
- return firstRect.right > secondRect.right;
- }
- // Returns the closest window of an element or range.
- //
- // @private
- // @param {HTMLElement|Range} firstRect
- // @returns {Window}
- function getWindow( elementOrRange ) {
- if ( Object(_isrange__WEBPACK_IMPORTED_MODULE_0__["default"])( elementOrRange ) ) {
- return elementOrRange.startContainer.ownerDocument.defaultView;
- } else {
- return elementOrRange.ownerDocument.defaultView;
- }
- }
- // Returns the closest parent of an element or DOM range.
- //
- // @private
- // @param {HTMLElement|Range} firstRect
- // @returns {HTMLelement}
- function getParentElement( elementOrRange ) {
- if ( Object(_isrange__WEBPACK_IMPORTED_MODULE_0__["default"])( elementOrRange ) ) {
- let parent = elementOrRange.commonAncestorContainer;
- // If a Range is attached to the Text, use the closest element ancestor.
- if ( Object(_istext__WEBPACK_IMPORTED_MODULE_2__["default"])( parent ) ) {
- parent = parent.parentNode;
- }
- return parent;
- } else {
- return elementOrRange.parentNode;
- }
- }
- // Returns the rect of an element or range residing in an iframe.
- // The result rect is relative to the geometry of the passed window instance.
- //
- // @private
- // @param {HTMLElement|Range} target Element or range which rect should be returned.
- // @param {Window} relativeWindow A window the rect should be relative to.
- // @returns {module:utils/dom/rect~Rect}
- function getRectRelativeToWindow( target, relativeWindow ) {
- const targetWindow = getWindow( target );
- const rect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( target );
- if ( targetWindow === relativeWindow ) {
- return rect;
- } else {
- let currentWindow = targetWindow;
- while ( currentWindow != relativeWindow ) {
- const frame = currentWindow.frameElement;
- const frameRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( frame ).excludeScrollbarsAndBorders();
- rect.moveBy( frameRect.left, frameRect.top );
- currentWindow = currentWindow.parent;
- }
- }
- return rect;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js ***!
- \****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setDataInElement; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/setdatainelement
- */
- /* globals HTMLTextAreaElement */
- /**
- * Sets data in a given element.
- *
- * @param {HTMLElement} el The element in which the data will be set.
- * @param {String} data The data string.
- */
- function setDataInElement( el, data ) {
- if ( el instanceof HTMLTextAreaElement ) {
- el.value = data;
- }
- el.innerHTML = data;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toUnit; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/dom/tounit
- */
- /**
- * Returns a helper function, which adds a desired trailing
- * `unit` to the passed value.
- *
- * @param {String} unit An unit like "px" or "em".
- * @returns {module:utils/dom/tounit~helper}
- */
- function toUnit( unit ) {
- /**
- * A function, which adds a pre–defined trailing `unit`
- * to the passed `value`.
- *
- * @function helper
- * @param {*} value A value to be given the unit.
- * @returns {String} A value with the trailing unit.
- */
- return value => value + unit;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ElementReplacer; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/elementreplacer
- */
- /**
- * Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove
- * the original elements from the DOM.
- */
- class ElementReplacer {
- constructor() {
- /**
- * The elements replaced by {@link #replace} and their replacements.
- *
- * @private
- * @member {Array.<Object>}
- */
- this._replacedElements = [];
- }
- /**
- * Hides the `element` and, if specified, inserts the the given element next to it.
- *
- * The effect of this method can be reverted by {@link #restore}.
- *
- * @param {HTMLElement} element The element to replace.
- * @param {HTMLElement} [newElement] The replacement element. If not passed, then the `element` will just be hidden.
- */
- replace( element, newElement ) {
- this._replacedElements.push( { element, newElement } );
- element.style.display = 'none';
- if ( newElement ) {
- element.parentNode.insertBefore( newElement, element.nextSibling );
- }
- }
- /**
- * Restores what {@link #replace} did.
- */
- restore() {
- this._replacedElements.forEach( ( { element, newElement } ) => {
- element.style.display = '';
- if ( newElement ) {
- newElement.remove();
- }
- } );
- this._replacedElements = [];
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js ***!
- \********************************************************************/
- /*! exports provided: default, _getEmitterListenedTo, _setEmitterId, _getEmitterId */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_getEmitterListenedTo", function() { return _getEmitterListenedTo; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_setEmitterId", function() { return _setEmitterId; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_getEmitterId", function() { return _getEmitterId; });
- /* harmony import */ var _eventinfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
- /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
- /* harmony import */ var _priorities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
- /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
- /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/emittermixin
- */
- // To check if component is loaded more than once.
- const _listeningTo = Symbol( 'listeningTo' );
- const _emitterId = Symbol( 'emitterId' );
- /**
- * Mixin that injects the {@link ~Emitter events API} into its host.
- *
- * Read more about the concept of emitters in the:
- * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables Event system and observables}
- * section of the {@glink framework/guides/architecture/core-editor-architecture Core editor architecture} guide.
- * * {@glink framework/guides/deep-dive/event-system Event system} deep dive guide.
- *
- * @mixin EmitterMixin
- * @implements module:utils/emittermixin~Emitter
- */
- const EmitterMixin = {
- /**
- * @inheritDoc
- */
- on( event, callback, options = {} ) {
- this.listenTo( this, event, callback, options );
- },
- /**
- * @inheritDoc
- */
- once( event, callback, options ) {
- let wasFired = false;
- const onceCallback = function( event, ...args ) {
- // Ensure the callback is called only once even if the callback itself leads to re-firing the event
- // (which would call the callback again).
- if ( !wasFired ) {
- wasFired = true;
- // Go off() at the first call.
- event.off();
- // Go with the original callback.
- callback.call( this, event, ...args );
- }
- };
- // Make a similar on() call, simply replacing the callback.
- this.listenTo( this, event, onceCallback, options );
- },
- /**
- * @inheritDoc
- */
- off( event, callback ) {
- this.stopListening( this, event, callback );
- },
- /**
- * @inheritDoc
- */
- listenTo( emitter, event, callback, options = {} ) {
- let emitterInfo, eventCallbacks;
- // _listeningTo contains a list of emitters that this object is listening to.
- // This list has the following format:
- //
- // _listeningTo: {
- // emitterId: {
- // emitter: emitter,
- // callbacks: {
- // event1: [ callback1, callback2, ... ]
- // ....
- // }
- // },
- // ...
- // }
- if ( !this[ _listeningTo ] ) {
- this[ _listeningTo ] = {};
- }
- const emitters = this[ _listeningTo ];
- if ( !_getEmitterId( emitter ) ) {
- _setEmitterId( emitter );
- }
- const emitterId = _getEmitterId( emitter );
- if ( !( emitterInfo = emitters[ emitterId ] ) ) {
- emitterInfo = emitters[ emitterId ] = {
- emitter,
- callbacks: {}
- };
- }
- if ( !( eventCallbacks = emitterInfo.callbacks[ event ] ) ) {
- eventCallbacks = emitterInfo.callbacks[ event ] = [];
- }
- eventCallbacks.push( callback );
- // Finally register the callback to the event.
- addEventListener( this, emitter, event, callback, options );
- },
- /**
- * @inheritDoc
- */
- stopListening( emitter, event, callback ) {
- const emitters = this[ _listeningTo ];
- let emitterId = emitter && _getEmitterId( emitter );
- const emitterInfo = emitters && emitterId && emitters[ emitterId ];
- const eventCallbacks = emitterInfo && event && emitterInfo.callbacks[ event ];
- // Stop if nothing has been listened.
- if ( !emitters || ( emitter && !emitterInfo ) || ( event && !eventCallbacks ) ) {
- return;
- }
- // All params provided. off() that single callback.
- if ( callback ) {
- removeEventListener( this, emitter, event, callback );
- // We must remove callbacks as well in order to prevent memory leaks.
- // See https://github.com/ckeditor/ckeditor5/pull/8480
- const index = eventCallbacks.indexOf( callback );
- if ( index !== -1 ) {
- if ( eventCallbacks.length === 1 ) {
- delete emitterInfo.callbacks[ event ];
- } else {
- removeEventListener( this, emitter, event, callback );
- }
- }
- }
- // Only `emitter` and `event` provided. off() all callbacks for that event.
- else if ( eventCallbacks ) {
- while ( ( callback = eventCallbacks.pop() ) ) {
- removeEventListener( this, emitter, event, callback );
- }
- delete emitterInfo.callbacks[ event ];
- }
- // Only `emitter` provided. off() all events for that emitter.
- else if ( emitterInfo ) {
- for ( event in emitterInfo.callbacks ) {
- this.stopListening( emitter, event );
- }
- delete emitters[ emitterId ];
- }
- // No params provided. off() all emitters.
- else {
- for ( emitterId in emitters ) {
- this.stopListening( emitters[ emitterId ].emitter );
- }
- delete this[ _listeningTo ];
- }
- },
- /**
- * @inheritDoc
- */
- fire( eventOrInfo, ...args ) {
- try {
- const eventInfo = eventOrInfo instanceof _eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"] ? eventOrInfo : new _eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"]( this, eventOrInfo );
- const event = eventInfo.name;
- let callbacks = getCallbacksForEvent( this, event );
- // Record that the event passed this emitter on its path.
- eventInfo.path.push( this );
- // Handle event listener callbacks first.
- if ( callbacks ) {
- // Arguments passed to each callback.
- const callbackArgs = [ eventInfo, ...args ];
- // Copying callbacks array is the easiest and most secure way of preventing infinite loops, when event callbacks
- // are added while processing other callbacks. Previous solution involved adding counters (unique ids) but
- // failed if callbacks were added to the queue before currently processed callback.
- // If this proves to be too inefficient, another method is to change `.on()` so callbacks are stored if same
- // event is currently processed. Then, `.fire()` at the end, would have to add all stored events.
- callbacks = Array.from( callbacks );
- for ( let i = 0; i < callbacks.length; i++ ) {
- callbacks[ i ].callback.apply( this, callbackArgs );
- // Remove the callback from future requests if off() has been called.
- if ( eventInfo.off.called ) {
- // Remove the called mark for the next calls.
- delete eventInfo.off.called;
- this._removeEventListener( event, callbacks[ i ].callback );
- }
- // Do not execute next callbacks if stop() was called.
- if ( eventInfo.stop.called ) {
- break;
- }
- }
- }
- // Delegate event to other emitters if needed.
- if ( this._delegations ) {
- const destinations = this._delegations.get( event );
- const passAllDestinations = this._delegations.get( '*' );
- if ( destinations ) {
- fireDelegatedEvents( destinations, eventInfo, args );
- }
- if ( passAllDestinations ) {
- fireDelegatedEvents( passAllDestinations, eventInfo, args );
- }
- }
- return eventInfo.return;
- } catch ( err ) {
- // @if CK_DEBUG // throw err;
- /* istanbul ignore next */
- _ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"].rethrowUnexpectedError( err, this );
- }
- },
- /**
- * @inheritDoc
- */
- delegate( ...events ) {
- return {
- to: ( emitter, nameOrFunction ) => {
- if ( !this._delegations ) {
- this._delegations = new Map();
- }
- // Originally there was a for..of loop which unfortunately caused an error in Babel that didn't allow
- // build an application. See: https://github.com/ckeditor/ckeditor5-react/issues/40.
- events.forEach( eventName => {
- const destinations = this._delegations.get( eventName );
- if ( !destinations ) {
- this._delegations.set( eventName, new Map( [ [ emitter, nameOrFunction ] ] ) );
- } else {
- destinations.set( emitter, nameOrFunction );
- }
- } );
- }
- };
- },
- /**
- * @inheritDoc
- */
- stopDelegating( event, emitter ) {
- if ( !this._delegations ) {
- return;
- }
- if ( !event ) {
- this._delegations.clear();
- } else if ( !emitter ) {
- this._delegations.delete( event );
- } else {
- const destinations = this._delegations.get( event );
- if ( destinations ) {
- destinations.delete( emitter );
- }
- }
- },
- /**
- * @inheritDoc
- */
- _addEventListener( event, callback, options ) {
- createEventNamespace( this, event );
- const lists = getCallbacksListsForNamespace( this, event );
- const priority = _priorities__WEBPACK_IMPORTED_MODULE_2__["default"].get( options.priority );
- const callbackDefinition = {
- callback,
- priority
- };
- // Add the callback to all callbacks list.
- for ( const callbacks of lists ) {
- // Add the callback to the list in the right priority position.
- let added = false;
- for ( let i = 0; i < callbacks.length; i++ ) {
- if ( callbacks[ i ].priority < priority ) {
- callbacks.splice( i, 0, callbackDefinition );
- added = true;
- break;
- }
- }
- // Add at the end, if right place was not found.
- if ( !added ) {
- callbacks.push( callbackDefinition );
- }
- }
- },
- /**
- * @inheritDoc
- */
- _removeEventListener( event, callback ) {
- const lists = getCallbacksListsForNamespace( this, event );
- for ( const callbacks of lists ) {
- for ( let i = 0; i < callbacks.length; i++ ) {
- if ( callbacks[ i ].callback == callback ) {
- // Remove the callback from the list (fixing the next index).
- callbacks.splice( i, 1 );
- i--;
- }
- }
- }
- }
- };
- /* harmony default export */ __webpack_exports__["default"] = (EmitterMixin);
- /**
- * Emitter/listener interface.
- *
- * Can be easily implemented by a class by mixing the {@link module:utils/emittermixin~EmitterMixin} mixin.
- *
- * Read more about the usage of this interface in the:
- * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables Event system and observables}
- * section of the {@glink framework/guides/architecture/core-editor-architecture Core editor architecture} guide.
- * * {@glink framework/guides/deep-dive/event-system Event system} deep dive guide.
- *
- * @interface Emitter
- */
- /**
- * Registers a callback function to be executed when an event is fired.
- *
- * Shorthand for {@link #listenTo `this.listenTo( this, event, callback, options )`} (it makes the emitter
- * listen on itself).
- *
- * @method #on
- * @param {String} event The name of the event.
- * @param {Function} callback The function to be called on event.
- * @param {Object} [options={}] Additional options.
- * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
- * the priority value the sooner the callback will be fired. Events having the same priority are called in the
- * order they were added.
- */
- /**
- * Registers a callback function to be executed on the next time the event is fired only. This is similar to
- * calling {@link #on} followed by {@link #off} in the callback.
- *
- * @method #once
- * @param {String} event The name of the event.
- * @param {Function} callback The function to be called on event.
- * @param {Object} [options={}] Additional options.
- * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
- * the priority value the sooner the callback will be fired. Events having the same priority are called in the
- * order they were added.
- */
- /**
- * Stops executing the callback on the given event.
- * Shorthand for {@link #stopListening `this.stopListening( this, event, callback )`}.
- *
- * @method #off
- * @param {String} event The name of the event.
- * @param {Function} callback The function to stop being called.
- */
- /**
- * Registers a callback function to be executed when an event is fired in a specific (emitter) object.
- *
- * Events can be grouped in namespaces using `:`.
- * When namespaced event is fired, it additionally fires all callbacks for that namespace.
- *
- * // myEmitter.on( ... ) is a shorthand for myEmitter.listenTo( myEmitter, ... ).
- * myEmitter.on( 'myGroup', genericCallback );
- * myEmitter.on( 'myGroup:myEvent', specificCallback );
- *
- * // genericCallback is fired.
- * myEmitter.fire( 'myGroup' );
- * // both genericCallback and specificCallback are fired.
- * myEmitter.fire( 'myGroup:myEvent' );
- * // genericCallback is fired even though there are no callbacks for "foo".
- * myEmitter.fire( 'myGroup:foo' );
- *
- * An event callback can {@link module:utils/eventinfo~EventInfo#stop stop the event} and
- * set the {@link module:utils/eventinfo~EventInfo#return return value} of the {@link #fire} method.
- *
- * @method #listenTo
- * @param {module:utils/emittermixin~Emitter} emitter The object that fires the event.
- * @param {String} event The name of the event.
- * @param {Function} callback The function to be called on event.
- * @param {Object} [options={}] Additional options.
- * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
- * the priority value the sooner the callback will be fired. Events having the same priority are called in the
- * order they were added.
- */
- /**
- * Stops listening for events. It can be used at different levels:
- *
- * * To stop listening to a specific callback.
- * * To stop listening to a specific event.
- * * To stop listening to all events fired by a specific object.
- * * To stop listening to all events fired by all objects.
- *
- * @method #stopListening
- * @param {module:utils/emittermixin~Emitter} [emitter] The object to stop listening to. If omitted, stops it for all objects.
- * @param {String} [event] (Requires the `emitter`) The name of the event to stop listening to. If omitted, stops it
- * for all events from `emitter`.
- * @param {Function} [callback] (Requires the `event`) The function to be removed from the call list for the given
- * `event`.
- */
- /**
- * Fires an event, executing all callbacks registered for it.
- *
- * The first parameter passed to callbacks is an {@link module:utils/eventinfo~EventInfo} object,
- * followed by the optional `args` provided in the `fire()` method call.
- *
- * @method #fire
- * @param {String|module:utils/eventinfo~EventInfo} eventOrInfo The name of the event or `EventInfo` object if event is delegated.
- * @param {...*} [args] Additional arguments to be passed to the callbacks.
- * @returns {*} By default the method returns `undefined`. However, the return value can be changed by listeners
- * through modification of the {@link module:utils/eventinfo~EventInfo#return `evt.return`}'s property (the event info
- * is the first param of every callback).
- */
- /**
- * Delegates selected events to another {@link module:utils/emittermixin~Emitter}. For instance:
- *
- * emitterA.delegate( 'eventX' ).to( emitterB );
- * emitterA.delegate( 'eventX', 'eventY' ).to( emitterC );
- *
- * then `eventX` is delegated (fired by) `emitterB` and `emitterC` along with `data`:
- *
- * emitterA.fire( 'eventX', data );
- *
- * and `eventY` is delegated (fired by) `emitterC` along with `data`:
- *
- * emitterA.fire( 'eventY', data );
- *
- * @method #delegate
- * @param {...String} events Event names that will be delegated to another emitter.
- * @returns {module:utils/emittermixin~EmitterMixinDelegateChain}
- */
- /**
- * Stops delegating events. It can be used at different levels:
- *
- * * To stop delegating all events.
- * * To stop delegating a specific event to all emitters.
- * * To stop delegating a specific event to a specific emitter.
- *
- * @method #stopDelegating
- * @param {String} [event] The name of the event to stop delegating. If omitted, stops it all delegations.
- * @param {module:utils/emittermixin~Emitter} [emitter] (requires `event`) The object to stop delegating a particular event to.
- * If omitted, stops delegation of `event` to all emitters.
- */
- /**
- * Adds callback to emitter for given event.
- *
- * @protected
- * @method #_addEventListener
- * @param {String} event The name of the event.
- * @param {Function} callback The function to be called on event.
- * @param {Object} [options={}] Additional options.
- * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
- * the priority value the sooner the callback will be fired. Events having the same priority are called in the
- * order they were added.
- */
- /**
- * Removes callback from emitter for given event.
- *
- * @protected
- * @method #_removeEventListener
- * @param {String} event The name of the event.
- * @param {Function} callback The function to stop being called.
- */
- /**
- * Checks if `listeningEmitter` listens to an emitter with given `listenedToEmitterId` and if so, returns that emitter.
- * If not, returns `null`.
- *
- * @protected
- * @param {module:utils/emittermixin~Emitter} listeningEmitter An emitter that listens.
- * @param {String} listenedToEmitterId Unique emitter id of emitter listened to.
- * @returns {module:utils/emittermixin~Emitter|null}
- */
- function _getEmitterListenedTo( listeningEmitter, listenedToEmitterId ) {
- if ( listeningEmitter[ _listeningTo ] && listeningEmitter[ _listeningTo ][ listenedToEmitterId ] ) {
- return listeningEmitter[ _listeningTo ][ listenedToEmitterId ].emitter;
- }
- return null;
- }
- /**
- * Sets emitter's unique id.
- *
- * **Note:** `_emitterId` can be set only once.
- *
- * @protected
- * @param {module:utils/emittermixin~Emitter} emitter An emitter for which id will be set.
- * @param {String} [id] Unique id to set. If not passed, random unique id will be set.
- */
- function _setEmitterId( emitter, id ) {
- if ( !emitter[ _emitterId ] ) {
- emitter[ _emitterId ] = id || Object(_uid__WEBPACK_IMPORTED_MODULE_1__["default"])();
- }
- }
- /**
- * Returns emitter's unique id.
- *
- * @protected
- * @param {module:utils/emittermixin~Emitter} emitter An emitter which id will be returned.
- */
- function _getEmitterId( emitter ) {
- return emitter[ _emitterId ];
- }
- // Gets the internal `_events` property of the given object.
- // `_events` property store all lists with callbacks for registered event names.
- // If there were no events registered on the object, empty `_events` object is created.
- function getEvents( source ) {
- if ( !source._events ) {
- Object.defineProperty( source, '_events', {
- value: {}
- } );
- }
- return source._events;
- }
- // Creates event node for generic-specific events relation architecture.
- function makeEventNode() {
- return {
- callbacks: [],
- childEvents: []
- };
- }
- // Creates an architecture for generic-specific events relation.
- // If needed, creates all events for given eventName, i.e. if the first registered event
- // is foo:bar:abc, it will create foo:bar:abc, foo:bar and foo event and tie them together.
- // It also copies callbacks from more generic events to more specific events when
- // specific events are created.
- function createEventNamespace( source, eventName ) {
- const events = getEvents( source );
- // First, check if the event we want to add to the structure already exists.
- if ( events[ eventName ] ) {
- // If it exists, we don't have to do anything.
- return;
- }
- // In other case, we have to create the structure for the event.
- // Note, that we might need to create intermediate events too.
- // I.e. if foo:bar:abc is being registered and we only have foo in the structure,
- // we need to also register foo:bar.
- // Currently processed event name.
- let name = eventName;
- // Name of the event that is a child event for currently processed event.
- let childEventName = null;
- // Array containing all newly created specific events.
- const newEventNodes = [];
- // While loop can't check for ':' index because we have to handle generic events too.
- // In each loop, we truncate event name, going from the most specific name to the generic one.
- // I.e. foo:bar:abc -> foo:bar -> foo.
- while ( name !== '' ) {
- if ( events[ name ] ) {
- // If the currently processed event name is already registered, we can be sure
- // that it already has all the structure created, so we can break the loop here
- // as no more events need to be registered.
- break;
- }
- // If this event is not yet registered, create a new object for it.
- events[ name ] = makeEventNode();
- // Add it to the array with newly created events.
- newEventNodes.push( events[ name ] );
- // Add previously processed event name as a child of this event.
- if ( childEventName ) {
- events[ name ].childEvents.push( childEventName );
- }
- childEventName = name;
- // If `.lastIndexOf()` returns -1, `.substr()` will return '' which will break the loop.
- name = name.substr( 0, name.lastIndexOf( ':' ) );
- }
- if ( name !== '' ) {
- // If name is not empty, we found an already registered event that was a parent of the
- // event we wanted to register.
- // Copy that event's callbacks to newly registered events.
- for ( const node of newEventNodes ) {
- node.callbacks = events[ name ].callbacks.slice();
- }
- // Add last newly created event to the already registered event.
- events[ name ].childEvents.push( childEventName );
- }
- }
- // Gets an array containing callbacks list for a given event and it's more specific events.
- // I.e. if given event is foo:bar and there is also foo:bar:abc event registered, this will
- // return callback list of foo:bar and foo:bar:abc (but not foo).
- function getCallbacksListsForNamespace( source, eventName ) {
- const eventNode = getEvents( source )[ eventName ];
- if ( !eventNode ) {
- return [];
- }
- let callbacksLists = [ eventNode.callbacks ];
- for ( let i = 0; i < eventNode.childEvents.length; i++ ) {
- const childCallbacksLists = getCallbacksListsForNamespace( source, eventNode.childEvents[ i ] );
- callbacksLists = callbacksLists.concat( childCallbacksLists );
- }
- return callbacksLists;
- }
- // Get the list of callbacks for a given event, but only if there any callbacks have been registered.
- // If there are no callbacks registered for given event, it checks if this is a specific event and looks
- // for callbacks for it's more generic version.
- function getCallbacksForEvent( source, eventName ) {
- let event;
- if ( !source._events || !( event = source._events[ eventName ] ) || !event.callbacks.length ) {
- // There are no callbacks registered for specified eventName.
- // But this could be a specific-type event that is in a namespace.
- if ( eventName.indexOf( ':' ) > -1 ) {
- // If the eventName is specific, try to find callback lists for more generic event.
- return getCallbacksForEvent( source, eventName.substr( 0, eventName.lastIndexOf( ':' ) ) );
- } else {
- // If this is a top-level generic event, return null;
- return null;
- }
- }
- return event.callbacks;
- }
- // Fires delegated events for given map of destinations.
- //
- // @private
- // * @param {Map.<utils.Emitter>} destinations A map containing
- // `[ {@link module:utils/emittermixin~Emitter}, "event name" ]` pair destinations.
- // * @param {utils.EventInfo} eventInfo The original event info object.
- // * @param {Array.<*>} fireArgs Arguments the original event was fired with.
- function fireDelegatedEvents( destinations, eventInfo, fireArgs ) {
- for ( let [ emitter, name ] of destinations ) {
- if ( !name ) {
- name = eventInfo.name;
- } else if ( typeof name == 'function' ) {
- name = name( eventInfo.name );
- }
- const delegatedInfo = new _eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"]( eventInfo.source, name );
- delegatedInfo.path = [ ...eventInfo.path ];
- emitter.fire( delegatedInfo, ...fireArgs );
- }
- }
- // Helper for registering event callback on the emitter.
- function addEventListener( listener, emitter, event, callback, options ) {
- if ( emitter._addEventListener ) {
- emitter._addEventListener( event, callback, options );
- } else {
- // Allow listening on objects that do not implement Emitter interface.
- // This is needed in some tests that are using mocks instead of the real objects with EmitterMixin mixed.
- listener._addEventListener.call( emitter, event, callback, options );
- }
- }
- // Helper for removing event callback from the emitter.
- function removeEventListener( listener, emitter, event, callback ) {
- if ( emitter._removeEventListener ) {
- emitter._removeEventListener( event, callback );
- } else {
- // Allow listening on objects that do not implement Emitter interface.
- // This is needed in some tests that are using mocks instead of the real objects with EmitterMixin mixed.
- listener._removeEventListener.call( emitter, event, callback );
- }
- }
- /**
- * The return value of {@link ~EmitterMixin#delegate}.
- *
- * @interface module:utils/emittermixin~EmitterMixinDelegateChain
- */
- /**
- * Selects destination for {@link module:utils/emittermixin~EmitterMixin#delegate} events.
- *
- * @method #to
- * @param {module:utils/emittermixin~Emitter} emitter An `EmitterMixin` instance which is the destination for delegated events.
- * @param {String|Function} [nameOrFunction] A custom event name or function which converts the original name string.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js":
- /*!***********************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/env.js ***!
- \***********************************************************/
- /*! exports provided: default, isMac, isGecko, isSafari, isAndroid, isBlink, isRegExpUnicodePropertySupported */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMac", function() { return isMac; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isGecko", function() { return isGecko; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSafari", function() { return isSafari; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAndroid", function() { return isAndroid; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlink", function() { return isBlink; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExpUnicodePropertySupported", function() { return isRegExpUnicodePropertySupported; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /* globals navigator:false */
- /**
- * @module utils/env
- */
- const userAgent = navigator.userAgent.toLowerCase();
- /**
- * A namespace containing environment and browser information.
- *
- * @namespace
- */
- const env = {
- /**
- * Indicates that the application is running on Macintosh.
- *
- * @static
- * @type {Boolean}
- */
- isMac: isMac( userAgent ),
- /**
- * Indicates that the application is running in Firefox (Gecko).
- *
- * @static
- * @type {Boolean}
- */
- isGecko: isGecko( userAgent ),
- /**
- * Indicates that the application is running in Safari.
- *
- * @static
- * @type {Boolean}
- */
- isSafari: isSafari( userAgent ),
- /**
- * Indicates that the application is running on Android mobile device.
- *
- * @static
- * @type {Boolean}
- */
- isAndroid: isAndroid( userAgent ),
- /**
- * Indicates that the application is running in a browser using the Blink engine.
- *
- * @static
- * @type {Boolean}
- */
- isBlink: isBlink( userAgent ),
- /**
- * Environment features information.
- *
- * @memberOf module:utils/env~env
- * @namespace
- */
- features: {
- /**
- * Indicates that the environment supports ES2018 Unicode property escapes — like `\p{P}` or `\p{L}`.
- * More information about unicode properties might be found
- * [in Unicode Standard Annex #44](https://www.unicode.org/reports/tr44/#GC_Values_Table).
- *
- * @type {Boolean}
- */
- isRegExpUnicodePropertySupported: isRegExpUnicodePropertySupported()
- }
- };
- /* harmony default export */ __webpack_exports__["default"] = (env);
- /**
- * Checks if User Agent represented by the string is running on Macintosh.
- *
- * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
- * @returns {Boolean} Whether User Agent is running on Macintosh or not.
- */
- function isMac( userAgent ) {
- return userAgent.indexOf( 'macintosh' ) > -1;
- }
- /**
- * Checks if User Agent represented by the string is Firefox (Gecko).
- *
- * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
- * @returns {Boolean} Whether User Agent is Firefox or not.
- */
- function isGecko( userAgent ) {
- return !!userAgent.match( /gecko\/\d+/ );
- }
- /**
- * Checks if User Agent represented by the string is Safari.
- *
- * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
- * @returns {Boolean} Whether User Agent is Safari or not.
- */
- function isSafari( userAgent ) {
- return userAgent.indexOf( ' applewebkit/' ) > -1 && userAgent.indexOf( 'chrome' ) === -1;
- }
- /**
- * Checks if User Agent represented by the string is Android mobile device.
- *
- * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
- * @returns {Boolean} Whether User Agent is Safari or not.
- */
- function isAndroid( userAgent ) {
- return userAgent.indexOf( 'android' ) > -1;
- }
- /**
- * Checks if User Agent represented by the string is Blink engine.
- *
- * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
- * @returns {Boolean} Whether User Agent is Blink engine or not.
- */
- function isBlink( userAgent ) {
- // The Edge browser before switching to the Blink engine used to report itself as Chrome (and "Edge/")
- // but after switching to the Blink it replaced "Edge/" with "Edg/".
- return userAgent.indexOf( 'chrome/' ) > -1 && userAgent.indexOf( 'edge/' ) < 0;
- }
- /**
- * Checks if the current environment supports ES2018 Unicode properties like `\p{P}` or `\p{L}`.
- * More information about unicode properties might be found
- * [in Unicode Standard Annex #44](https://www.unicode.org/reports/tr44/#GC_Values_Table).
- *
- * @returns {Boolean}
- */
- function isRegExpUnicodePropertySupported() {
- let isSupported = false;
- // Feature detection for Unicode properties. Added in ES2018. Currently Firefox does not support it.
- // See https://github.com/ckeditor/ckeditor5-mention/issues/44#issuecomment-487002174.
- try {
- // Usage of regular expression literal cause error during build (ckeditor/ckeditor5-dev#534).
- isSupported = 'ć'.search( new RegExp( '[\\p{L}]', 'u' ) ) === 0;
- } catch ( error ) {
- // Firefox throws a SyntaxError when the group is unsupported.
- }
- return isSupported;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EventInfo; });
- /* harmony import */ var _spy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./spy */ "./node_modules/@ckeditor/ckeditor5-utils/src/spy.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/eventinfo
- */
- /**
- * The event object passed to event callbacks. It is used to provide information about the event as well as a tool to
- * manipulate it.
- */
- class EventInfo {
- /**
- * @param {Object} source The emitter.
- * @param {String} name The event name.
- */
- constructor( source, name ) {
- /**
- * The object that fired the event.
- *
- * @readonly
- * @member {Object}
- */
- this.source = source;
- /**
- * The event name.
- *
- * @readonly
- * @member {String}
- */
- this.name = name;
- /**
- * Path this event has followed. See {@link module:utils/emittermixin~EmitterMixin#delegate}.
- *
- * @readonly
- * @member {Array.<Object>}
- */
- this.path = [];
- // The following methods are defined in the constructor because they must be re-created per instance.
- /**
- * Stops the event emitter to call further callbacks for this event interaction.
- *
- * @method #stop
- */
- this.stop = Object(_spy__WEBPACK_IMPORTED_MODULE_0__["default"])();
- /**
- * Removes the current callback from future interactions of this event.
- *
- * @method #off
- */
- this.off = Object(_spy__WEBPACK_IMPORTED_MODULE_0__["default"])();
- /**
- * The value which will be returned by {@link module:utils/emittermixin~EmitterMixin#fire}.
- *
- * It's `undefined` by default and can be changed by an event listener:
- *
- * dataController.fire( 'getSelectedContent', ( evt ) => {
- * // This listener will make `dataController.fire( 'getSelectedContent' )`
- * // always return an empty DocumentFragment.
- * evt.return = new DocumentFragment();
- *
- * // Make sure no other listeners are executed.
- * evt.stop();
- * } );
- *
- * @member #return
- */
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js":
- /*!****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return fastDiff; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/fastdiff
- */
- /**
- * Finds positions of the first and last change in the given string/array and generates a set of changes:
- *
- * fastDiff( '12a', '12xyza' );
- * // [ { index: 2, type: 'insert', values: [ 'x', 'y', 'z' ] } ]
- *
- * fastDiff( '12a', '12aa' );
- * // [ { index: 3, type: 'insert', values: [ 'a' ] } ]
- *
- * fastDiff( '12xyza', '12a' );
- * // [ { index: 2, type: 'delete', howMany: 3 } ]
- *
- * fastDiff( [ '1', '2', 'a', 'a' ], [ '1', '2', 'a' ] );
- * // [ { index: 3, type: 'delete', howMany: 1 } ]
- *
- * fastDiff( [ '1', '2', 'a', 'b', 'c', '3' ], [ '2', 'a', 'b' ] );
- * // [ { index: 0, type: 'insert', values: [ '2', 'a', 'b' ] }, { index: 3, type: 'delete', howMany: 6 } ]
- *
- * Passed arrays can contain any type of data, however to compare them correctly custom comparator function
- * should be passed as a third parameter:
- *
- * fastDiff( [ { value: 1 }, { value: 2 } ], [ { value: 1 }, { value: 3 } ], ( a, b ) => {
- * return a.value === b.value;
- * } );
- * // [ { index: 1, type: 'insert', values: [ { value: 3 } ] }, { index: 2, type: 'delete', howMany: 1 } ]
- *
- * The resulted set of changes can be applied to the input in order to transform it into the output, for example:
- *
- * let input = '12abc3';
- * const output = '2ab';
- * const changes = fastDiff( input, output );
- *
- * changes.forEach( change => {
- * if ( change.type == 'insert' ) {
- * input = input.substring( 0, change.index ) + change.values.join( '' ) + input.substring( change.index );
- * } else if ( change.type == 'delete' ) {
- * input = input.substring( 0, change.index ) + input.substring( change.index + change.howMany );
- * }
- * } );
- *
- * // input equals output now
- *
- * or in case of arrays:
- *
- * let input = [ '1', '2', 'a', 'b', 'c', '3' ];
- * const output = [ '2', 'a', 'b' ];
- * const changes = fastDiff( input, output );
- *
- * changes.forEach( change => {
- * if ( change.type == 'insert' ) {
- * input = input.slice( 0, change.index ).concat( change.values, input.slice( change.index ) );
- * } else if ( change.type == 'delete' ) {
- * input = input.slice( 0, change.index ).concat( input.slice( change.index + change.howMany ) );
- * }
- * } );
- *
- * // input equals output now
- *
- * By passing `true` as the fourth parameter (`atomicChanges`) the output of this function will become compatible with
- * the {@link module:utils/diff~diff `diff()`} function:
- *
- * fastDiff( '12a', '12xyza' );
- * // [ 'equal', 'equal', 'insert', 'insert', 'insert', 'equal' ]
- *
- * The default output format of this function is compatible with the output format of
- * {@link module:utils/difftochanges~diffToChanges `diffToChanges()`}. The `diffToChanges()` input format is, in turn,
- * compatible with the output of {@link module:utils/diff~diff `diff()`}:
- *
- * const a = '1234';
- * const b = '12xyz34';
- *
- * // Both calls will return the same results (grouped changes format).
- * fastDiff( a, b );
- * diffToChanges( diff( a, b ) );
- *
- * // Again, both calls will return the same results (atomic changes format).
- * fastDiff( a, b, null, true );
- * diff( a, b );
- *
- *
- * @param {Array|String} a Input array or string.
- * @param {Array|String} b Input array or string.
- * @param {Function} [cmp] Optional function used to compare array values, by default `===` (strict equal operator) is used.
- * @param {Boolean} [atomicChanges=false] Whether an array of `inset|delete|equal` operations should
- * be returned instead of changes set. This makes this function compatible with {@link module:utils/diff~diff `diff()`}.
- * @returns {Array} Array of changes.
- */
- function fastDiff( a, b, cmp, atomicChanges = false ) {
- // Set the comparator function.
- cmp = cmp || function( a, b ) {
- return a === b;
- };
- // Convert the string (or any array-like object - eg. NodeList) to an array by using the slice() method because,
- // unlike Array.from(), it returns array of UTF-16 code units instead of the code points of a string.
- // One code point might be a surrogate pair of two code units. All text offsets are expected to be in code units.
- // See ckeditor/ckeditor5#3147.
- //
- // We need to make sure here that fastDiff() works identical to diff().
- if ( !Array.isArray( a ) ) {
- a = Array.prototype.slice.call( a );
- }
- if ( !Array.isArray( b ) ) {
- b = Array.prototype.slice.call( b );
- }
- // Find first and last change.
- const changeIndexes = findChangeBoundaryIndexes( a, b, cmp );
- // Transform into changes array.
- return atomicChanges ? changeIndexesToAtomicChanges( changeIndexes, b.length ) : changeIndexesToChanges( b, changeIndexes );
- }
- // Finds position of the first and last change in the given arrays. For example:
- //
- // const indexes = findChangeBoundaryIndexes( [ '1', '2', '3', '4' ], [ '1', '3', '4', '2', '4' ] );
- // console.log( indexes ); // { firstIndex: 1, lastIndexOld: 3, lastIndexNew: 4 }
- //
- // The above indexes means that in the first array the modified part is `1[23]4` and in the second array it is `1[342]4`.
- // Based on such indexes, array with `insert`/`delete` operations which allows transforming first value into the second one
- // can be generated.
- //
- // @param {Array} arr1
- // @param {Array} arr2
- // @param {Function} cmp Comparator function.
- // @returns {Object}
- // @returns {Number} return.firstIndex Index of the first change in both values (always the same for both).
- // @returns {Number} result.lastIndexOld Index of the last common value in `arr1`.
- // @returns {Number} result.lastIndexNew Index of the last common value in `arr2`.
- function findChangeBoundaryIndexes( arr1, arr2, cmp ) {
- // Find the first difference between passed values.
- const firstIndex = findFirstDifferenceIndex( arr1, arr2, cmp );
- // If arrays are equal return -1 indexes object.
- if ( firstIndex === -1 ) {
- return { firstIndex: -1, lastIndexOld: -1, lastIndexNew: -1 };
- }
- // Remove the common part of each value and reverse them to make it simpler to find the last difference between them.
- const oldArrayReversed = cutAndReverse( arr1, firstIndex );
- const newArrayReversed = cutAndReverse( arr2, firstIndex );
- // Find the first difference between reversed values.
- // It should be treated as "how many elements from the end the last difference occurred".
- //
- // For example:
- //
- // initial -> after cut -> reversed:
- // oldValue: '321ba' -> '21ba' -> 'ab12'
- // newValue: '31xba' -> '1xba' -> 'abx1'
- // lastIndex: -> 2
- //
- // So the last change occurred two characters from the end of the arrays.
- const lastIndex = findFirstDifferenceIndex( oldArrayReversed, newArrayReversed, cmp );
- // Use `lastIndex` to calculate proper offset, starting from the beginning (`lastIndex` kind of starts from the end).
- const lastIndexOld = arr1.length - lastIndex;
- const lastIndexNew = arr2.length - lastIndex;
- return { firstIndex, lastIndexOld, lastIndexNew };
- }
- // Returns a first index on which given arrays differ. If both arrays are the same, -1 is returned.
- //
- // @param {Array} arr1
- // @param {Array} arr2
- // @param {Function} cmp Comparator function.
- // @returns {Number}
- function findFirstDifferenceIndex( arr1, arr2, cmp ) {
- for ( let i = 0; i < Math.max( arr1.length, arr2.length ); i++ ) {
- if ( arr1[ i ] === undefined || arr2[ i ] === undefined || !cmp( arr1[ i ], arr2[ i ] ) ) {
- return i;
- }
- }
- return -1; // Return -1 if arrays are equal.
- }
- // Returns a copy of the given array with `howMany` elements removed starting from the beginning and in reversed order.
- //
- // @param {Array} arr Array to be processed.
- // @param {Number} howMany How many elements from array beginning to remove.
- // @returns {Array} Shortened and reversed array.
- function cutAndReverse( arr, howMany ) {
- return arr.slice( howMany ).reverse();
- }
- // Generates changes array based on change indexes from `findChangeBoundaryIndexes` function. This function will
- // generate array with 0 (no changes), 1 (deletion or insertion) or 2 records (insertion and deletion).
- //
- // @param {Array} newArray New array for which change indexes were calculated.
- // @param {Object} changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.
- // @returns {Array.<Object>} Array of changes compatible with {@link module:utils/difftochanges~diffToChanges} format.
- function changeIndexesToChanges( newArray, changeIndexes ) {
- const result = [];
- const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;
- // Order operations as 'insert', 'delete' array to keep compatibility with {@link module:utils/difftochanges~diffToChanges}
- // in most cases. However, 'diffToChanges' does not stick to any order so in some cases
- // (for example replacing '12345' with 'abcd') it will generate 'delete', 'insert' order.
- if ( lastIndexNew - firstIndex > 0 ) {
- result.push( {
- index: firstIndex,
- type: 'insert',
- values: newArray.slice( firstIndex, lastIndexNew )
- } );
- }
- if ( lastIndexOld - firstIndex > 0 ) {
- result.push( {
- index: firstIndex + ( lastIndexNew - firstIndex ), // Increase index of what was inserted.
- type: 'delete',
- howMany: lastIndexOld - firstIndex
- } );
- }
- return result;
- }
- // Generates array with set `equal|insert|delete` operations based on change indexes from `findChangeBoundaryIndexes` function.
- //
- // @param {Object} changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.
- // @param {Number} newLength Length of the new array on which `findChangeBoundaryIndexes` calculated change indexes.
- // @returns {Array.<String>} Array of changes compatible with {@link module:utils/diff~diff} format.
- function changeIndexesToAtomicChanges( changeIndexes, newLength ) {
- const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;
- // No changes.
- if ( firstIndex === -1 ) {
- return Array( newLength ).fill( 'equal' );
- }
- let result = [];
- if ( firstIndex > 0 ) {
- result = result.concat( Array( firstIndex ).fill( 'equal' ) );
- }
- if ( lastIndexNew - firstIndex > 0 ) {
- result = result.concat( Array( lastIndexNew - firstIndex ).fill( 'insert' ) );
- }
- if ( lastIndexOld - firstIndex > 0 ) {
- result = result.concat( Array( lastIndexOld - firstIndex ).fill( 'delete' ) );
- }
- if ( lastIndexNew < newLength ) {
- result = result.concat( Array( newLength - lastIndexNew ).fill( 'equal' ) );
- }
- return result;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/first.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return first; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/first
- */
- /**
- * Returns first item of the given `iterable`.
- *
- * @param {Iterable.<*>} iterable
- * @returns {*}
- */
- function first( iterable ) {
- const iteratorItem = iterable.next();
- if ( iteratorItem.done ) {
- return null;
- }
- return iteratorItem.value;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FocusTracker; });
- /* harmony import */ var _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
- /* harmony import */ var _observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /* global setTimeout, clearTimeout */
- /**
- * @module utils/focustracker
- */
- /**
- * Allows observing a group of `HTMLElement`s whether at least one of them is focused.
- *
- * Used by the {@link module:core/editor/editor~Editor} in order to track whether the focus is still within the application,
- * or were used outside of its UI.
- *
- * **Note** `focus` and `blur` listeners use event capturing, so it is only needed to register wrapper `HTMLElement`
- * which contain other `focusable` elements. But note that this wrapper element has to be focusable too
- * (have e.g. `tabindex="-1"`).
- *
- * Check out the {@glink framework/guides/deep-dive/ui/focus-tracking "Deep dive into focus tracking" guide} to learn more.
- *
- * @mixes module:utils/dom/emittermixin~EmitterMixin
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class FocusTracker {
- constructor() {
- /**
- * True when one of the registered elements is focused.
- *
- * @readonly
- * @observable
- * @member {Boolean} #isFocused
- */
- this.set( 'isFocused', false );
- /**
- * The currently focused element.
- *
- * While {@link #isFocused `isFocused`} remains `true`, the focus can
- * move between different UI elements. This property tracks those
- * elements and tells which one is currently focused.
- *
- * @readonly
- * @observable
- * @member {HTMLElement|null} #focusedElement
- */
- this.set( 'focusedElement', null );
- /**
- * List of registered elements.
- *
- * @private
- * @member {Set.<HTMLElement>}
- */
- this._elements = new Set();
- /**
- * Event loop timeout.
- *
- * @private
- * @member {Number}
- */
- this._nextEventLoopTimeout = null;
- }
- /**
- * Starts tracking the specified element.
- *
- * @param {HTMLElement} element
- */
- add( element ) {
- if ( this._elements.has( element ) ) {
- /**
- * This element is already tracked by {@link module:utils/focustracker~FocusTracker}.
- *
- * @error focustracker-add-element-already-exist
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'focustracker-add-element-already-exist', this );
- }
- this.listenTo( element, 'focus', () => this._focus( element ), { useCapture: true } );
- this.listenTo( element, 'blur', () => this._blur(), { useCapture: true } );
- this._elements.add( element );
- }
- /**
- * Stops tracking the specified element and stops listening on this element.
- *
- * @param {HTMLElement} element
- */
- remove( element ) {
- if ( element === this.focusedElement ) {
- this._blur( element );
- }
- if ( this._elements.has( element ) ) {
- this.stopListening( element );
- this._elements.delete( element );
- }
- }
- /**
- * Destroys the focus tracker by:
- * - Disabling all event listeners attached to tracked elements.
- * - Removing all tracked elements that were previously added.
- */
- destroy() {
- this.stopListening();
- }
- /**
- * Stores currently focused element and set {#isFocused} as `true`.
- *
- * @private
- * @param {HTMLElement} element Element which has been focused.
- */
- _focus( element ) {
- clearTimeout( this._nextEventLoopTimeout );
- this.focusedElement = element;
- this.isFocused = true;
- }
- /**
- * Clears currently focused element and set {@link #isFocused} as `false`.
- * This method uses `setTimeout` to change order of fires `blur` and `focus` events.
- *
- * @private
- * @fires blur
- */
- _blur() {
- clearTimeout( this._nextEventLoopTimeout );
- this._nextEventLoopTimeout = setTimeout( () => {
- this.focusedElement = null;
- this.isFocused = false;
- }, 0 );
- }
- /**
- * @event focus
- */
- /**
- * @event blur
- */
- }
- Object(_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( FocusTracker, _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
- Object(_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( FocusTracker, _observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/index.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/index.js ***!
- \*************************************************************/
- /*! exports provided: env, diff, mix, EmitterMixin, ObservableMixin, CKEditorError, logError, logWarning, ElementReplacer, createElement, DomEmitterMixin, global, getDataFromElement, Rect, ResizeObserver, setDataInElement, toUnit, keyCodes, getCode, parseKeystroke, getEnvKeystrokeText, isArrowKeyCode, getLocalizedArrowKeyCodeDirection, isForwardArrowKeyCode, getLanguageDirection, Locale, Collection, first, FocusTracker, KeystrokeHandler, toArray, toMap, priorities, uid, version */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "env", function() { return _env__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _diff__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./diff */ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "diff", function() { return _diff__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mix", function() { return _mix__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmitterMixin", function() { return _emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObservableMixin", function() { return _observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CKEditorError", function() { return _ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logError", function() { return _ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["logError"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logWarning", function() { return _ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["logWarning"]; });
- /* harmony import */ var _elementreplacer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./elementreplacer */ "./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ElementReplacer", function() { return _elementreplacer__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _dom_createelement__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dom/createelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return _dom_createelement__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _dom_emittermixin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEmitterMixin", function() { return _dom_emittermixin__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _dom_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "global", function() { return _dom_global__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _dom_getdatafromelement__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./dom/getdatafromelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDataFromElement", function() { return _dom_getdatafromelement__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _dom_rect__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Rect", function() { return _dom_rect__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _dom_resizeobserver__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResizeObserver", function() { return _dom_resizeobserver__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _dom_setdatainelement__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./dom/setdatainelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setDataInElement", function() { return _dom_setdatainelement__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _dom_tounit__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUnit", function() { return _dom_tounit__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyCodes", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["keyCodes"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["getCode"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseKeystroke", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["parseKeystroke"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnvKeystrokeText", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["getEnvKeystrokeText"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrowKeyCode", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["isArrowKeyCode"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocalizedArrowKeyCodeDirection", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["getLocalizedArrowKeyCodeDirection"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isForwardArrowKeyCode", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["isForwardArrowKeyCode"]; });
- /* harmony import */ var _language__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./language */ "./node_modules/@ckeditor/ckeditor5-utils/src/language.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLanguageDirection", function() { return _language__WEBPACK_IMPORTED_MODULE_16__["getLanguageDirection"]; });
- /* harmony import */ var _locale__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./locale */ "./node_modules/@ckeditor/ckeditor5-utils/src/locale.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Locale", function() { return _locale__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Collection", function() { return _collection__WEBPACK_IMPORTED_MODULE_18__["default"]; });
- /* harmony import */ var _first__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _first__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _focustracker__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusTracker", function() { return _focustracker__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /* harmony import */ var _keystrokehandler__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KeystrokeHandler", function() { return _keystrokehandler__WEBPACK_IMPORTED_MODULE_21__["default"]; });
- /* harmony import */ var _toarray__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _toarray__WEBPACK_IMPORTED_MODULE_22__["default"]; });
- /* harmony import */ var _tomap__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toMap", function() { return _tomap__WEBPACK_IMPORTED_MODULE_23__["default"]; });
- /* harmony import */ var _priorities__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "priorities", function() { return _priorities__WEBPACK_IMPORTED_MODULE_24__["default"]; });
- /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uid", function() { return _uid__WEBPACK_IMPORTED_MODULE_25__["default"]; });
- /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "version", function() { return _version__WEBPACK_IMPORTED_MODULE_26__["default"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isIterable; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/isiterable
- */
- /**
- * Checks if value implements iterator interface.
- *
- * @param {*} value The value to check.
- * @returns {Boolean} True if value implements iterator interface.
- */
- function isIterable( value ) {
- return !!( value && value[ Symbol.iterator ] );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js":
- /*!****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js ***!
- \****************************************************************/
- /*! exports provided: keyCodes, getCode, parseKeystroke, getEnvKeystrokeText, isArrowKeyCode, getLocalizedArrowKeyCodeDirection, isForwardArrowKeyCode */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyCodes", function() { return keyCodes; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseKeystroke", function() { return parseKeystroke; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEnvKeystrokeText", function() { return getEnvKeystrokeText; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArrowKeyCode", function() { return isArrowKeyCode; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedArrowKeyCodeDirection", function() { return getLocalizedArrowKeyCodeDirection; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isForwardArrowKeyCode", function() { return isForwardArrowKeyCode; });
- /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * A set of utilities related to keyboard support.
- *
- * @module utils/keyboard
- */
- const modifiersToGlyphsMac = {
- ctrl: '⌃',
- cmd: '⌘',
- alt: '⌥',
- shift: '⇧'
- };
- const modifiersToGlyphsNonMac = {
- ctrl: 'Ctrl+',
- alt: 'Alt+',
- shift: 'Shift+'
- };
- /**
- * An object with `keyName => keyCode` pairs for a set of known keys.
- *
- * Contains:
- *
- * * `a-z`,
- * * `0-9`,
- * * `f1-f12`,
- * * `arrow(left|up|right|bottom)`,
- * * `backspace`, `delete`, `enter`, `esc`, `tab`,
- * * `ctrl`, `cmd`, `shift`, `alt`.
- */
- const keyCodes = generateKnownKeyCodes();
- const keyCodeNames = Object.fromEntries(
- Object.entries( keyCodes ).map( ( [ name, code ] ) => [ code, name.charAt( 0 ).toUpperCase() + name.slice( 1 ) ] )
- );
- /**
- * Converts a key name or {@link module:utils/keyboard~KeystrokeInfo keystroke info} into a key code.
- *
- * Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.
- *
- * @param {String|module:utils/keyboard~KeystrokeInfo} A key name (see {@link module:utils/keyboard~keyCodes})
- * or a keystroke data object.
- * @returns {Number} Key or keystroke code.
- */
- function getCode( key ) {
- let keyCode;
- if ( typeof key == 'string' ) {
- keyCode = keyCodes[ key.toLowerCase() ];
- if ( !keyCode ) {
- /**
- * Unknown key name. Only key names included in the {@link module:utils/keyboard~keyCodes} can be used.
- *
- * @error keyboard-unknown-key
- * @param {String} key
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'keyboard-unknown-key', null, { key } );
- }
- } else {
- keyCode = key.keyCode +
- ( key.altKey ? keyCodes.alt : 0 ) +
- ( key.ctrlKey ? keyCodes.ctrl : 0 ) +
- ( key.shiftKey ? keyCodes.shift : 0 ) +
- ( key.metaKey ? keyCodes.cmd : 0 );
- }
- return keyCode;
- }
- /**
- * Parses the keystroke and returns a keystroke code that will match the code returned by
- * {@link module:utils/keyboard~getCode} for the corresponding {@link module:utils/keyboard~KeystrokeInfo keystroke info}.
- *
- * The keystroke can be passed in two formats:
- *
- * * as a single string – e.g. `ctrl + A`,
- * * as an array of {@link module:utils/keyboard~keyCodes known key names} and key codes – e.g.:
- * * `[ 'ctrl', 32 ]` (ctrl + space),
- * * `[ 'ctrl', 'a' ]` (ctrl + A).
- *
- * Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.
- *
- * Note: Only keystrokes with a single non-modifier key are supported (e.g. `ctrl+A` is OK, but `ctrl+A+B` is not).
- *
- * Note: On macOS, keystroke handling is translating the `Ctrl` key to the `Cmd` key and handling only that keystroke.
- * For example, a registered keystroke `Ctrl+A` will be translated to `Cmd+A` on macOS. To disable the translation of some keystroke,
- * use the forced modifier: `Ctrl!+A` (note the exclamation mark).
- *
- * @param {String|Array.<Number|String>} keystroke The keystroke definition.
- * @returns {Number} Keystroke code.
- */
- function parseKeystroke( keystroke ) {
- if ( typeof keystroke == 'string' ) {
- keystroke = splitKeystrokeText( keystroke );
- }
- return keystroke
- .map( key => ( typeof key == 'string' ) ? getEnvKeyCode( key ) : key )
- .reduce( ( key, sum ) => sum + key, 0 );
- }
- /**
- * Translates any keystroke string text like `"Ctrl+A"` to an
- * environment–specific keystroke, i.e. `"⌘A"` on macOS.
- *
- * @param {String} keystroke The keystroke text.
- * @returns {String} The keystroke text specific for the environment.
- */
- function getEnvKeystrokeText( keystroke ) {
- let keystrokeCode = parseKeystroke( keystroke );
- const modifiersToGlyphs = Object.entries( _env__WEBPACK_IMPORTED_MODULE_1__["default"].isMac ? modifiersToGlyphsMac : modifiersToGlyphsNonMac );
- const modifiers = modifiersToGlyphs.reduce( ( modifiers, [ name, glyph ] ) => {
- // Modifier keys are stored as a bit mask so extract those from the keystroke code.
- if ( ( keystrokeCode & keyCodes[ name ] ) != 0 ) {
- keystrokeCode &= ~keyCodes[ name ];
- modifiers += glyph;
- }
- return modifiers;
- }, '' );
- return modifiers + ( keystrokeCode ? keyCodeNames[ keystrokeCode ] : '' );
- }
- /**
- * Returns `true` if the provided key code represents one of the arrow keys.
- *
- * @param {Number} keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
- * @returns {Boolean}
- */
- function isArrowKeyCode( keyCode ) {
- return keyCode == keyCodes.arrowright ||
- keyCode == keyCodes.arrowleft ||
- keyCode == keyCodes.arrowup ||
- keyCode == keyCodes.arrowdown;
- }
- /**
- * Returns the direction in which the {@link module:engine/model/documentselection~DocumentSelection selection}
- * will move when the provided arrow key code is pressed considering the language direction of the editor content.
- *
- * For instance, in right–to–left (RTL) content languages, pressing the left arrow means moving the selection right (forward)
- * in the model structure. Similarly, pressing the right arrow moves the selection left (backward).
- *
- * @param {Number} keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
- * @param {'ltr'|'rtl'} contentLanguageDirection The content language direction, corresponding to
- * {@link module:utils/locale~Locale#contentLanguageDirection}.
- * @returns {'left'|'up'|'right'|'down'} Localized arrow direction.
- */
- function getLocalizedArrowKeyCodeDirection( keyCode, contentLanguageDirection ) {
- const isLtrContent = contentLanguageDirection === 'ltr';
- switch ( keyCode ) {
- case keyCodes.arrowleft:
- return isLtrContent ? 'left' : 'right';
- case keyCodes.arrowright:
- return isLtrContent ? 'right' : 'left';
- case keyCodes.arrowup:
- return 'up';
- case keyCodes.arrowdown:
- return 'down';
- }
- }
- // Converts a key name to the key code with mapping based on the env.
- //
- // See: {@link module:utils/keyboard~getCode}.
- //
- // @param {String} key The key name (see {@link module:utils/keyboard~keyCodes}).
- // @returns {Number} Key code.
- function getEnvKeyCode( key ) {
- // Don't remap modifier key for forced modifiers.
- if ( key.endsWith( '!' ) ) {
- return getCode( key.slice( 0, -1 ) );
- }
- const code = getCode( key );
- return _env__WEBPACK_IMPORTED_MODULE_1__["default"].isMac && code == keyCodes.ctrl ? keyCodes.cmd : code;
- }
- /**
- * Determines if the provided key code moves the {@link module:engine/model/documentselection~DocumentSelection selection}
- * forward or backward considering the language direction of the editor content.
- *
- * For instance, in right–to–left (RTL) languages, pressing the left arrow means moving forward
- * in the model structure. Similarly, pressing the right arrow moves the selection backward.
- *
- * @param {Number} keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
- * @param {'ltr'|'rtl'} contentLanguageDirection The content language direction, corresponding to
- * {@link module:utils/locale~Locale#contentLanguageDirection}.
- * @returns {Boolean}
- */
- function isForwardArrowKeyCode( keyCode, contentLanguageDirection ) {
- const localizedKeyCodeDirection = getLocalizedArrowKeyCodeDirection( keyCode, contentLanguageDirection );
- return localizedKeyCodeDirection === 'down' || localizedKeyCodeDirection === 'right';
- }
- function generateKnownKeyCodes() {
- const keyCodes = {
- arrowleft: 37,
- arrowup: 38,
- arrowright: 39,
- arrowdown: 40,
- backspace: 8,
- delete: 46,
- enter: 13,
- space: 32,
- esc: 27,
- tab: 9,
- // The idea about these numbers is that they do not collide with any real key codes, so we can use them
- // like bit masks.
- ctrl: 0x110000,
- shift: 0x220000,
- alt: 0x440000,
- cmd: 0x880000
- };
- // a-z
- for ( let code = 65; code <= 90; code++ ) {
- const letter = String.fromCharCode( code );
- keyCodes[ letter.toLowerCase() ] = code;
- }
- // 0-9
- for ( let code = 48; code <= 57; code++ ) {
- keyCodes[ code - 48 ] = code;
- }
- // F1-F12
- for ( let code = 112; code <= 123; code++ ) {
- keyCodes[ 'f' + ( code - 111 ) ] = code;
- }
- return keyCodes;
- }
- function splitKeystrokeText( keystroke ) {
- return keystroke.split( '+' ).map( key => key.trim() );
- }
- /**
- * Information about the keystroke.
- *
- * @interface module:utils/keyboard~KeystrokeInfo
- */
- /**
- * The [key code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode).
- *
- * @member {Number} module:utils/keyboard~KeystrokeInfo#keyCode
- */
- /**
- * Whether the <kbd>Alt</kbd> modifier was pressed.
- *
- * @member {Boolean} module:utils/keyboard~KeystrokeInfo#altKey
- */
- /**
- * Whether the <kbd>Ctrl</kbd> modifier was pressed.
- *
- * @member {Boolean} module:utils/keyboard~KeystrokeInfo#ctrlKey
- */
- /**
- * Whether the <kbd>Shift</kbd> modifier was pressed.
- *
- * @member {Boolean} module:utils/keyboard~KeystrokeInfo#shiftKey
- */
- /**
- * Whether the <kbd>Cmd</kbd> modifier was pressed.
- *
- * @member {Boolean} module:utils/keyboard~KeystrokeInfo#metaKey
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return KeystrokeHandler; });
- /* harmony import */ var _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
- /* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/keystrokehandler
- */
- /**
- * Keystroke handler allows registering callbacks for given keystrokes.
- *
- * The most frequent use of this class is through the {@link module:core/editor/editor~Editor#keystrokes `editor.keystrokes`}
- * property. It allows listening to keystrokes executed in the editing view:
- *
- * editor.keystrokes.set( 'Ctrl+A', ( keyEvtData, cancel ) => {
- * console.log( 'Ctrl+A has been pressed' );
- * cancel();
- * } );
- *
- * However, this utility class can be used in various part of the UI. For instance, a certain {@link module:ui/view~View}
- * can use it like this:
- *
- * class MyView extends View {
- * constructor() {
- * this.keystrokes = new KeystrokeHandler();
- *
- * this.keystrokes.set( 'tab', handleTabKey );
- * }
- *
- * render() {
- * super.render();
- *
- * this.keystrokes.listenTo( this.element );
- * }
- * }
- *
- * That keystroke handler will listen to `keydown` events fired in this view's main element.
- *
- */
- class KeystrokeHandler {
- /**
- * Creates an instance of the keystroke handler.
- */
- constructor() {
- /**
- * Listener used to listen to events for easier keystroke handler destruction.
- *
- * @protected
- * @member {module:utils/dom/emittermixin~Emitter}
- */
- this._listener = Object.create( _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
- }
- /**
- * Starts listening for `keydown` events from a given emitter.
- *
- * @param {module:utils/emittermixin~Emitter} emitter
- */
- listenTo( emitter ) {
- // The #_listener works here as a kind of dispatcher. It groups the events coming from the same
- // keystroke so the listeners can be attached to them with different priorities.
- //
- // E.g. all the keystrokes with the `keyCode` of 42 coming from the `emitter` are propagated
- // as a `_keydown:42` event by the `_listener`. If there's a callback created by the `set`
- // method for this 42 keystroke, it listens to the `_listener#_keydown:42` event only and interacts
- // only with other listeners of this particular event, thus making it possible to prioritize
- // the listeners and safely cancel execution, when needed. Instead of duplicating the Emitter logic,
- // the KeystrokeHandler re–uses it to do its job.
- this._listener.listenTo( emitter, 'keydown', ( evt, keyEvtData ) => {
- this._listener.fire( '_keydown:' + Object(_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( keyEvtData ), keyEvtData );
- } );
- }
- /**
- * Registers a handler for the specified keystroke.
- *
- * @param {String|Array.<String|Number>} keystroke Keystroke defined in a format accepted by
- * the {@link module:utils/keyboard~parseKeystroke} function.
- * @param {Function} callback A function called with the
- * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
- * a helper funcion to call both `preventDefault()` and `stopPropagation()` on the underlying event.
- * @param {Object} [options={}] Additional options.
- * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of the keystroke
- * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority
- * are called in the order they were added.
- */
- set( keystroke, callback, options = {} ) {
- const keyCode = Object(_keyboard__WEBPACK_IMPORTED_MODULE_1__["parseKeystroke"])( keystroke );
- const priority = options.priority;
- // Execute the passed callback on KeystrokeHandler#_keydown.
- // TODO: https://github.com/ckeditor/ckeditor5-utils/issues/144
- this._listener.listenTo( this._listener, '_keydown:' + keyCode, ( evt, keyEvtData ) => {
- callback( keyEvtData, () => {
- // Stop the event in the DOM: no listener in the web page
- // will be triggered by this event.
- keyEvtData.preventDefault();
- keyEvtData.stopPropagation();
- // Stop the event in the KeystrokeHandler: no more callbacks
- // will be executed for this keystroke.
- evt.stop();
- } );
- // Mark this keystroke as handled by the callback. See: #press.
- evt.return = true;
- }, { priority } );
- }
- /**
- * Triggers a keystroke handler for a specified key combination, if such a keystroke was {@link #set defined}.
- *
- * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEvtData Key event data.
- * @returns {Boolean} Whether the keystroke was handled.
- */
- press( keyEvtData ) {
- return !!this._listener.fire( '_keydown:' + Object(_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( keyEvtData ), keyEvtData );
- }
- /**
- * Destroys the keystroke handler.
- */
- destroy() {
- this._listener.stopListening();
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/language.js":
- /*!****************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/language.js ***!
- \****************************************************************/
- /*! exports provided: getLanguageDirection */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLanguageDirection", function() { return getLanguageDirection; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/language
- */
- const RTL_LANGUAGE_CODES = [
- 'ar', 'ara', // Arabic
- 'fa', 'per', 'fas', // Persian
- 'he', 'heb', // Hebrew
- 'ku', 'kur', // Kurdish
- 'ug', 'uig' // Uighur, Uyghur
- ];
- /**
- * Helps determine whether a language text direction is LTR or RTL.
- *
- * @param {String} language The ISO 639-1 or ISO 639-2 language code.
- * @returns {'ltr'|'rtl'}
- */
- function getLanguageDirection( languageCode ) {
- return RTL_LANGUAGE_CODES.includes( languageCode ) ? 'rtl' : 'ltr';
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/locale.js":
- /*!**************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/locale.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Locale; });
- /* harmony import */ var _toarray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
- /* harmony import */ var _translation_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./translation-service */ "./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js");
- /* harmony import */ var _language__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./language */ "./node_modules/@ckeditor/ckeditor5-utils/src/language.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/locale
- */
- /* globals console */
- /**
- * Represents the localization services.
- */
- class Locale {
- /**
- * Creates a new instance of the locale class. Learn more about
- * {@glink features/ui-language configuring the language of the editor}.
- *
- * @param {Object} [options] Locale configuration.
- * @param {String} [options.uiLanguage='en'] The editor UI language code in the
- * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. See {@link #uiLanguage}.
- * @param {String} [options.contentLanguage] The editor content language code in the
- * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. If not specified, the same as `options.language`.
- * See {@link #contentLanguage}.
- */
- constructor( options = {} ) {
- /**
- * The editor UI language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
- *
- * If the {@link #contentLanguage content language} was not specified in the `Locale` constructor,
- * it also defines the language of the content.
- *
- * @readonly
- * @member {String}
- */
- this.uiLanguage = options.uiLanguage || 'en';
- /**
- * The editor content language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
- *
- * Usually the same as the {@link #uiLanguage editor language}, it can be customized by passing an optional
- * argument to the `Locale` constructor.
- *
- * @readonly
- * @member {String}
- */
- this.contentLanguage = options.contentLanguage || this.uiLanguage;
- /**
- * Text direction of the {@link #uiLanguage editor UI language}. Either `'ltr'` or `'rtl'`.
- *
- * @readonly
- * @member {String}
- */
- this.uiLanguageDirection = Object(_language__WEBPACK_IMPORTED_MODULE_2__["getLanguageDirection"])( this.uiLanguage );
- /**
- * Text direction of the {@link #contentLanguage editor content language}.
- *
- * If the content language was passed directly to the `Locale` constructor, this property represents the
- * direction of that language.
- *
- * If the {@link #contentLanguage editor content language} was derived from the {@link #uiLanguage editor language},
- * the content language direction is the same as the {@link #uiLanguageDirection UI language direction}.
- *
- * The value is either `'ltr'` or `'rtl'`.
- *
- * @readonly
- * @member {String}
- */
- this.contentLanguageDirection = Object(_language__WEBPACK_IMPORTED_MODULE_2__["getLanguageDirection"])( this.contentLanguage );
- /**
- * Translates the given message to the {@link #uiLanguage}. This method is also available in
- * {@link module:core/editor/editor~Editor#t `Editor`} and {@link module:ui/view~View#t `View`}.
- *
- * This method's context is statically bound to the `Locale` instance and **should always be called as a function**:
- *
- * const t = locale.t;
- * t( 'Label' );
- *
- * The message can be either a string or an object implementing the {@link module:utils/translation-service~Message} interface.
- *
- * The message may contain placeholders (`%<index>`) for value(s) that are passed as a `values` parameter.
- * For an array of values, the `%<index>` will be changed to an element of that array at the given index.
- * For a single value passed as the second argument, only the `%0` placeholders will be changed to the provided value.
- *
- * t( 'Created file "%0" in %1ms.', [ fileName, timeTaken ] );
- * t( 'Created file "%0", fileName );
- *
- * The message supports plural forms. To specify the plural form, use the `plural` property. Singular or plural form
- * will be chosen depending on the first value from the passed `values`. The value of the `plural` property is used
- * as a default plural translation when the translation for the target language is missing.
- *
- * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Add a space' for the English language.
- * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 5 ); // 'Add 5 spaces' for the English language.
- * t( { string: '%1 a space', plural: '%1 %0 spaces' }, [ 2, 'Add' ] ); // 'Add 2 spaces' for the English language.
- *
- * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Dodaj spację' for the Polish language.
- * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 5 ); // 'Dodaj 5 spacji' for the Polish language.
- * t( { string: '%1 a space', plural: '%1 %0 spaces' }, [ 2, 'Add' ] ); // 'Dodaj 2 spacje' for the Polish language.
- *
- * * The message should provide an ID using the `id` property when the message strings are not unique and their
- * translations should be different.
- *
- * translate( 'en', { string: 'image', id: 'ADD_IMAGE' } );
- * translate( 'en', { string: 'image', id: 'AN_IMAGE' } );
- *
- * @method #t
- * @param {String|module:utils/translation-service~Message} message A message that will be localized (translated).
- * @param {String|Number|Array.<String|Number>} [values] A value or an array of values that will fill message placeholders.
- * For messages supporting plural forms the first value will determine the plural form.
- * @returns {String}
- */
- this.t = ( message, values ) => this._t( message, values );
- }
- /**
- * The editor UI language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
- *
- * **Note**: This property was deprecated. Please use {@link #uiLanguage} and {@link #contentLanguage}
- * properties instead.
- *
- * @deprecated
- * @member {String}
- */
- get language() {
- /**
- * The {@link module:utils/locale~Locale#language `Locale#language`} property was deprecated and will
- * be removed in the near future. Please use the {@link #uiLanguage} and {@link #contentLanguage} properties instead.
- *
- * @error locale-deprecated-language-property
- */
- console.warn(
- 'locale-deprecated-language-property: ' +
- 'The Locale#language property has been deprecated and will be removed in the near future. ' +
- 'Please use #uiLanguage and #contentLanguage properties instead.' );
- return this.uiLanguage;
- }
- /**
- * An unbound version of the {@link #t} method.
- *
- * @private
- * @param {String|module:utils/translation-service~Message} message
- * @param {Number|String|Array.<Number|String>} [values]
- * @returns {String}
- */
- _t( message, values = [] ) {
- values = Object(_toarray__WEBPACK_IMPORTED_MODULE_0__["default"])( values );
- if ( typeof message === 'string' ) {
- message = { string: message };
- }
- const hasPluralForm = !!message.plural;
- const quantity = hasPluralForm ? values[ 0 ] : 1;
- const translatedString = Object(_translation_service__WEBPACK_IMPORTED_MODULE_1__["_translate"])( this.uiLanguage, message, quantity );
- return interpolateString( translatedString, values );
- }
- }
- // Fills the `%0, %1, ...` string placeholders with values.
- function interpolateString( string, values ) {
- return string.replace( /%(\d+)/g, ( match, index ) => {
- return ( index < values.length ) ? values[ index ] : match;
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js":
- /*!***********************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/mix.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return mix; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/mix
- */
- /**
- * Copies enumerable properties and symbols from the objects given as 2nd+ parameters to the
- * prototype of first object (a constructor).
- *
- * class Editor {
- * ...
- * }
- *
- * const SomeMixin = {
- * a() {
- * return 'a';
- * }
- * };
- *
- * mix( Editor, SomeMixin, ... );
- *
- * new Editor().a(); // -> 'a'
- *
- * Note: Properties which already exist in the base class will not be overriden.
- *
- * @param {Function} [baseClass] Class which prototype will be extended.
- * @param {Object} [...mixins] Objects from which to get properties.
- */
- function mix( baseClass, ...mixins ) {
- mixins.forEach( mixin => {
- Object.getOwnPropertyNames( mixin ).concat( Object.getOwnPropertySymbols( mixin ) )
- .forEach( key => {
- if ( key in baseClass.prototype ) {
- return;
- }
- const sourceDescriptor = Object.getOwnPropertyDescriptor( mixin, key );
- sourceDescriptor.enumerable = false;
- Object.defineProperty( baseClass.prototype, key, sourceDescriptor );
- } );
- } );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return objectToMap; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/objecttomap
- */
- /**
- * Transforms object to map.
- *
- * const map = objectToMap( { 'foo': 1, 'bar': 2 } );
- * map.get( 'foo' ); // 1
- *
- * **Note**: For mixed data (`Object` or `Iterable`) there's a dedicated {@link module:utils/tomap~toMap} function.
- *
- * @param {Object} obj Object to transform.
- * @returns {Map} Map created from object.
- */
- function objectToMap( obj ) {
- const map = new Map();
- for ( const key in obj ) {
- map.set( key, obj[ key ] );
- }
- return map;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/observablemixin
- */
- const observablePropertiesSymbol = Symbol( 'observableProperties' );
- const boundObservablesSymbol = Symbol( 'boundObservables' );
- const boundPropertiesSymbol = Symbol( 'boundProperties' );
- const _decoratedMethods = Symbol( 'decoratedMethods' );
- const _decoratedOriginal = Symbol( 'decoratedOriginal' );
- /**
- * A mixin that injects the "observable properties" and data binding functionality described in the
- * {@link ~Observable} interface.
- *
- * Read more about the concept of observables in the:
- * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables "Event system and observables"}
- * section of the {@glink framework/guides/architecture/core-editor-architecture "Core editor architecture"} guide,
- * * {@glink framework/guides/deep-dive/observables "Observables" deep dive} guide.
- *
- * @mixin ObservableMixin
- * @mixes module:utils/emittermixin~EmitterMixin
- * @implements module:utils/observablemixin~Observable
- */
- const ObservableMixin = {
- /**
- * @inheritDoc
- */
- set( name, value ) {
- // If the first parameter is an Object, iterate over its properties.
- if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isObject"])( name ) ) {
- Object.keys( name ).forEach( property => {
- this.set( property, name[ property ] );
- }, this );
- return;
- }
- initObservable( this );
- const properties = this[ observablePropertiesSymbol ];
- if ( ( name in this ) && !properties.has( name ) ) {
- /**
- * Cannot override an existing property.
- *
- * This error is thrown when trying to {@link ~Observable#set set} a property with
- * a name of an already existing property. For example:
- *
- * let observable = new Model();
- * observable.property = 1;
- * observable.set( 'property', 2 ); // throws
- *
- * observable.set( 'property', 1 );
- * observable.set( 'property', 2 ); // ok, because this is an existing property.
- *
- * @error observable-set-cannot-override
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-set-cannot-override', this );
- }
- Object.defineProperty( this, name, {
- enumerable: true,
- configurable: true,
- get() {
- return properties.get( name );
- },
- set( value ) {
- const oldValue = properties.get( name );
- // Fire `set` event before the new value will be set to make it possible
- // to override observable property without affecting `change` event.
- // See https://github.com/ckeditor/ckeditor5-utils/issues/171.
- let newValue = this.fire( 'set:' + name, name, value, oldValue );
- if ( newValue === undefined ) {
- newValue = value;
- }
- // Allow undefined as an initial value like A.define( 'x', undefined ) (#132).
- // Note: When properties map has no such own property, then its value is undefined.
- if ( oldValue !== newValue || !properties.has( name ) ) {
- properties.set( name, newValue );
- this.fire( 'change:' + name, name, newValue, oldValue );
- }
- }
- } );
- this[ name ] = value;
- },
- /**
- * @inheritDoc
- */
- bind( ...bindProperties ) {
- if ( !bindProperties.length || !isStringArray( bindProperties ) ) {
- /**
- * All properties must be strings.
- *
- * @error observable-bind-wrong-properties
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-wrong-properties', this );
- }
- if ( ( new Set( bindProperties ) ).size !== bindProperties.length ) {
- /**
- * Properties must be unique.
- *
- * @error observable-bind-duplicate-properties
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-duplicate-properties', this );
- }
- initObservable( this );
- const boundProperties = this[ boundPropertiesSymbol ];
- bindProperties.forEach( propertyName => {
- if ( boundProperties.has( propertyName ) ) {
- /**
- * Cannot bind the same property more than once.
- *
- * @error observable-bind-rebind
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-rebind', this );
- }
- } );
- const bindings = new Map();
- // @typedef {Object} Binding
- // @property {Array} property Property which is bound.
- // @property {Array} to Array of observable–property components of the binding (`{ observable: ..., property: .. }`).
- // @property {Array} callback A function which processes `to` components.
- bindProperties.forEach( a => {
- const binding = { property: a, to: [] };
- boundProperties.set( a, binding );
- bindings.set( a, binding );
- } );
- // @typedef {Object} BindChain
- // @property {Function} to See {@link ~ObservableMixin#_bindTo}.
- // @property {Function} toMany See {@link ~ObservableMixin#_bindToMany}.
- // @property {module:utils/observablemixin~Observable} _observable The observable which initializes the binding.
- // @property {Array} _bindProperties Array of `_observable` properties to be bound.
- // @property {Array} _to Array of `to()` observable–properties (`{ observable: toObservable, properties: ...toProperties }`).
- // @property {Map} _bindings Stores bindings to be kept in
- // {@link ~ObservableMixin#_boundProperties}/{@link ~ObservableMixin#_boundObservables}
- // initiated in this binding chain.
- return {
- to: bindTo,
- toMany: bindToMany,
- _observable: this,
- _bindProperties: bindProperties,
- _to: [],
- _bindings: bindings
- };
- },
- /**
- * @inheritDoc
- */
- unbind( ...unbindProperties ) {
- // Nothing to do here if not inited yet.
- if ( !( this[ observablePropertiesSymbol ] ) ) {
- return;
- }
- const boundProperties = this[ boundPropertiesSymbol ];
- const boundObservables = this[ boundObservablesSymbol ];
- if ( unbindProperties.length ) {
- if ( !isStringArray( unbindProperties ) ) {
- /**
- * Properties must be strings.
- *
- * @error observable-unbind-wrong-properties
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-unbind-wrong-properties', this );
- }
- unbindProperties.forEach( propertyName => {
- const binding = boundProperties.get( propertyName );
- // Nothing to do if the binding is not defined
- if ( !binding ) {
- return;
- }
- let toObservable, toProperty, toProperties, toPropertyBindings;
- binding.to.forEach( to => {
- // TODO: ES6 destructuring.
- toObservable = to[ 0 ];
- toProperty = to[ 1 ];
- toProperties = boundObservables.get( toObservable );
- toPropertyBindings = toProperties[ toProperty ];
- toPropertyBindings.delete( binding );
- if ( !toPropertyBindings.size ) {
- delete toProperties[ toProperty ];
- }
- if ( !Object.keys( toProperties ).length ) {
- boundObservables.delete( toObservable );
- this.stopListening( toObservable, 'change' );
- }
- } );
- boundProperties.delete( propertyName );
- } );
- } else {
- boundObservables.forEach( ( bindings, boundObservable ) => {
- this.stopListening( boundObservable, 'change' );
- } );
- boundObservables.clear();
- boundProperties.clear();
- }
- },
- /**
- * @inheritDoc
- */
- decorate( methodName ) {
- const originalMethod = this[ methodName ];
- if ( !originalMethod ) {
- /**
- * Cannot decorate an undefined method.
- *
- * @error observablemixin-cannot-decorate-undefined
- * @param {Object} object The object which method should be decorated.
- * @param {String} methodName Name of the method which does not exist.
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
- 'observablemixin-cannot-decorate-undefined',
- this,
- { object: this, methodName }
- );
- }
- this.on( methodName, ( evt, args ) => {
- evt.return = originalMethod.apply( this, args );
- } );
- this[ methodName ] = function( ...args ) {
- return this.fire( methodName, args );
- };
- this[ methodName ][ _decoratedOriginal ] = originalMethod;
- if ( !this[ _decoratedMethods ] ) {
- this[ _decoratedMethods ] = [];
- }
- this[ _decoratedMethods ].push( methodName );
- }
- };
- Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["extend"])( ObservableMixin, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
- // Override the EmitterMixin stopListening method to be able to clean (and restore) decorated methods.
- // This is needed in case of:
- // 1. Have x.foo() decorated.
- // 2. Call x.stopListening()
- // 3. Call x.foo(). Problem: nothing happens (the original foo() method is not executed)
- ObservableMixin.stopListening = function( emitter, event, callback ) {
- // Removing all listeners so let's clean the decorated methods to the original state.
- if ( !emitter && this[ _decoratedMethods ] ) {
- for ( const methodName of this[ _decoratedMethods ] ) {
- this[ methodName ] = this[ methodName ][ _decoratedOriginal ];
- }
- delete this[ _decoratedMethods ];
- }
- _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"].stopListening.call( this, emitter, event, callback );
- };
- /* harmony default export */ __webpack_exports__["default"] = (ObservableMixin);
- // Init symbol properties needed for the observable mechanism to work.
- //
- // @private
- // @param {module:utils/observablemixin~ObservableMixin} observable
- function initObservable( observable ) {
- // Do nothing if already inited.
- if ( observable[ observablePropertiesSymbol ] ) {
- return;
- }
- // The internal hash containing the observable's state.
- //
- // @private
- // @type {Map}
- Object.defineProperty( observable, observablePropertiesSymbol, {
- value: new Map()
- } );
- // Map containing bindings to external observables. It shares the binding objects
- // (`{ observable: A, property: 'a', to: ... }`) with {@link module:utils/observablemixin~ObservableMixin#_boundProperties} and
- // it is used to observe external observables to update own properties accordingly.
- // See {@link module:utils/observablemixin~ObservableMixin#bind}.
- //
- // A.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );
- // console.log( A._boundObservables );
- //
- // Map( {
- // B: {
- // x: Set( [
- // { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
- // { observable: A, property: 'c', to: [ [ B, 'x' ] ] }
- // ] ),
- // y: Set( [
- // { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
- // ] )
- // }
- // } )
- //
- // A.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );
- // console.log( A._boundObservables );
- //
- // Map( {
- // B: {
- // x: Set( [
- // { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
- // { observable: A, property: 'c', to: [ [ B, 'x' ] ] }
- // ] ),
- // y: Set( [
- // { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
- // ] ),
- // z: Set( [
- // { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }
- // ] )
- // },
- // C: {
- // w: Set( [
- // { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }
- // ] )
- // }
- // } )
- //
- // @private
- // @type {Map}
- Object.defineProperty( observable, boundObservablesSymbol, {
- value: new Map()
- } );
- // Object that stores which properties of this observable are bound and how. It shares
- // the binding objects (`{ observable: A, property: 'a', to: ... }`) with
- // {@link module:utils/observablemixin~ObservableMixin#_boundObservables}. This data structure is
- // a reverse of {@link module:utils/observablemixin~ObservableMixin#_boundObservables} and it is helpful for
- // {@link module:utils/observablemixin~ObservableMixin#unbind}.
- //
- // See {@link module:utils/observablemixin~ObservableMixin#bind}.
- //
- // A.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );
- // console.log( A._boundProperties );
- //
- // Map( {
- // a: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
- // b: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
- // c: { observable: A, property: 'c', to: [ [ B, 'x' ] ] }
- // } )
- //
- // A.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );
- // console.log( A._boundProperties );
- //
- // Map( {
- // a: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
- // b: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
- // c: { observable: A, property: 'c', to: [ [ B, 'x' ] ] },
- // d: { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }
- // } )
- //
- // @private
- // @type {Map}
- Object.defineProperty( observable, boundPropertiesSymbol, {
- value: new Map()
- } );
- }
- // A chaining for {@link module:utils/observablemixin~ObservableMixin#bind} providing `.to()` interface.
- //
- // @private
- // @param {...[Observable|String|Function]} args Arguments of the `.to( args )` binding.
- function bindTo( ...args ) {
- const parsedArgs = parseBindToArgs( ...args );
- const bindingsKeys = Array.from( this._bindings.keys() );
- const numberOfBindings = bindingsKeys.length;
- // Eliminate A.bind( 'x' ).to( B, C )
- if ( !parsedArgs.callback && parsedArgs.to.length > 1 ) {
- /**
- * Binding multiple observables only possible with callback.
- *
- * @error observable-bind-to-no-callback
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-no-callback', this );
- }
- // Eliminate A.bind( 'x', 'y' ).to( B, callback )
- if ( numberOfBindings > 1 && parsedArgs.callback ) {
- /**
- * Cannot bind multiple properties and use a callback in one binding.
- *
- * @error observable-bind-to-extra-callback
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
- 'observable-bind-to-extra-callback',
- this
- );
- }
- parsedArgs.to.forEach( to => {
- // Eliminate A.bind( 'x', 'y' ).to( B, 'a' )
- if ( to.properties.length && to.properties.length !== numberOfBindings ) {
- /**
- * The number of properties must match.
- *
- * @error observable-bind-to-properties-length
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-properties-length', this );
- }
- // When no to.properties specified, observing source properties instead i.e.
- // A.bind( 'x', 'y' ).to( B ) -> Observe B.x and B.y
- if ( !to.properties.length ) {
- to.properties = this._bindProperties;
- }
- } );
- this._to = parsedArgs.to;
- // Fill {@link BindChain#_bindings} with callback. When the callback is set there's only one binding.
- if ( parsedArgs.callback ) {
- this._bindings.get( bindingsKeys[ 0 ] ).callback = parsedArgs.callback;
- }
- attachBindToListeners( this._observable, this._to );
- // Update observable._boundProperties and observable._boundObservables.
- updateBindToBound( this );
- // Set initial values of bound properties.
- this._bindProperties.forEach( propertyName => {
- updateBoundObservableProperty( this._observable, propertyName );
- } );
- }
- // Binds to an attribute in a set of iterable observables.
- //
- // @private
- // @param {Array.<Observable>} observables
- // @param {String} attribute
- // @param {Function} callback
- function bindToMany( observables, attribute, callback ) {
- if ( this._bindings.size > 1 ) {
- /**
- * Binding one attribute to many observables only possible with one attribute.
- *
- * @error observable-bind-to-many-not-one-binding
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-many-not-one-binding', this );
- }
- this.to(
- // Bind to #attribute of each observable...
- ...getBindingTargets( observables, attribute ),
- // ...using given callback to parse attribute values.
- callback
- );
- }
- // Returns an array of binding components for
- // {@link Observable#bind} from a set of iterable observables.
- //
- // @param {Array.<Observable>} observables
- // @param {String} attribute
- // @returns {Array.<String|Observable>}
- function getBindingTargets( observables, attribute ) {
- const observableAndAttributePairs = observables.map( observable => [ observable, attribute ] );
- // Merge pairs to one-dimension array of observables and attributes.
- return Array.prototype.concat.apply( [], observableAndAttributePairs );
- }
- // Check if all entries of the array are of `String` type.
- //
- // @private
- // @param {Array} arr An array to be checked.
- // @returns {Boolean}
- function isStringArray( arr ) {
- return arr.every( a => typeof a == 'string' );
- }
- // Parses and validates {@link Observable#bind}`.to( args )` arguments and returns
- // an object with a parsed structure. For example
- //
- // A.bind( 'x' ).to( B, 'a', C, 'b', call );
- //
- // becomes
- //
- // {
- // to: [
- // { observable: B, properties: [ 'a' ] },
- // { observable: C, properties: [ 'b' ] },
- // ],
- // callback: call
- // }
- //
- // @private
- // @param {...*} args Arguments of {@link Observable#bind}`.to( args )`.
- // @returns {Object}
- function parseBindToArgs( ...args ) {
- // Eliminate A.bind( 'x' ).to()
- if ( !args.length ) {
- /**
- * Invalid argument syntax in `to()`.
- *
- * @error observable-bind-to-parse-error
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-parse-error', null );
- }
- const parsed = { to: [] };
- let lastObservable;
- if ( typeof args[ args.length - 1 ] == 'function' ) {
- parsed.callback = args.pop();
- }
- args.forEach( a => {
- if ( typeof a == 'string' ) {
- lastObservable.properties.push( a );
- } else if ( typeof a == 'object' ) {
- lastObservable = { observable: a, properties: [] };
- parsed.to.push( lastObservable );
- } else {
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-parse-error', null );
- }
- } );
- return parsed;
- }
- // Synchronizes {@link module:utils/observablemixin#_boundObservables} with {@link Binding}.
- //
- // @private
- // @param {Binding} binding A binding to store in {@link Observable#_boundObservables}.
- // @param {Observable} toObservable A observable, which is a new component of `binding`.
- // @param {String} toPropertyName A name of `toObservable`'s property, a new component of the `binding`.
- function updateBoundObservables( observable, binding, toObservable, toPropertyName ) {
- const boundObservables = observable[ boundObservablesSymbol ];
- const bindingsToObservable = boundObservables.get( toObservable );
- const bindings = bindingsToObservable || {};
- if ( !bindings[ toPropertyName ] ) {
- bindings[ toPropertyName ] = new Set();
- }
- // Pass the binding to a corresponding Set in `observable._boundObservables`.
- bindings[ toPropertyName ].add( binding );
- if ( !bindingsToObservable ) {
- boundObservables.set( toObservable, bindings );
- }
- }
- // Synchronizes {@link Observable#_boundProperties} and {@link Observable#_boundObservables}
- // with {@link BindChain}.
- //
- // Assuming the following binding being created
- //
- // A.bind( 'a', 'b' ).to( B, 'x', 'y' );
- //
- // the following bindings were initialized by {@link Observable#bind} in {@link BindChain#_bindings}:
- //
- // {
- // a: { observable: A, property: 'a', to: [] },
- // b: { observable: A, property: 'b', to: [] },
- // }
- //
- // Iterate over all bindings in this chain and fill their `to` properties with
- // corresponding to( ... ) arguments (components of the binding), so
- //
- // {
- // a: { observable: A, property: 'a', to: [ B, 'x' ] },
- // b: { observable: A, property: 'b', to: [ B, 'y' ] },
- // }
- //
- // Then update the structure of {@link Observable#_boundObservables} with updated
- // binding, so it becomes:
- //
- // Map( {
- // B: {
- // x: Set( [
- // { observable: A, property: 'a', to: [ [ B, 'x' ] ] }
- // ] ),
- // y: Set( [
- // { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
- // ] )
- // }
- // } )
- //
- // @private
- // @param {BindChain} chain The binding initialized by {@link Observable#bind}.
- function updateBindToBound( chain ) {
- let toProperty;
- chain._bindings.forEach( ( binding, propertyName ) => {
- // Note: For a binding without a callback, this will run only once
- // like in A.bind( 'x', 'y' ).to( B, 'a', 'b' )
- // TODO: ES6 destructuring.
- chain._to.forEach( to => {
- toProperty = to.properties[ binding.callback ? 0 : chain._bindProperties.indexOf( propertyName ) ];
- binding.to.push( [ to.observable, toProperty ] );
- updateBoundObservables( chain._observable, binding, to.observable, toProperty );
- } );
- } );
- }
- // Updates an property of a {@link Observable} with a value
- // determined by an entry in {@link Observable#_boundProperties}.
- //
- // @private
- // @param {Observable} observable A observable which property is to be updated.
- // @param {String} propertyName An property to be updated.
- function updateBoundObservableProperty( observable, propertyName ) {
- const boundProperties = observable[ boundPropertiesSymbol ];
- const binding = boundProperties.get( propertyName );
- let propertyValue;
- // When a binding with callback is created like
- //
- // A.bind( 'a' ).to( B, 'b', C, 'c', callback );
- //
- // collect B.b and C.c, then pass them to callback to set A.a.
- if ( binding.callback ) {
- propertyValue = binding.callback.apply( observable, binding.to.map( to => to[ 0 ][ to[ 1 ] ] ) );
- } else {
- propertyValue = binding.to[ 0 ];
- propertyValue = propertyValue[ 0 ][ propertyValue[ 1 ] ];
- }
- if ( Object.prototype.hasOwnProperty.call( observable, propertyName ) ) {
- observable[ propertyName ] = propertyValue;
- } else {
- observable.set( propertyName, propertyValue );
- }
- }
- // Starts listening to changes in {@link BindChain._to} observables to update
- // {@link BindChain._observable} {@link BindChain._bindProperties}. Also sets the
- // initial state of {@link BindChain._observable}.
- //
- // @private
- // @param {BindChain} chain The chain initialized by {@link Observable#bind}.
- function attachBindToListeners( observable, toBindings ) {
- toBindings.forEach( to => {
- const boundObservables = observable[ boundObservablesSymbol ];
- let bindings;
- // If there's already a chain between the observables (`observable` listens to
- // `to.observable`), there's no need to create another `change` event listener.
- if ( !boundObservables.get( to.observable ) ) {
- observable.listenTo( to.observable, 'change', ( evt, propertyName ) => {
- bindings = boundObservables.get( to.observable )[ propertyName ];
- // Note: to.observable will fire for any property change, react
- // to changes of properties which are bound only.
- if ( bindings ) {
- bindings.forEach( binding => {
- updateBoundObservableProperty( observable, binding.property );
- } );
- }
- } );
- }
- } );
- }
- /**
- * An interface which adds "observable properties" and data binding functionality.
- *
- * Can be easily implemented by a class by mixing the {@link module:utils/observablemixin~ObservableMixin} mixin.
- *
- * Read more about the usage of this interface in the:
- * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables "Event system and observables"}
- * section of the {@glink framework/guides/architecture/core-editor-architecture "Core editor architecture"} guide,
- * * {@glink framework/guides/deep-dive/observables "Observables" deep dive} guide.
- *
- * @interface Observable
- * @extends module:utils/emittermixin~Emitter
- */
- /**
- * Fired when a property changed value.
- *
- * observable.set( 'prop', 1 );
- *
- * observable.on( 'change:prop', ( evt, propertyName, newValue, oldValue ) => {
- * console.log( `${ propertyName } has changed from ${ oldValue } to ${ newValue }` );
- * } );
- *
- * observable.prop = 2; // -> 'prop has changed from 1 to 2'
- *
- * @event change:{property}
- * @param {String} name The property name.
- * @param {*} value The new property value.
- * @param {*} oldValue The previous property value.
- */
- /**
- * Fired when a property value is going to be set but is not set yet (before the `change` event is fired).
- *
- * You can control the final value of the property by using
- * the {@link module:utils/eventinfo~EventInfo#return event's `return` property}.
- *
- * observable.set( 'prop', 1 );
- *
- * observable.on( 'set:prop', ( evt, propertyName, newValue, oldValue ) => {
- * console.log( `Value is going to be changed from ${ oldValue } to ${ newValue }` );
- * console.log( `Current property value is ${ observable[ propertyName ] }` );
- *
- * // Let's override the value.
- * evt.return = 3;
- * } );
- *
- * observable.on( 'change:prop', ( evt, propertyName, newValue, oldValue ) => {
- * console.log( `Value has changed from ${ oldValue } to ${ newValue }` );
- * } );
- *
- * observable.prop = 2; // -> 'Value is going to be changed from 1 to 2'
- * // -> 'Current property value is 1'
- * // -> 'Value has changed from 1 to 3'
- *
- * **Note:** The event is fired even when the new value is the same as the old value.
- *
- * @event set:{property}
- * @param {String} name The property name.
- * @param {*} value The new property value.
- * @param {*} oldValue The previous property value.
- */
- /**
- * Creates and sets the value of an observable property of this object. Such a property becomes a part
- * of the state and is observable.
- *
- * It accepts also a single object literal containing key/value pairs with properties to be set.
- *
- * This method throws the `observable-set-cannot-override` error if the observable instance already
- * has a property with the given property name. This prevents from mistakenly overriding existing
- * properties and methods, but means that `foo.set( 'bar', 1 )` may be slightly slower than `foo.bar = 1`.
- *
- * @method #set
- * @param {String|Object} name The property's name or object with `name=>value` pairs.
- * @param {*} [value] The property's value (if `name` was passed in the first parameter).
- */
- /**
- * Binds {@link #set observable properties} to other objects implementing the
- * {@link module:utils/observablemixin~Observable} interface.
- *
- * Read more in the {@glink framework/guides/deep-dive/observables#property-bindings dedicated guide}
- * covering the topic of property bindings with some additional examples.
- *
- * Consider two objects: a `button` and an associated `command` (both `Observable`).
- *
- * A simple property binding could be as follows:
- *
- * button.bind( 'isEnabled' ).to( command, 'isEnabled' );
- *
- * or even shorter:
- *
- * button.bind( 'isEnabled' ).to( command );
- *
- * which works in the following way:
- *
- * * `button.isEnabled` **instantly equals** `command.isEnabled`,
- * * whenever `command.isEnabled` changes, `button.isEnabled` will immediately reflect its value.
- *
- * **Note**: To release the binding, use {@link module:utils/observablemixin~Observable#unbind}.
- *
- * You can also "rename" the property in the binding by specifying the new name in the `to()` chain:
- *
- * button.bind( 'isEnabled' ).to( command, 'isWorking' );
- *
- * It is possible to bind more than one property at a time to shorten the code:
- *
- * button.bind( 'isEnabled', 'value' ).to( command );
- *
- * which corresponds to:
- *
- * button.bind( 'isEnabled' ).to( command );
- * button.bind( 'value' ).to( command );
- *
- * The binding can include more than one observable, combining multiple data sources in a custom callback:
- *
- * button.bind( 'isEnabled' ).to( command, 'isEnabled', ui, 'isVisible',
- * ( isCommandEnabled, isUIVisible ) => isCommandEnabled && isUIVisible );
- *
- * Using a custom callback allows processing the value before passing it to the target property:
- *
- * button.bind( 'isEnabled' ).to( command, 'value', value => value === 'heading1' );
- *
- * It is also possible to bind to the same property in an array of observables.
- * To bind a `button` to multiple commands (also `Observables`) so that each and every one of them
- * must be enabled for the button to become enabled, use the following code:
- *
- * button.bind( 'isEnabled' ).toMany( [ commandA, commandB, commandC ], 'isEnabled',
- * ( isAEnabled, isBEnabled, isCEnabled ) => isAEnabled && isBEnabled && isCEnabled );
- *
- * @method #bind
- * @param {...String} bindProperties Observable properties that will be bound to other observable(s).
- * @returns {Object} The bind chain with the `to()` and `toMany()` methods.
- */
- /**
- * Removes the binding created with {@link #bind}.
- *
- * // Removes the binding for the 'a' property.
- * A.unbind( 'a' );
- *
- * // Removes bindings for all properties.
- * A.unbind();
- *
- * @method #unbind
- * @param {...String} [unbindProperties] Observable properties to be unbound. All the bindings will
- * be released if no properties are provided.
- */
- /**
- * Turns the given methods of this object into event-based ones. This means that the new method will fire an event
- * (named after the method) and the original action will be plugged as a listener to that event.
- *
- * Read more in the {@glink framework/guides/deep-dive/observables#decorating-object-methods dedicated guide}
- * covering the topic of decorating methods with some additional examples.
- *
- * Decorating the method does not change its behavior (it only adds an event),
- * but it allows to modify it later on by listening to the method's event.
- *
- * For example, to cancel the method execution the event can be {@link module:utils/eventinfo~EventInfo#stop stopped}:
- *
- * class Foo {
- * constructor() {
- * this.decorate( 'method' );
- * }
- *
- * method() {
- * console.log( 'called!' );
- * }
- * }
- *
- * const foo = new Foo();
- * foo.on( 'method', ( evt ) => {
- * evt.stop();
- * }, { priority: 'high' } );
- *
- * foo.method(); // Nothing is logged.
- *
- *
- * **Note**: The high {@link module:utils/priorities~PriorityString priority} listener
- * has been used to execute this particular callback before the one which calls the original method
- * (which uses the "normal" priority).
- *
- * It is also possible to change the returned value:
- *
- * foo.on( 'method', ( evt ) => {
- * evt.return = 'Foo!';
- * } );
- *
- * foo.method(); // -> 'Foo'
- *
- * Finally, it is possible to access and modify the arguments the method is called with:
- *
- * method( a, b ) {
- * console.log( `${ a }, ${ b }` );
- * }
- *
- * // ...
- *
- * foo.on( 'method', ( evt, args ) => {
- * args[ 0 ] = 3;
- *
- * console.log( args[ 1 ] ); // -> 2
- * }, { priority: 'high' } );
- *
- * foo.method( 1, 2 ); // -> '3, 2'
- *
- * @method #decorate
- * @param {String} methodName Name of the method to decorate.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/priorities
- */
- /**
- * String representing a priority value.
- *
- * @typedef {'highest'|'high'|'normal'|'low'|'lowest'} module:utils/priorities~PriorityString
- */
- /**
- * Provides group of constants to use instead of hardcoding numeric priority values.
- *
- * @namespace
- */
- const priorities = {
- /**
- * Converts a string with priority name to it's numeric value. If `Number` is given, it just returns it.
- *
- * @static
- * @param {module:utils/priorities~PriorityString|Number} priority Priority to convert.
- * @returns {Number} Converted priority.
- */
- get( priority ) {
- if ( typeof priority != 'number' ) {
- return this[ priority ] || this.normal;
- } else {
- return priority;
- }
- },
- highest: 100000,
- high: 1000,
- normal: 0,
- low: -1000,
- lowest: -100000
- };
- /* harmony default export */ __webpack_exports__["default"] = (priorities);
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/spy.js":
- /*!***********************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/spy.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/spy
- */
- /**
- * Creates a spy function (ala Sinon.js) that can be used to inspect call to it.
- *
- * The following are the present features:
- *
- * * spy.called: property set to `true` if the function has been called at least once.
- *
- * @returns {Function} The spy function.
- */
- function spy() {
- return function spy() {
- spy.called = true;
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (spy);
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toArray; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/toarray
- */
- /**
- * Transforms any value to an array. If the provided value is already an array, it is returned unchanged.
- *
- * @param {*} data The value to transform to an array.
- * @returns {Array} An array created from data.
- */
- function toArray( data ) {
- return Array.isArray( data ) ? data : [ data ];
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toMap; });
- /* harmony import */ var _objecttomap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objecttomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js");
- /* harmony import */ var _isiterable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/tomap
- */
- /**
- * Transforms object or iterable to map. Iterable needs to be in the format acceptable by the `Map` constructor.
- *
- * map = toMap( { 'foo': 1, 'bar': 2 } );
- * map = toMap( [ [ 'foo', 1 ], [ 'bar', 2 ] ] );
- * map = toMap( anotherMap );
- *
- * @param {Object|Iterable} data Object or iterable to transform.
- * @returns {Map} Map created from data.
- */
- function toMap( data ) {
- if ( Object(_isiterable__WEBPACK_IMPORTED_MODULE_1__["default"])( data ) ) {
- return new Map( data );
- } else {
- return Object(_objecttomap__WEBPACK_IMPORTED_MODULE_0__["default"])( data );
- }
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js ***!
- \***************************************************************************/
- /*! exports provided: add, _translate, _clear */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_translate", function() { return _translate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_clear", function() { return _clear; });
- /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /* globals window */
- /**
- * @module utils/translation-service
- */
- /* istanbul ignore else */
- if ( !window.CKEDITOR_TRANSLATIONS ) {
- window.CKEDITOR_TRANSLATIONS = {};
- }
- /**
- * Adds translations to existing ones or overrides the existing translations. These translations will later
- * be available for the {@link module:utils/locale~Locale#t `t()`} function.
- *
- * The `translations` is an object which consists of `messageId: translation` pairs. Note that the message ID can be
- * either constructed from the message string or from the message ID if it was passed
- * (this happens rarely and mostly for short messages or messages with placeholders).
- * Since the editor displays only the message string, the message ID can be found either in the source code or in the
- * built translations for another language.
- *
- * add( 'pl', {
- * 'Cancel': 'Anuluj',
- * 'IMAGE': 'obraz', // Note that the `IMAGE` comes from the message ID, while the string can be `image`.
- * } );
- *
- * If the message is supposed to support various plural forms, make sure to provide an array with the singular form and all plural forms:
- *
- * add( 'pl', {
- * 'Add space': [ 'Dodaj spację', 'Dodaj %0 spacje', 'Dodaj %0 spacji' ]
- * } );
- *
- * You should also specify the third argument (the `getPluralForm()` function) that will be used to determine the plural form if no
- * language file was loaded for that language. All language files coming from CKEditor 5 sources will have this option set, so
- * these plural form rules will be reused by other translations added to the registered languages. The `getPluralForm()` function
- * can return either a Boolean or a number.
- *
- * add( 'en', {
- * // ... Translations.
- * }, n => n !== 1 );
- * add( 'pl', {
- * // ... Translations.
- * }, n => n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && ( n % 100 < 10 || n % 100 >= 20 ) ? 1 : 2 );
- *
- * All translations extend the global `window.CKEDITOR_TRANSLATIONS` object. An example of this object can be found below:
- *
- * {
- * pl: {
- * dictionary: {
- * 'Cancel': 'Anuluj',
- * 'Add space': [ 'Dodaj spację', 'Dodaj %0 spacje', 'Dodaj %0 spacji' ]
- * },
- * // A function that returns the plural form index.
- * getPluralForm: n => n !==1
- * }
- * // Other languages.
- * }
- *
- * If you cannot import this function from this module (e.g. because you use a CKEditor 5 build), you can
- * still add translations by extending the global `window.CKEDITOR_TRANSLATIONS` object by using a function like
- * the one below:
- *
- * function addTranslations( language, translations, getPluralForm ) {
- * if ( !window.CKEDITOR_TRANSLATIONS ) {
- * window.CKEDITOR_TRANSLATIONS = {};
- * }
- * if ( !window.CKEDITOR_TRANSLATIONS[ language ] ) {
- * window.CKEDITOR_TRANSLATIONS[ language ] = {};
- * }
- *
- * const languageTranslations = window.CKEDITOR_TRANSLATIONS[ language ];
- *
- * languageTranslations.dictionary = languageTranslations.dictionary || {};
- * languageTranslations.getPluralForm = getPluralForm || languageTranslations.getPluralForm;
- *
- * // Extend the dictionary for the given language.
- * Object.assign( languageTranslations.dictionary, translations );
- * }
- *
- * @param {String} language Target language.
- * @param {Object.<String,*>} translations An object with translations which will be added to the dictionary.
- * For each message ID the value should be either a translation or an array of translations if the message
- * should support plural forms.
- * @param {Function} getPluralForm A function that returns the plural form index (a number).
- */
- function add( language, translations, getPluralForm ) {
- if ( !window.CKEDITOR_TRANSLATIONS[ language ] ) {
- window.CKEDITOR_TRANSLATIONS[ language ] = {};
- }
- const languageTranslations = window.CKEDITOR_TRANSLATIONS[ language ];
- languageTranslations.dictionary = languageTranslations.dictionary || {};
- languageTranslations.getPluralForm = getPluralForm || languageTranslations.getPluralForm;
- Object.assign( languageTranslations.dictionary, translations );
- }
- /**
- * **Note:** This method is internal, use {@link module:utils/locale~Locale#t the `t()` function} instead to translate
- * the editor UI parts.
- *
- * This function is responsible for translating messages to the specified language. It uses translations added perviously
- * by {@link module:utils/translation-service~add} (a translations dictionary and the `getPluralForm()` function
- * to provide accurate translations of plural forms).
- *
- * When no translation is defined in the dictionary or the dictionary does not exist, this function returns
- * the original message string or the message plural depending on the number of elements.
- *
- * translate( 'pl', { string: 'Cancel' } ); // 'Cancel'
- *
- * The third optional argument is the number of elements, based on which the single form or one of the plural forms
- * should be picked when the message is supposed to support various plural forms.
- *
- * translate( 'en', { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Add a space'
- * translate( 'en', { string: 'Add a space', plural: 'Add %0 spaces' }, 3 ); // 'Add %0 spaces'
- *
- * The message should provide an ID using the `id` property when the message strings are not unique and their
- * translations should be different.
- *
- * translate( 'en', { string: 'image', id: 'ADD_IMAGE' } );
- * translate( 'en', { string: 'image', id: 'AN_IMAGE' } );
- *
- * @protected
- * @param {String} language Target language.
- * @param {module:utils/translation-service~Message|String} message A message that will be translated.
- * @param {Number} [quantity] The number of elements for which a plural form should be picked from the target language dictionary.
- * @returns {String} Translated sentence.
- */
- function _translate( language, message, quantity = 1 ) {
- if ( typeof quantity !== 'number' ) {
- /**
- * An incorrect value was passed to the translation function. This was probably caused
- * by an incorrect message interpolation of a plural form. Note that for messages supporting plural forms
- * the second argument of the `t()` function should always be a number or an array with a number as the first element.
- *
- * @error translation-service-quantity-not-a-number
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'translation-service-quantity-not-a-number', null, { quantity } );
- }
- const numberOfLanguages = getNumberOfLanguages();
- if ( numberOfLanguages === 1 ) {
- // Override the language to the only supported one.
- // This can't be done in the `Locale` class, because the translations comes after the `Locale` class initialization.
- language = Object.keys( window.CKEDITOR_TRANSLATIONS )[ 0 ];
- }
- const messageId = message.id || message.string;
- if ( numberOfLanguages === 0 || !hasTranslation( language, messageId ) ) {
- if ( quantity !== 1 ) {
- // Return the default plural form that was passed in the `message.plural` parameter.
- return message.plural;
- }
- return message.string;
- }
- const dictionary = window.CKEDITOR_TRANSLATIONS[ language ].dictionary;
- const getPluralForm = window.CKEDITOR_TRANSLATIONS[ language ].getPluralForm || ( n => n === 1 ? 0 : 1 );
- if ( typeof dictionary[ messageId ] === 'string' ) {
- return dictionary[ messageId ];
- }
- const pluralFormIndex = Number( getPluralForm( quantity ) );
- // Note: The `translate` function is not responsible for replacing `%0, %1, ...` with values.
- return dictionary[ messageId ][ pluralFormIndex ];
- }
- /**
- * Clears dictionaries for test purposes.
- *
- * @protected
- */
- function _clear() {
- window.CKEDITOR_TRANSLATIONS = {};
- }
- // Checks whether the dictionary exists and translation in that dictionary exists.
- function hasTranslation( language, messageId ) {
- return (
- !!window.CKEDITOR_TRANSLATIONS[ language ] &&
- !!window.CKEDITOR_TRANSLATIONS[ language ].dictionary[ messageId ]
- );
- }
- function getNumberOfLanguages() {
- return Object.keys( window.CKEDITOR_TRANSLATIONS ).length;
- }
- /**
- * The internationalization message interface. A message that implements this interface can be passed to the `t()` function
- * to be translated to the target UI language.
- *
- * @typedef {Object} module:utils/translation-service~Message
- *
- * @property {String} string The message string to translate. Acts as a default translation if the translation for a given language
- * is not defined. When the message is supposed to support plural forms, the string should be the English singular form of the message.
- * @property {String} [id] The message ID. If passed, the message ID is taken from this property instead of the `message.string`.
- * This property is useful when various messages share the same message string, for example, the `editor` string in `in the editor`
- * and `my editor` sentences.
- * @property {String} [plural] The plural form of the message. This property should be skipped when a message is not supposed
- * to support plural forms. Otherwise it should always be set to a string with the English plural form of the message.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js":
- /*!***********************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/uid.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return uid; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/uid
- */
- // A hash table of hex numbers to avoid using toString() in uid() which is costly.
- // [ '00', '01', '02', ..., 'fe', 'ff' ]
- const HEX_NUMBERS = new Array( 256 ).fill()
- .map( ( val, index ) => ( '0' + ( index ).toString( 16 ) ).slice( -2 ) );
- /**
- * Returns a unique id. The id starts with an "e" character and a randomly generated string of
- * 32 alphanumeric characters.
- *
- * **Note**: The characters the unique id is built from correspond to the hex number notation
- * (from "0" to "9", from "a" to "f"). In other words, each id corresponds to an "e" followed
- * by 16 8-bit numbers next to each other.
- *
- * @returns {String} An unique id string.
- */
- function uid() {
- // Let's create some positive random 32bit integers first.
- //
- // 1. Math.random() is a float between 0 and 1.
- // 2. 0x100000000 is 2^32 = 4294967296.
- // 3. >>> 0 enforces integer (in JS all numbers are floating point).
- //
- // For instance:
- // Math.random() * 0x100000000 = 3366450031.853859
- // but
- // Math.random() * 0x100000000 >>> 0 = 3366450031.
- const r1 = Math.random() * 0x100000000 >>> 0;
- const r2 = Math.random() * 0x100000000 >>> 0;
- const r3 = Math.random() * 0x100000000 >>> 0;
- const r4 = Math.random() * 0x100000000 >>> 0;
- // Make sure that id does not start with number.
- return 'e' +
- HEX_NUMBERS[ r1 >> 0 & 0xFF ] +
- HEX_NUMBERS[ r1 >> 8 & 0xFF ] +
- HEX_NUMBERS[ r1 >> 16 & 0xFF ] +
- HEX_NUMBERS[ r1 >> 24 & 0xFF ] +
- HEX_NUMBERS[ r2 >> 0 & 0xFF ] +
- HEX_NUMBERS[ r2 >> 8 & 0xFF ] +
- HEX_NUMBERS[ r2 >> 16 & 0xFF ] +
- HEX_NUMBERS[ r2 >> 24 & 0xFF ] +
- HEX_NUMBERS[ r3 >> 0 & 0xFF ] +
- HEX_NUMBERS[ r3 >> 8 & 0xFF ] +
- HEX_NUMBERS[ r3 >> 16 & 0xFF ] +
- HEX_NUMBERS[ r3 >> 24 & 0xFF ] +
- HEX_NUMBERS[ r4 >> 0 & 0xFF ] +
- HEX_NUMBERS[ r4 >> 8 & 0xFF ] +
- HEX_NUMBERS[ r4 >> 16 & 0xFF ] +
- HEX_NUMBERS[ r4 >> 24 & 0xFF ];
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js ***!
- \***************************************************************/
- /*! exports provided: isCombiningMark, isHighSurrogateHalf, isLowSurrogateHalf, isInsideSurrogatePair, isInsideCombinedSymbol */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCombiningMark", function() { return isCombiningMark; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogateHalf", function() { return isHighSurrogateHalf; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogateHalf", function() { return isLowSurrogateHalf; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInsideSurrogatePair", function() { return isInsideSurrogatePair; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInsideCombinedSymbol", function() { return isInsideCombinedSymbol; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * Set of utils to handle unicode characters.
- *
- * @module utils/unicode
- */
- /**
- * Checks whether given `character` is a combining mark.
- *
- * @param {String} character Character to check.
- * @returns {Boolean}
- */
- function isCombiningMark( character ) {
- // eslint-disable-next-line no-misleading-character-class
- return !!character && character.length == 1 && /[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test( character );
- }
- /**
- * Checks whether given `character` is a high half of surrogate pair.
- *
- * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair
- * consist of high surrogate pair character followed by low surrogate pair character.
- *
- * @param {String} character Character to check.
- * @returns {Boolean}
- */
- function isHighSurrogateHalf( character ) {
- return !!character && character.length == 1 && /[\ud800-\udbff]/.test( character );
- }
- /**
- * Checks whether given `character` is a low half of surrogate pair.
- *
- * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair
- * consist of high surrogate pair character followed by low surrogate pair character.
- *
- * @param {String} character Character to check.
- * @returns {Boolean}
- */
- function isLowSurrogateHalf( character ) {
- return !!character && character.length == 1 && /[\udc00-\udfff]/.test( character );
- }
- /**
- * Checks whether given offset in a string is inside a surrogate pair (between two surrogate halves).
- *
- * @param {String} string String to check.
- * @param {Number} offset Offset to check.
- * @returns {Boolean}
- */
- function isInsideSurrogatePair( string, offset ) {
- return isHighSurrogateHalf( string.charAt( offset - 1 ) ) && isLowSurrogateHalf( string.charAt( offset ) );
- }
- /**
- * Checks whether given offset in a string is between base character and combining mark or between two combining marks.
- *
- * @param {String} string String to check.
- * @param {Number} offset Offset to check.
- * @returns {Boolean}
- */
- function isInsideCombinedSymbol( string, offset ) {
- return isCombiningMark( string.charAt( offset ) );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-utils/src/version.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module utils/version
- */
- /* globals window, global */
- const version = '28.0.0';
- /* harmony default export */ __webpack_exports__["default"] = (version);
- /* istanbul ignore next */
- const windowOrGlobal = typeof window === 'object' ? window : global;
- /* istanbul ignore next */
- if ( windowOrGlobal.CKEDITOR_VERSION ) {
- /**
- * This error is thrown when due to a mistake in how CKEditor 5 was installed or initialized, some
- * of its modules were duplicated (evaluated and executed twice). Module duplication leads to inevitable runtime
- * errors.
- *
- * There are many situations in which some modules can be loaded twice. In the worst case scenario,
- * you may need to check your project for each of these issues and fix them all.
- *
- * # Trying to add a plugin to an existing build
- *
- * If you import an existing CKEditor 5 build and a plugin like this:
- *
- * import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
- * import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight';
- *
- * Then your project loads some CKEditor 5 packages twice. How does it happen?
- *
- * The build package contains a file which is already compiled with webpack. This means
- * that it contains all the necessary code from e.g. `@ckeditor/ckeditor5-engine` and `@ckeditor/ckeditor5-utils`.
- *
- * However, the `Highlight` plugin imports some of the modules from these packages, too. If you ask webpack to
- * build such a project, you will end up with the modules being included (and run) twice — first, because they are
- * included inside the build package, and second, because they are required by the `Highlight` plugin.
- *
- * Therefore, **you must never add plugins to an existing build** unless your plugin has no dependencies.
- *
- * Adding plugins to a build is done by taking the source version of this build (so, before it was built with webpack)
- * and adding plugins there. In this situation, webpack will know that it only needs to load each plugin once.
- *
- * Read more in the {@glink builds/guides/integration/installing-plugins "Installing plugins"} guide.
- *
- * # Confused an editor build with an editor implementation
- *
- * This scenario is very similar to the previous one, but has a different origin.
- *
- * Let's assume that you wanted to use CKEditor 5 from source, as explained in the
- * {@glink builds/guides/integration/advanced-setup#scenario-2-building-from-source "Building from source"} section
- * or in the {@glink framework/guides/quick-start "Quick start"} guide of CKEditor 5 Framework.
- *
- * The correct way to do so is to import an editor and plugins and run them together like this:
- *
- * import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
- * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
- * import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
- * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
- * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
- *
- * ClassicEditor
- * .create( document.querySelector( '#editor' ), {
- * plugins: [ Essentials, Paragraph, Bold, Italic ],
- * toolbar: [ 'bold', 'italic' ]
- * } )
- * .then( editor => {
- * console.log( 'Editor was initialized', editor );
- * } )
- * .catch( error => {
- * console.error( error.stack );
- * } );
- *
- * However, you might have mistakenly imported a build instead of the source `ClassicEditor`. In this case
- * your imports will look like this:
- *
- * import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
- * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
- * import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
- * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
- * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
- *
- * This creates the same situation as in the previous section because you use a build together with source plugins.
- *
- * Remember: `@ckeditor/ckeditor5-build-*` packages contain editor builds and `@ckeditor/ckeditor5-editor-*` contain source editors.
- *
- * # Loading two or more builds on one page
- *
- * If you use CKEditor 5 builds, you might have loaded two (or more) `ckeditor.js` files on one web page.
- * Check your web page for duplicated `<script>` elements or make sure your page builder/bundler includes CKEditor only once.
- *
- * If you want to use two different types of editors at once, see the
- * {@glink builds/guides/integration/advanced-setup#scenario-3-using-two-different-editors "Using two different editors"}
- * section.
- *
- * # Using outdated packages
- *
- * Building CKEditor 5 from source requires using multiple npm packages. These packages have their dependencies
- * to other packages. If you use the latest version of, for example, `@ckeditor/ckeditor5-editor-classic` with
- * an outdated version of `@ckeditor/ckeditor5-image`, npm or yarn will need to install two different versions of
- * `@ckeditor/ckeditor5-core` because `@ckeditor/ckeditor5-editor-classic` and `@ckeditor/ckeditor5-image` may require
- * different versions of the core package.
- *
- * The solution to this issue is to update all packages to their latest version. We recommend
- * using tools like [`npm-check-updates`](https://www.npmjs.com/package/npm-check-updates) which simplify this process.
- *
- * # Conflicting version of dependencies
- *
- * This is a special case of the previous scenario. If you use CKEditor 5 with some third-party plugins,
- * it may happen that even if you use the latest versions of the official packages and the latest version of
- * these third-party packages, there will be a conflict between some of their dependencies.
- *
- * Such a problem can be resolved by either downgrading CKEditor 5 packages (which we do not recommend) or
- * asking the author of the third-party package to upgrade its depdendencies (or forking their project and doing this yourself).
- *
- * **Note:** All official CKEditor 5 packages (excluding integrations and `ckeditor5-dev-*` packages) are released in the
- * same major version. This is — in the `x.y.z`, the `x` is the same for all packages. This is the simplest way to check
- * whether you use packages coming from the same CKEditor 5 version. You can read more about versioning in the
- * {@glink framework/guides/support/versioning-policy Versioning policy} guide.
- *
- * # Packages were duplicated in `node_modules`
- *
- * In some situations, especially when calling `npm install` multiple times, it may happen
- * that npm will not correctly "deduplicate" packages.
- *
- * Normally, npm deduplicates all packages so, for example, `@ckeditor/ckeditor5-core` is installed only once in `node_modules/`.
- * However, it is known to fail to do so from time to time.
- *
- * We recommend checking if any of the steps listed below help:
- *
- * * `rm -rf node_modules && npm install` to make sure you have a clean `node_modules/` directory. This step
- * is known to help in most cases.
- * * If you use `yarn.lock` or `package-lock.json`, remove it before `npm install`.
- * * Check whether all CKEditor 5 packages are up to date and reinstall them
- * if you changed anything (`rm -rf node_modules && npm install`).
- *
- * If all packages are correct and compatible with each other, the steps above are known to help. If not, you may
- * try to check with `npm ls` how many times packages like `@ckeditor/ckeditor5-core`, `@ckeditor/ckeditor5-engine` and
- *`@ckeditor/ckeditor5-utils` are installed. If more than once, verify which package causes that.
- *
- * @error ckeditor-duplicated-modules
- */
- throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
- 'ckeditor-duplicated-modules',
- null
- );
- } else {
- windowOrGlobal.CKEDITOR_VERSION = version;
- }
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HighlightStack; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module widget/highlightstack
- */
- /**
- * Class used to handle correct order of highlights on elements.
- *
- * When different highlights are applied to same element correct order should be preserved:
- *
- * * highlight with highest priority should be applied,
- * * if two highlights have same priority - sort by CSS class provided in
- * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
- *
- * This way, highlight will be applied with the same rules it is applied on texts.
- */
- class HighlightStack {
- /**
- * Creates class instance.
- */
- constructor() {
- this._stack = [];
- }
- /**
- * Adds highlight descriptor to the stack.
- *
- * @fires change:top
- * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer
- */
- add( descriptor, writer ) {
- const stack = this._stack;
- // Save top descriptor and insert new one. If top is changed - fire event.
- const oldTop = stack[ 0 ];
- this._insertDescriptor( descriptor );
- const newTop = stack[ 0 ];
- // When new object is at the top and stores different information.
- if ( oldTop !== newTop && !compareDescriptors( oldTop, newTop ) ) {
- this.fire( 'change:top', {
- oldDescriptor: oldTop,
- newDescriptor: newTop,
- writer
- } );
- }
- }
- /**
- * Removes highlight descriptor from the stack.
- *
- * @fires change:top
- * @param {String} id Id of the descriptor to remove.
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer
- */
- remove( id, writer ) {
- const stack = this._stack;
- const oldTop = stack[ 0 ];
- this._removeDescriptor( id );
- const newTop = stack[ 0 ];
- // When new object is at the top and stores different information.
- if ( oldTop !== newTop && !compareDescriptors( oldTop, newTop ) ) {
- this.fire( 'change:top', {
- oldDescriptor: oldTop,
- newDescriptor: newTop,
- writer
- } );
- }
- }
- /**
- * Inserts given descriptor in correct place in the stack. It also takes care about updating information when
- * descriptor with same id is already present.
- *
- * @private
- * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
- */
- _insertDescriptor( descriptor ) {
- const stack = this._stack;
- const index = stack.findIndex( item => item.id === descriptor.id );
- // Inserting exact same descriptor - do nothing.
- if ( compareDescriptors( descriptor, stack[ index ] ) ) {
- return;
- }
- // If descriptor with same id but with different information is on the stack - remove it.
- if ( index > -1 ) {
- stack.splice( index, 1 );
- }
- // Find correct place to insert descriptor in the stack.
- // It have different information (for example priority) so it must be re-inserted in correct place.
- let i = 0;
- while ( stack[ i ] && shouldABeBeforeB( stack[ i ], descriptor ) ) {
- i++;
- }
- stack.splice( i, 0, descriptor );
- }
- /**
- * Removes descriptor with given id from the stack.
- *
- * @private
- * @param {String} id Descriptor's id.
- */
- _removeDescriptor( id ) {
- const stack = this._stack;
- const index = stack.findIndex( item => item.id === id );
- // If descriptor with same id is on the list - remove it.
- if ( index > -1 ) {
- stack.splice( index, 1 );
- }
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( HighlightStack, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
- // Compares two descriptors by checking their priority and class list.
- //
- // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} a
- // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} b
- // @returns {Boolean} Returns true if both descriptors are defined and have same priority and classes.
- function compareDescriptors( a, b ) {
- return a && b && a.priority == b.priority && classesToString( a.classes ) == classesToString( b.classes );
- }
- // Checks whenever first descriptor should be placed in the stack before second one.
- //
- // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} a
- // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} b
- // @returns {Boolean}
- function shouldABeBeforeB( a, b ) {
- if ( a.priority > b.priority ) {
- return true;
- } else if ( a.priority < b.priority ) {
- return false;
- }
- // When priorities are equal and names are different - use classes to compare.
- return classesToString( a.classes ) > classesToString( b.classes );
- }
- // Converts CSS classes passed with {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} to
- // sorted string.
- //
- // @param {String|Array<String>} descriptor
- // @returns {String}
- function classesToString( classes ) {
- return Array.isArray( classes ) ? classes.sort().join( ',' ) : classes;
- }
- /**
- * Fired when top element on {@link module:widget/highlightstack~HighlightStack} has been changed
- *
- * @event change:top
- * @param {Object} data Additional information about the change.
- * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} [data.newDescriptor] New highlight
- * descriptor. It will be `undefined` when last descriptor is removed from the stack.
- * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} [data.oldDescriptor] Old highlight
- * descriptor. It will be `undefined` when first descriptor is added to the stack.
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that can be used to modify element.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/index.js":
- /*!**************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/src/index.js ***!
- \**************************************************************/
- /*! exports provided: Widget, WidgetToolbarRepository, WidgetResize, WidgetTypeAround, WIDGET_CLASS_NAME, WIDGET_SELECTED_CLASS_NAME, isWidget, toWidget, setHighlightHandling, setLabel, getLabel, toWidgetEditable, findOptimalInsertionPosition, checkSelectionOnObject, viewToModelPositionOutsideModelElement, centeredBalloonPositionForLongWidgets */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./widget */ "./node_modules/@ckeditor/ckeditor5-widget/src/widget.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Widget", function() { return _widget__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _widgettoolbarrepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./widgettoolbarrepository */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetToolbarRepository", function() { return _widgettoolbarrepository__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _widgetresize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./widgetresize */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetResize", function() { return _widgetresize__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./widgettypearound/widgettypearound */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetTypeAround", function() { return _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WIDGET_CLASS_NAME", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["WIDGET_CLASS_NAME"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WIDGET_SELECTED_CLASS_NAME", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["WIDGET_SELECTED_CLASS_NAME"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWidget", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toWidget", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["toWidget"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setHighlightHandling", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["setHighlightHandling"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setLabel", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["setLabel"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLabel", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["getLabel"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toWidgetEditable", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["toWidgetEditable"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findOptimalInsertionPosition", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["findOptimalInsertionPosition"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "checkSelectionOnObject", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["checkSelectionOnObject"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "viewToModelPositionOutsideModelElement", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["viewToModelPositionOutsideModelElement"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "centeredBalloonPositionForLongWidgets", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["centeredBalloonPositionForLongWidgets"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js":
- /*!**************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/src/utils.js ***!
- \**************************************************************/
- /*! exports provided: WIDGET_CLASS_NAME, WIDGET_SELECTED_CLASS_NAME, isWidget, toWidget, setHighlightHandling, setLabel, getLabel, toWidgetEditable, findOptimalInsertionPosition, checkSelectionOnObject, viewToModelPositionOutsideModelElement, centeredBalloonPositionForLongWidgets */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WIDGET_CLASS_NAME", function() { return WIDGET_CLASS_NAME; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WIDGET_SELECTED_CLASS_NAME", function() { return WIDGET_SELECTED_CLASS_NAME; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWidget", function() { return isWidget; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toWidget", function() { return toWidget; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setHighlightHandling", function() { return setHighlightHandling; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLabel", function() { return setLabel; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLabel", function() { return getLabel; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toWidgetEditable", function() { return toWidgetEditable; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findOptimalInsertionPosition", function() { return findOptimalInsertionPosition; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkSelectionOnObject", function() { return checkSelectionOnObject; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewToModelPositionOutsideModelElement", function() { return viewToModelPositionOutsideModelElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "centeredBalloonPositionForLongWidgets", function() { return centeredBalloonPositionForLongWidgets; });
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
- /* harmony import */ var _highlightstack__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./highlightstack */ "./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js");
- /* harmony import */ var _widgettypearound_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./widgettypearound/utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js");
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_icon_iconview__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
- /* harmony import */ var _theme_icons_drag_handle_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/icons/drag-handle.svg */ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module widget/utils
- */
- /**
- * CSS class added to each widget element.
- *
- * @const {String}
- */
- const WIDGET_CLASS_NAME = 'ck-widget';
- /**
- * CSS class added to currently selected widget element.
- *
- * @const {String}
- */
- const WIDGET_SELECTED_CLASS_NAME = 'ck-widget_selected';
- /**
- * Returns `true` if given {@link module:engine/view/node~Node} is an {@link module:engine/view/element~Element} and a widget.
- *
- * @param {module:engine/view/node~Node} node
- * @returns {Boolean}
- */
- function isWidget( node ) {
- if ( !node.is( 'element' ) ) {
- return false;
- }
- return !!node.getCustomProperty( 'widget' );
- }
- /**
- * Converts the given {@link module:engine/view/element~Element} to a widget in the following way:
- *
- * * sets the `contenteditable` attribute to `"false"`,
- * * adds the `ck-widget` CSS class,
- * * adds a custom {@link module:engine/view/element~Element#getFillerOffset `getFillerOffset()`} method returning `null`,
- * * adds a custom property allowing to recognize widget elements by using {@link ~isWidget `isWidget()`},
- * * implements the {@link ~setHighlightHandling view highlight on widgets}.
- *
- * This function needs to be used in conjunction with
- * {@link module:engine/conversion/downcasthelpers~DowncastHelpers downcast conversion helpers}
- * like {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
- * Moreover, typically you will want to use `toWidget()` only for `editingDowncast`, while keeping the `dataDowncast` clean.
- *
- * For example, in order to convert a `<widget>` model element to `<div class="widget">` in the view, you can define
- * such converters:
- *
- * editor.conversion.for( 'editingDowncast' )
- * .elementToElement( {
- * model: 'widget',
- * view: ( modelItem, { writer } ) => {
- * const div = writer.createContainerElement( 'div', { class: 'widget' } );
- *
- * return toWidget( div, writer, { label: 'some widget' } );
- * }
- * } );
- *
- * editor.conversion.for( 'dataDowncast' )
- * .elementToElement( {
- * model: 'widget',
- * view: ( modelItem, { writer } ) => {
- * return writer.createContainerElement( 'div', { class: 'widget' } );
- * }
- * } );
- *
- * See the full source code of the widget (with a nested editable) schema definition and converters in
- * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).
- *
- * @param {module:engine/view/element~Element} element
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer
- * @param {Object} [options={}]
- * @param {String|Function} [options.label] Element's label provided to the {@link ~setLabel} function. It can be passed as
- * a plain string or a function returning a string. It represents the widget for assistive technologies (like screen readers).
- * @param {Boolean} [options.hasSelectionHandle=false] If `true`, the widget will have a selection handle added.
- * @returns {module:engine/view/element~Element} Returns the same element.
- */
- function toWidget( element, writer, options = {} ) {
- if ( !element.is( 'containerElement' ) ) {
- /**
- * The element passed to `toWidget()` must be a {@link module:engine/view/containerelement~ContainerElement}
- * instance.
- *
- * @error widget-to-widget-wrong-element-type
- * @param {String} element The view element passed to `toWidget()`.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
- 'widget-to-widget-wrong-element-type',
- null,
- { element }
- );
- }
- writer.setAttribute( 'contenteditable', 'false', element );
- writer.addClass( WIDGET_CLASS_NAME, element );
- writer.setCustomProperty( 'widget', true, element );
- element.getFillerOffset = getFillerOffset;
- if ( options.label ) {
- setLabel( element, options.label, writer );
- }
- if ( options.hasSelectionHandle ) {
- addSelectionHandle( element, writer );
- }
- setHighlightHandling( element, writer, addHighlight, removeHighlight );
- return element;
- }
- // Default handler for adding a highlight on a widget.
- // It adds CSS class and attributes basing on the given highlight descriptor.
- //
- // @param {module:engine/view/element~Element} element
- // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- function addHighlight( element, descriptor, writer ) {
- if ( descriptor.classes ) {
- writer.addClass( Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( descriptor.classes ), element );
- }
- if ( descriptor.attributes ) {
- for ( const key in descriptor.attributes ) {
- writer.setAttribute( key, descriptor.attributes[ key ], element );
- }
- }
- }
- // Default handler for removing a highlight from a widget.
- // It removes CSS class and attributes basing on the given highlight descriptor.
- //
- // @param {module:engine/view/element~Element} element
- // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- function removeHighlight( element, descriptor, writer ) {
- if ( descriptor.classes ) {
- writer.removeClass( Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( descriptor.classes ), element );
- }
- if ( descriptor.attributes ) {
- for ( const key in descriptor.attributes ) {
- writer.removeAttribute( key, element );
- }
- }
- }
- /**
- * Sets highlight handling methods. Uses {@link module:widget/highlightstack~HighlightStack} to
- * properly determine which highlight descriptor should be used at given time.
- *
- * @param {module:engine/view/element~Element} element
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer
- * @param {Function} add
- * @param {Function} remove
- */
- function setHighlightHandling( element, writer, add, remove ) {
- const stack = new _highlightstack__WEBPACK_IMPORTED_MODULE_5__["default"]();
- stack.on( 'change:top', ( evt, data ) => {
- if ( data.oldDescriptor ) {
- remove( element, data.oldDescriptor, data.writer );
- }
- if ( data.newDescriptor ) {
- add( element, data.newDescriptor, data.writer );
- }
- } );
- writer.setCustomProperty( 'addHighlight', ( element, descriptor, writer ) => stack.add( descriptor, writer ), element );
- writer.setCustomProperty( 'removeHighlight', ( element, id, writer ) => stack.remove( id, writer ), element );
- }
- /**
- * Sets label for given element.
- * It can be passed as a plain string or a function returning a string. Function will be called each time label is retrieved by
- * {@link ~getLabel `getLabel()`}.
- *
- * @param {module:engine/view/element~Element} element
- * @param {String|Function} labelOrCreator
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer
- */
- function setLabel( element, labelOrCreator, writer ) {
- writer.setCustomProperty( 'widgetLabel', labelOrCreator, element );
- }
- /**
- * Returns the label of the provided element.
- *
- * @param {module:engine/view/element~Element} element
- * @returns {String}
- */
- function getLabel( element ) {
- const labelCreator = element.getCustomProperty( 'widgetLabel' );
- if ( !labelCreator ) {
- return '';
- }
- return typeof labelCreator == 'function' ? labelCreator() : labelCreator;
- }
- /**
- * Adds functionality to the provided {@link module:engine/view/editableelement~EditableElement} to act as a widget's editable:
- *
- * * sets the `contenteditable` attribute to `true` when {@link module:engine/view/editableelement~EditableElement#isReadOnly} is `false`,
- * otherwise sets it to `false`,
- * * adds the `ck-editor__editable` and `ck-editor__nested-editable` CSS classes,
- * * adds the `ck-editor__nested-editable_focused` CSS class when the editable is focused and removes it when it is blurred.
- *
- * Similarly to {@link ~toWidget `toWidget()`} this function should be used in `editingDowncast` only and it is usually
- * used together with {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
- *
- * For example, in order to convert a `<nested>` model element to `<div class="nested">` in the view, you can define
- * such converters:
- *
- * editor.conversion.for( 'editingDowncast' )
- * .elementToElement( {
- * model: 'nested',
- * view: ( modelItem, { writer } ) => {
- * const div = writer.createEditableElement( 'div', { class: 'nested' } );
- *
- * return toWidgetEditable( nested, writer );
- * }
- * } );
- *
- * editor.conversion.for( 'dataDowncast' )
- * .elementToElement( {
- * model: 'nested',
- * view: ( modelItem, { writer } ) => {
- * return writer.createContainerElement( 'div', { class: 'nested' } );
- * }
- * } );
- *
- * See the full source code of the widget (with nested editable) schema definition and converters in
- * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).
- *
- * @param {module:engine/view/editableelement~EditableElement} editable
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer
- * @returns {module:engine/view/editableelement~EditableElement} Returns the same element that was provided in the `editable` parameter
- */
- function toWidgetEditable( editable, writer ) {
- writer.addClass( [ 'ck-editor__editable', 'ck-editor__nested-editable' ], editable );
- // Set initial contenteditable value.
- writer.setAttribute( 'contenteditable', editable.isReadOnly ? 'false' : 'true', editable );
- // Bind the contenteditable property to element#isReadOnly.
- editable.on( 'change:isReadOnly', ( evt, property, is ) => {
- writer.setAttribute( 'contenteditable', is ? 'false' : 'true', editable );
- } );
- editable.on( 'change:isFocused', ( evt, property, is ) => {
- if ( is ) {
- writer.addClass( 'ck-editor__nested-editable_focused', editable );
- } else {
- writer.removeClass( 'ck-editor__nested-editable_focused', editable );
- }
- } );
- return editable;
- }
- /**
- * Returns a model position which is optimal (in terms of UX) for inserting a widget block.
- *
- * For instance, if a selection is in the middle of a paragraph, the position before this paragraph
- * will be returned so that it is not split. If the selection is at the end of a paragraph,
- * the position after this paragraph will be returned.
- *
- * Note: If the selection is placed in an empty block, that block will be returned. If that position
- * is then passed to {@link module:engine/model/model~Model#insertContent},
- * the block will be fully replaced by the image.
- *
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- * The selection based on which the insertion position should be calculated.
- * @param {module:engine/model/model~Model} model Model instance.
- * @returns {module:engine/model/position~Position} The optimal position.
- */
- function findOptimalInsertionPosition( selection, model ) {
- const selectedElement = selection.getSelectedElement();
- if ( selectedElement ) {
- const typeAroundFakeCaretPosition = Object(_widgettypearound_utils__WEBPACK_IMPORTED_MODULE_6__["getTypeAroundFakeCaretPosition"])( selection );
- // If the WidgetTypeAround "fake caret" is displayed, use its position for the insertion
- // to provide the most predictable UX (https://github.com/ckeditor/ckeditor5/issues/7438).
- if ( typeAroundFakeCaretPosition ) {
- return model.createPositionAt( selectedElement, typeAroundFakeCaretPosition );
- }
- if ( model.schema.isBlock( selectedElement ) ) {
- return model.createPositionAfter( selectedElement );
- }
- }
- const firstBlock = selection.getSelectedBlocks().next().value;
- if ( firstBlock ) {
- // If inserting into an empty block – return position in that block. It will get
- // replaced with the image by insertContent(). #42.
- if ( firstBlock.isEmpty ) {
- return model.createPositionAt( firstBlock, 0 );
- }
- const positionAfter = model.createPositionAfter( firstBlock );
- // If selection is at the end of the block - return position after the block.
- if ( selection.focus.isTouching( positionAfter ) ) {
- return positionAfter;
- }
- // Otherwise return position before the block.
- return model.createPositionBefore( firstBlock );
- }
- return selection.focus;
- }
- /**
- * Checks if the selection is on an object.
- *
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- * @param {module:engine/model/schema~Schema} schema
- * @returns {Boolean}
- */
- function checkSelectionOnObject( selection, schema ) {
- const selectedElement = selection.getSelectedElement();
- return !!selectedElement && schema.isObject( selectedElement );
- }
- /**
- * A util to be used in order to map view positions to correct model positions when implementing a widget
- * which renders non-empty view element for an empty model element.
- *
- * For example:
- *
- * // Model:
- * <placeholder type="name"></placeholder>
- *
- * // View:
- * <span class="placeholder">name</span>
- *
- * In such case, view positions inside `<span>` cannot be correct mapped to the model (because the model element is empty).
- * To handle mapping positions inside `<span class="placeholder">` to the model use this util as follows:
- *
- * editor.editing.mapper.on(
- * 'viewToModelPosition',
- * viewToModelPositionOutsideModelElement( model, viewElement => viewElement.hasClass( 'placeholder' ) )
- * );
- *
- * The callback will try to map the view offset of selection to an expected model position.
- *
- * 1. When the position is at the end (or in the middle) of the inline widget:
- *
- * // View:
- * <p>foo <span class="placeholder">name|</span> bar</p>
- *
- * // Model:
- * <paragraph>foo <placeholder type="name"></placeholder>| bar</paragraph>
- *
- * 2. When the position is at the beginning of the inline widget:
- *
- * // View:
- * <p>foo <span class="placeholder">|name</span> bar</p>
- *
- * // Model:
- * <paragraph>foo |<placeholder type="name"></placeholder> bar</paragraph>
- *
- * @param {module:engine/model/model~Model} model Model instance on which the callback operates.
- * @param {Function} viewElementMatcher Function that is passed a view element and should return `true` if the custom mapping
- * should be applied to the given view element.
- * @return {Function}
- */
- function viewToModelPositionOutsideModelElement( model, viewElementMatcher ) {
- return ( evt, data ) => {
- const { mapper, viewPosition } = data;
- const viewParent = mapper.findMappedViewAncestor( viewPosition );
- if ( !viewElementMatcher( viewParent ) ) {
- return;
- }
- const modelParent = mapper.toModelElement( viewParent );
- data.modelPosition = model.createPositionAt( modelParent, viewPosition.isAtStart ? 'before' : 'after' );
- };
- }
- /**
- * A positioning function passed to the {@link module:utils/dom/position~getOptimalPosition} helper as a last resort
- * when attaching {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView balloon UI} to widgets.
- * It comes in handy when a widget is longer than the visual viewport of the web browser and/or upper/lower boundaries
- * of a widget are off screen because of the web page scroll.
- *
- * ┌─┄┄┄┄┄┄┄┄┄Widget┄┄┄┄┄┄┄┄┄┐
- * ┊ ┊
- * ┌────────────Viewport───────────┐ ┌──╁─────────Viewport────────╁──┐
- * │ ┏━━━━━━━━━━Widget━━━━━━━━━┓ │ │ ┃ ^ ┃ │
- * │ ┃ ^ ┃ │ │ ┃ ╭───────/ \───────╮ ┃ │
- * │ ┃ ╭───────/ \───────╮ ┃ │ │ ┃ │ Balloon │ ┃ │
- * │ ┃ │ Balloon │ ┃ │ │ ┃ ╰─────────────────╯ ┃ │
- * │ ┃ ╰─────────────────╯ ┃ │ │ ┃ ┃ │
- * │ ┃ ┃ │ │ ┃ ┃ │
- * │ ┃ ┃ │ │ ┃ ┃ │
- * │ ┃ ┃ │ │ ┃ ┃ │
- * │ ┃ ┃ │ │ ┃ ┃ │
- * │ ┃ ┃ │ │ ┃ ┃ │
- * │ ┃ ┃ │ │ ┃ ┃ │
- * └──╀─────────────────────────╀──┘ └──╀─────────────────────────╀──┘
- * ┊ ┊ ┊ ┊
- * ┊ ┊ └┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
- * ┊ ┊
- * └┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
- *
- * **Note**: Works best if used together with
- * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions default `BalloonPanelView` positions}
- * like `northArrowSouth` and `southArrowNorth`; the transition between these two and this position is smooth.
- *
- * @param {module:utils/dom/rect~Rect} widgetRect A rect of the widget.
- * @param {module:utils/dom/rect~Rect} balloonRect A rect of the balloon.
- * @returns {module:utils/dom/position~Position|null}
- */
- function centeredBalloonPositionForLongWidgets( widgetRect, balloonRect ) {
- const viewportRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__["default"]( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_1__["default"].window );
- const viewportWidgetInsersectionRect = viewportRect.getIntersection( widgetRect );
- const balloonTotalHeight = balloonRect.height + _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_0__["default"].arrowVerticalOffset;
- // If there is enough space above or below the widget then this position should not be used.
- if ( widgetRect.top - balloonTotalHeight > viewportRect.top || widgetRect.bottom + balloonTotalHeight < viewportRect.bottom ) {
- return null;
- }
- // Because this is a last resort positioning, to keep things simple we're not playing with positions of the arrow
- // like, for instance, "south west" or whatever. Just try to keep the balloon in the middle of the visible area of
- // the widget for as long as it is possible. If the widgets becomes invisible (because cropped by the viewport),
- // just... place the balloon in the middle of it (because why not?).
- const targetRect = viewportWidgetInsersectionRect || widgetRect;
- const left = targetRect.left + targetRect.width / 2 - balloonRect.width / 2;
- return {
- top: Math.max( widgetRect.top, 0 ) + _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_0__["default"].arrowVerticalOffset,
- left,
- name: 'arrow_n'
- };
- }
- // Default filler offset function applied to all widget elements.
- //
- // @returns {null}
- function getFillerOffset() {
- return null;
- }
- // Adds a drag handle to the widget.
- //
- // @param {module:engine/view/containerelement~ContainerElement}
- // @param {module:engine/view/downcastwriter~DowncastWriter} writer
- function addSelectionHandle( widgetElement, writer ) {
- const selectionHandle = writer.createUIElement( 'div', { class: 'ck ck-widget__selection-handle' }, function( domDocument ) {
- const domElement = this.toDomElement( domDocument );
- // Use the IconView from the ui library.
- const icon = new _ckeditor_ckeditor5_ui_src_icon_iconview__WEBPACK_IMPORTED_MODULE_7__["default"]();
- icon.set( 'content', _theme_icons_drag_handle_svg__WEBPACK_IMPORTED_MODULE_8__["default"] );
- // Render the icon view right away to append its #element to the selectionHandle DOM element.
- icon.render();
- domElement.appendChild( icon.element );
- return domElement;
- } );
- // Append the selection handle into the widget wrapper.
- writer.insert( writer.createPositionAt( widgetElement, 0 ), selectionHandle );
- writer.addClass( [ 'ck-widget_with-selection-handle' ], widgetElement );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return verticalNavigationHandler; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module widget/verticalnavigationhandler
- */
- /**
- * Returns 'keydown' handler for up/down arrow keys that modifies the caret movement if it's in a text line next to an object.
- *
- * @param {module:engine/controller/editingcontroller~EditingController} editing The editing controller.
- * @returns {Function}
- */
- function verticalNavigationHandler( editing ) {
- const model = editing.model;
- return ( evt, data ) => {
- const arrowUpPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].arrowup;
- const arrowDownPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].arrowdown;
- const expandSelection = data.shiftKey;
- const selection = model.document.selection;
- if ( !arrowUpPressed && !arrowDownPressed ) {
- return;
- }
- const isForward = arrowDownPressed;
- // Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.
- // Selection for sure will not approach any object.
- if ( expandSelection && selectionWillShrink( selection, isForward ) ) {
- return;
- }
- // Find a range between selection and closest limit element.
- const range = findTextRangeFromSelection( editing, selection, isForward );
- if ( !range || range.isCollapsed ) {
- return;
- }
- // If the range is a single line (there is no word wrapping) then move the selection to the position closest to the limit element.
- //
- // We can't move the selection directly to the isObject element (eg. table cell) because of dual position at the end/beginning
- // of wrapped line (it's at the same time at the end of one line and at the start of the next line).
- if ( isSingleLineRange( editing, range, isForward ) ) {
- model.change( writer => {
- const newPosition = isForward ? range.end : range.start;
- if ( expandSelection ) {
- const newSelection = model.createSelection( selection.anchor );
- newSelection.setFocus( newPosition );
- writer.setSelection( newSelection );
- } else {
- writer.setSelection( newPosition );
- }
- } );
- evt.stop();
- data.preventDefault();
- data.stopPropagation();
- }
- };
- }
- // Finds the range between selection and closest limit element (in the direction of navigation).
- // The position next to limit element is adjusted to the closest allowed `$text` position.
- //
- // Returns `null` if, according to the schema, the resulting range cannot contain a `$text` element.
- //
- // @param {module:engine/controller/editingcontroller~EditingController} editing The editing controller.
- // @param {module:engine/model/selection~Selection} selection The current selection.
- // @param {Boolean} isForward The expected navigation direction.
- // @returns {module:engine/model/range~Range|null}
- //
- function findTextRangeFromSelection( editing, selection, isForward ) {
- const model = editing.model;
- if ( isForward ) {
- const startPosition = selection.isCollapsed ? selection.focus : selection.getLastPosition();
- const endPosition = getNearestNonInlineLimit( model, startPosition, 'forward' );
- // There is no limit element, browser should handle this.
- if ( !endPosition ) {
- return null;
- }
- const range = model.createRange( startPosition, endPosition );
- const lastRangePosition = getNearestTextPosition( model.schema, range, 'backward' );
- if ( lastRangePosition && startPosition.isBefore( lastRangePosition ) ) {
- return model.createRange( startPosition, lastRangePosition );
- }
- return null;
- } else {
- const endPosition = selection.isCollapsed ? selection.focus : selection.getFirstPosition();
- const startPosition = getNearestNonInlineLimit( model, endPosition, 'backward' );
- // There is no limit element, browser should handle this.
- if ( !startPosition ) {
- return null;
- }
- const range = model.createRange( startPosition, endPosition );
- const firstRangePosition = getNearestTextPosition( model.schema, range, 'forward' );
- if ( firstRangePosition && endPosition.isAfter( firstRangePosition ) ) {
- return model.createRange( firstRangePosition, endPosition );
- }
- return null;
- }
- }
- // Finds the limit element position that is closest to startPosition.
- //
- // @param {module:engine/model/model~Model} model
- // @param {<module:engine/model/position~Position>} startPosition
- // @param {'forward'|'backward'} direction Search direction.
- // @returns {<module:engine/model/position~Position>|null}
- //
- function getNearestNonInlineLimit( model, startPosition, direction ) {
- const schema = model.schema;
- const range = model.createRangeIn( startPosition.root );
- const walkerValueType = direction == 'forward' ? 'elementStart' : 'elementEnd';
- for ( const { previousPosition, item, type } of range.getWalker( { startPosition, direction } ) ) {
- if ( schema.isLimit( item ) && !schema.isInline( item ) ) {
- return previousPosition;
- }
- // Stop looking for isLimit element if the next element is a block element (it is for sure not single line).
- if ( type == walkerValueType && schema.isBlock( item ) ) {
- return null;
- }
- }
- return null;
- }
- // Basing on the provided range, finds the first or last (depending on `direction`) position inside the range
- // that can contain `$text` (according to schema).
- //
- // @param {module:engine/model/schema~Schema} schema The schema.
- // @param {module:engine/model/range~Range} range The range to find the position in.
- // @param {'forward'|'backward'} direction Search direction.
- // @returns {module:engine/model/position~Position} The nearest selection range.
- //
- function getNearestTextPosition( schema, range, direction ) {
- const position = direction == 'backward' ? range.end : range.start;
- if ( schema.checkChild( position, '$text' ) ) {
- return position;
- }
- for ( const { nextPosition } of range.getWalker( { direction } ) ) {
- if ( schema.checkChild( nextPosition, '$text' ) ) {
- return nextPosition;
- }
- }
- }
- // Checks if the DOM range corresponding to the provided model range renders as a single line by analyzing DOMRects
- // (verifying if they visually wrap content to the next line).
- //
- // @param {module:engine/controller/editingcontroller~EditingController} editing The editing controller.
- // @param {module:engine/model/range~Range} modelRange The current table cell content range.
- // @param {Boolean} isForward The expected navigation direction.
- // @returns {Boolean}
- //
- function isSingleLineRange( editing, modelRange, isForward ) {
- const model = editing.model;
- const domConverter = editing.view.domConverter;
- // Wrapped lines contain exactly the same position at the end of current line
- // and at the beginning of next line. That position's client rect is at the end
- // of current line. In case of caret at first position of the last line that 'dual'
- // position would be detected as it's not the last line.
- if ( isForward ) {
- const probe = model.createSelection( modelRange.start );
- model.modifySelection( probe );
- // If the new position is at the end of the container then we can't use this position
- // because it would provide incorrect result for eg caption of image and selection
- // just before end of it. Also in this case there is no "dual" position.
- if ( !probe.focus.isAtEnd && !modelRange.start.isEqual( probe.focus ) ) {
- modelRange = model.createRange( probe.focus, modelRange.end );
- }
- }
- const viewRange = editing.mapper.toViewRange( modelRange );
- const domRange = domConverter.viewRangeToDom( viewRange );
- const rects = _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_1__["default"].getDomRangeRects( domRange );
- let boundaryVerticalPosition;
- for ( const rect of rects ) {
- if ( boundaryVerticalPosition === undefined ) {
- boundaryVerticalPosition = Math.round( rect.bottom );
- continue;
- }
- // Let's check if this rect is in new line.
- if ( Math.round( rect.top ) >= boundaryVerticalPosition ) {
- return false;
- }
- boundaryVerticalPosition = Math.max( boundaryVerticalPosition, Math.round( rect.bottom ) );
- }
- return true;
- }
- function selectionWillShrink( selection, isForward ) {
- return !selection.isCollapsed && selection.isBackward == isForward;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widget.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widget.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Widget; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
- /* harmony import */ var _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./widgettypearound/widgettypearound */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js");
- /* harmony import */ var _ckeditor_ckeditor5_typing_src_delete__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
- /* harmony import */ var _theme_widget_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../theme/widget.css */ "./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css");
- /* harmony import */ var _theme_widget_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_theme_widget_css__WEBPACK_IMPORTED_MODULE_7__);
- /* harmony import */ var _verticalnavigation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./verticalnavigation */ "./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module widget/widget
- */
- /**
- * The widget plugin. It enables base support for widgets.
- *
- * See {@glink api/widget package page} for more details and documentation.
- *
- * This plugin enables multiple behaviors required by widgets:
- *
- * * The model to view selection converter for the editing pipeline (it handles widget custom selection rendering).
- * If a converted selection wraps around a widget element, that selection is marked as
- * {@link module:engine/view/selection~Selection#isFake fake}. Additionally, the `ck-widget_selected` CSS class
- * is added to indicate that widget has been selected.
- * * The mouse and keyboard events handling on and around widget elements.
- *
- * @extends module:core/plugin~Plugin
- */
- class Widget extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'Widget';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_2__["default"], _ckeditor_ckeditor5_typing_src_delete__WEBPACK_IMPORTED_MODULE_3__["default"] ];
- }
- /**
- * @inheritDoc
- */
- init() {
- const view = this.editor.editing.view;
- const viewDocument = view.document;
- /**
- * Holds previously selected widgets.
- *
- * @private
- * @type {Set.<module:engine/view/element~Element>}
- */
- this._previouslySelected = new Set();
- // Model to view selection converter.
- // Converts selection placed over widget element to fake selection
- this.editor.editing.downcastDispatcher.on( 'selection', ( evt, data, conversionApi ) => {
- // Remove selected class from previously selected widgets.
- this._clearPreviouslySelectedWidgets( conversionApi.writer );
- const viewWriter = conversionApi.writer;
- const viewSelection = viewWriter.document.selection;
- const selectedElement = viewSelection.getSelectedElement();
- let lastMarked = null;
- for ( const range of viewSelection.getRanges() ) {
- for ( const value of range ) {
- const node = value.item;
- // Do not mark nested widgets in selected one. See: #57.
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"])( node ) && !isChild( node, lastMarked ) ) {
- viewWriter.addClass( _utils__WEBPACK_IMPORTED_MODULE_4__["WIDGET_SELECTED_CLASS_NAME"], node );
- this._previouslySelected.add( node );
- lastMarked = node;
- // Check if widget is a single element selected.
- if ( node == selectedElement ) {
- viewWriter.setSelection( viewSelection.getRanges(), { fake: true, label: Object(_utils__WEBPACK_IMPORTED_MODULE_4__["getLabel"])( selectedElement ) } );
- }
- }
- }
- }
- }, { priority: 'low' } );
- // If mouse down is pressed on widget - create selection over whole widget.
- view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
- this.listenTo( viewDocument, 'mousedown', ( ...args ) => this._onMousedown( ...args ) );
- // There are two keydown listeners working on different priorities. This allows other
- // features such as WidgetTypeAround or TableKeyboard to attach their listeners in between
- // and customize the behavior even further in different content/selection scenarios.
- //
- // * The first listener handles changing the selection on arrow key press
- // if the widget is selected or if the selection is next to a widget and the widget
- // should become selected upon the arrow key press.
- //
- // * The second (late) listener makes sure the default browser action on arrow key press is
- // prevented when a widget is selected. This prevents the selection from being moved
- // from a fake selection container.
- this.listenTo( viewDocument, 'arrowKey', ( ...args ) => {
- this._handleSelectionChangeOnArrowKeyPress( ...args );
- }, { context: [ _utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"], '$text' ] } );
- this.listenTo( viewDocument, 'arrowKey', ( ...args ) => {
- this._preventDefaultOnArrowKeyPress( ...args );
- }, { context: '$root' } );
- this.listenTo( viewDocument, 'arrowKey', Object(_verticalnavigation__WEBPACK_IMPORTED_MODULE_8__["default"])( this.editor.editing ), { context: '$text' } );
- // Handle custom delete behaviour.
- this.listenTo( viewDocument, 'delete', ( evt, data ) => {
- if ( this._handleDelete( data.direction == 'forward' ) ) {
- data.preventDefault();
- evt.stop();
- }
- }, { context: '$root' } );
- }
- /**
- * Handles {@link module:engine/view/document~Document#event:mousedown mousedown} events on widget elements.
- *
- * @private
- * @param {module:utils/eventinfo~EventInfo} eventInfo
- * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
- */
- _onMousedown( eventInfo, domEventData ) {
- const editor = this.editor;
- const view = editor.editing.view;
- const viewDocument = view.document;
- let element = domEventData.target;
- // Do nothing for single or double click inside nested editable.
- if ( isInsideNestedEditable( element ) ) {
- // But at least triple click inside nested editable causes broken selection in Safari.
- // For such event, we select the entire nested editable element.
- // See: https://github.com/ckeditor/ckeditor5/issues/1463.
- if ( ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_6__["default"].isSafari || _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_6__["default"].isGecko ) && domEventData.domEvent.detail >= 3 ) {
- const mapper = editor.editing.mapper;
- const viewElement = element.is( 'attributeElement' ) ?
- element.findAncestor( element => !element.is( 'attributeElement' ) ) : element;
- const modelElement = mapper.toModelElement( viewElement );
- domEventData.preventDefault();
- this.editor.model.change( writer => {
- writer.setSelection( modelElement, 'in' );
- } );
- }
- return;
- }
- // If target is not a widget element - check if one of the ancestors is.
- if ( !Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"])( element ) ) {
- element = element.findAncestor( _utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"] );
- if ( !element ) {
- return;
- }
- }
- // On Android selection would jump to the first table cell, on other devices
- // we can't block it (and don't need to) because of drag and drop support.
- if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_6__["default"].isAndroid ) {
- domEventData.preventDefault();
- }
- // Focus editor if is not focused already.
- if ( !viewDocument.isFocused ) {
- view.focus();
- }
- // Create model selection over widget.
- const modelElement = editor.editing.mapper.toModelElement( element );
- this._setSelectionOverElement( modelElement );
- }
- /**
- * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and changes
- * the model selection when:
- *
- * * arrow key is pressed when the widget is selected,
- * * the selection is next to a widget and the widget should become selected upon the arrow key press.
- *
- * See {@link #_preventDefaultOnArrowKeyPress}.
- *
- * @private
- * @param {module:utils/eventinfo~EventInfo} eventInfo
- * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
- */
- _handleSelectionChangeOnArrowKeyPress( eventInfo, domEventData ) {
- const keyCode = domEventData.keyCode;
- const model = this.editor.model;
- const schema = model.schema;
- const modelSelection = model.document.selection;
- const objectElement = modelSelection.getSelectedElement();
- const isForward = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_5__["isForwardArrowKeyCode"])( keyCode, this.editor.locale.contentLanguageDirection );
- // If object element is selected.
- if ( objectElement && schema.isObject( objectElement ) ) {
- const position = isForward ? modelSelection.getLastPosition() : modelSelection.getFirstPosition();
- const newRange = schema.getNearestSelectionRange( position, isForward ? 'forward' : 'backward' );
- if ( newRange ) {
- model.change( writer => {
- writer.setSelection( newRange );
- } );
- domEventData.preventDefault();
- eventInfo.stop();
- }
- return;
- }
- // If selection is next to object element.
- // Return if not collapsed.
- if ( !modelSelection.isCollapsed ) {
- return;
- }
- const objectElementNextToSelection = this._getObjectElementNextToSelection( isForward );
- if ( objectElementNextToSelection && schema.isObject( objectElementNextToSelection ) ) {
- this._setSelectionOverElement( objectElementNextToSelection );
- domEventData.preventDefault();
- eventInfo.stop();
- }
- }
- /**
- * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and prevents
- * the default browser behavior to make sure the fake selection is not being moved from a fake selection
- * container.
- *
- * See {@link #_handleSelectionChangeOnArrowKeyPress}.
- *
- * @private
- * @param {module:utils/eventinfo~EventInfo} eventInfo
- * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
- */
- _preventDefaultOnArrowKeyPress( eventInfo, domEventData ) {
- const model = this.editor.model;
- const schema = model.schema;
- const objectElement = model.document.selection.getSelectedElement();
- // If object element is selected.
- if ( objectElement && schema.isObject( objectElement ) ) {
- domEventData.preventDefault();
- eventInfo.stop();
- }
- }
- /**
- * Handles delete keys: backspace and delete.
- *
- * @private
- * @param {Boolean} isForward Set to true if delete was performed in forward direction.
- * @returns {Boolean|undefined} Returns `true` if keys were handled correctly.
- */
- _handleDelete( isForward ) {
- // Do nothing when the read only mode is enabled.
- if ( this.editor.isReadOnly ) {
- return;
- }
- const modelDocument = this.editor.model.document;
- const modelSelection = modelDocument.selection;
- // Do nothing on non-collapsed selection.
- if ( !modelSelection.isCollapsed ) {
- return;
- }
- const objectElement = this._getObjectElementNextToSelection( isForward );
- if ( objectElement ) {
- this.editor.model.change( writer => {
- let previousNode = modelSelection.anchor.parent;
- // Remove previous element if empty.
- while ( previousNode.isEmpty ) {
- const nodeToRemove = previousNode;
- previousNode = nodeToRemove.parent;
- writer.remove( nodeToRemove );
- }
- this._setSelectionOverElement( objectElement );
- } );
- return true;
- }
- }
- /**
- * Sets {@link module:engine/model/selection~Selection document's selection} over given element.
- *
- * @protected
- * @param {module:engine/model/element~Element} element
- */
- _setSelectionOverElement( element ) {
- this.editor.model.change( writer => {
- writer.setSelection( writer.createRangeOn( element ) );
- } );
- }
- /**
- * Checks if {@link module:engine/model/element~Element element} placed next to the current
- * {@link module:engine/model/selection~Selection model selection} exists and is marked in
- * {@link module:engine/model/schema~Schema schema} as `object`.
- *
- * @protected
- * @param {Boolean} forward Direction of checking.
- * @returns {module:engine/model/element~Element|null}
- */
- _getObjectElementNextToSelection( forward ) {
- const model = this.editor.model;
- const schema = model.schema;
- const modelSelection = model.document.selection;
- // Clone current selection to use it as a probe. We must leave default selection as it is so it can return
- // to its current state after undo.
- const probe = model.createSelection( modelSelection );
- model.modifySelection( probe, { direction: forward ? 'forward' : 'backward' } );
- const objectElement = forward ? probe.focus.nodeBefore : probe.focus.nodeAfter;
- if ( !!objectElement && schema.isObject( objectElement ) ) {
- return objectElement;
- }
- return null;
- }
- /**
- * Removes CSS class from previously selected widgets.
- *
- * @private
- * @param {module:engine/view/downcastwriter~DowncastWriter} writer
- */
- _clearPreviouslySelectedWidgets( writer ) {
- for ( const widget of this._previouslySelected ) {
- writer.removeClass( _utils__WEBPACK_IMPORTED_MODULE_4__["WIDGET_SELECTED_CLASS_NAME"], widget );
- }
- this._previouslySelected.clear();
- }
- }
- // Returns `true` when element is a nested editable or is placed inside one.
- //
- // @param {module:engine/view/element~Element}
- // @returns {Boolean}
- function isInsideNestedEditable( element ) {
- while ( element ) {
- if ( element.is( 'editableElement' ) && !element.is( 'rootElement' ) ) {
- return true;
- }
- // Click on nested widget should select it.
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"])( element ) ) {
- return false;
- }
- element = element.parent;
- }
- return false;
- }
- // Checks whether the specified `element` is a child of the `parent` element.
- //
- // @param {module:engine/view/element~Element} element An element to check.
- // @param {module:engine/view/element~Element|null} parent A parent for the element.
- // @returns {Boolean}
- function isChild( element, parent ) {
- if ( !parent ) {
- return false;
- }
- return Array.from( element.getAncestors() ).includes( parent );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WidgetResize; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _widgetresize_resizer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./widgetresize/resizer */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
- /* harmony import */ var _theme_widgetresize_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/widgetresize.css */ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css");
- /* harmony import */ var _theme_widgetresize_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_theme_widgetresize_css__WEBPACK_IMPORTED_MODULE_8__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module widget/widgetresize
- */
- /**
- * The widget resize feature plugin.
- *
- * Use the {@link module:widget/widgetresize~WidgetResize#attachTo} method to create a resizer for the specified widget.
- *
- * @extends module:core/plugin~Plugin
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class WidgetResize extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'WidgetResize';
- }
- /**
- * @inheritDoc
- */
- init() {
- /**
- * The currently visible resizer.
- *
- * @observable
- * @member {module:widget/widgetresize/resizer~Resizer|null} #visibleResizer
- */
- this.set( 'visibleResizer', null );
- /**
- * References an active resizer.
- *
- * Active resizer means a resizer which handle is actively used by the end user.
- *
- * @protected
- * @observable
- * @member {module:widget/widgetresize/resizer~Resizer|null} #_activeResizer
- */
- this.set( '_activeResizer', null );
- /**
- * A map of resizers created using this plugin instance.
- *
- * @private
- * @type {Map.<module:engine/view/containerelement~ContainerElement, module:widget/widgetresize/resizer~Resizer>}
- */
- this._resizers = new Map();
- const domDocument = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_3__["default"].window.document;
- this.editor.model.schema.setAttributeProperties( 'width', {
- isFormatting: true
- } );
- this.editor.editing.view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_5__["default"] );
- this._observer = Object.create( _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
- this.listenTo( this.editor.editing.view.document, 'mousedown', this._mouseDownListener.bind( this ), { priority: 'high' } );
- this._observer.listenTo( domDocument, 'mousemove', this._mouseMoveListener.bind( this ) );
- this._observer.listenTo( domDocument, 'mouseup', this._mouseUpListener.bind( this ) );
- const redrawFocusedResizer = () => {
- if ( this.visibleResizer ) {
- this.visibleResizer.redraw();
- }
- };
- this._redrawFocusedResizerThrottled = Object(lodash_es__WEBPACK_IMPORTED_MODULE_7__["throttle"])( redrawFocusedResizer, 200 );
- // Redraws occurring upon a change of visible resizer must not be throttled, as it is crucial for the initial
- // render. Without it the resizer frame would be misaligned with resizing host for a fraction of second.
- this.on( 'change:visibleResizer', redrawFocusedResizer );
- // Redrawing on any change of the UI of the editor (including content changes).
- this.editor.ui.on( 'update', this._redrawFocusedResizerThrottled );
- // Resizers need to be redrawn upon window resize, because new window might shrink resize host.
- this._observer.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_3__["default"].window, 'resize', this._redrawFocusedResizerThrottled );
- const viewSelection = this.editor.editing.view.document.selection;
- viewSelection.on( 'change', () => {
- const selectedElement = viewSelection.getSelectedElement();
- this.visibleResizer = this.getResizerByViewElement( selectedElement ) || null;
- } );
- }
- /**
- * @inheritDoc
- */
- destroy() {
- this._observer.stopListening();
- for ( const resizer of this._resizers.values() ) {
- resizer.destroy();
- }
- this._redrawFocusedResizerThrottled.cancel();
- }
- /**
- * @param {module:widget/widgetresize~ResizerOptions} [options] Resizer options.
- * @returns {module:widget/widgetresize/resizer~Resizer}
- */
- attachTo( options ) {
- const resizer = new _widgetresize_resizer__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
- const plugins = this.editor.plugins;
- resizer.attach();
- if ( plugins.has( 'WidgetToolbarRepository' ) ) {
- // Hiding widget toolbar to improve the performance
- // (https://github.com/ckeditor/ckeditor5-widget/pull/112#issuecomment-564528765).
- const widgetToolbarRepository = plugins.get( 'WidgetToolbarRepository' );
- resizer.on( 'begin', () => {
- widgetToolbarRepository.forceDisabled( 'resize' );
- }, { priority: 'lowest' } );
- resizer.on( 'cancel', () => {
- widgetToolbarRepository.clearForceDisabled( 'resize' );
- }, { priority: 'highest' } );
- resizer.on( 'commit', () => {
- widgetToolbarRepository.clearForceDisabled( 'resize' );
- }, { priority: 'highest' } );
- }
- this._resizers.set( options.viewElement, resizer );
- const viewSelection = this.editor.editing.view.document.selection;
- const selectedElement = viewSelection.getSelectedElement();
- // If the element the resizer is created for is currently focused, it should become visible.
- if ( this.getResizerByViewElement( selectedElement ) == resizer ) {
- this.visibleResizer = resizer;
- }
- return resizer;
- }
- /**
- * Returns a resizer created for a given view element (widget element).
- *
- * @param {module:engine/view/containerelement~ContainerElement} viewElement View element associated with the resizer.
- * @returns {module:widget/widgetresize/resizer~Resizer|undefined}
- */
- getResizerByViewElement( viewElement ) {
- return this._resizers.get( viewElement );
- }
- /**
- * Returns a resizer that contains a given resize handle.
- *
- * @protected
- * @param {HTMLElement} domResizeHandle
- * @returns {module:widget/widgetresize/resizer~Resizer}
- */
- _getResizerByHandle( domResizeHandle ) {
- for ( const resizer of this._resizers.values() ) {
- if ( resizer.containsHandle( domResizeHandle ) ) {
- return resizer;
- }
- }
- }
- /**
- * @protected
- * @param {module:utils/eventinfo~EventInfo} event
- * @param {Event} domEventData Native DOM event.
- */
- _mouseDownListener( event, domEventData ) {
- const resizeHandle = domEventData.domTarget;
- if ( !_widgetresize_resizer__WEBPACK_IMPORTED_MODULE_1__["default"].isResizeHandle( resizeHandle ) ) {
- return;
- }
- this._activeResizer = this._getResizerByHandle( resizeHandle );
- if ( this._activeResizer ) {
- this._activeResizer.begin( resizeHandle );
- // Do not call other events when resizing. See: #6755.
- event.stop();
- domEventData.preventDefault();
- }
- }
- /**
- * @protected
- * @param {module:utils/eventinfo~EventInfo} event
- * @param {Event} domEventData Native DOM event.
- */
- _mouseMoveListener( event, domEventData ) {
- if ( this._activeResizer ) {
- this._activeResizer.updateSize( domEventData );
- }
- }
- /**
- * @protected
- */
- _mouseUpListener() {
- if ( this._activeResizer ) {
- this._activeResizer.commit();
- this._activeResizer = null;
- }
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( WidgetResize, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
- /**
- * Interface describing a resizer. It allows to specify the resizing host, custom logic for calculating aspect ratio, etc.
- *
- * @interface ResizerOptions
- */
- /**
- * Editor instance associated with the resizer.
- *
- * @member {module:core/editor/editor~Editor} module:widget/widgetresize~ResizerOptions#editor
- */
- /**
- * @member {module:engine/model/element~Element} module:widget/widgetresize~ResizerOptions#modelElement
- */
- /**
- * A view of an element to be resized. Typically it's the main widget's view instance.
- *
- * @member {module:engine/view/containerelement~ContainerElement} module:widget/widgetresize~ResizerOptions#viewElement
- */
- /**
- * A callback to be executed once the resizing process is done.
- *
- * It receives a `Number` (`newValue`) as a parameter.
- *
- * For example, {@link module:image/imageresize~ImageResize} uses it to execute the resize image command
- * which puts the new value into the model.
- *
- * ```js
- * {
- * editor,
- * modelElement: data.item,
- * viewElement: widget,
- *
- * onCommit( newValue ) {
- * editor.execute( 'resizeImage', { width: newValue } );
- * }
- * };
- * ```
- *
- *
- * @member {Function} module:widget/widgetresize~ResizerOptions#onCommit
- */
- /**
- * @member {Function} module:widget/widgetresize~ResizerOptions#getResizeHost
- */
- /**
- * @member {Function} module:widget/widgetresize~ResizerOptions#isCentered
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Resizer; });
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /* harmony import */ var _resizerstate__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./resizerstate */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module widget/widgetresize/resizer
- */
- /**
- * Represents a resizer for a single resizable object.
- *
- * @mixes module:utils/observablemixin~ObservableMixin
- */
- class Resizer {
- /**
- * @param {module:widget/widgetresize~ResizerOptions} options Resizer options.
- */
- constructor( options ) {
- /**
- * Stores the state of the resizable host geometry, such as the original width, the currently proposed height, etc.
- *
- * Note that a new state is created for each resize transaction.
- *
- * @readonly
- * @member {module:widget/widgetresize/resizerstate~ResizerState} #state
- */
- /**
- * A view displaying the proposed new element size during the resizing.
- *
- * @protected
- * @readonly
- * @member {module:widget/widgetresize/resizer~SizeView} #_sizeUI
- */
- /**
- * Options passed to the {@link #constructor}.
- *
- * @private
- * @type {module:widget/widgetresize~ResizerOptions}
- */
- this._options = options;
- /**
- * Container of the entire resize UI.
- *
- * Note that this property is initialized only after the element bound with the resizer is drawn
- * so it will be a `null` when uninitialized.
- *
- * @private
- * @type {HTMLElement|null}
- */
- this._domResizerWrapper = null;
- /**
- * A wrapper that is controlled by the resizer. This is usually a widget element.
- *
- * @private
- * @type {module:engine/view/element~Element|null}
- */
- this._viewResizerWrapper = null;
- /**
- * The width of the resized {@link module:widget/widgetresize~ResizerOptions#viewElement viewElement} before the resizing started.
- *
- * @private
- * @member {Number|String|undefined} #_initialViewWidth
- */
- /**
- * @observable
- */
- this.set( 'isEnabled', true );
- this.decorate( 'begin' );
- this.decorate( 'cancel' );
- this.decorate( 'commit' );
- this.decorate( 'updateSize' );
- this.on( 'commit', event => {
- // State might not be initialized yet. In this case, prevent further handling and make sure that the resizer is
- // cleaned up (#5195).
- if ( !this.state.proposedWidth && !this.state.proposedWidthPercents ) {
- this._cleanup();
- event.stop();
- }
- }, { priority: 'high' } );
- this.on( 'change:isEnabled', () => {
- // We should redraw the resize handles when the plugin is enabled again.
- // Otherwise they won't show up.
- if ( this.isEnabled ) {
- this.redraw();
- }
- } );
- }
- /**
- * Attaches the resizer to the DOM.
- */
- attach() {
- const that = this;
- const widgetElement = this._options.viewElement;
- const editingView = this._options.editor.editing.view;
- editingView.change( writer => {
- const viewResizerWrapper = writer.createUIElement( 'div', {
- class: 'ck ck-reset_all ck-widget__resizer'
- }, function( domDocument ) {
- const domElement = this.toDomElement( domDocument );
- that._appendHandles( domElement );
- that._appendSizeUI( domElement );
- that._domResizerWrapper = domElement;
- that.on( 'change:isEnabled', ( evt, propName, newValue ) => {
- domElement.style.display = newValue ? '' : 'none';
- } );
- domElement.style.display = that.isEnabled ? '' : 'none';
- return domElement;
- } );
- // Append the resizer wrapper to the widget's wrapper.
- writer.insert( writer.createPositionAt( widgetElement, 'end' ), viewResizerWrapper );
- writer.addClass( 'ck-widget_with-resizer', widgetElement );
- this._viewResizerWrapper = viewResizerWrapper;
- } );
- }
- /**
- * Starts the resizing process.
- *
- * Creates a new {@link #state} for the current process.
- *
- * @fires begin
- * @param {HTMLElement} domResizeHandle Clicked handle.
- */
- begin( domResizeHandle ) {
- this.state = new _resizerstate__WEBPACK_IMPORTED_MODULE_6__["default"]( this._options );
- this._sizeUI.bindToState( this._options, this.state );
- this._initialViewWidth = this._options.viewElement.getStyle( 'width' );
- this.state.begin( domResizeHandle, this._getHandleHost(), this._getResizeHost() );
- }
- /**
- * Updates the proposed size based on `domEventData`.
- *
- * @fires updateSize
- * @param {Event} domEventData
- */
- updateSize( domEventData ) {
- const newSize = this._proposeNewSize( domEventData );
- const editingView = this._options.editor.editing.view;
- editingView.change( writer => {
- const unit = this._options.unit || '%';
- const newWidth = ( unit === '%' ? newSize.widthPercents : newSize.width ) + unit;
- writer.setStyle( 'width', newWidth, this._options.viewElement );
- } );
- // Get an actual image width, and:
- // * reflect this size to the resize wrapper
- // * apply this **real** size to the state
- const domHandleHost = this._getHandleHost();
- const domHandleHostRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__["default"]( domHandleHost );
- newSize.handleHostWidth = Math.round( domHandleHostRect.width );
- newSize.handleHostHeight = Math.round( domHandleHostRect.height );
- // Handle max-width limitation.
- const domResizeHostRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__["default"]( domHandleHost );
- newSize.width = Math.round( domResizeHostRect.width );
- newSize.height = Math.round( domResizeHostRect.height );
- this.redraw( domHandleHostRect );
- this.state.update( newSize );
- }
- /**
- * Applies the geometry proposed with the resizer.
- *
- * @fires commit
- */
- commit() {
- const unit = this._options.unit || '%';
- const newValue = ( unit === '%' ? this.state.proposedWidthPercents : this.state.proposedWidth ) + unit;
- // Both cleanup and onCommit callback are very likely to make view changes. Ensure that it is made in a single step.
- this._options.editor.editing.view.change( () => {
- this._cleanup();
- this._options.onCommit( newValue );
- } );
- }
- /**
- * Cancels and rejects the proposed resize dimensions, hiding the UI.
- *
- * @fires cancel
- */
- cancel() {
- this._cleanup();
- }
- /**
- * Destroys the resizer.
- */
- destroy() {
- this.cancel();
- }
- /**
- * Redraws the resizer.
- *
- * @param {module:utils/dom/rect~Rect} [handleHostRect] Handle host rectangle might be given to improve performance.
- */
- redraw( handleHostRect ) {
- const domWrapper = this._domResizerWrapper;
- // Refresh only if resizer exists in the DOM.
- if ( !existsInDom( domWrapper ) ) {
- return;
- }
- const widgetWrapper = domWrapper.parentElement;
- const handleHost = this._getHandleHost();
- const resizerWrapper = this._viewResizerWrapper;
- const currentDimensions = [
- resizerWrapper.getStyle( 'width' ),
- resizerWrapper.getStyle( 'height' ),
- resizerWrapper.getStyle( 'left' ),
- resizerWrapper.getStyle( 'top' )
- ];
- let newDimensions;
- if ( widgetWrapper.isSameNode( handleHost ) ) {
- const clientRect = handleHostRect || new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__["default"]( handleHost );
- newDimensions = [
- clientRect.width + 'px',
- clientRect.height + 'px',
- undefined,
- undefined
- ];
- }
- // In case a resizing host is not a widget wrapper, we need to compensate
- // for any additional offsets the resize host might have. E.g. wrapper padding
- // or simply another editable. By doing that the border and resizers are shown
- // only around the resize host.
- else {
- newDimensions = [
- handleHost.offsetWidth + 'px',
- handleHost.offsetHeight + 'px',
- handleHost.offsetLeft + 'px',
- handleHost.offsetTop + 'px'
- ];
- }
- // Make changes to the view only if the resizer should actually get new dimensions.
- // Otherwise, if View#change() was always called, this would cause EditorUI#update
- // loops because the WidgetResize plugin listens to EditorUI#update and updates
- // the resizer.
- // https://github.com/ckeditor/ckeditor5/issues/7633
- if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__["default"])( currentDimensions, newDimensions ) !== 'same' ) {
- this._options.editor.editing.view.change( writer => {
- writer.setStyle( {
- width: newDimensions[ 0 ],
- height: newDimensions[ 1 ],
- left: newDimensions[ 2 ],
- top: newDimensions[ 3 ]
- }, resizerWrapper );
- } );
- }
- }
- containsHandle( domElement ) {
- return this._domResizerWrapper.contains( domElement );
- }
- static isResizeHandle( domElement ) {
- return domElement.classList.contains( 'ck-widget__resizer__handle' );
- }
- /**
- * Cleans up the context state.
- *
- * @protected
- */
- _cleanup() {
- this._sizeUI.dismiss();
- this._sizeUI.isVisible = false;
- const editingView = this._options.editor.editing.view;
- editingView.change( writer => {
- writer.setStyle( 'width', this._initialViewWidth, this._options.viewElement );
- } );
- }
- /**
- * Calculates the proposed size as the resize handles are dragged.
- *
- * @private
- * @param {Event} domEventData Event data that caused the size update request. It should be used to calculate the proposed size.
- * @returns {Object} return
- * @returns {Number} return.width Proposed width.
- * @returns {Number} return.height Proposed height.
- */
- _proposeNewSize( domEventData ) {
- const state = this.state;
- const currentCoordinates = extractCoordinates( domEventData );
- const isCentered = this._options.isCentered ? this._options.isCentered( this ) : true;
- // Enlargement defines how much the resize host has changed in a given axis. Naturally it could be a negative number
- // meaning that it has been shrunk.
- //
- // +----------------+--+
- // | | |
- // | img | |
- // | /handle host | |
- // +----------------+ | ^
- // | | | - enlarge y
- // +-------------------+ v
- // <-->
- // enlarge x
- const enlargement = {
- x: state._referenceCoordinates.x - ( currentCoordinates.x + state.originalWidth ),
- y: ( currentCoordinates.y - state.originalHeight ) - state._referenceCoordinates.y
- };
- if ( isCentered && state.activeHandlePosition.endsWith( '-right' ) ) {
- enlargement.x = currentCoordinates.x - ( state._referenceCoordinates.x + state.originalWidth );
- }
- // Objects needs to be resized twice as much in horizontal axis if centered, since enlargement is counted from
- // one resized corner to your cursor. It needs to be duplicated to compensate for the other side too.
- if ( isCentered ) {
- enlargement.x *= 2;
- }
- // const resizeHost = this._getResizeHost();
- // The size proposed by the user. It does not consider the aspect ratio.
- const proposedSize = {
- width: Math.abs( state.originalWidth + enlargement.x ),
- height: Math.abs( state.originalHeight + enlargement.y )
- };
- // Dominant determination must take the ratio into account.
- proposedSize.dominant = proposedSize.width / state.aspectRatio > proposedSize.height ? 'width' : 'height';
- proposedSize.max = proposedSize[ proposedSize.dominant ];
- // Proposed size, respecting the aspect ratio.
- const targetSize = {
- width: proposedSize.width,
- height: proposedSize.height
- };
- if ( proposedSize.dominant == 'width' ) {
- targetSize.height = targetSize.width / state.aspectRatio;
- } else {
- targetSize.width = targetSize.height * state.aspectRatio;
- }
- return {
- width: Math.round( targetSize.width ),
- height: Math.round( targetSize.height ),
- widthPercents: Math.min( Math.round( state.originalWidthPercents / state.originalWidth * targetSize.width * 100 ) / 100, 100 )
- };
- }
- /**
- * Obtains the resize host.
- *
- * Resize host is an object that receives dimensions which are the result of resizing.
- *
- * @protected
- * @returns {HTMLElement}
- */
- _getResizeHost() {
- const widgetWrapper = this._domResizerWrapper.parentElement;
- return this._options.getResizeHost( widgetWrapper );
- }
- /**
- * Obtains the handle host.
- *
- * Handle host is an object that the handles are aligned to.
- *
- * Handle host will not always be an entire widget itself. Take an image as an example. The image widget
- * contains an image and a caption. Only the image should be surrounded with handles.
- *
- * @protected
- * @returns {HTMLElement}
- */
- _getHandleHost() {
- const widgetWrapper = this._domResizerWrapper.parentElement;
- return this._options.getHandleHost( widgetWrapper );
- }
- /**
- * Renders the resize handles in the DOM.
- *
- * @private
- * @param {HTMLElement} domElement The resizer wrapper.
- */
- _appendHandles( domElement ) {
- const resizerPositions = [ 'top-left', 'top-right', 'bottom-right', 'bottom-left' ];
- for ( const currentPosition of resizerPositions ) {
- domElement.appendChild( ( new _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__["default"]( {
- tag: 'div',
- attributes: {
- class: `ck-widget__resizer__handle ${ getResizerClass( currentPosition ) }`
- }
- } ).render() ) );
- }
- }
- /**
- * Sets up the {@link #_sizeUI} property and adds it to the passed `domElement`.
- *
- * @private
- * @param {HTMLElement} domElement
- */
- _appendSizeUI( domElement ) {
- const sizeUI = new SizeView();
- // Make sure icon#element is rendered before passing to appendChild().
- sizeUI.render();
- this._sizeUI = sizeUI;
- domElement.appendChild( sizeUI.element );
- }
- /**
- * @event begin
- */
- /**
- * @event updateSize
- */
- /**
- * @event commit
- */
- /**
- * @event cancel
- */
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( Resizer, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
- /**
- * A view displaying the proposed new element size during the resizing.
- *
- * @extends {module:ui/view~View}
- */
- class SizeView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__["default"] {
- constructor() {
- super();
- const bind = this.bindTemplate;
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-size-view',
- bind.to( 'activeHandlePosition', value => value ? `ck-orientation-${ value }` : '' )
- ],
- style: {
- display: bind.if( 'isVisible', 'none', visible => !visible )
- }
- },
- children: [ {
- text: bind.to( 'label' )
- } ]
- } );
- }
- bindToState( options, resizerState ) {
- this.bind( 'isVisible' ).to( resizerState, 'proposedWidth', resizerState, 'proposedHeight', ( width, height ) =>
- width !== null && height !== null );
- this.bind( 'label' ).to(
- resizerState, 'proposedHandleHostWidth',
- resizerState, 'proposedHandleHostHeight',
- resizerState, 'proposedWidthPercents',
- ( width, height, widthPercents ) => {
- if ( options.unit === 'px' ) {
- return `${ width }×${ height }`;
- } else {
- return `${ widthPercents }%`;
- }
- }
- );
- this.bind( 'activeHandlePosition' ).to( resizerState );
- }
- dismiss() {
- this.unbind();
- this.isVisible = false;
- }
- }
- // @private
- // @param {String} resizerPosition Expected resizer position like `"top-left"`, `"bottom-right"`.
- // @returns {String} A prefixed HTML class name for the resizer element
- function getResizerClass( resizerPosition ) {
- return `ck-widget__resizer__handle-${ resizerPosition }`;
- }
- function extractCoordinates( event ) {
- return {
- x: event.pageX,
- y: event.pageY
- };
- }
- function existsInDom( element ) {
- return element && element.ownerDocument && element.ownerDocument.contains( element );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js ***!
- \**********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ResizeState; });
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module widget/widgetresize/resizerstate
- */
- /**
- * Stores the internal state of a single resizable object.
- *
- */
- class ResizeState {
- /**
- * @param {module:widget/widgetresize~ResizerOptions} options Resizer options.
- */
- constructor( options ) {
- /**
- * The original width (pixels) of the resized object when the resize process was started.
- *
- * @readonly
- * @member {Number} #originalWidth
- */
- /**
- * The original height (pixels) of the resized object when the resize process was started.
- *
- * @readonly
- * @member {Number} #originalHeight
- */
- /**
- * The original width (percents) of the resized object when the resize process was started.
- *
- * @readonly
- * @member {Number} #originalWidthPercents
- */
- /**
- * The position of the handle that initiated the resizing. E.g. `"top-left"`, `"bottom-right"` etc. or `null`
- * if unknown.
- *
- * @readonly
- * @observable
- * @member {String|null} #activeHandlePosition
- */
- this.set( 'activeHandlePosition', null );
- /**
- * The width (percents) proposed, but not committed yet, in the current resize process.
- *
- * @readonly
- * @observable
- * @member {Number|null} #proposedWidthPercents
- */
- this.set( 'proposedWidthPercents', null );
- /**
- * The width (pixels) proposed, but not committed yet, in the current resize process.
- *
- * @readonly
- * @observable
- * @member {Number|null} #proposedWidthPixels
- */
- this.set( 'proposedWidth', null );
- /**
- * The height (pixels) proposed, but not committed yet, in the current resize process.
- *
- * @readonly
- * @observable
- * @member {Number|null} #proposedHeightPixels
- */
- this.set( 'proposedHeight', null );
- this.set( 'proposedHandleHostWidth', null );
- this.set( 'proposedHandleHostHeight', null );
- /**
- * A width to height ratio of the resized image.
- *
- * @readonly
- * @member {Number} #aspectRatio
- */
- /**
- * @private
- * @type {module:widget/widgetresize~ResizerOptions}
- */
- this._options = options;
- /**
- * The reference point of the resizer where the dragging started. It is used to measure the distance the user cursor
- * traveled, so how much the image should be enlarged.
- * This information is only known after the DOM was rendered, so it will be updated later.
- *
- * @private
- * @type {Object}
- */
- this._referenceCoordinates = null;
- }
- /**
- *
- * @param {HTMLElement} domResizeHandle The handle used to calculate the reference point.
- * @param {HTMLElement} domHandleHost
- * @param {HTMLElement} domResizeHost
- */
- begin( domResizeHandle, domHandleHost, domResizeHost ) {
- const clientRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_0__["default"]( domHandleHost );
- this.activeHandlePosition = getHandlePosition( domResizeHandle );
- this._referenceCoordinates = getAbsoluteBoundaryPoint( domHandleHost, getOppositePosition( this.activeHandlePosition ) );
- this.originalWidth = clientRect.width;
- this.originalHeight = clientRect.height;
- this.aspectRatio = clientRect.width / clientRect.height;
- const widthStyle = domResizeHost.style.width;
- if ( widthStyle && widthStyle.match( /^\d+(\.\d*)?%$/ ) ) {
- this.originalWidthPercents = parseFloat( widthStyle );
- } else {
- this.originalWidthPercents = calculateHostPercentageWidth( domResizeHost, clientRect );
- }
- }
- update( newSize ) {
- this.proposedWidth = newSize.width;
- this.proposedHeight = newSize.height;
- this.proposedWidthPercents = newSize.widthPercents;
- this.proposedHandleHostWidth = newSize.handleHostWidth;
- this.proposedHandleHostHeight = newSize.handleHostHeight;
- }
- }
- Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( ResizeState, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
- // Calculates a relative width of a `domResizeHost` compared to it's parent in percents.
- //
- // @private
- // @param {HTMLElement} domResizeHost
- // @param {module:utils/dom/rect~Rect} resizeHostRect
- // @returns {Number}
- function calculateHostPercentageWidth( domResizeHost, resizeHostRect ) {
- const domResizeHostParent = domResizeHost.parentElement;
- // Need to use computed style as it properly excludes parent's paddings from the returned value.
- const parentWidth = parseFloat( domResizeHostParent.ownerDocument.defaultView.getComputedStyle( domResizeHostParent ).width );
- return resizeHostRect.width / parentWidth * 100;
- }
- // Returns coordinates of the top-left corner of an element, relative to the document's top-left corner.
- //
- // @private
- // @param {HTMLElement} element
- // @param {String} resizerPosition The position of the resize handle, e.g. `"top-left"`, `"bottom-right"`.
- // @returns {Object} return
- // @returns {Number} return.x
- // @returns {Number} return.y
- function getAbsoluteBoundaryPoint( element, resizerPosition ) {
- const elementRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_0__["default"]( element );
- const positionParts = resizerPosition.split( '-' );
- const ret = {
- x: positionParts[ 1 ] == 'right' ? elementRect.right : elementRect.left,
- y: positionParts[ 0 ] == 'bottom' ? elementRect.bottom : elementRect.top
- };
- ret.x += element.ownerDocument.defaultView.scrollX;
- ret.y += element.ownerDocument.defaultView.scrollY;
- return ret;
- }
- // @private
- // @param {String} resizerPosition The expected resizer position, like `"top-left"`, `"bottom-right"`.
- // @returns {String} A prefixed HTML class name for the resizer element.
- function getResizerHandleClass( resizerPosition ) {
- return `ck-widget__resizer__handle-${ resizerPosition }`;
- }
- // Determines the position of a given resize handle.
- //
- // @private
- // @param {HTMLElement} domHandle Handle used to calculate the reference point.
- // @returns {String|undefined} Returns a string like `"top-left"` or `undefined` if not matched.
- function getHandlePosition( domHandle ) {
- const resizerPositions = [ 'top-left', 'top-right', 'bottom-right', 'bottom-left' ];
- for ( const position of resizerPositions ) {
- if ( domHandle.classList.contains( getResizerHandleClass( position ) ) ) {
- return position;
- }
- }
- }
- // @private
- // @param {String} position Like `"top-left"`.
- // @returns {String} Inverted `position`, e.g. it returns `"bottom-right"` if `"top-left"` was given as `position`.
- function getOppositePosition( position ) {
- const parts = position.split( '-' );
- const replacements = {
- top: 'bottom',
- bottom: 'top',
- left: 'right',
- right: 'left'
- };
- return `${ replacements[ parts[ 0 ] ] }-${ replacements[ parts[ 1 ] ] }`;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js ***!
- \********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WidgetToolbarRepository; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js");
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/toolbar/toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module widget/widgettoolbarrepository
- */
- /**
- * Widget toolbar repository plugin. A central point for registering widget toolbars. This plugin handles the whole
- * toolbar rendering process and exposes a concise API.
- *
- * To add a toolbar for your widget use the {@link ~WidgetToolbarRepository#register `WidgetToolbarRepository#register()`} method.
- *
- * The following example comes from the {@link module:image/imagetoolbar~ImageToolbar} plugin:
- *
- * class ImageToolbar extends Plugin {
- * static get requires() {
- * return [ WidgetToolbarRepository ];
- * }
- *
- * afterInit() {
- * const editor = this.editor;
- * const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
- *
- * widgetToolbarRepository.register( 'image', {
- * items: editor.config.get( 'image.toolbar' ),
- * getRelatedElement: getSelectedImageWidget
- * } );
- * }
- * }
- */
- class WidgetToolbarRepository extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _ckeditor_ckeditor5_ui_src_panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__["default"] ];
- }
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'WidgetToolbarRepository';
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- // Disables the default balloon toolbar for all widgets.
- if ( editor.plugins.has( 'BalloonToolbar' ) ) {
- const balloonToolbar = editor.plugins.get( 'BalloonToolbar' );
- this.listenTo( balloonToolbar, 'show', evt => {
- if ( isWidgetSelected( editor.editing.view.document.selection ) ) {
- evt.stop();
- }
- }, { priority: 'high' } );
- }
- /**
- * A map of toolbar definitions.
- *
- * @protected
- * @member {Map.<String,module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition>} #_toolbarDefinitions
- */
- this._toolbarDefinitions = new Map();
- /**
- * @private
- */
- this._balloon = this.editor.plugins.get( 'ContextualBalloon' );
- this.on( 'change:isEnabled', () => {
- this._updateToolbarsVisibility();
- } );
- this.listenTo( editor.ui, 'update', () => {
- this._updateToolbarsVisibility();
- } );
- // UI#update is not fired after focus is back in editor, we need to check if balloon panel should be visible.
- this.listenTo( editor.ui.focusTracker, 'change:isFocused', () => {
- this._updateToolbarsVisibility();
- }, { priority: 'low' } );
- }
- destroy() {
- super.destroy();
- for ( const toolbarConfig of this._toolbarDefinitions.values() ) {
- toolbarConfig.view.destroy();
- }
- }
- /**
- * Registers toolbar in the WidgetToolbarRepository. It renders it in the `ContextualBalloon` based on the value of the invoked
- * `getRelatedElement` function. Toolbar items are gathered from `items` array.
- * The balloon's CSS class is by default `ck-toolbar-container` and may be override with the `balloonClassName` option.
- *
- * Note: This method should be called in the {@link module:core/plugin~PluginInterface#afterInit `Plugin#afterInit()`}
- * callback (or later) to make sure that the given toolbar items were already registered by other plugins.
- *
- * @param {String} toolbarId An id for the toolbar. Used to
- * @param {Object} options
- * @param {String} [options.ariaLabel] Label used by assistive technologies to describe this toolbar element.
- * @param {Array.<String>} options.items Array of toolbar items.
- * @param {Function} options.getRelatedElement Callback which returns an element the toolbar should be attached to.
- * @param {String} [options.balloonClassName='ck-toolbar-container'] CSS class for the widget balloon.
- */
- register( toolbarId, { ariaLabel, items, getRelatedElement, balloonClassName = 'ck-toolbar-container' } ) {
- // Trying to register a toolbar without any item.
- if ( !items.length ) {
- /**
- * When {@link #register} a new toolbar, you need to provide a non-empty array with
- * the items that will be inserted into the toolbar.
- *
- * @error widget-toolbar-no-items
- */
- Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["logWarning"])( 'widget-toolbar-no-items', { toolbarId } );
- return;
- }
- const editor = this.editor;
- const t = editor.t;
- const toolbarView = new _ckeditor_ckeditor5_ui_src_toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.locale );
- toolbarView.ariaLabel = ariaLabel || t( 'Widget toolbar' );
- if ( this._toolbarDefinitions.has( toolbarId ) ) {
- /**
- * Toolbar with the given id was already added.
- *
- * @error widget-toolbar-duplicated
- * @param toolbarId Toolbar id.
- */
- throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'widget-toolbar-duplicated', this, { toolbarId } );
- }
- toolbarView.fillFromConfig( items, editor.ui.componentFactory );
- this._toolbarDefinitions.set( toolbarId, {
- view: toolbarView,
- getRelatedElement,
- balloonClassName
- } );
- }
- /**
- * Iterates over stored toolbars and makes them visible or hidden.
- *
- * @private
- */
- _updateToolbarsVisibility() {
- let maxRelatedElementDepth = 0;
- let deepestRelatedElement = null;
- let deepestToolbarDefinition = null;
- for ( const definition of this._toolbarDefinitions.values() ) {
- const relatedElement = definition.getRelatedElement( this.editor.editing.view.document.selection );
- if ( !this.isEnabled || !relatedElement ) {
- if ( this._isToolbarInBalloon( definition ) ) {
- this._hideToolbar( definition );
- }
- } else if ( !this.editor.ui.focusTracker.isFocused ) {
- if ( this._isToolbarVisible( definition ) ) {
- this._hideToolbar( definition );
- }
- } else {
- const relatedElementDepth = relatedElement.getAncestors().length;
- // Many toolbars can express willingness to be displayed but they do not know about
- // each other. Figure out which toolbar is deepest in the view tree to decide which
- // should be displayed. For instance, if a selected image is inside a table cell, display
- // the ImageToolbar rather than the TableToolbar (#60).
- if ( relatedElementDepth > maxRelatedElementDepth ) {
- maxRelatedElementDepth = relatedElementDepth;
- deepestRelatedElement = relatedElement;
- deepestToolbarDefinition = definition;
- }
- }
- }
- if ( deepestToolbarDefinition ) {
- this._showToolbar( deepestToolbarDefinition, deepestRelatedElement );
- }
- }
- /**
- * Hides the given toolbar.
- *
- * @private
- * @param {module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition} toolbarDefinition
- */
- _hideToolbar( toolbarDefinition ) {
- this._balloon.remove( toolbarDefinition.view );
- this.stopListening( this._balloon, 'change:visibleView' );
- }
- /**
- * Shows up the toolbar if the toolbar is not visible.
- * Otherwise, repositions the toolbar's balloon when toolbar's view is the most top view in balloon stack.
- *
- * It might happen here that the toolbar's view is under another view. Then do nothing as the other toolbar view
- * should be still visible after the {@link module:core/editor/editorui~EditorUI#event:update}.
- *
- * @private
- * @param {module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition} toolbarDefinition
- * @param {module:engine/view/element~Element} relatedElement
- */
- _showToolbar( toolbarDefinition, relatedElement ) {
- if ( this._isToolbarVisible( toolbarDefinition ) ) {
- repositionContextualBalloon( this.editor, relatedElement );
- } else if ( !this._isToolbarInBalloon( toolbarDefinition ) ) {
- this._balloon.add( {
- view: toolbarDefinition.view,
- position: getBalloonPositionData( this.editor, relatedElement ),
- balloonClassName: toolbarDefinition.balloonClassName
- } );
- // Update toolbar position each time stack with toolbar view is switched to visible.
- // This is in a case target element has changed when toolbar was in invisible stack
- // e.g. target image was wrapped by a block quote.
- // See https://github.com/ckeditor/ckeditor5-widget/issues/92.
- this.listenTo( this._balloon, 'change:visibleView', () => {
- for ( const definition of this._toolbarDefinitions.values() ) {
- if ( this._isToolbarVisible( definition ) ) {
- const relatedElement = definition.getRelatedElement( this.editor.editing.view.document.selection );
- repositionContextualBalloon( this.editor, relatedElement );
- }
- }
- } );
- }
- }
- /**
- * @private
- * @param {Object} toolbar
- * @returns {Boolean}
- */
- _isToolbarVisible( toolbar ) {
- return this._balloon.visibleView === toolbar.view;
- }
- /**
- * @private
- * @param {Object} toolbar
- * @returns {Boolean}
- */
- _isToolbarInBalloon( toolbar ) {
- return this._balloon.hasView( toolbar.view );
- }
- }
- function repositionContextualBalloon( editor, relatedElement ) {
- const balloon = editor.plugins.get( 'ContextualBalloon' );
- const position = getBalloonPositionData( editor, relatedElement );
- balloon.updatePosition( position );
- }
- function getBalloonPositionData( editor, relatedElement ) {
- const editingView = editor.editing.view;
- const defaultPositions = _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_3__["default"].defaultPositions;
- return {
- target: editingView.domConverter.mapViewToDom( relatedElement ),
- positions: [
- defaultPositions.northArrowSouth,
- defaultPositions.northArrowSouthWest,
- defaultPositions.northArrowSouthEast,
- defaultPositions.southArrowNorth,
- defaultPositions.southArrowNorthWest,
- defaultPositions.southArrowNorthEast,
- _utils__WEBPACK_IMPORTED_MODULE_4__["centeredBalloonPositionForLongWidgets"]
- ]
- };
- }
- function isWidgetSelected( selection ) {
- const viewElement = selection.getSelectedElement();
- return !!( viewElement && Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"])( viewElement ) );
- }
- /**
- * The toolbar definition object used by the toolbar repository to manage toolbars.
- * It contains information necessary to display the toolbar in the
- * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} and
- * update it during its life (display) cycle.
- *
- * @typedef {Object} module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition
- *
- * @property {module:ui/view~View} view The UI view of the toolbar.
- * @property {Function} getRelatedElement A function that returns an engine {@link module:engine/view/view~View}
- * element the toolbar is to be attached to. For instance, an image widget or a table widget (or `null` when
- * there is no such element). The function accepts an instance of {@link module:engine/view/selection~Selection}.
- * @property {String} balloonClassName CSS class for the widget balloon when a toolbar is displayed.
- */
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js ***!
- \*******************************************************************************/
- /*! exports provided: TYPE_AROUND_SELECTION_ATTRIBUTE, isTypeAroundWidget, getClosestTypeAroundDomButton, getTypeAroundButtonPosition, getClosestWidgetViewElement, getTypeAroundFakeCaretPosition */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPE_AROUND_SELECTION_ATTRIBUTE", function() { return TYPE_AROUND_SELECTION_ATTRIBUTE; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isTypeAroundWidget", function() { return isTypeAroundWidget; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClosestTypeAroundDomButton", function() { return getClosestTypeAroundDomButton; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTypeAroundButtonPosition", function() { return getTypeAroundButtonPosition; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClosestWidgetViewElement", function() { return getClosestWidgetViewElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTypeAroundFakeCaretPosition", function() { return getTypeAroundFakeCaretPosition; });
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module widget/widgettypearound/utils
- */
- /**
- * The name of the type around model selection attribute responsible for
- * displaying a fake caret next to a selected widget.
- */
- const TYPE_AROUND_SELECTION_ATTRIBUTE = 'widget-type-around';
- /**
- * Checks if an element is a widget that qualifies to get the widget type around UI.
- *
- * @param {module:engine/view/element~Element} viewElement
- * @param {module:engine/model/element~Element} modelElement
- * @param {module:engine/model/schema~Schema} schema
- * @returns {Boolean}
- */
- function isTypeAroundWidget( viewElement, modelElement, schema ) {
- return viewElement && Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isWidget"])( viewElement ) && !schema.isInline( modelElement );
- }
- /**
- * For the passed HTML element, this helper finds the closest widget type around button ancestor.
- *
- * @param {HTMLElement} domElement
- * @returns {HTMLElement|null}
- */
- function getClosestTypeAroundDomButton( domElement ) {
- return domElement.closest( '.ck-widget__type-around__button' );
- }
- /**
- * For the passed widget type around button element, this helper determines at which position
- * the paragraph would be inserted into the content if, for instance, the button was
- * clicked by the user.
- *
- * @param {HTMLElement} domElement
- * @returns {'before'|'after'} The position of the button.
- */
- function getTypeAroundButtonPosition( domElement ) {
- return domElement.classList.contains( 'ck-widget__type-around__button_before' ) ? 'before' : 'after';
- }
- /**
- * For the passed HTML element, this helper returns the closest view widget ancestor.
- *
- * @param {HTMLElement} domElement
- * @param {module:engine/view/domconverter~DomConverter} domConverter
- * @returns {module:engine/view/element~Element}
- */
- function getClosestWidgetViewElement( domElement, domConverter ) {
- const widgetDomElement = domElement.closest( '.ck-widget' );
- return domConverter.mapDomToView( widgetDomElement );
- }
- /**
- * For the passed selection instance, it returns the position of the fake caret displayed next to a widget.
- *
- * **Note**: If the fake caret is not currently displayed, `null` is returned.
- *
- * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
- * @returns {'before'|'after'|null} The position of the fake caret or `null` when none is present.
- */
- function getTypeAroundFakeCaretPosition( selection ) {
- return selection.getAttribute( TYPE_AROUND_SELECTION_ATTRIBUTE );
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js":
- /*!******************************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js ***!
- \******************************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WidgetTypeAround; });
- /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
- /* harmony import */ var _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
- /* harmony import */ var _ckeditor_ckeditor5_enter_src_enter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-enter/src/enter */ "./node_modules/@ckeditor/ckeditor5-enter/src/enter.js");
- /* harmony import */ var _ckeditor_ckeditor5_typing_src_delete__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
- /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js");
- /* harmony import */ var _ckeditor_ckeditor5_typing_src_utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
- /* harmony import */ var _theme_icons_return_arrow_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../theme/icons/return-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg");
- /* harmony import */ var _theme_widgettypearound_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../theme/widgettypearound.css */ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css");
- /* harmony import */ var _theme_widgettypearound_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_theme_widgettypearound_css__WEBPACK_IMPORTED_MODULE_9__);
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /* global DOMParser */
- /**
- * @module widget/widgettypearound
- */
- const POSSIBLE_INSERTION_POSITIONS = [ 'before', 'after' ];
- // Do the SVG parsing once and then clone the result <svg> DOM element for each new button.
- const RETURN_ARROW_ICON_ELEMENT = new DOMParser().parseFromString( _theme_icons_return_arrow_svg__WEBPACK_IMPORTED_MODULE_8__["default"], 'image/svg+xml' ).firstChild;
- const PLUGIN_DISABLED_EDITING_ROOT_CLASS = 'ck-widget__type-around_disabled';
- /**
- * A plugin that allows users to type around widgets where normally it is impossible to place the caret due
- * to limitations of web browsers. These "tight spots" occur, for instance, before (or after) a widget being
- * the first (or last) child of its parent or between two block widgets.
- *
- * This plugin extends the {@link module:widget/widget~Widget `Widget`} plugin and injects the user interface
- * with two buttons into each widget instance in the editor. Each of the buttons can be clicked by the
- * user if the widget is next to the "tight spot". Once clicked, a paragraph is created with the selection anchored
- * in it so that users can type (or insert content, paste, etc.) straight away.
- *
- * @extends module:core/plugin~Plugin
- */
- class WidgetTypeAround extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
- /**
- * @inheritDoc
- */
- static get pluginName() {
- return 'WidgetTypeAround';
- }
- /**
- * @inheritDoc
- */
- static get requires() {
- return [ _ckeditor_ckeditor5_enter_src_enter__WEBPACK_IMPORTED_MODULE_2__["default"], _ckeditor_ckeditor5_typing_src_delete__WEBPACK_IMPORTED_MODULE_3__["default"] ];
- }
- /**
- * @inheritDoc
- */
- constructor( editor ) {
- super( editor );
- /**
- * A reference to the model widget element that has the fake caret active
- * on either side of it. It is later used to remove CSS classes associated with the fake caret
- * when the widget no longer needs it.
- *
- * @private
- * @member {module:engine/model/element~Element|null}
- */
- this._currentFakeCaretModelElement = null;
- }
- /**
- * @inheritDoc
- */
- init() {
- const editor = this.editor;
- const editingView = editor.editing.view;
- // Set a CSS class on the view editing root when the plugin is disabled so all the buttons
- // and lines visually disappear. All the interactions are disabled in individual plugin methods.
- this.on( 'change:isEnabled', ( evt, data, isEnabled ) => {
- editingView.change( writer => {
- for ( const root of editingView.document.roots ) {
- if ( isEnabled ) {
- writer.removeClass( PLUGIN_DISABLED_EDITING_ROOT_CLASS, root );
- } else {
- writer.addClass( PLUGIN_DISABLED_EDITING_ROOT_CLASS, root );
- }
- }
- } );
- if ( !isEnabled ) {
- editor.model.change( writer => {
- writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
- } );
- }
- } );
- this._enableTypeAroundUIInjection();
- this._enableInsertingParagraphsOnButtonClick();
- this._enableInsertingParagraphsOnEnterKeypress();
- this._enableInsertingParagraphsOnTypingKeystroke();
- this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();
- this._enableDeleteIntegration();
- this._enableInsertContentIntegration();
- this._enableDeleteContentIntegration();
- }
- /**
- * @inheritDoc
- */
- destroy() {
- this._currentFakeCaretModelElement = null;
- }
- /**
- * Inserts a new paragraph next to a widget element with the selection anchored in it.
- *
- * **Note**: This method is heavily user-oriented and will both focus the editing view and scroll
- * the viewport to the selection in the inserted paragraph.
- *
- * @protected
- * @param {module:engine/model/element~Element} widgetModelElement The model widget element next to which a paragraph is inserted.
- * @param {'before'|'after'} position The position where the paragraph is inserted. Either `'before'` or `'after'` the widget.
- */
- _insertParagraph( widgetModelElement, position ) {
- const editor = this.editor;
- const editingView = editor.editing.view;
- editor.execute( 'insertParagraph', {
- position: editor.model.createPositionAt( widgetModelElement, position )
- } );
- editingView.focus();
- editingView.scrollToTheSelection();
- }
- /**
- * A wrapper for the {@link module:utils/emittermixin~EmitterMixin#listenTo} method that executes the callbacks only
- * when the plugin {@link #isEnabled is enabled}.
- *
- * @private
- * @param {module:utils/emittermixin~Emitter} emitter The object that fires the event.
- * @param {String} event The name of the event.
- * @param {Function} callback The function to be called on event.
- * @param {Object} [options={}] Additional options.
- * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
- * the priority value the sooner the callback will be fired. Events having the same priority are called in the
- * order they were added.
- */
- _listenToIfEnabled( emitter, event, callback, options ) {
- this.listenTo( emitter, event, ( ...args ) => {
- // Do not respond if the plugin is disabled.
- if ( this.isEnabled ) {
- callback( ...args );
- }
- }, options );
- }
- /**
- * Similar to {@link #_insertParagraph}, this method inserts a paragraph except that it
- * does not expect a position. Instead, it performs the insertion next to a selected widget
- * according to the `widget-type-around` model selection attribute value (fake caret position).
- *
- * Because this method requires the `widget-type-around` attribute to be set,
- * the insertion can only happen when the widget's fake caret is active (e.g. activated
- * using the keyboard).
- *
- * @private
- * @returns {Boolean} Returns `true` when the paragraph was inserted (the attribute was present) and `false` otherwise.
- */
- _insertParagraphAccordingToFakeCaretPosition() {
- const editor = this.editor;
- const model = editor.model;
- const modelSelection = model.document.selection;
- const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( modelSelection );
- if ( !typeAroundFakeCaretPosition ) {
- return false;
- }
- const selectedModelElement = modelSelection.getSelectedElement();
- this._insertParagraph( selectedModelElement, typeAroundFakeCaretPosition );
- return true;
- }
- /**
- * Creates a listener in the editing conversion pipeline that injects the widget type around
- * UI into every single widget instance created in the editor.
- *
- * The UI is delivered as a {@link module:engine/view/uielement~UIElement}
- * wrapper which renders DOM buttons that users can use to insert paragraphs.
- *
- * @private
- */
- _enableTypeAroundUIInjection() {
- const editor = this.editor;
- const schema = editor.model.schema;
- const t = editor.locale.t;
- const buttonTitles = {
- before: t( 'Insert paragraph before block' ),
- after: t( 'Insert paragraph after block' )
- };
- editor.editing.downcastDispatcher.on( 'insert', ( evt, data, conversionApi ) => {
- const viewElement = conversionApi.mapper.toViewElement( data.item );
- // Filter out non-widgets and inline widgets.
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( viewElement, data.item, schema ) ) {
- injectUIIntoWidget( conversionApi.writer, buttonTitles, viewElement );
- }
- }, { priority: 'low' } );
- }
- /**
- * Brings support for the fake caret that appears when either:
- *
- * * the selection moves to a widget from a position next to it using arrow keys,
- * * the arrow key is pressed when the widget is already selected.
- *
- * The fake caret lets the user know that they can start typing or just press
- * <kbd>Enter</kbd> to insert a paragraph at the position next to a widget as suggested by the fake caret.
- *
- * The fake caret disappears when the user changes the selection or the editor
- * gets blurred.
- *
- * The whole idea is as follows:
- *
- * 1. A user does one of the 2 scenarios described at the beginning.
- * 2. The "keydown" listener is executed and the decision is made whether to show or hide the fake caret.
- * 3. If it should show up, the `widget-type-around` model selection attribute is set indicating
- * on which side of the widget it should appear.
- * 4. The selection dispatcher reacts to the selection attribute and sets CSS classes responsible for the
- * fake caret on the view widget.
- * 5. If the fake caret should disappear, the selection attribute is removed and the dispatcher
- * does the CSS class clean-up in the view.
- * 6. Additionally, `change:range` and `FocusTracker#isFocused` listeners also remove the selection
- * attribute (the former also removes widget CSS classes).
- *
- * @private
- */
- _enableTypeAroundFakeCaretActivationUsingKeyboardArrows() {
- const editor = this.editor;
- const model = editor.model;
- const modelSelection = model.document.selection;
- const schema = model.schema;
- const editingView = editor.editing.view;
- // This is the main listener responsible for the fake caret.
- // Note: The priority must precede the default Widget class keydown handler ("high").
- this._listenToIfEnabled( editingView.document, 'arrowKey', ( evt, domEventData ) => {
- this._handleArrowKeyPress( evt, domEventData );
- }, { context: [ _utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"], '$text' ], priority: 'high' } );
- // This listener makes sure the widget type around selection attribute will be gone from the model
- // selection as soon as the model range changes. This attribute only makes sense when a widget is selected
- // (and the "fake horizontal caret" is visible) so whenever the range changes (e.g. selection moved somewhere else),
- // let's get rid of the attribute so that the selection downcast dispatcher isn't even bothered.
- this._listenToIfEnabled( modelSelection, 'change:range', ( evt, data ) => {
- // Do not reset the selection attribute when the change was indirect.
- if ( !data.directChange ) {
- return;
- }
- // Get rid of the widget type around attribute of the selection on every change:range.
- // If the range changes, it means for sure, the user is no longer in the active ("fake horizontal caret") mode.
- editor.model.change( writer => {
- writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
- } );
- } );
- // Get rid of the widget type around attribute of the selection on every document change
- // that makes widget not selected any more (i.e. widget was removed).
- this._listenToIfEnabled( model.document, 'change:data', () => {
- const selectedModelElement = modelSelection.getSelectedElement();
- if ( selectedModelElement ) {
- const selectedViewElement = editor.editing.mapper.toViewElement( selectedModelElement );
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
- return;
- }
- }
- editor.model.change( writer => {
- writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
- } );
- } );
- // React to changes of the model selection attribute made by the arrow keys listener.
- // If the block widget is selected and the attribute changes, downcast the attribute to special
- // CSS classes associated with the active ("fake horizontal caret") mode of the widget.
- this._listenToIfEnabled( editor.editing.downcastDispatcher, 'selection', ( evt, data, conversionApi ) => {
- const writer = conversionApi.writer;
- if ( this._currentFakeCaretModelElement ) {
- const selectedViewElement = conversionApi.mapper.toViewElement( this._currentFakeCaretModelElement );
- if ( selectedViewElement ) {
- // Get rid of CSS classes associated with the active ("fake horizontal caret") mode from the view widget.
- writer.removeClass( POSSIBLE_INSERTION_POSITIONS.map( positionToWidgetCssClass ), selectedViewElement );
- this._currentFakeCaretModelElement = null;
- }
- }
- const selectedModelElement = data.selection.getSelectedElement();
- if ( !selectedModelElement ) {
- return;
- }
- const selectedViewElement = conversionApi.mapper.toViewElement( selectedModelElement );
- if ( !Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
- return;
- }
- const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( data.selection );
- if ( !typeAroundFakeCaretPosition ) {
- return;
- }
- writer.addClass( positionToWidgetCssClass( typeAroundFakeCaretPosition ), selectedViewElement );
- // Remember the view widget that got the "fake-caret" CSS class. This class should be removed ASAP when the
- // selection changes
- this._currentFakeCaretModelElement = selectedModelElement;
- } );
- this._listenToIfEnabled( editor.ui.focusTracker, 'change:isFocused', ( evt, name, isFocused ) => {
- if ( !isFocused ) {
- editor.model.change( writer => {
- writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
- } );
- }
- } );
- function positionToWidgetCssClass( position ) {
- return `ck-widget_type-around_show-fake-caret_${ position }`;
- }
- }
- /**
- * A listener executed on each "keydown" in the view document, a part of
- * {@link #_enableTypeAroundFakeCaretActivationUsingKeyboardArrows}.
- *
- * It decides whether the arrow keypress should activate the fake caret or not (also whether it should
- * be deactivated).
- *
- * The fake caret activation is done by setting the `widget-type-around` model selection attribute
- * in this listener, and stopping and preventing the event that would normally be handled by the widget
- * plugin that is responsible for the regular keyboard navigation near/across all widgets (that
- * includes inline widgets, which are ignored by the widget type around plugin).
- *
- * @private
- */
- _handleArrowKeyPress( evt, domEventData ) {
- const editor = this.editor;
- const model = editor.model;
- const modelSelection = model.document.selection;
- const schema = model.schema;
- const editingView = editor.editing.view;
- const keyCode = domEventData.keyCode;
- const isForward = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["isForwardArrowKeyCode"])( keyCode, editor.locale.contentLanguageDirection );
- const selectedViewElement = editingView.document.selection.getSelectedElement();
- const selectedModelElement = editor.editing.mapper.toModelElement( selectedViewElement );
- let shouldStopAndPreventDefault;
- // Handle keyboard navigation when a type-around-compatible widget is currently selected.
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
- shouldStopAndPreventDefault = this._handleArrowKeyPressOnSelectedWidget( isForward );
- }
- // Handle keyboard arrow navigation when the selection is next to a type-around-compatible widget
- // and the widget is about to be selected.
- else if ( modelSelection.isCollapsed ) {
- shouldStopAndPreventDefault = this._handleArrowKeyPressWhenSelectionNextToAWidget( isForward );
- }
- if ( shouldStopAndPreventDefault ) {
- domEventData.preventDefault();
- evt.stop();
- }
- }
- /**
- * Handles the keyboard navigation on "keydown" when a widget is currently selected and activates or deactivates
- * the fake caret for that widget, depending on the current value of the `widget-type-around` model
- * selection attribute and the direction of the pressed arrow key.
- *
- * @private
- * @param {Boolean} isForward `true` when the pressed arrow key was responsible for the forward model selection movement
- * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.
- * @returns {Boolean} Returns `true` when the keypress was handled and no other keydown listener of the editor should
- * process the event any further. Returns `false` otherwise.
- */
- _handleArrowKeyPressOnSelectedWidget( isForward ) {
- const editor = this.editor;
- const model = editor.model;
- const modelSelection = model.document.selection;
- const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( modelSelection );
- return model.change( writer => {
- // If the fake caret is displayed...
- if ( typeAroundFakeCaretPosition ) {
- const isLeavingWidget = typeAroundFakeCaretPosition === ( isForward ? 'after' : 'before' );
- // If the keyboard arrow works against the value of the selection attribute...
- // then remove the selection attribute but prevent default DOM actions
- // and do not let the Widget plugin listener move the selection. This brings
- // the widget back to the state, for instance, like if was selected using the mouse.
- //
- // **Note**: If leaving the widget when the fake caret is active, then the default
- // Widget handler will change the selection and, in turn, this will automatically discard
- // the selection attribute.
- if ( !isLeavingWidget ) {
- writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
- return true;
- }
- }
- // If the fake caret wasn't displayed, let's set it now according to the direction of the arrow
- // key press. This also means we cannot let the Widget plugin listener move the selection.
- else {
- writer.setSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"], isForward ? 'after' : 'before' );
- return true;
- }
- return false;
- } );
- }
- /**
- * Handles the keyboard navigation on "keydown" when **no** widget is selected but the selection is **directly** next
- * to one and upon the fake caret should become active for this widget upon arrow keypress
- * (AKA entering/selecting the widget).
- *
- * **Note**: This code mirrors the implementation from the widget plugin but also adds the selection attribute.
- * Unfortunately, there is no safe way to let the widget plugin do the selection part first and then just set the
- * selection attribute here in the widget type around plugin. This is why this code must duplicate some from the widget plugin.
- *
- * @private
- * @param {Boolean} isForward `true` when the pressed arrow key was responsible for the forward model selection movement
- * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.
- * @returns {Boolean} Returns `true` when the keypress was handled and no other keydown listener of the editor should
- * process the event any further. Returns `false` otherwise.
- */
- _handleArrowKeyPressWhenSelectionNextToAWidget( isForward ) {
- const editor = this.editor;
- const model = editor.model;
- const schema = model.schema;
- const widgetPlugin = editor.plugins.get( 'Widget' );
- // This is the widget the selection is about to be set on.
- const modelElementNextToSelection = widgetPlugin._getObjectElementNextToSelection( isForward );
- const viewElementNextToSelection = editor.editing.mapper.toViewElement( modelElementNextToSelection );
- if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( viewElementNextToSelection, modelElementNextToSelection, schema ) ) {
- model.change( writer => {
- widgetPlugin._setSelectionOverElement( modelElementNextToSelection );
- writer.setSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"], isForward ? 'before' : 'after' );
- } );
- // The change() block above does the same job as the Widget plugin. The event can
- // be safely canceled.
- return true;
- }
- return false;
- }
- /**
- * Registers a `mousedown` listener for the view document which intercepts events
- * coming from the widget type around UI, which happens when a user clicks one of the buttons
- * that insert a paragraph next to a widget.
- *
- * @private
- */
- _enableInsertingParagraphsOnButtonClick() {
- const editor = this.editor;
- const editingView = editor.editing.view;
- this._listenToIfEnabled( editingView.document, 'mousedown', ( evt, domEventData ) => {
- const button = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getClosestTypeAroundDomButton"])( domEventData.domTarget );
- if ( !button ) {
- return;
- }
- const buttonPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundButtonPosition"])( button );
- const widgetViewElement = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getClosestWidgetViewElement"])( button, editingView.domConverter );
- const widgetModelElement = editor.editing.mapper.toModelElement( widgetViewElement );
- this._insertParagraph( widgetModelElement, buttonPosition );
- domEventData.preventDefault();
- evt.stop();
- } );
- }
- /**
- * Creates the <kbd>Enter</kbd> key listener on the view document that allows the user to insert a paragraph
- * near the widget when either:
- *
- * * The fake caret was first activated using the arrow keys,
- * * The entire widget is selected in the model.
- *
- * In the first case, the new paragraph is inserted according to the `widget-type-around` selection
- * attribute (see {@link #_handleArrowKeyPress}).
- *
- * In the second case, the new paragraph is inserted based on whether a soft (<kbd>Shift</kbd>+<kbd>Enter</kbd>) keystroke
- * was pressed or not.
- *
- * @private
- */
- _enableInsertingParagraphsOnEnterKeypress() {
- const editor = this.editor;
- const selection = editor.model.document.selection;
- const editingView = editor.editing.view;
- this._listenToIfEnabled( editingView.document, 'enter', ( evt, domEventData ) => {
- // This event could be triggered from inside the widget but we are interested
- // only when the widget is selected itself.
- if ( evt.eventPhase != 'atTarget' ) {
- return;
- }
- const selectedModelElement = selection.getSelectedElement();
- const selectedViewElement = editor.editing.mapper.toViewElement( selectedModelElement );
- const schema = editor.model.schema;
- let wasHandled;
- // First check if the widget is selected and there's a type around selection attribute associated
- // with the fake caret that would tell where to insert a new paragraph.
- if ( this._insertParagraphAccordingToFakeCaretPosition() ) {
- wasHandled = true;
- }
- // Then, if there is no selection attribute associated with the fake caret, check if the widget
- // simply is selected and create a new paragraph according to the keystroke (Shift+)Enter.
- else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
- this._insertParagraph( selectedModelElement, domEventData.isSoft ? 'before' : 'after' );
- wasHandled = true;
- }
- if ( wasHandled ) {
- domEventData.preventDefault();
- evt.stop();
- }
- }, { context: _utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"] } );
- }
- /**
- * Similar to the {@link #_enableInsertingParagraphsOnEnterKeypress}, it allows the user
- * to insert a paragraph next to a widget when the fake caret was activated using arrow
- * keys but it responds to typing keystrokes instead of <kbd>Enter</kbd>.
- *
- * "Typing keystrokes" are keystrokes that insert new content into the document,
- * for instance, letters ("a") or numbers ("4"). The "keydown" listener enabled by this method
- * will insert a new paragraph according to the `widget-type-around` model selection attribute
- * as the user simply starts typing, which creates the impression that the fake caret
- * behaves like a real one rendered by the browser (AKA your text appears where the caret was).
- *
- * **Note**: At the moment this listener creates 2 undo steps: one for the `insertParagraph` command
- * and another one for actual typing. It is not a disaster but this may need to be fixed
- * sooner or later.
- *
- * Learn more in {@link module:typing/utils/injectunsafekeystrokeshandling}.
- *
- * @private
- */
- _enableInsertingParagraphsOnTypingKeystroke() {
- const editor = this.editor;
- const editingView = editor.editing.view;
- const keyCodesHandledSomewhereElse = [
- _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].enter,
- _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].delete,
- _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].backspace
- ];
- // Note: The priority must precede the default observers.
- this._listenToIfEnabled( editingView.document, 'keydown', ( evt, domEventData ) => {
- // Don't handle enter/backspace/delete here. They are handled in dedicated listeners.
- if ( !keyCodesHandledSomewhereElse.includes( domEventData.keyCode ) && !Object(_ckeditor_ckeditor5_typing_src_utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_6__["isNonTypingKeystroke"])( domEventData ) ) {
- this._insertParagraphAccordingToFakeCaretPosition();
- }
- }, { priority: 'high' } );
- }
- /**
- * It creates a "delete" event listener on the view document to handle cases when the <kbd>Delete</kbd> or <kbd>Backspace</kbd>
- * is pressed and the fake caret is currently active.
- *
- * The fake caret should create an illusion of a real browser caret so that when it appears before or after
- * a widget, pressing <kbd>Delete</kbd> or <kbd>Backspace</kbd> should remove a widget or delete the content
- * before or after a widget (depending on the content surrounding the widget).
- *
- * @private
- */
- _enableDeleteIntegration() {
- const editor = this.editor;
- const editingView = editor.editing.view;
- const model = editor.model;
- const schema = model.schema;
- this._listenToIfEnabled( editingView.document, 'delete', ( evt, domEventData ) => {
- // This event could be triggered from inside the widget but we are interested
- // only when the widget is selected itself.
- if ( evt.eventPhase != 'atTarget' ) {
- return;
- }
- const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( model.document.selection );
- // This listener handles only these cases when the fake caret is active.
- if ( !typeAroundFakeCaretPosition ) {
- return;
- }
- const direction = domEventData.direction;
- const selectedModelWidget = model.document.selection.getSelectedElement();
- const isFakeCaretBefore = typeAroundFakeCaretPosition === 'before';
- const isDeleteForward = direction == 'forward';
- const shouldDeleteEntireWidget = isFakeCaretBefore === isDeleteForward;
- if ( shouldDeleteEntireWidget ) {
- editor.execute( 'delete', {
- selection: model.createSelection( selectedModelWidget, 'on' )
- } );
- } else {
- const range = schema.getNearestSelectionRange(
- model.createPositionAt( selectedModelWidget, typeAroundFakeCaretPosition ),
- direction
- );
- // If there is somewhere to move selection to, then there will be something to delete.
- if ( range ) {
- // If the range is NOT collapsed, then we know that the range contains an object (see getNearestSelectionRange() docs).
- if ( !range.isCollapsed ) {
- model.change( writer => {
- writer.setSelection( range );
- editor.execute( isDeleteForward ? 'deleteForward' : 'delete' );
- } );
- } else {
- const probe = model.createSelection( range.start );
- model.modifySelection( probe, { direction } );
- // If the range is collapsed, let's see if a non-collapsed range exists that can could be deleted.
- // If such range exists, use the editor command because it it safe for collaboration (it merges where it can).
- if ( !probe.focus.isEqual( range.start ) ) {
- model.change( writer => {
- writer.setSelection( range );
- editor.execute( isDeleteForward ? 'deleteForward' : 'delete' );
- } );
- }
- // If there is no non-collapsed range to be deleted then we are sure that there is an empty element
- // next to a widget that should be removed. "delete" and "deleteForward" commands cannot get rid of it
- // so calling Model#deleteContent here manually.
- else {
- const deepestEmptyRangeAncestor = getDeepestEmptyElementAncestor( schema, range.start.parent );
- model.deleteContent( model.createSelection( deepestEmptyRangeAncestor, 'on' ), {
- doNotAutoparagraph: true
- } );
- }
- }
- }
- }
- // If some content was deleted, don't let the handler from the Widget plugin kick in.
- // If nothing was deleted, then the default handler will have nothing to do anyway.
- domEventData.preventDefault();
- evt.stop();
- }, { context: _utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"] } );
- }
- /**
- * Attaches the {@link module:engine/model/model~Model#event:insertContent} event listener that, for instance, allows the user to paste
- * content near a widget when the fake caret is first activated using the arrow keys.
- *
- * The content is inserted according to the `widget-type-around` selection attribute (see {@link #_handleArrowKeyPress}).
- *
- * @private
- */
- _enableInsertContentIntegration() {
- const editor = this.editor;
- const model = this.editor.model;
- const documentSelection = model.document.selection;
- this._listenToIfEnabled( editor.model, 'insertContent', ( evt, [ content, selectable ] ) => {
- if ( selectable && !selectable.is( 'documentSelection' ) ) {
- return;
- }
- const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( documentSelection );
- if ( !typeAroundFakeCaretPosition ) {
- return;
- }
- evt.stop();
- return model.change( writer => {
- const selectedElement = documentSelection.getSelectedElement();
- const position = model.createPositionAt( selectedElement, typeAroundFakeCaretPosition );
- const selection = writer.createSelection( position );
- const result = model.insertContent( content, selection );
- writer.setSelection( selection );
- return result;
- } );
- }, { priority: 'high' } );
- }
- /**
- * Attaches the {@link module:engine/model/model~Model#event:deleteContent} event listener to block the event when the fake
- * caret is active.
- *
- * This is required for cases that trigger {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}
- * before calling {@link module:engine/model/model~Model#insertContent `model.insertContent()`} like, for instance,
- * plain text pasting.
- *
- * @private
- */
- _enableDeleteContentIntegration() {
- const editor = this.editor;
- const model = this.editor.model;
- const documentSelection = model.document.selection;
- this._listenToIfEnabled( editor.model, 'deleteContent', ( evt, [ selection ] ) => {
- if ( selection && !selection.is( 'documentSelection' ) ) {
- return;
- }
- const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( documentSelection );
- // Disable removing the selection content while pasting plain text.
- if ( typeAroundFakeCaretPosition ) {
- evt.stop();
- }
- }, { priority: 'high' } );
- }
- }
- // Injects the type around UI into a view widget instance.
- //
- // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
- // @param {Object.<String,String>} buttonTitles
- // @param {module:engine/view/element~Element} widgetViewElement
- function injectUIIntoWidget( viewWriter, buttonTitles, widgetViewElement ) {
- const typeAroundWrapper = viewWriter.createUIElement( 'div', {
- class: 'ck ck-reset_all ck-widget__type-around'
- }, function( domDocument ) {
- const wrapperDomElement = this.toDomElement( domDocument );
- injectButtons( wrapperDomElement, buttonTitles );
- injectFakeCaret( wrapperDomElement );
- return wrapperDomElement;
- } );
- // Inject the type around wrapper into the widget's wrapper.
- viewWriter.insert( viewWriter.createPositionAt( widgetViewElement, 'end' ), typeAroundWrapper );
- }
- // FYI: Not using the IconView class because each instance would need to be destroyed to avoid memory leaks
- // and it's pretty hard to figure out when a view (widget) is gone for good so it's cheaper to use raw
- // <svg> here.
- //
- // @param {HTMLElement} wrapperDomElement
- // @param {Object.<String,String>} buttonTitles
- function injectButtons( wrapperDomElement, buttonTitles ) {
- for ( const position of POSSIBLE_INSERTION_POSITIONS ) {
- const buttonTemplate = new _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__["default"]( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-widget__type-around__button',
- `ck-widget__type-around__button_${ position }`
- ],
- title: buttonTitles[ position ]
- },
- children: [
- wrapperDomElement.ownerDocument.importNode( RETURN_ARROW_ICON_ELEMENT, true )
- ]
- } );
- wrapperDomElement.appendChild( buttonTemplate.render() );
- }
- }
- // @param {HTMLElement} wrapperDomElement
- function injectFakeCaret( wrapperDomElement ) {
- const caretTemplate = new _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__["default"]( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-widget__type-around__fake-caret'
- ]
- }
- } );
- wrapperDomElement.appendChild( caretTemplate.render() );
- }
- // Returns the ancestor of an element closest to the root which is empty. For instance,
- // for `<baz>`:
- //
- // <foo>abc<bar><baz></baz></bar></foo>
- //
- // it returns `<bar>`.
- //
- // @param {module:engine/model/schema~Schema} schema
- // @param {module:engine/model/element~Element} element
- // @returns {module:engine/model/element~Element|null}
- function getDeepestEmptyElementAncestor( schema, element ) {
- let deepestEmptyAncestor = element;
- for ( const ancestor of element.getAncestors( { parentFirst: true } ) ) {
- if ( ancestor.childCount > 1 || schema.isLimit( ancestor ) ) {
- break;
- }
- deepestEmptyAncestor = ancestor;
- }
- return deepestEmptyAncestor;
- }
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z\"/><path fill-opacity=\".256\" d=\"M1 1h14v14H1z\"/><g class=\"ck-icon__selected-indicator\"><path d=\"M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z\"/><path fill-opacity=\".254\" d=\"M1 1h14v14H1z\"/></g></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg ***!
- \******************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 10 8\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038\"/></svg>");
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css":
- /*!******************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css ***!
- \******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./widget.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css":
- /*!************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css ***!
- \************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./widgetresize.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css":
- /*!****************************************************************************!*\
- !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
- var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./widgettypearound.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css");
- content = content.__esModule ? content.default : content;
- if (typeof content === 'string') {
- content = [[module.i, content, '']];
- }
- var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
- options.insert = "head";
- options.singleton = true;
- var update = api(content, options);
- module.exports = content.locals || {};
- /***/ }),
- /***/ "./node_modules/ckeditor5/src/clipboard.js":
- /*!*************************************************!*\
- !*** ./node_modules/ckeditor5/src/clipboard.js ***!
- \*************************************************/
- /*! exports provided: Clipboard, ClipboardPipeline, DragDrop, PastePlainText */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-clipboard */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Clipboard", function() { return _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__["Clipboard"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClipboardPipeline", function() { return _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__["ClipboardPipeline"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragDrop", function() { return _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__["DragDrop"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PastePlainText", function() { return _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__["PastePlainText"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckeditor5/clipboard
- */
- /***/ }),
- /***/ "./node_modules/ckeditor5/src/core.js":
- /*!********************************************!*\
- !*** ./node_modules/ckeditor5/src/core.js ***!
- \********************************************/
- /*! exports provided: Plugin, Command, MultiCommand, Context, ContextPlugin, Editor, EditorUI, attachToForm, DataApiMixin, ElementApiMixin, secureSourceElement, PendingActions, icons */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core */ "./node_modules/@ckeditor/ckeditor5-core/src/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Plugin", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["Command"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiCommand", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["MultiCommand"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["Context"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextPlugin", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["ContextPlugin"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Editor", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["Editor"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorUI", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["EditorUI"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attachToForm", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["attachToForm"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataApiMixin", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["DataApiMixin"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ElementApiMixin", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["ElementApiMixin"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "secureSourceElement", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["secureSourceElement"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PendingActions", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["PendingActions"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "icons", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["icons"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckeditor5/core
- */
- /***/ }),
- /***/ "./node_modules/ckeditor5/src/engine.js":
- /*!**********************************************!*\
- !*** ./node_modules/ckeditor5/src/engine.js ***!
- \**********************************************/
- /*! exports provided: enablePlaceholder, disablePlaceholder, showPlaceholder, hidePlaceholder, needsPlaceholder, EditingController, DataController, Conversion, HtmlDataProcessor, InsertOperation, MarkerOperation, OperationFactory, transformSets, DocumentSelection, Range, LiveRange, LivePosition, Model, TreeWalker, Element, DomConverter, ViewDocument, getFillerOffset, Observer, ClickObserver, DomEventObserver, MouseObserver, DowncastWriter, UpcastWriter, Matcher, DomEventData, StylesProcessor, addBackgroundRules, addBorderRules, addMarginRules, addPaddingRules, isColor, isLineStyle, isLength, isPercentage, isRepeat, isPosition, isAttachment, isURL, getBoxSidesValues, getBoxSidesValueReducer, getBoxSidesShorthandValue, getPositionShorthandNormalizer, getShorthandValues */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine */ "./node_modules/@ckeditor/ckeditor5-engine/src/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enablePlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["enablePlaceholder"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "disablePlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["disablePlaceholder"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showPlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["showPlaceholder"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hidePlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["hidePlaceholder"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "needsPlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["needsPlaceholder"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditingController", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["EditingController"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataController", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DataController"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Conversion", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Conversion"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HtmlDataProcessor", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["HtmlDataProcessor"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InsertOperation", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["InsertOperation"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkerOperation", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["MarkerOperation"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OperationFactory", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["OperationFactory"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transformSets", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["transformSets"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentSelection", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DocumentSelection"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Range"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LiveRange", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["LiveRange"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LivePosition", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["LivePosition"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Model", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Model"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TreeWalker", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["TreeWalker"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Element"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomConverter", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DomConverter"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewDocument", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["ViewDocument"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFillerOffset", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getFillerOffset"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observer", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Observer"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClickObserver", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["ClickObserver"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEventObserver", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DomEventObserver"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MouseObserver", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["MouseObserver"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DowncastWriter", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DowncastWriter"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UpcastWriter", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["UpcastWriter"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Matcher", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEventData", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DomEventData"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StylesProcessor", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["StylesProcessor"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBackgroundRules", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["addBackgroundRules"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBorderRules", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["addBorderRules"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addMarginRules", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["addMarginRules"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addPaddingRules", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["addPaddingRules"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isColor", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isColor"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLineStyle", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isLineStyle"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isLength"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPercentage", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isPercentage"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRepeat", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isRepeat"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPosition", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isPosition"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isAttachment", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isAttachment"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isURL"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValues", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValueReducer", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesShorthandValue", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesShorthandValue"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPositionShorthandNormalizer", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getPositionShorthandNormalizer"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getShorthandValues", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getShorthandValues"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckeditor5/engine
- */
- /***/ }),
- /***/ "./node_modules/ckeditor5/src/enter.js":
- /*!*********************************************!*\
- !*** ./node_modules/ckeditor5/src/enter.js ***!
- \*********************************************/
- /*! exports provided: Enter, ShiftEnter */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_enter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-enter */ "./node_modules/@ckeditor/ckeditor5-enter/src/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Enter", function() { return _ckeditor_ckeditor5_enter__WEBPACK_IMPORTED_MODULE_0__["Enter"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShiftEnter", function() { return _ckeditor_ckeditor5_enter__WEBPACK_IMPORTED_MODULE_0__["ShiftEnter"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckeditor5/enter
- */
- /***/ }),
- /***/ "./node_modules/ckeditor5/src/paragraph.js":
- /*!*************************************************!*\
- !*** ./node_modules/ckeditor5/src/paragraph.js ***!
- \*************************************************/
- /*! exports provided: Paragraph, ParagraphButtonUI */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_paragraph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Paragraph", function() { return _ckeditor_ckeditor5_paragraph__WEBPACK_IMPORTED_MODULE_0__["Paragraph"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ParagraphButtonUI", function() { return _ckeditor_ckeditor5_paragraph__WEBPACK_IMPORTED_MODULE_0__["ParagraphButtonUI"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckeditor5/paragraph
- */
- /***/ }),
- /***/ "./node_modules/ckeditor5/src/select-all.js":
- /*!**************************************************!*\
- !*** ./node_modules/ckeditor5/src/select-all.js ***!
- \**************************************************/
- /*! exports provided: SelectAll, SelectAllEditing, SelectAllUI */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_select_all__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-select-all */ "./node_modules/@ckeditor/ckeditor5-select-all/src/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAll", function() { return _ckeditor_ckeditor5_select_all__WEBPACK_IMPORTED_MODULE_0__["SelectAll"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAllEditing", function() { return _ckeditor_ckeditor5_select_all__WEBPACK_IMPORTED_MODULE_0__["SelectAllEditing"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAllUI", function() { return _ckeditor_ckeditor5_select_all__WEBPACK_IMPORTED_MODULE_0__["SelectAllUI"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckeditor5/select-all
- */
- /***/ }),
- /***/ "./node_modules/ckeditor5/src/typing.js":
- /*!**********************************************!*\
- !*** ./node_modules/ckeditor5/src/typing.js ***!
- \**********************************************/
- /*! exports provided: Typing, Input, Delete, TextWatcher, TwoStepCaretMovement, TextTransformation, inlineHighlight, findAttributeRange, getLastTextLine, isNonTypingKeystroke */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing */ "./node_modules/@ckeditor/ckeditor5-typing/src/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Typing", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["Typing"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["Input"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Delete", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["Delete"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextWatcher", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["TextWatcher"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TwoStepCaretMovement", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["TwoStepCaretMovement"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextTransformation", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["TextTransformation"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inlineHighlight", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["inlineHighlight"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findAttributeRange", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["findAttributeRange"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLastTextLine", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["getLastTextLine"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNonTypingKeystroke", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["isNonTypingKeystroke"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckeditor5/typing
- */
- /***/ }),
- /***/ "./node_modules/ckeditor5/src/ui.js":
- /*!******************************************!*\
- !*** ./node_modules/ckeditor5/src/ui.js ***!
- \******************************************/
- /*! exports provided: clickOutsideHandler, injectCssTransitionDisabler, submitHandler, BodyCollection, ButtonView, SwitchButtonView, getLocalizedColorOptions, normalizeColorOptions, normalizeSingleColorDefinition, ColorGridView, ColorTileView, DropdownButtonView, SplitButtonView, createDropdown, addToolbarToDropdown, addListToDropdown, EditorUIView, BoxedEditorUIView, InlineEditableUIView, FormHeaderView, FocusCycler, IconView, InputTextView, LabelView, LabeledFieldView, createLabeledInputText, createLabeledDropdown, ListItemView, ListView, Notification, Model, BalloonPanelView, ContextualBalloon, StickyPanelView, TooltipView, Template, ToolbarView, ToolbarSeparatorView, enableToolbarKeyboardFocus, normalizeToolbarConfig, BalloonToolbar, BlockToolbar, View, ViewCollection */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui */ "./node_modules/@ckeditor/ckeditor5-ui/src/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clickOutsideHandler", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["clickOutsideHandler"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "injectCssTransitionDisabler", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["injectCssTransitionDisabler"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "submitHandler", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["submitHandler"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BodyCollection", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BodyCollection"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SwitchButtonView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["SwitchButtonView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocalizedColorOptions", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["getLocalizedColorOptions"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeColorOptions", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["normalizeColorOptions"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeSingleColorDefinition", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["normalizeSingleColorDefinition"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorGridView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ColorGridView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorTileView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ColorTileView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownButtonView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["DropdownButtonView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SplitButtonView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["SplitButtonView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createDropdown", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["createDropdown"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addToolbarToDropdown", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["addToolbarToDropdown"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addListToDropdown", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["addListToDropdown"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorUIView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["EditorUIView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoxedEditorUIView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BoxedEditorUIView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InlineEditableUIView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["InlineEditableUIView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormHeaderView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["FormHeaderView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusCycler", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["FocusCycler"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IconView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["IconView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InputTextView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["InputTextView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LabelView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["LabelView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LabeledFieldView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["LabeledFieldView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLabeledInputText", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["createLabeledInputText"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLabeledDropdown", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["createLabeledDropdown"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListItemView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ListItemView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ListView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["Notification"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Model", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["Model"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BalloonPanelView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BalloonPanelView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextualBalloon", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ContextualBalloon"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StickyPanelView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["StickyPanelView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TooltipView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["TooltipView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Template", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["Template"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ToolbarView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarSeparatorView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ToolbarSeparatorView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enableToolbarKeyboardFocus", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["enableToolbarKeyboardFocus"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeToolbarConfig", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["normalizeToolbarConfig"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BalloonToolbar", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BalloonToolbar"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockToolbar", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BlockToolbar"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "View", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["View"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewCollection", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ViewCollection"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckeditor5/ui
- */
- /***/ }),
- /***/ "./node_modules/ckeditor5/src/undo.js":
- /*!********************************************!*\
- !*** ./node_modules/ckeditor5/src/undo.js ***!
- \********************************************/
- /*! exports provided: Undo, UndoEditing, UndoUi */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_undo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-undo */ "./node_modules/@ckeditor/ckeditor5-undo/src/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Undo", function() { return _ckeditor_ckeditor5_undo__WEBPACK_IMPORTED_MODULE_0__["Undo"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoEditing", function() { return _ckeditor_ckeditor5_undo__WEBPACK_IMPORTED_MODULE_0__["UndoEditing"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoUi", function() { return _ckeditor_ckeditor5_undo__WEBPACK_IMPORTED_MODULE_0__["UndoUi"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckeditor5/undo
- */
- /***/ }),
- /***/ "./node_modules/ckeditor5/src/upload.js":
- /*!**********************************************!*\
- !*** ./node_modules/ckeditor5/src/upload.js ***!
- \**********************************************/
- /*! exports provided: FileRepository, FileDialogButtonView, Base64UploadAdapter, SimpleUploadAdapter */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-upload */ "./node_modules/@ckeditor/ckeditor5-upload/src/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileRepository", function() { return _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__["FileRepository"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileDialogButtonView", function() { return _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__["FileDialogButtonView"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Base64UploadAdapter", function() { return _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__["Base64UploadAdapter"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleUploadAdapter", function() { return _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__["SimpleUploadAdapter"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckeditor5/upload
- */
- /***/ }),
- /***/ "./node_modules/ckeditor5/src/utils.js":
- /*!*********************************************!*\
- !*** ./node_modules/ckeditor5/src/utils.js ***!
- \*********************************************/
- /*! exports provided: env, diff, mix, EmitterMixin, ObservableMixin, CKEditorError, logError, logWarning, ElementReplacer, createElement, DomEmitterMixin, global, getDataFromElement, Rect, ResizeObserver, setDataInElement, toUnit, keyCodes, getCode, parseKeystroke, getEnvKeystrokeText, isArrowKeyCode, getLocalizedArrowKeyCodeDirection, isForwardArrowKeyCode, getLanguageDirection, Locale, Collection, first, FocusTracker, KeystrokeHandler, toArray, toMap, priorities, uid, version */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ "./node_modules/@ckeditor/ckeditor5-utils/src/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "env", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["env"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "diff", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["diff"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mix", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["mix"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmitterMixin", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["EmitterMixin"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObservableMixin", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["ObservableMixin"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CKEditorError", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logError", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["logError"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logWarning", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["logWarning"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ElementReplacer", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["ElementReplacer"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["createElement"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEmitterMixin", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["DomEmitterMixin"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "global", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["global"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDataFromElement", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getDataFromElement"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Rect", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["Rect"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResizeObserver", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["ResizeObserver"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setDataInElement", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["setDataInElement"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUnit", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["toUnit"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyCodes", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["keyCodes"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getCode"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseKeystroke", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["parseKeystroke"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnvKeystrokeText", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getEnvKeystrokeText"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrowKeyCode", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["isArrowKeyCode"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocalizedArrowKeyCodeDirection", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getLocalizedArrowKeyCodeDirection"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isForwardArrowKeyCode", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["isForwardArrowKeyCode"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLanguageDirection", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getLanguageDirection"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Locale", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["Locale"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Collection", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["Collection"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["first"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusTracker", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["FocusTracker"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KeystrokeHandler", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["KeystrokeHandler"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["toArray"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toMap", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["toMap"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "priorities", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["priorities"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uid", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["uid"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "version", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["version"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckeditor5/utils
- */
- /***/ }),
- /***/ "./node_modules/ckeditor5/src/widget.js":
- /*!**********************************************!*\
- !*** ./node_modules/ckeditor5/src/widget.js ***!
- \**********************************************/
- /*! exports provided: Widget, WidgetToolbarRepository, WidgetResize, WidgetTypeAround, WIDGET_CLASS_NAME, WIDGET_SELECTED_CLASS_NAME, isWidget, toWidget, setHighlightHandling, setLabel, getLabel, toWidgetEditable, findOptimalInsertionPosition, checkSelectionOnObject, viewToModelPositionOutsideModelElement, centeredBalloonPositionForLongWidgets */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget */ "./node_modules/@ckeditor/ckeditor5-widget/src/index.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Widget", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["Widget"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetToolbarRepository", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WidgetToolbarRepository"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetResize", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WidgetResize"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetTypeAround", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WidgetTypeAround"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WIDGET_CLASS_NAME", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WIDGET_CLASS_NAME"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WIDGET_SELECTED_CLASS_NAME", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WIDGET_SELECTED_CLASS_NAME"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWidget", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["isWidget"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toWidget", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["toWidget"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setHighlightHandling", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["setHighlightHandling"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setLabel", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["setLabel"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLabel", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["getLabel"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toWidgetEditable", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["toWidgetEditable"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findOptimalInsertionPosition", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["findOptimalInsertionPosition"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "checkSelectionOnObject", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["checkSelectionOnObject"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "viewToModelPositionOutsideModelElement", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["viewToModelPositionOutsideModelElement"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "centeredBalloonPositionForLongWidgets", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["centeredBalloonPositionForLongWidgets"]; });
- /**
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module ckeditor5/widget
- */
- /***/ }),
- /***/ "./node_modules/lodash-es/_DataView.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_DataView.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /* Built-in method references that are verified to be native. */
- var DataView = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'DataView');
- /* harmony default export */ __webpack_exports__["default"] = (DataView);
- /***/ }),
- /***/ "./node_modules/lodash-es/_Hash.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/_Hash.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _hashClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_hashClear.js */ "./node_modules/lodash-es/_hashClear.js");
- /* harmony import */ var _hashDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hashDelete.js */ "./node_modules/lodash-es/_hashDelete.js");
- /* harmony import */ var _hashGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hashGet.js */ "./node_modules/lodash-es/_hashGet.js");
- /* harmony import */ var _hashHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_hashHas.js */ "./node_modules/lodash-es/_hashHas.js");
- /* harmony import */ var _hashSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_hashSet.js */ "./node_modules/lodash-es/_hashSet.js");
- /**
- * Creates a hash object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function Hash(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- // Add methods to `Hash`.
- Hash.prototype.clear = _hashClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- Hash.prototype['delete'] = _hashDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- Hash.prototype.get = _hashGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
- Hash.prototype.has = _hashHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
- Hash.prototype.set = _hashSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (Hash);
- /***/ }),
- /***/ "./node_modules/lodash-es/_LazyWrapper.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_LazyWrapper.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
- /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
- /** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = 4294967295;
- /**
- * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
- *
- * @private
- * @constructor
- * @param {*} value The value to wrap.
- */
- function LazyWrapper(value) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__dir__ = 1;
- this.__filtered__ = false;
- this.__iteratees__ = [];
- this.__takeCount__ = MAX_ARRAY_LENGTH;
- this.__views__ = [];
- }
- // Ensure `LazyWrapper` is an instance of `baseLodash`.
- LazyWrapper.prototype = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_baseLodash_js__WEBPACK_IMPORTED_MODULE_1__["default"].prototype);
- LazyWrapper.prototype.constructor = LazyWrapper;
- /* harmony default export */ __webpack_exports__["default"] = (LazyWrapper);
- /***/ }),
- /***/ "./node_modules/lodash-es/_ListCache.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_ListCache.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _listCacheClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_listCacheClear.js */ "./node_modules/lodash-es/_listCacheClear.js");
- /* harmony import */ var _listCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_listCacheDelete.js */ "./node_modules/lodash-es/_listCacheDelete.js");
- /* harmony import */ var _listCacheGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_listCacheGet.js */ "./node_modules/lodash-es/_listCacheGet.js");
- /* harmony import */ var _listCacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_listCacheHas.js */ "./node_modules/lodash-es/_listCacheHas.js");
- /* harmony import */ var _listCacheSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_listCacheSet.js */ "./node_modules/lodash-es/_listCacheSet.js");
- /**
- * Creates an list cache object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function ListCache(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- // Add methods to `ListCache`.
- ListCache.prototype.clear = _listCacheClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- ListCache.prototype['delete'] = _listCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- ListCache.prototype.get = _listCacheGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
- ListCache.prototype.has = _listCacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
- ListCache.prototype.set = _listCacheSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (ListCache);
- /***/ }),
- /***/ "./node_modules/lodash-es/_LodashWrapper.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_LodashWrapper.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
- /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
- /**
- * The base constructor for creating `lodash` wrapper objects.
- *
- * @private
- * @param {*} value The value to wrap.
- * @param {boolean} [chainAll] Enable explicit method chain sequences.
- */
- function LodashWrapper(value, chainAll) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__chain__ = !!chainAll;
- this.__index__ = 0;
- this.__values__ = undefined;
- }
- LodashWrapper.prototype = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_baseLodash_js__WEBPACK_IMPORTED_MODULE_1__["default"].prototype);
- LodashWrapper.prototype.constructor = LodashWrapper;
- /* harmony default export */ __webpack_exports__["default"] = (LodashWrapper);
- /***/ }),
- /***/ "./node_modules/lodash-es/_Map.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/_Map.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /* Built-in method references that are verified to be native. */
- var Map = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Map');
- /* harmony default export */ __webpack_exports__["default"] = (Map);
- /***/ }),
- /***/ "./node_modules/lodash-es/_MapCache.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_MapCache.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _mapCacheClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_mapCacheClear.js */ "./node_modules/lodash-es/_mapCacheClear.js");
- /* harmony import */ var _mapCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_mapCacheDelete.js */ "./node_modules/lodash-es/_mapCacheDelete.js");
- /* harmony import */ var _mapCacheGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_mapCacheGet.js */ "./node_modules/lodash-es/_mapCacheGet.js");
- /* harmony import */ var _mapCacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_mapCacheHas.js */ "./node_modules/lodash-es/_mapCacheHas.js");
- /* harmony import */ var _mapCacheSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_mapCacheSet.js */ "./node_modules/lodash-es/_mapCacheSet.js");
- /**
- * Creates a map cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function MapCache(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- // Add methods to `MapCache`.
- MapCache.prototype.clear = _mapCacheClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- MapCache.prototype['delete'] = _mapCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- MapCache.prototype.get = _mapCacheGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
- MapCache.prototype.has = _mapCacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
- MapCache.prototype.set = _mapCacheSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (MapCache);
- /***/ }),
- /***/ "./node_modules/lodash-es/_Promise.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_Promise.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /* Built-in method references that are verified to be native. */
- var Promise = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Promise');
- /* harmony default export */ __webpack_exports__["default"] = (Promise);
- /***/ }),
- /***/ "./node_modules/lodash-es/_Set.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/_Set.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /* Built-in method references that are verified to be native. */
- var Set = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Set');
- /* harmony default export */ __webpack_exports__["default"] = (Set);
- /***/ }),
- /***/ "./node_modules/lodash-es/_SetCache.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_SetCache.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
- /* harmony import */ var _setCacheAdd_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setCacheAdd.js */ "./node_modules/lodash-es/_setCacheAdd.js");
- /* harmony import */ var _setCacheHas_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setCacheHas.js */ "./node_modules/lodash-es/_setCacheHas.js");
- /**
- *
- * Creates an array cache object to store unique values.
- *
- * @private
- * @constructor
- * @param {Array} [values] The values to cache.
- */
- function SetCache(values) {
- var index = -1,
- length = values == null ? 0 : values.length;
- this.__data__ = new _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- while (++index < length) {
- this.add(values[index]);
- }
- }
- // Add methods to `SetCache`.
- SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- SetCache.prototype.has = _setCacheHas_js__WEBPACK_IMPORTED_MODULE_2__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (SetCache);
- /***/ }),
- /***/ "./node_modules/lodash-es/_Stack.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/_Stack.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
- /* harmony import */ var _stackClear_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stackClear.js */ "./node_modules/lodash-es/_stackClear.js");
- /* harmony import */ var _stackDelete_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stackDelete.js */ "./node_modules/lodash-es/_stackDelete.js");
- /* harmony import */ var _stackGet_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stackGet.js */ "./node_modules/lodash-es/_stackGet.js");
- /* harmony import */ var _stackHas_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stackHas.js */ "./node_modules/lodash-es/_stackHas.js");
- /* harmony import */ var _stackSet_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stackSet.js */ "./node_modules/lodash-es/_stackSet.js");
- /**
- * Creates a stack cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function Stack(entries) {
- var data = this.__data__ = new _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](entries);
- this.size = data.size;
- }
- // Add methods to `Stack`.
- Stack.prototype.clear = _stackClear_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- Stack.prototype['delete'] = _stackDelete_js__WEBPACK_IMPORTED_MODULE_2__["default"];
- Stack.prototype.get = _stackGet_js__WEBPACK_IMPORTED_MODULE_3__["default"];
- Stack.prototype.has = _stackHas_js__WEBPACK_IMPORTED_MODULE_4__["default"];
- Stack.prototype.set = _stackSet_js__WEBPACK_IMPORTED_MODULE_5__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (Stack);
- /***/ }),
- /***/ "./node_modules/lodash-es/_Symbol.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/_Symbol.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /** Built-in value references. */
- var Symbol = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Symbol;
- /* harmony default export */ __webpack_exports__["default"] = (Symbol);
- /***/ }),
- /***/ "./node_modules/lodash-es/_Uint8Array.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_Uint8Array.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /** Built-in value references. */
- var Uint8Array = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Uint8Array;
- /* harmony default export */ __webpack_exports__["default"] = (Uint8Array);
- /***/ }),
- /***/ "./node_modules/lodash-es/_WeakMap.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_WeakMap.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /* Built-in method references that are verified to be native. */
- var WeakMap = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'WeakMap');
- /* harmony default export */ __webpack_exports__["default"] = (WeakMap);
- /***/ }),
- /***/ "./node_modules/lodash-es/_apply.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/_apply.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A faster alternative to `Function#apply`, this function invokes `func`
- * with the `this` binding of `thisArg` and the arguments of `args`.
- *
- * @private
- * @param {Function} func The function to invoke.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {Array} args The arguments to invoke `func` with.
- * @returns {*} Returns the result of `func`.
- */
- function apply(func, thisArg, args) {
- switch (args.length) {
- case 0: return func.call(thisArg);
- case 1: return func.call(thisArg, args[0]);
- case 2: return func.call(thisArg, args[0], args[1]);
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
- }
- return func.apply(thisArg, args);
- }
- /* harmony default export */ __webpack_exports__["default"] = (apply);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayAggregator.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_arrayAggregator.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A specialized version of `baseAggregator` for arrays.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} setter The function to set `accumulator` values.
- * @param {Function} iteratee The iteratee to transform keys.
- * @param {Object} accumulator The initial aggregated object.
- * @returns {Function} Returns `accumulator`.
- */
- function arrayAggregator(array, setter, iteratee, accumulator) {
- var index = -1,
- length = array == null ? 0 : array.length;
- while (++index < length) {
- var value = array[index];
- setter(accumulator, value, iteratee(value), array);
- }
- return accumulator;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayAggregator);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayEach.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_arrayEach.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A specialized version of `_.forEach` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEach(array, iteratee) {
- var index = -1,
- length = array == null ? 0 : array.length;
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayEach);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayEachRight.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_arrayEachRight.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A specialized version of `_.forEachRight` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEachRight(array, iteratee) {
- var length = array == null ? 0 : array.length;
- while (length--) {
- if (iteratee(array[length], length, array) === false) {
- break;
- }
- }
- return array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayEachRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayEvery.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_arrayEvery.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A specialized version of `_.every` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- */
- function arrayEvery(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length;
- while (++index < length) {
- if (!predicate(array[index], index, array)) {
- return false;
- }
- }
- return true;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayEvery);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayFilter.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_arrayFilter.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A specialized version of `_.filter` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function arrayFilter(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length,
- resIndex = 0,
- result = [];
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayFilter);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayIncludes.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_arrayIncludes.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
- /**
- * A specialized version of `_.includes` for arrays without support for
- * specifying an index to search from.
- *
- * @private
- * @param {Array} [array] The array to inspect.
- * @param {*} target The value to search for.
- * @returns {boolean} Returns `true` if `target` is found, else `false`.
- */
- function arrayIncludes(array, value) {
- var length = array == null ? 0 : array.length;
- return !!length && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, 0) > -1;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayIncludes);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayIncludesWith.js":
- /*!******************************************************!*\
- !*** ./node_modules/lodash-es/_arrayIncludesWith.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This function is like `arrayIncludes` except that it accepts a comparator.
- *
- * @private
- * @param {Array} [array] The array to inspect.
- * @param {*} target The value to search for.
- * @param {Function} comparator The comparator invoked per element.
- * @returns {boolean} Returns `true` if `target` is found, else `false`.
- */
- function arrayIncludesWith(array, value, comparator) {
- var index = -1,
- length = array == null ? 0 : array.length;
- while (++index < length) {
- if (comparator(value, array[index])) {
- return true;
- }
- }
- return false;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayIncludesWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayLikeKeys.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_arrayLikeKeys.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
- /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
- /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
- /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Creates an array of the enumerable property names of the array-like `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @param {boolean} inherited Specify returning inherited property names.
- * @returns {Array} Returns the array of property names.
- */
- function arrayLikeKeys(value, inherited) {
- var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value),
- isArg = !isArr && Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value),
- isBuff = !isArr && !isArg && Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value),
- isType = !isArr && !isArg && !isBuff && Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value),
- skipIndexes = isArr || isArg || isBuff || isType,
- result = skipIndexes ? Object(_baseTimes_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value.length, String) : [],
- length = result.length;
- for (var key in value) {
- if ((inherited || hasOwnProperty.call(value, key)) &&
- !(skipIndexes && (
- // Safari 9 has enumerable `arguments.length` in strict mode.
- key == 'length' ||
- // Node.js 0.10 has enumerable non-index properties on buffers.
- (isBuff && (key == 'offset' || key == 'parent')) ||
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
- // Skip index properties.
- Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_4__["default"])(key, length)
- ))) {
- result.push(key);
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayLikeKeys);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayMap.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_arrayMap.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A specialized version of `_.map` for arrays without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function arrayMap(array, iteratee) {
- var index = -1,
- length = array == null ? 0 : array.length,
- result = Array(length);
- while (++index < length) {
- result[index] = iteratee(array[index], index, array);
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayMap);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayPush.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_arrayPush.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Appends the elements of `values` to `array`.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {Array} values The values to append.
- * @returns {Array} Returns `array`.
- */
- function arrayPush(array, values) {
- var index = -1,
- length = values.length,
- offset = array.length;
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayPush);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayReduce.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_arrayReduce.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A specialized version of `_.reduce` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initAccum] Specify using the first element of `array` as
- * the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduce(array, iteratee, accumulator, initAccum) {
- var index = -1,
- length = array == null ? 0 : array.length;
- if (initAccum && length) {
- accumulator = array[++index];
- }
- while (++index < length) {
- accumulator = iteratee(accumulator, array[index], index, array);
- }
- return accumulator;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayReduce);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayReduceRight.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_arrayReduceRight.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A specialized version of `_.reduceRight` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initAccum] Specify using the last element of `array` as
- * the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduceRight(array, iteratee, accumulator, initAccum) {
- var length = array == null ? 0 : array.length;
- if (initAccum && length) {
- accumulator = array[--length];
- }
- while (length--) {
- accumulator = iteratee(accumulator, array[length], length, array);
- }
- return accumulator;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayReduceRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arraySample.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_arraySample.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRandom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRandom.js */ "./node_modules/lodash-es/_baseRandom.js");
- /**
- * A specialized version of `_.sample` for arrays.
- *
- * @private
- * @param {Array} array The array to sample.
- * @returns {*} Returns the random element.
- */
- function arraySample(array) {
- var length = array.length;
- return length ? array[Object(_baseRandom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(0, length - 1)] : undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arraySample);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arraySampleSize.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_arraySampleSize.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
- /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
- /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
- /**
- * A specialized version of `_.sampleSize` for arrays.
- *
- * @private
- * @param {Array} array The array to sample.
- * @param {number} n The number of elements to sample.
- * @returns {Array} Returns the random elements.
- */
- function arraySampleSize(array, n) {
- return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array), Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n, 0, array.length));
- }
- /* harmony default export */ __webpack_exports__["default"] = (arraySampleSize);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arrayShuffle.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_arrayShuffle.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
- /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
- /**
- * A specialized version of `_.shuffle` for arrays.
- *
- * @private
- * @param {Array} array The array to shuffle.
- * @returns {Array} Returns the new shuffled array.
- */
- function arrayShuffle(array) {
- return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array));
- }
- /* harmony default export */ __webpack_exports__["default"] = (arrayShuffle);
- /***/ }),
- /***/ "./node_modules/lodash-es/_arraySome.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_arraySome.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A specialized version of `_.some` for arrays without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
- function arraySome(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length;
- while (++index < length) {
- if (predicate(array[index], index, array)) {
- return true;
- }
- }
- return false;
- }
- /* harmony default export */ __webpack_exports__["default"] = (arraySome);
- /***/ }),
- /***/ "./node_modules/lodash-es/_asciiSize.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_asciiSize.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseProperty.js */ "./node_modules/lodash-es/_baseProperty.js");
- /**
- * Gets the size of an ASCII `string`.
- *
- * @private
- * @param {string} string The string inspect.
- * @returns {number} Returns the string size.
- */
- var asciiSize = Object(_baseProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])('length');
- /* harmony default export */ __webpack_exports__["default"] = (asciiSize);
- /***/ }),
- /***/ "./node_modules/lodash-es/_asciiToArray.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_asciiToArray.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Converts an ASCII `string` to an array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the converted array.
- */
- function asciiToArray(string) {
- return string.split('');
- }
- /* harmony default export */ __webpack_exports__["default"] = (asciiToArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/_asciiWords.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_asciiWords.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to match words composed of alphanumeric characters. */
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
- /**
- * Splits an ASCII `string` into an array of its words.
- *
- * @private
- * @param {string} The string to inspect.
- * @returns {Array} Returns the words of `string`.
- */
- function asciiWords(string) {
- return string.match(reAsciiWord) || [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (asciiWords);
- /***/ }),
- /***/ "./node_modules/lodash-es/_assignMergeValue.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_assignMergeValue.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /**
- * This function is like `assignValue` except that it doesn't assign
- * `undefined` values.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function assignMergeValue(object, key, value) {
- if ((value !== undefined && !Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object[key], value)) ||
- (value === undefined && !(key in object))) {
- Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, value);
- }
- }
- /* harmony default export */ __webpack_exports__["default"] = (assignMergeValue);
- /***/ }),
- /***/ "./node_modules/lodash-es/_assignValue.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_assignValue.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function assignValue(object, key, value) {
- var objValue = object[key];
- if (!(hasOwnProperty.call(object, key) && Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(objValue, value)) ||
- (value === undefined && !(key in object))) {
- Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, value);
- }
- }
- /* harmony default export */ __webpack_exports__["default"] = (assignValue);
- /***/ }),
- /***/ "./node_modules/lodash-es/_assocIndexOf.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_assocIndexOf.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /**
- * Gets the index at which the `key` is found in `array` of key-value pairs.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} key The key to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
- /* harmony default export */ __webpack_exports__["default"] = (assocIndexOf);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseAggregator.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_baseAggregator.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
- /**
- * Aggregates elements of `collection` on `accumulator` with keys transformed
- * by `iteratee` and values set by `setter`.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} setter The function to set `accumulator` values.
- * @param {Function} iteratee The iteratee to transform keys.
- * @param {Object} accumulator The initial aggregated object.
- * @returns {Function} Returns `accumulator`.
- */
- function baseAggregator(collection, setter, iteratee, accumulator) {
- Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, key, collection) {
- setter(accumulator, value, iteratee(value), collection);
- });
- return accumulator;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseAggregator);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseAssign.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseAssign.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * The base implementation of `_.assign` without support for multiple sources
- * or `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
- function baseAssign(object, source) {
- return object && Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseAssign);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseAssignIn.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_baseAssignIn.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /**
- * The base implementation of `_.assignIn` without support for multiple sources
- * or `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
- function baseAssignIn(object, source) {
- return object && Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseAssignIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseAssignValue.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_baseAssignValue.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_defineProperty.js */ "./node_modules/lodash-es/_defineProperty.js");
- /**
- * The base implementation of `assignValue` and `assignMergeValue` without
- * value checks.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function baseAssignValue(object, key, value) {
- if (key == '__proto__' && _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
- Object(_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, {
- 'configurable': true,
- 'enumerable': true,
- 'value': value,
- 'writable': true
- });
- } else {
- object[key] = value;
- }
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseAssignValue);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseAt.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/_baseAt.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
- /**
- * The base implementation of `_.at` without support for individual paths.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {string[]} paths The property paths to pick.
- * @returns {Array} Returns the picked elements.
- */
- function baseAt(object, paths) {
- var index = -1,
- length = paths.length,
- result = Array(length),
- skip = object == null;
- while (++index < length) {
- result[index] = skip ? undefined : Object(_get_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths[index]);
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseAt);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseClamp.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseClamp.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.clamp` which doesn't coerce arguments.
- *
- * @private
- * @param {number} number The number to clamp.
- * @param {number} [lower] The lower bound.
- * @param {number} upper The upper bound.
- * @returns {number} Returns the clamped number.
- */
- function baseClamp(number, lower, upper) {
- if (number === number) {
- if (upper !== undefined) {
- number = number <= upper ? number : upper;
- }
- if (lower !== undefined) {
- number = number >= lower ? number : lower;
- }
- }
- return number;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseClamp);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseClone.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseClone.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
- /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
- /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
- /* harmony import */ var _baseAssign_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseAssign.js */ "./node_modules/lodash-es/_baseAssign.js");
- /* harmony import */ var _baseAssignIn_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseAssignIn.js */ "./node_modules/lodash-es/_baseAssignIn.js");
- /* harmony import */ var _cloneBuffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_cloneBuffer.js */ "./node_modules/lodash-es/_cloneBuffer.js");
- /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
- /* harmony import */ var _copySymbols_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_copySymbols.js */ "./node_modules/lodash-es/_copySymbols.js");
- /* harmony import */ var _copySymbolsIn_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_copySymbolsIn.js */ "./node_modules/lodash-es/_copySymbolsIn.js");
- /* harmony import */ var _getAllKeys_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./_getAllKeys.js */ "./node_modules/lodash-es/_getAllKeys.js");
- /* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
- /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
- /* harmony import */ var _initCloneArray_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_initCloneArray.js */ "./node_modules/lodash-es/_initCloneArray.js");
- /* harmony import */ var _initCloneByTag_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_initCloneByTag.js */ "./node_modules/lodash-es/_initCloneByTag.js");
- /* harmony import */ var _initCloneObject_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_initCloneObject.js */ "./node_modules/lodash-es/_initCloneObject.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
- /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1,
- CLONE_FLAT_FLAG = 2,
- CLONE_SYMBOLS_FLAG = 4;
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- objectTag = '[object Object]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- symbolTag = '[object Symbol]',
- weakMapTag = '[object WeakMap]';
- var arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
- /** Used to identify `toStringTag` values supported by `_.clone`. */
- var cloneableTags = {};
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
- cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
- cloneableTags[boolTag] = cloneableTags[dateTag] =
- cloneableTags[float32Tag] = cloneableTags[float64Tag] =
- cloneableTags[int8Tag] = cloneableTags[int16Tag] =
- cloneableTags[int32Tag] = cloneableTags[mapTag] =
- cloneableTags[numberTag] = cloneableTags[objectTag] =
- cloneableTags[regexpTag] = cloneableTags[setTag] =
- cloneableTags[stringTag] = cloneableTags[symbolTag] =
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
- cloneableTags[errorTag] = cloneableTags[funcTag] =
- cloneableTags[weakMapTag] = false;
- /**
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
- * traversed objects.
- *
- * @private
- * @param {*} value The value to clone.
- * @param {boolean} bitmask The bitmask flags.
- * 1 - Deep clone
- * 2 - Flatten inherited properties
- * 4 - Clone symbols
- * @param {Function} [customizer] The function to customize cloning.
- * @param {string} [key] The key of `value`.
- * @param {Object} [object] The parent object of `value`.
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
- * @returns {*} Returns the cloned value.
- */
- function baseClone(value, bitmask, customizer, key, object, stack) {
- var result,
- isDeep = bitmask & CLONE_DEEP_FLAG,
- isFlat = bitmask & CLONE_FLAT_FLAG,
- isFull = bitmask & CLONE_SYMBOLS_FLAG;
- if (customizer) {
- result = object ? customizer(value, key, object, stack) : customizer(value);
- }
- if (result !== undefined) {
- return result;
- }
- if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_18__["default"])(value)) {
- return value;
- }
- var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_15__["default"])(value);
- if (isArr) {
- result = Object(_initCloneArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(value);
- if (!isDeep) {
- return Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value, result);
- }
- } else {
- var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_11__["default"])(value),
- isFunc = tag == funcTag || tag == genTag;
- if (Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_16__["default"])(value)) {
- return Object(_cloneBuffer_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value, isDeep);
- }
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
- result = (isFlat || isFunc) ? {} : Object(_initCloneObject_js__WEBPACK_IMPORTED_MODULE_14__["default"])(value);
- if (!isDeep) {
- return isFlat
- ? Object(_copySymbolsIn_js__WEBPACK_IMPORTED_MODULE_8__["default"])(value, Object(_baseAssignIn_js__WEBPACK_IMPORTED_MODULE_4__["default"])(result, value))
- : Object(_copySymbols_js__WEBPACK_IMPORTED_MODULE_7__["default"])(value, Object(_baseAssign_js__WEBPACK_IMPORTED_MODULE_3__["default"])(result, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object ? value : {};
- }
- result = Object(_initCloneByTag_js__WEBPACK_IMPORTED_MODULE_13__["default"])(value, tag, isDeep);
- }
- }
- // Check for circular references and return its corresponding clone.
- stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- var stacked = stack.get(value);
- if (stacked) {
- return stacked;
- }
- stack.set(value, result);
- if (Object(_isSet_js__WEBPACK_IMPORTED_MODULE_19__["default"])(value)) {
- value.forEach(function(subValue) {
- result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
- });
- } else if (Object(_isMap_js__WEBPACK_IMPORTED_MODULE_17__["default"])(value)) {
- value.forEach(function(subValue, key) {
- result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
- });
- }
- var keysFunc = isFull
- ? (isFlat ? _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_10__["default"] : _getAllKeys_js__WEBPACK_IMPORTED_MODULE_9__["default"])
- : (isFlat ? _keysIn_js__WEBPACK_IMPORTED_MODULE_21__["default"] : _keys_js__WEBPACK_IMPORTED_MODULE_20__["default"]);
- var props = isArr ? undefined : keysFunc(value);
- Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(props || value, function(subValue, key) {
- if (props) {
- key = subValue;
- subValue = value[key];
- }
- // Recursively populate clone (susceptible to call stack limits).
- Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
- });
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseClone);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseConforms.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_baseConforms.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseConformsTo.js */ "./node_modules/lodash-es/_baseConformsTo.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * The base implementation of `_.conforms` which doesn't clone `source`.
- *
- * @private
- * @param {Object} source The object of property predicates to conform to.
- * @returns {Function} Returns the new spec function.
- */
- function baseConforms(source) {
- var props = Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source);
- return function(object) {
- return Object(_baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, props);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseConforms);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseConformsTo.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_baseConformsTo.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.conformsTo` which accepts `props` to check.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property predicates to conform to.
- * @returns {boolean} Returns `true` if `object` conforms, else `false`.
- */
- function baseConformsTo(object, source, props) {
- var length = props.length;
- if (object == null) {
- return !length;
- }
- object = Object(object);
- while (length--) {
- var key = props[length],
- predicate = source[key],
- value = object[key];
- if ((value === undefined && !(key in object)) || !predicate(value)) {
- return false;
- }
- }
- return true;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseConformsTo);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseCreate.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseCreate.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /** Built-in value references. */
- var objectCreate = Object.create;
- /**
- * The base implementation of `_.create` without support for assigning
- * properties to the created object.
- *
- * @private
- * @param {Object} proto The object to inherit from.
- * @returns {Object} Returns the new object.
- */
- var baseCreate = (function() {
- function object() {}
- return function(proto) {
- if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(proto)) {
- return {};
- }
- if (objectCreate) {
- return objectCreate(proto);
- }
- object.prototype = proto;
- var result = new object;
- object.prototype = undefined;
- return result;
- };
- }());
- /* harmony default export */ __webpack_exports__["default"] = (baseCreate);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseDelay.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseDelay.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Error message constants. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /**
- * The base implementation of `_.delay` and `_.defer` which accepts `args`
- * to provide to `func`.
- *
- * @private
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {Array} args The arguments to provide to `func`.
- * @returns {number|Object} Returns the timer id or timeout object.
- */
- function baseDelay(func, wait, args) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return setTimeout(function() { func.apply(undefined, args); }, wait);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseDelay);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseDifference.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_baseDifference.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
- /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
- /* harmony import */ var _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayIncludesWith.js */ "./node_modules/lodash-es/_arrayIncludesWith.js");
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
- /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
- /** Used as the size to enable large array optimizations. */
- var LARGE_ARRAY_SIZE = 200;
- /**
- * The base implementation of methods like `_.difference` without support
- * for excluding multiple arrays or iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Array} values The values to exclude.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- */
- function baseDifference(array, values, iteratee, comparator) {
- var index = -1,
- includes = _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
- isCommon = true,
- length = array.length,
- result = [],
- valuesLength = values.length;
- if (!length) {
- return result;
- }
- if (iteratee) {
- values = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_3__["default"])(values, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee));
- }
- if (comparator) {
- includes = _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__["default"];
- isCommon = false;
- }
- else if (values.length >= LARGE_ARRAY_SIZE) {
- includes = _cacheHas_js__WEBPACK_IMPORTED_MODULE_5__["default"];
- isCommon = false;
- values = new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](values);
- }
- outer:
- while (++index < length) {
- var value = array[index],
- computed = iteratee == null ? value : iteratee(value);
- value = (comparator || value !== 0) ? value : 0;
- if (isCommon && computed === computed) {
- var valuesIndex = valuesLength;
- while (valuesIndex--) {
- if (values[valuesIndex] === computed) {
- continue outer;
- }
- }
- result.push(value);
- }
- else if (!includes(values, computed, comparator)) {
- result.push(value);
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseDifference);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseEach.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_baseEach.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
- /* harmony import */ var _createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createBaseEach.js */ "./node_modules/lodash-es/_createBaseEach.js");
- /**
- * The base implementation of `_.forEach` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- */
- var baseEach = Object(_createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (baseEach);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseEachRight.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_baseEachRight.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwnRight.js */ "./node_modules/lodash-es/_baseForOwnRight.js");
- /* harmony import */ var _createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createBaseEach.js */ "./node_modules/lodash-es/_createBaseEach.js");
- /**
- * The base implementation of `_.forEachRight` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- */
- var baseEachRight = Object(_createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__["default"], true);
- /* harmony default export */ __webpack_exports__["default"] = (baseEachRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseEvery.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseEvery.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
- /**
- * The base implementation of `_.every` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`
- */
- function baseEvery(collection, predicate) {
- var result = true;
- Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, index, collection) {
- result = !!predicate(value, index, collection);
- return result;
- });
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseEvery);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseExtremum.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_baseExtremum.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /**
- * The base implementation of methods like `_.max` and `_.min` which accepts a
- * `comparator` to determine the extremum value.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The iteratee invoked per iteration.
- * @param {Function} comparator The comparator used to compare values.
- * @returns {*} Returns the extremum value.
- */
- function baseExtremum(array, iteratee, comparator) {
- var index = -1,
- length = array.length;
- while (++index < length) {
- var value = array[index],
- current = iteratee(value);
- if (current != null && (computed === undefined
- ? (current === current && !Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(current))
- : comparator(current, computed)
- )) {
- var computed = current,
- result = value;
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseExtremum);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseFill.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_baseFill.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
- /**
- * The base implementation of `_.fill` without an iteratee call guard.
- *
- * @private
- * @param {Array} array The array to fill.
- * @param {*} value The value to fill `array` with.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns `array`.
- */
- function baseFill(array, value, start, end) {
- var length = array.length;
- start = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(start);
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = (end === undefined || end > length) ? length : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(end);
- if (end < 0) {
- end += length;
- }
- end = start > end ? 0 : Object(_toLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(end);
- while (start < end) {
- array[start++] = value;
- }
- return array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseFill);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseFilter.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseFilter.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
- /**
- * The base implementation of `_.filter` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function baseFilter(collection, predicate) {
- var result = [];
- Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, index, collection) {
- if (predicate(value, index, collection)) {
- result.push(value);
- }
- });
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseFilter);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseFindIndex.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_baseFindIndex.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.findIndex` and `_.findLastIndex` without
- * support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} predicate The function invoked per iteration.
- * @param {number} fromIndex The index to search from.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
- var length = array.length,
- index = fromIndex + (fromRight ? 1 : -1);
- while ((fromRight ? index-- : ++index < length)) {
- if (predicate(array[index], index, array)) {
- return index;
- }
- }
- return -1;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseFindIndex);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseFindKey.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_baseFindKey.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of methods like `_.findKey` and `_.findLastKey`,
- * without support for iteratee shorthands, which iterates over `collection`
- * using `eachFunc`.
- *
- * @private
- * @param {Array|Object} collection The collection to inspect.
- * @param {Function} predicate The function invoked per iteration.
- * @param {Function} eachFunc The function to iterate over `collection`.
- * @returns {*} Returns the found element or its key, else `undefined`.
- */
- function baseFindKey(collection, predicate, eachFunc) {
- var result;
- eachFunc(collection, function(value, key, collection) {
- if (predicate(value, key, collection)) {
- result = key;
- return false;
- }
- });
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseFindKey);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseFlatten.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_baseFlatten.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
- /* harmony import */ var _isFlattenable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isFlattenable.js */ "./node_modules/lodash-es/_isFlattenable.js");
- /**
- * The base implementation of `_.flatten` with support for restricting flattening.
- *
- * @private
- * @param {Array} array The array to flatten.
- * @param {number} depth The maximum recursion depth.
- * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
- * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
- * @param {Array} [result=[]] The initial result value.
- * @returns {Array} Returns the new flattened array.
- */
- function baseFlatten(array, depth, predicate, isStrict, result) {
- var index = -1,
- length = array.length;
- predicate || (predicate = _isFlattenable_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- result || (result = []);
- while (++index < length) {
- var value = array[index];
- if (depth > 0 && predicate(value)) {
- if (depth > 1) {
- // Recursively flatten arrays (susceptible to call stack limits).
- baseFlatten(value, depth - 1, predicate, isStrict, result);
- } else {
- Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, value);
- }
- } else if (!isStrict) {
- result[result.length] = value;
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseFlatten);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseFor.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_baseFor.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createBaseFor.js */ "./node_modules/lodash-es/_createBaseFor.js");
- /**
- * The base implementation of `baseForOwn` which iterates over `object`
- * properties returned by `keysFunc` and invokes `iteratee` for each property.
- * Iteratee functions may exit iteration early by explicitly returning `false`.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
- var baseFor = Object(_createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
- /* harmony default export */ __webpack_exports__["default"] = (baseFor);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseForOwn.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseForOwn.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * The base implementation of `_.forOwn` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForOwn(object, iteratee) {
- return object && Object(_baseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, iteratee, _keys_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseForOwn);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseForOwnRight.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_baseForOwnRight.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseForRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForRight.js */ "./node_modules/lodash-es/_baseForRight.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForOwnRight(object, iteratee) {
- return object && Object(_baseForRight_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, iteratee, _keys_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseForOwnRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseForRight.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_baseForRight.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createBaseFor.js */ "./node_modules/lodash-es/_createBaseFor.js");
- /**
- * This function is like `baseFor` except that it iterates over properties
- * in the opposite order.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
- var baseForRight = Object(_createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(true);
- /* harmony default export */ __webpack_exports__["default"] = (baseForRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseFunctions.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_baseFunctions.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
- /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
- /**
- * The base implementation of `_.functions` which creates an array of
- * `object` function property names filtered from `props`.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Array} props The property names to filter.
- * @returns {Array} Returns the function names.
- */
- function baseFunctions(object, props) {
- return Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(props, function(key) {
- return Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object[key]);
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseFunctions);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseGet.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_baseGet.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
- /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
- /**
- * The base implementation of `_.get` without support for default values.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to get.
- * @returns {*} Returns the resolved value.
- */
- function baseGet(object, path) {
- path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
- var index = 0,
- length = path.length;
- while (object != null && index < length) {
- object = object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path[index++])];
- }
- return (index && index == length) ? object : undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseGet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseGetAllKeys.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_baseGetAllKeys.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
- * symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result = keysFunc(object);
- return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object) ? result : Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, symbolsFunc(object));
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseGetAllKeys);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseGetTag.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseGetTag.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
- /* harmony import */ var _getRawTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getRawTag.js */ "./node_modules/lodash-es/_getRawTag.js");
- /* harmony import */ var _objectToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_objectToString.js */ "./node_modules/lodash-es/_objectToString.js");
- /** `Object#toString` result references. */
- var nullTag = '[object Null]',
- undefinedTag = '[object Undefined]';
- /** Built-in value references. */
- var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].toStringTag : undefined;
- /**
- * The base implementation of `getTag` without fallbacks for buggy environments.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- function baseGetTag(value) {
- if (value == null) {
- return value === undefined ? undefinedTag : nullTag;
- }
- return (symToStringTag && symToStringTag in Object(value))
- ? Object(_getRawTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)
- : Object(_objectToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseGetTag);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseGt.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/_baseGt.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.gt` which doesn't coerce arguments.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than `other`,
- * else `false`.
- */
- function baseGt(value, other) {
- return value > other;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseGt);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseHas.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_baseHas.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * The base implementation of `_.has` without support for deep paths.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {Array|string} key The key to check.
- * @returns {boolean} Returns `true` if `key` exists, else `false`.
- */
- function baseHas(object, key) {
- return object != null && hasOwnProperty.call(object, key);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseHas);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseHasIn.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseHasIn.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.hasIn` without support for deep paths.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {Array|string} key The key to check.
- * @returns {boolean} Returns `true` if `key` exists, else `false`.
- */
- function baseHasIn(object, key) {
- return object != null && key in Object(object);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseHasIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseInRange.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_baseInRange.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max,
- nativeMin = Math.min;
- /**
- * The base implementation of `_.inRange` which doesn't coerce arguments.
- *
- * @private
- * @param {number} number The number to check.
- * @param {number} start The start of the range.
- * @param {number} end The end of the range.
- * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
- */
- function baseInRange(number, start, end) {
- return number >= nativeMin(start, end) && number < nativeMax(start, end);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseInRange);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIndexOf.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_baseIndexOf.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
- /* harmony import */ var _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsNaN.js */ "./node_modules/lodash-es/_baseIsNaN.js");
- /* harmony import */ var _strictIndexOf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_strictIndexOf.js */ "./node_modules/lodash-es/_strictIndexOf.js");
- /**
- * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseIndexOf(array, value, fromIndex) {
- return value === value
- ? Object(_strictIndexOf_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, value, fromIndex)
- : Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__["default"], fromIndex);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIndexOf);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIndexOfWith.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_baseIndexOfWith.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This function is like `baseIndexOf` except that it accepts a comparator.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @param {Function} comparator The comparator invoked per element.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseIndexOfWith(array, value, fromIndex, comparator) {
- var index = fromIndex - 1,
- length = array.length;
- while (++index < length) {
- if (comparator(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIndexOfWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIntersection.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_baseIntersection.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
- /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
- /* harmony import */ var _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayIncludesWith.js */ "./node_modules/lodash-es/_arrayIncludesWith.js");
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
- /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMin = Math.min;
- /**
- * The base implementation of methods like `_.intersection`, without support
- * for iteratee shorthands, that accepts an array of arrays to inspect.
- *
- * @private
- * @param {Array} arrays The arrays to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of shared values.
- */
- function baseIntersection(arrays, iteratee, comparator) {
- var includes = comparator ? _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__["default"] : _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
- length = arrays[0].length,
- othLength = arrays.length,
- othIndex = othLength,
- caches = Array(othLength),
- maxLength = Infinity,
- result = [];
- while (othIndex--) {
- var array = arrays[othIndex];
- if (othIndex && iteratee) {
- array = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee));
- }
- maxLength = nativeMin(array.length, maxLength);
- caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
- ? new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](othIndex && array)
- : undefined;
- }
- array = arrays[0];
- var index = -1,
- seen = caches[0];
- outer:
- while (++index < length && result.length < maxLength) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
- value = (comparator || value !== 0) ? value : 0;
- if (!(seen
- ? Object(_cacheHas_js__WEBPACK_IMPORTED_MODULE_5__["default"])(seen, computed)
- : includes(result, computed, comparator)
- )) {
- othIndex = othLength;
- while (--othIndex) {
- var cache = caches[othIndex];
- if (!(cache
- ? Object(_cacheHas_js__WEBPACK_IMPORTED_MODULE_5__["default"])(cache, computed)
- : includes(arrays[othIndex], computed, comparator))
- ) {
- continue outer;
- }
- }
- if (seen) {
- seen.push(computed);
- }
- result.push(value);
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIntersection);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseInverter.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_baseInverter.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
- /**
- * The base implementation of `_.invert` and `_.invertBy` which inverts
- * `object` with values transformed by `iteratee` and set by `setter`.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} setter The function to set `accumulator` values.
- * @param {Function} iteratee The iteratee to transform values.
- * @param {Object} accumulator The initial inverted object.
- * @returns {Function} Returns `accumulator`.
- */
- function baseInverter(object, setter, iteratee, accumulator) {
- Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, function(value, key, object) {
- setter(accumulator, iteratee(value), key, object);
- });
- return accumulator;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseInverter);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseInvoke.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseInvoke.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
- /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /* harmony import */ var _parent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_parent.js */ "./node_modules/lodash-es/_parent.js");
- /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
- /**
- * The base implementation of `_.invoke` without support for individual
- * method arguments.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the method to invoke.
- * @param {Array} args The arguments to invoke the method with.
- * @returns {*} Returns the result of the invoked method.
- */
- function baseInvoke(object, path, args) {
- path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, object);
- object = Object(_parent_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, path);
- var func = object == null ? object : object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_last_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path))];
- return func == null ? undefined : Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, object, args);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseInvoke);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIsArguments.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_baseIsArguments.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]';
- /**
- * The base implementation of `_.isArguments`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- */
- function baseIsArguments(value) {
- return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == argsTag;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIsArguments);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIsArrayBuffer.js":
- /*!******************************************************!*\
- !*** ./node_modules/lodash-es/_baseIsArrayBuffer.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- var arrayBufferTag = '[object ArrayBuffer]';
- /**
- * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
- */
- function baseIsArrayBuffer(value) {
- return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == arrayBufferTag;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIsArrayBuffer);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIsDate.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseIsDate.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var dateTag = '[object Date]';
- /**
- * The base implementation of `_.isDate` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
- */
- function baseIsDate(value) {
- return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == dateTag;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIsDate);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIsEqual.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_baseIsEqual.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsEqualDeep_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqualDeep.js */ "./node_modules/lodash-es/_baseIsEqualDeep.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /**
- * The base implementation of `_.isEqual` which supports partial comparisons
- * and tracks traversed objects.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {boolean} bitmask The bitmask flags.
- * 1 - Unordered comparison
- * 2 - Partial comparison
- * @param {Function} [customizer] The function to customize comparisons.
- * @param {Object} [stack] Tracks traversed `value` and `other` objects.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- */
- function baseIsEqual(value, other, bitmask, customizer, stack) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && !Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other))) {
- return value !== value && other !== other;
- }
- return Object(_baseIsEqualDeep_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other, bitmask, customizer, baseIsEqual, stack);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIsEqual);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIsEqualDeep.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_baseIsEqualDeep.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
- /* harmony import */ var _equalArrays_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_equalArrays.js */ "./node_modules/lodash-es/_equalArrays.js");
- /* harmony import */ var _equalByTag_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_equalByTag.js */ "./node_modules/lodash-es/_equalByTag.js");
- /* harmony import */ var _equalObjects_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_equalObjects.js */ "./node_modules/lodash-es/_equalObjects.js");
- /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
- /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
- /** Used to compose bitmasks for value comparisons. */
- var COMPARE_PARTIAL_FLAG = 1;
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- objectTag = '[object Object]';
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * A specialized version of `baseIsEqual` for arrays and objects which performs
- * deep comparisons and tracks traversed objects enabling objects with circular
- * references to be compared.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} [stack] Tracks traversed `object` and `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
- var objIsArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(object),
- othIsArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(other),
- objTag = objIsArr ? arrayTag : Object(_getTag_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object),
- othTag = othIsArr ? arrayTag : Object(_getTag_js__WEBPACK_IMPORTED_MODULE_4__["default"])(other);
- objTag = objTag == argsTag ? objectTag : objTag;
- othTag = othTag == argsTag ? objectTag : othTag;
- var objIsObj = objTag == objectTag,
- othIsObj = othTag == objectTag,
- isSameTag = objTag == othTag;
- if (isSameTag && Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object)) {
- if (!Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(other)) {
- return false;
- }
- objIsArr = true;
- objIsObj = false;
- }
- if (isSameTag && !objIsObj) {
- stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- return (objIsArr || Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__["default"])(object))
- ? Object(_equalArrays_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, other, bitmask, customizer, equalFunc, stack)
- : Object(_equalByTag_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, other, objTag, bitmask, customizer, equalFunc, stack);
- }
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
- if (objIsWrapped || othIsWrapped) {
- var objUnwrapped = objIsWrapped ? object.value() : object,
- othUnwrapped = othIsWrapped ? other.value() : other;
- stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
- }
- }
- if (!isSameTag) {
- return false;
- }
- stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- return Object(_equalObjects_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, other, bitmask, customizer, equalFunc, stack);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIsEqualDeep);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIsMap.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseIsMap.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var mapTag = '[object Map]';
- /**
- * The base implementation of `_.isMap` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
- */
- function baseIsMap(value) {
- return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_getTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == mapTag;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIsMap);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIsMatch.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_baseIsMatch.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
- /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
- /** Used to compose bitmasks for value comparisons. */
- var COMPARE_PARTIAL_FLAG = 1,
- COMPARE_UNORDERED_FLAG = 2;
- /**
- * The base implementation of `_.isMatch` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @param {Array} matchData The property names, values, and compare flags to match.
- * @param {Function} [customizer] The function to customize comparisons.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- */
- function baseIsMatch(object, source, matchData, customizer) {
- var index = matchData.length,
- length = index,
- noCustomizer = !customizer;
- if (object == null) {
- return !length;
- }
- object = Object(object);
- while (index--) {
- var data = matchData[index];
- if ((noCustomizer && data[2])
- ? data[1] !== object[data[0]]
- : !(data[0] in object)
- ) {
- return false;
- }
- }
- while (++index < length) {
- data = matchData[index];
- var key = data[0],
- objValue = object[key],
- srcValue = data[1];
- if (noCustomizer && data[2]) {
- if (objValue === undefined && !(key in object)) {
- return false;
- }
- } else {
- var stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- if (customizer) {
- var result = customizer(objValue, srcValue, key, object, source, stack);
- }
- if (!(result === undefined
- ? Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_1__["default"])(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
- : result
- )) {
- return false;
- }
- }
- }
- return true;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIsMatch);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIsNaN.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseIsNaN.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.isNaN` without support for number objects.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
- */
- function baseIsNaN(value) {
- return value !== value;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIsNaN);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIsNative.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_baseIsNative.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
- /* harmony import */ var _isMasked_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isMasked.js */ "./node_modules/lodash-es/_isMasked.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _toSource_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toSource.js */ "./node_modules/lodash-es/_toSource.js");
- /**
- * Used to match `RegExp`
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
- */
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
- /** Used to detect host constructors (Safari). */
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
- /** Used for built-in method references. */
- var funcProto = Function.prototype,
- objectProto = Object.prototype;
- /** Used to resolve the decompiled source of functions. */
- var funcToString = funcProto.toString;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /** Used to detect if a method is native. */
- var reIsNative = RegExp('^' +
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
- );
- /**
- * The base implementation of `_.isNative` without bad shim checks.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function,
- * else `false`.
- */
- function baseIsNative(value) {
- if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_isMasked_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
- return false;
- }
- var pattern = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? reIsNative : reIsHostCtor;
- return pattern.test(Object(_toSource_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value));
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIsNative);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIsRegExp.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_baseIsRegExp.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var regexpTag = '[object RegExp]';
- /**
- * The base implementation of `_.isRegExp` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
- */
- function baseIsRegExp(value) {
- return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == regexpTag;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIsRegExp);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIsSet.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseIsSet.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var setTag = '[object Set]';
- /**
- * The base implementation of `_.isSet` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
- */
- function baseIsSet(value) {
- return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_getTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == setTag;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIsSet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIsTypedArray.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_baseIsTypedArray.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- funcTag = '[object Function]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- objectTag = '[object Object]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- weakMapTag = '[object WeakMap]';
- var arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
- /** Used to identify `toStringTag` values of typed arrays. */
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
- typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
- typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
- typedArrayTags[mapTag] = typedArrayTags[numberTag] =
- typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
- typedArrayTags[setTag] = typedArrayTags[stringTag] =
- typedArrayTags[weakMapTag] = false;
- /**
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
- */
- function baseIsTypedArray(value) {
- return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) &&
- Object(_isLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value.length) && !!typedArrayTags[Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)];
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIsTypedArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseIteratee.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_baseIteratee.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseMatches_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMatches.js */ "./node_modules/lodash-es/_baseMatches.js");
- /* harmony import */ var _baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMatchesProperty.js */ "./node_modules/lodash-es/_baseMatchesProperty.js");
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
- /**
- * The base implementation of `_.iteratee`.
- *
- * @private
- * @param {*} [value=_.identity] The value to convert to an iteratee.
- * @returns {Function} Returns the iteratee.
- */
- function baseIteratee(value) {
- // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
- // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
- if (typeof value == 'function') {
- return value;
- }
- if (value == null) {
- return _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"];
- }
- if (typeof value == 'object') {
- return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)
- ? Object(_baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value[0], value[1])
- : Object(_baseMatches_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- }
- return Object(_property_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseIteratee);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseKeys.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_baseKeys.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
- /* harmony import */ var _nativeKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_nativeKeys.js */ "./node_modules/lodash-es/_nativeKeys.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function baseKeys(object) {
- if (!Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
- return Object(_nativeKeys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
- }
- var result = [];
- for (var key in Object(object)) {
- if (hasOwnProperty.call(object, key) && key != 'constructor') {
- result.push(key);
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseKeys);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseKeysIn.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseKeysIn.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
- /* harmony import */ var _nativeKeysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nativeKeysIn.js */ "./node_modules/lodash-es/_nativeKeysIn.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function baseKeysIn(object) {
- if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
- return Object(_nativeKeysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
- }
- var isProto = Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object),
- result = [];
- for (var key in object) {
- if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
- result.push(key);
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseKeysIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseLodash.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseLodash.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The function whose prototype chain sequence wrappers inherit from.
- *
- * @private
- */
- function baseLodash() {
- // No operation performed.
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseLodash);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseLt.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/_baseLt.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.lt` which doesn't coerce arguments.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than `other`,
- * else `false`.
- */
- function baseLt(value, other) {
- return value < other;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseLt);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseMap.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_baseMap.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /**
- * The base implementation of `_.map` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function baseMap(collection, iteratee) {
- var index = -1,
- result = Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection) ? Array(collection.length) : [];
- Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, key, collection) {
- result[++index] = iteratee(value, key, collection);
- });
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseMap);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseMatches.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_baseMatches.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMatch.js */ "./node_modules/lodash-es/_baseIsMatch.js");
- /* harmony import */ var _getMatchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getMatchData.js */ "./node_modules/lodash-es/_getMatchData.js");
- /* harmony import */ var _matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_matchesStrictComparable.js */ "./node_modules/lodash-es/_matchesStrictComparable.js");
- /**
- * The base implementation of `_.matches` which doesn't clone `source`.
- *
- * @private
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new spec function.
- */
- function baseMatches(source) {
- var matchData = Object(_getMatchData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source);
- if (matchData.length == 1 && matchData[0][2]) {
- return Object(_matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_2__["default"])(matchData[0][0], matchData[0][1]);
- }
- return function(object) {
- return object === source || Object(_baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, matchData);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseMatches);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseMatchesProperty.js":
- /*!********************************************************!*\
- !*** ./node_modules/lodash-es/_baseMatchesProperty.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
- /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
- /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
- /* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
- /* harmony import */ var _isStrictComparable_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isStrictComparable.js */ "./node_modules/lodash-es/_isStrictComparable.js");
- /* harmony import */ var _matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_matchesStrictComparable.js */ "./node_modules/lodash-es/_matchesStrictComparable.js");
- /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
- /** Used to compose bitmasks for value comparisons. */
- var COMPARE_PARTIAL_FLAG = 1,
- COMPARE_UNORDERED_FLAG = 2;
- /**
- * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
- *
- * @private
- * @param {string} path The path of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new spec function.
- */
- function baseMatchesProperty(path, srcValue) {
- if (Object(_isKey_js__WEBPACK_IMPORTED_MODULE_3__["default"])(path) && Object(_isStrictComparable_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue)) {
- return Object(_matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_toKey_js__WEBPACK_IMPORTED_MODULE_6__["default"])(path), srcValue);
- }
- return function(object) {
- var objValue = Object(_get_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path);
- return (objValue === undefined && objValue === srcValue)
- ? Object(_hasIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, path)
- : Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseMatchesProperty);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseMean.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_baseMean.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSum.js */ "./node_modules/lodash-es/_baseSum.js");
- /** Used as references for various `Number` constants. */
- var NAN = 0 / 0;
- /**
- * The base implementation of `_.mean` and `_.meanBy` without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {number} Returns the mean.
- */
- function baseMean(array, iteratee) {
- var length = array == null ? 0 : array.length;
- return length ? (Object(_baseSum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, iteratee) / length) : NAN;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseMean);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseMerge.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseMerge.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
- /* harmony import */ var _assignMergeValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_assignMergeValue.js */ "./node_modules/lodash-es/_assignMergeValue.js");
- /* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
- /* harmony import */ var _baseMergeDeep_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseMergeDeep.js */ "./node_modules/lodash-es/_baseMergeDeep.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /* harmony import */ var _safeGet_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_safeGet.js */ "./node_modules/lodash-es/_safeGet.js");
- /**
- * The base implementation of `_.merge` without support for multiple sources.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {number} srcIndex The index of `source`.
- * @param {Function} [customizer] The function to customize merged values.
- * @param {Object} [stack] Tracks traversed source values and their merged
- * counterparts.
- */
- function baseMerge(object, source, srcIndex, customizer, stack) {
- if (object === source) {
- return;
- }
- Object(_baseFor_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source, function(srcValue, key) {
- stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue)) {
- Object(_baseMergeDeep_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, source, key, srcIndex, baseMerge, customizer, stack);
- }
- else {
- var newValue = customizer
- ? customizer(Object(_safeGet_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object, key), srcValue, (key + ''), object, source, stack)
- : undefined;
- if (newValue === undefined) {
- newValue = srcValue;
- }
- Object(_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, newValue);
- }
- }, _keysIn_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseMerge);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseMergeDeep.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_baseMergeDeep.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assignMergeValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignMergeValue.js */ "./node_modules/lodash-es/_assignMergeValue.js");
- /* harmony import */ var _cloneBuffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_cloneBuffer.js */ "./node_modules/lodash-es/_cloneBuffer.js");
- /* harmony import */ var _cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cloneTypedArray.js */ "./node_modules/lodash-es/_cloneTypedArray.js");
- /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
- /* harmony import */ var _initCloneObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_initCloneObject.js */ "./node_modules/lodash-es/_initCloneObject.js");
- /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
- /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
- /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
- /* harmony import */ var _safeGet_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_safeGet.js */ "./node_modules/lodash-es/_safeGet.js");
- /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
- /**
- * A specialized version of `baseMerge` for arrays and objects which performs
- * deep merges and tracks traversed objects enabling objects with circular
- * references to be merged.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {string} key The key of the value to merge.
- * @param {number} srcIndex The index of `source`.
- * @param {Function} mergeFunc The function to merge values.
- * @param {Function} [customizer] The function to customize assigned values.
- * @param {Object} [stack] Tracks traversed source values and their merged
- * counterparts.
- */
- function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
- var objValue = Object(_safeGet_js__WEBPACK_IMPORTED_MODULE_13__["default"])(object, key),
- srcValue = Object(_safeGet_js__WEBPACK_IMPORTED_MODULE_13__["default"])(source, key),
- stacked = stack.get(srcValue);
- if (stacked) {
- Object(_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, stacked);
- return;
- }
- var newValue = customizer
- ? customizer(objValue, srcValue, (key + ''), object, source, stack)
- : undefined;
- var isCommon = newValue === undefined;
- if (isCommon) {
- var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(srcValue),
- isBuff = !isArr && Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_8__["default"])(srcValue),
- isTyped = !isArr && !isBuff && Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(srcValue);
- newValue = srcValue;
- if (isArr || isBuff || isTyped) {
- if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(objValue)) {
- newValue = objValue;
- }
- else if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_7__["default"])(objValue)) {
- newValue = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(objValue);
- }
- else if (isBuff) {
- isCommon = false;
- newValue = Object(_cloneBuffer_js__WEBPACK_IMPORTED_MODULE_1__["default"])(srcValue, true);
- }
- else if (isTyped) {
- isCommon = false;
- newValue = Object(_cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(srcValue, true);
- }
- else {
- newValue = [];
- }
- }
- else if (Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_11__["default"])(srcValue) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_5__["default"])(srcValue)) {
- newValue = objValue;
- if (Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_5__["default"])(objValue)) {
- newValue = Object(_toPlainObject_js__WEBPACK_IMPORTED_MODULE_14__["default"])(objValue);
- }
- else if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_10__["default"])(objValue) || Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_9__["default"])(objValue)) {
- newValue = Object(_initCloneObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue);
- }
- }
- else {
- isCommon = false;
- }
- }
- if (isCommon) {
- // Recursively merge objects and arrays (susceptible to call stack limits).
- stack.set(srcValue, newValue);
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
- stack['delete'](srcValue);
- }
- Object(_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, newValue);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseMergeDeep);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseNth.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_baseNth.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
- /**
- * The base implementation of `_.nth` which doesn't coerce arguments.
- *
- * @private
- * @param {Array} array The array to query.
- * @param {number} n The index of the element to return.
- * @returns {*} Returns the nth element of `array`.
- */
- function baseNth(array, n) {
- var length = array.length;
- if (!length) {
- return;
- }
- n += n < 0 ? length : 0;
- return Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n, length) ? array[n] : undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseNth);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseOrderBy.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_baseOrderBy.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseMap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseMap.js */ "./node_modules/lodash-es/_baseMap.js");
- /* harmony import */ var _baseSortBy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseSortBy.js */ "./node_modules/lodash-es/_baseSortBy.js");
- /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
- /* harmony import */ var _compareMultiple_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_compareMultiple.js */ "./node_modules/lodash-es/_compareMultiple.js");
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * The base implementation of `_.orderBy` without param guards.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
- * @param {string[]} orders The sort orders of `iteratees`.
- * @returns {Array} Returns the new sorted array.
- */
- function baseOrderBy(collection, iteratees, orders) {
- if (iteratees.length) {
- iteratees = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, function(iteratee) {
- if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_8__["default"])(iteratee)) {
- return function(value) {
- return Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, iteratee.length === 1 ? iteratee[0] : iteratee);
- }
- }
- return iteratee;
- });
- } else {
- iteratees = [_identity_js__WEBPACK_IMPORTED_MODULE_7__["default"]];
- }
- var index = -1;
- iteratees = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"]));
- var result = Object(_baseMap_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection, function(value, key, collection) {
- var criteria = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, function(iteratee) {
- return iteratee(value);
- });
- return { 'criteria': criteria, 'index': ++index, 'value': value };
- });
- return Object(_baseSortBy_js__WEBPACK_IMPORTED_MODULE_4__["default"])(result, function(object, other) {
- return Object(_compareMultiple_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object, other, orders);
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseOrderBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/_basePick.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_basePick.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _basePickBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePickBy.js */ "./node_modules/lodash-es/_basePickBy.js");
- /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
- /**
- * The base implementation of `_.pick` without support for individual
- * property identifiers.
- *
- * @private
- * @param {Object} object The source object.
- * @param {string[]} paths The property paths to pick.
- * @returns {Object} Returns the new object.
- */
- function basePick(object, paths) {
- return Object(_basePickBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths, function(value, path) {
- return Object(_hasIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path);
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (basePick);
- /***/ }),
- /***/ "./node_modules/lodash-es/_basePickBy.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_basePickBy.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
- /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
- /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
- /**
- * The base implementation of `_.pickBy` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The source object.
- * @param {string[]} paths The property paths to pick.
- * @param {Function} predicate The function invoked per property.
- * @returns {Object} Returns the new object.
- */
- function basePickBy(object, paths, predicate) {
- var index = -1,
- length = paths.length,
- result = {};
- while (++index < length) {
- var path = paths[index],
- value = Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
- if (predicate(value, path)) {
- Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, Object(_castPath_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path, object), value);
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (basePickBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseProperty.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_baseProperty.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.property` without support for deep paths.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @returns {Function} Returns the new accessor function.
- */
- function baseProperty(key) {
- return function(object) {
- return object == null ? undefined : object[key];
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseProperty);
- /***/ }),
- /***/ "./node_modules/lodash-es/_basePropertyDeep.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_basePropertyDeep.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
- /**
- * A specialized version of `baseProperty` which supports deep paths.
- *
- * @private
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new accessor function.
- */
- function basePropertyDeep(path) {
- return function(object) {
- return Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (basePropertyDeep);
- /***/ }),
- /***/ "./node_modules/lodash-es/_basePropertyOf.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_basePropertyOf.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.propertyOf` without support for deep paths.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Function} Returns the new accessor function.
- */
- function basePropertyOf(object) {
- return function(key) {
- return object == null ? undefined : object[key];
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (basePropertyOf);
- /***/ }),
- /***/ "./node_modules/lodash-es/_basePullAll.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_basePullAll.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
- /* harmony import */ var _baseIndexOfWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIndexOfWith.js */ "./node_modules/lodash-es/_baseIndexOfWith.js");
- /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
- /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
- /** Used for built-in method references. */
- var arrayProto = Array.prototype;
- /** Built-in value references. */
- var splice = arrayProto.splice;
- /**
- * The base implementation of `_.pullAllBy` without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns `array`.
- */
- function basePullAll(array, values, iteratee, comparator) {
- var indexOf = comparator ? _baseIndexOfWith_js__WEBPACK_IMPORTED_MODULE_2__["default"] : _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_1__["default"],
- index = -1,
- length = values.length,
- seen = array;
- if (array === values) {
- values = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(values);
- }
- if (iteratee) {
- seen = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_3__["default"])(iteratee));
- }
- while (++index < length) {
- var fromIndex = 0,
- value = values[index],
- computed = iteratee ? iteratee(value) : value;
- while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
- if (seen !== array) {
- splice.call(seen, fromIndex, 1);
- }
- splice.call(array, fromIndex, 1);
- }
- }
- return array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (basePullAll);
- /***/ }),
- /***/ "./node_modules/lodash-es/_basePullAt.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_basePullAt.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseUnset_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUnset.js */ "./node_modules/lodash-es/_baseUnset.js");
- /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
- /** Used for built-in method references. */
- var arrayProto = Array.prototype;
- /** Built-in value references. */
- var splice = arrayProto.splice;
- /**
- * The base implementation of `_.pullAt` without support for individual
- * indexes or capturing the removed elements.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {number[]} indexes The indexes of elements to remove.
- * @returns {Array} Returns `array`.
- */
- function basePullAt(array, indexes) {
- var length = array ? indexes.length : 0,
- lastIndex = length - 1;
- while (length--) {
- var index = indexes[length];
- if (length == lastIndex || index !== previous) {
- var previous = index;
- if (Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"])(index)) {
- splice.call(array, index, 1);
- } else {
- Object(_baseUnset_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, index);
- }
- }
- }
- return array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (basePullAt);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseRandom.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseRandom.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeFloor = Math.floor,
- nativeRandom = Math.random;
- /**
- * The base implementation of `_.random` without support for returning
- * floating-point numbers.
- *
- * @private
- * @param {number} lower The lower bound.
- * @param {number} upper The upper bound.
- * @returns {number} Returns the random number.
- */
- function baseRandom(lower, upper) {
- return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseRandom);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseRange.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseRange.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeCeil = Math.ceil,
- nativeMax = Math.max;
- /**
- * The base implementation of `_.range` and `_.rangeRight` which doesn't
- * coerce arguments.
- *
- * @private
- * @param {number} start The start of the range.
- * @param {number} end The end of the range.
- * @param {number} step The value to increment or decrement by.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Array} Returns the range of numbers.
- */
- function baseRange(start, end, step, fromRight) {
- var index = -1,
- length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
- result = Array(length);
- while (length--) {
- result[fromRight ? length : ++index] = start;
- start += step;
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseRange);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseReduce.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseReduce.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.reduce` and `_.reduceRight`, without support
- * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} accumulator The initial value.
- * @param {boolean} initAccum Specify using the first or last element of
- * `collection` as the initial value.
- * @param {Function} eachFunc The function to iterate over `collection`.
- * @returns {*} Returns the accumulated value.
- */
- function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
- eachFunc(collection, function(value, index, collection) {
- accumulator = initAccum
- ? (initAccum = false, value)
- : iteratee(accumulator, value, index, collection);
- });
- return accumulator;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseReduce);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseRepeat.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseRepeat.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used as references for various `Number` constants. */
- var MAX_SAFE_INTEGER = 9007199254740991;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeFloor = Math.floor;
- /**
- * The base implementation of `_.repeat` which doesn't coerce arguments.
- *
- * @private
- * @param {string} string The string to repeat.
- * @param {number} n The number of times to repeat the string.
- * @returns {string} Returns the repeated string.
- */
- function baseRepeat(string, n) {
- var result = '';
- if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
- return result;
- }
- // Leverage the exponentiation by squaring algorithm for a faster repeat.
- // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
- do {
- if (n % 2) {
- result += string;
- }
- n = nativeFloor(n / 2);
- if (n) {
- string += string;
- }
- } while (n);
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseRepeat);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseRest.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_baseRest.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /* harmony import */ var _overRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_overRest.js */ "./node_modules/lodash-es/_overRest.js");
- /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");
- /**
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- */
- function baseRest(func, start) {
- return Object(_setToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_overRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, start, _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"]), func + '');
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseRest);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseSample.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseSample.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arraySample_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySample.js */ "./node_modules/lodash-es/_arraySample.js");
- /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
- /**
- * The base implementation of `_.sample`.
- *
- * @private
- * @param {Array|Object} collection The collection to sample.
- * @returns {*} Returns the random element.
- */
- function baseSample(collection) {
- return Object(_arraySample_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_values_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection));
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseSample);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseSampleSize.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_baseSampleSize.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
- /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
- /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
- /**
- * The base implementation of `_.sampleSize` without param guards.
- *
- * @private
- * @param {Array|Object} collection The collection to sample.
- * @param {number} n The number of elements to sample.
- * @returns {Array} Returns the random elements.
- */
- function baseSampleSize(collection, n) {
- var array = Object(_values_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection);
- return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n, 0, array.length));
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseSampleSize);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseSet.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_baseSet.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
- /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
- /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
- /**
- * The base implementation of `_.set`.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @param {Function} [customizer] The function to customize path creation.
- * @returns {Object} Returns `object`.
- */
- function baseSet(object, path, value, customizer) {
- if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object)) {
- return object;
- }
- path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, object);
- var index = -1,
- length = path.length,
- lastIndex = length - 1,
- nested = object;
- while (nested != null && ++index < length) {
- var key = Object(_toKey_js__WEBPACK_IMPORTED_MODULE_4__["default"])(path[index]),
- newValue = value;
- if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
- return object;
- }
- if (index != lastIndex) {
- var objValue = nested[key];
- newValue = customizer ? customizer(objValue, key, nested) : undefined;
- if (newValue === undefined) {
- newValue = Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(objValue)
- ? objValue
- : (Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path[index + 1]) ? [] : {});
- }
- }
- Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nested, key, newValue);
- nested = nested[key];
- }
- return object;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseSet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseSetData.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_baseSetData.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /* harmony import */ var _metaMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_metaMap.js */ "./node_modules/lodash-es/_metaMap.js");
- /**
- * The base implementation of `setData` without support for hot loop shorting.
- *
- * @private
- * @param {Function} func The function to associate metadata with.
- * @param {*} data The metadata.
- * @returns {Function} Returns `func`.
- */
- var baseSetData = !_metaMap_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"] : function(func, data) {
- _metaMap_js__WEBPACK_IMPORTED_MODULE_1__["default"].set(func, data);
- return func;
- };
- /* harmony default export */ __webpack_exports__["default"] = (baseSetData);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseSetToString.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_baseSetToString.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
- /* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_defineProperty.js */ "./node_modules/lodash-es/_defineProperty.js");
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /**
- * The base implementation of `setToString` without support for hot loop shorting.
- *
- * @private
- * @param {Function} func The function to modify.
- * @param {Function} string The `toString` result.
- * @returns {Function} Returns `func`.
- */
- var baseSetToString = !_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"] : function(func, string) {
- return Object(_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, 'toString', {
- 'configurable': true,
- 'enumerable': false,
- 'value': Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string),
- 'writable': true
- });
- };
- /* harmony default export */ __webpack_exports__["default"] = (baseSetToString);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseShuffle.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_baseShuffle.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
- /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
- /**
- * The base implementation of `_.shuffle`.
- *
- * @private
- * @param {Array|Object} collection The collection to shuffle.
- * @returns {Array} Returns the new shuffled array.
- */
- function baseShuffle(collection) {
- return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_values_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection));
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseShuffle);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseSlice.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseSlice.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.slice` without an iteratee call guard.
- *
- * @private
- * @param {Array} array The array to slice.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the slice of `array`.
- */
- function baseSlice(array, start, end) {
- var index = -1,
- length = array.length;
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = end > length ? length : end;
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : ((end - start) >>> 0);
- start >>>= 0;
- var result = Array(length);
- while (++index < length) {
- result[index] = array[index + start];
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseSlice);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseSome.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_baseSome.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
- /**
- * The base implementation of `_.some` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
- function baseSome(collection, predicate) {
- var result;
- Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, index, collection) {
- result = predicate(value, index, collection);
- return !result;
- });
- return !!result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseSome);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseSortBy.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseSortBy.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.sortBy` which uses `comparer` to define the
- * sort order of `array` and replaces criteria objects with their corresponding
- * values.
- *
- * @private
- * @param {Array} array The array to sort.
- * @param {Function} comparer The function to define sort order.
- * @returns {Array} Returns `array`.
- */
- function baseSortBy(array, comparer) {
- var length = array.length;
- array.sort(comparer);
- while (length--) {
- array[length] = array[length].value;
- }
- return array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseSortBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseSortedIndex.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_baseSortedIndex.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndexBy.js */ "./node_modules/lodash-es/_baseSortedIndexBy.js");
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = 4294967295,
- HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
- /**
- * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
- * performs a binary search of `array` to determine the index at which `value`
- * should be inserted into `array` in order to maintain its sort order.
- *
- * @private
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- */
- function baseSortedIndex(array, value, retHighest) {
- var low = 0,
- high = array == null ? low : array.length;
- if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
- while (low < high) {
- var mid = (low + high) >>> 1,
- computed = array[mid];
- if (computed !== null && !Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_2__["default"])(computed) &&
- (retHighest ? (computed <= value) : (computed < value))) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return high;
- }
- return Object(_baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"], retHighest);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseSortedIndex);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseSortedIndexBy.js":
- /*!******************************************************!*\
- !*** ./node_modules/lodash-es/_baseSortedIndexBy.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = 4294967295,
- MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeFloor = Math.floor,
- nativeMin = Math.min;
- /**
- * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
- * which invokes `iteratee` for `value` and each element of `array` to compute
- * their sort ranking. The iteratee is invoked with one argument; (value).
- *
- * @private
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} iteratee The iteratee invoked per element.
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- */
- function baseSortedIndexBy(array, value, iteratee, retHighest) {
- var low = 0,
- high = array == null ? 0 : array.length;
- if (high === 0) {
- return 0;
- }
- value = iteratee(value);
- var valIsNaN = value !== value,
- valIsNull = value === null,
- valIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value),
- valIsUndefined = value === undefined;
- while (low < high) {
- var mid = nativeFloor((low + high) / 2),
- computed = iteratee(array[mid]),
- othIsDefined = computed !== undefined,
- othIsNull = computed === null,
- othIsReflexive = computed === computed,
- othIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(computed);
- if (valIsNaN) {
- var setLow = retHighest || othIsReflexive;
- } else if (valIsUndefined) {
- setLow = othIsReflexive && (retHighest || othIsDefined);
- } else if (valIsNull) {
- setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
- } else if (valIsSymbol) {
- setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
- } else if (othIsNull || othIsSymbol) {
- setLow = false;
- } else {
- setLow = retHighest ? (computed <= value) : (computed < value);
- }
- if (setLow) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return nativeMin(high, MAX_ARRAY_INDEX);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseSortedIndexBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseSortedUniq.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_baseSortedUniq.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /**
- * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
- * support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- */
- function baseSortedUniq(array, iteratee) {
- var index = -1,
- length = array.length,
- resIndex = 0,
- result = [];
- while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
- if (!index || !Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(computed, seen)) {
- var seen = computed;
- result[resIndex++] = value === 0 ? 0 : value;
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseSortedUniq);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseSum.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_baseSum.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.sum` and `_.sumBy` without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {number} Returns the sum.
- */
- function baseSum(array, iteratee) {
- var result,
- index = -1,
- length = array.length;
- while (++index < length) {
- var current = iteratee(array[index]);
- if (current !== undefined) {
- result = result === undefined ? current : (result + current);
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseSum);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseTimes.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseTimes.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.times` without support for iteratee shorthands
- * or max array length checks.
- *
- * @private
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the array of results.
- */
- function baseTimes(n, iteratee) {
- var index = -1,
- result = Array(n);
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseTimes);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseToNumber.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_baseToNumber.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /** Used as references for various `Number` constants. */
- var NAN = 0 / 0;
- /**
- * The base implementation of `_.toNumber` which doesn't ensure correct
- * conversions of binary, hexadecimal, or octal string values.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {number} Returns the number.
- */
- function baseToNumber(value) {
- if (typeof value == 'number') {
- return value;
- }
- if (Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
- return NAN;
- }
- return +value;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseToNumber);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseToPairs.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_baseToPairs.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /**
- * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
- * of key-value pairs for `object` corresponding to the property names of `props`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} props The property names to get values for.
- * @returns {Object} Returns the key-value pairs.
- */
- function baseToPairs(object, props) {
- return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(props, function(key) {
- return [key, object[key]];
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseToPairs);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseToString.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_baseToString.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /** Used as references for various `Number` constants. */
- var INFINITY = 1 / 0;
- /** Used to convert symbols to primitives and strings. */
- var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
- symbolToString = symbolProto ? symbolProto.toString : undefined;
- /**
- * The base implementation of `_.toString` which doesn't convert nullish
- * values to empty strings.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {string} Returns the string.
- */
- function baseToString(value) {
- // Exit early for strings to avoid a performance hit in some environments.
- if (typeof value == 'string') {
- return value;
- }
- if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
- // Recursively convert values (susceptible to call stack limits).
- return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, baseToString) + '';
- }
- if (Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)) {
- return symbolToString ? symbolToString.call(value) : '';
- }
- var result = (value + '');
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseToString);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseTrim.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_baseTrim.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_trimmedEndIndex.js */ "./node_modules/lodash-es/_trimmedEndIndex.js");
- /** Used to match leading whitespace. */
- var reTrimStart = /^\s+/;
- /**
- * The base implementation of `_.trim`.
- *
- * @private
- * @param {string} string The string to trim.
- * @returns {string} Returns the trimmed string.
- */
- function baseTrim(string) {
- return string
- ? string.slice(0, Object(_trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string) + 1).replace(reTrimStart, '')
- : string;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseTrim);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseUnary.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseUnary.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The base implementation of `_.unary` without support for storing metadata.
- *
- * @private
- * @param {Function} func The function to cap arguments for.
- * @returns {Function} Returns the new capped function.
- */
- function baseUnary(func) {
- return function(value) {
- return func(value);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseUnary);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseUniq.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_baseUniq.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
- /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
- /* harmony import */ var _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayIncludesWith.js */ "./node_modules/lodash-es/_arrayIncludesWith.js");
- /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
- /* harmony import */ var _createSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_createSet.js */ "./node_modules/lodash-es/_createSet.js");
- /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
- /** Used as the size to enable large array optimizations. */
- var LARGE_ARRAY_SIZE = 200;
- /**
- * The base implementation of `_.uniqBy` without support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- */
- function baseUniq(array, iteratee, comparator) {
- var index = -1,
- includes = _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
- length = array.length,
- isCommon = true,
- result = [],
- seen = result;
- if (comparator) {
- isCommon = false;
- includes = _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__["default"];
- }
- else if (length >= LARGE_ARRAY_SIZE) {
- var set = iteratee ? null : Object(_createSet_js__WEBPACK_IMPORTED_MODULE_4__["default"])(array);
- if (set) {
- return Object(_setToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(set);
- }
- isCommon = false;
- includes = _cacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
- seen = new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- }
- else {
- seen = iteratee ? [] : result;
- }
- outer:
- while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
- value = (comparator || value !== 0) ? value : 0;
- if (isCommon && computed === computed) {
- var seenIndex = seen.length;
- while (seenIndex--) {
- if (seen[seenIndex] === computed) {
- continue outer;
- }
- }
- if (iteratee) {
- seen.push(computed);
- }
- result.push(value);
- }
- else if (!includes(seen, computed, comparator)) {
- if (seen !== result) {
- seen.push(computed);
- }
- result.push(value);
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseUniq);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseUnset.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseUnset.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /* harmony import */ var _parent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_parent.js */ "./node_modules/lodash-es/_parent.js");
- /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
- /**
- * The base implementation of `_.unset`.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {Array|string} path The property path to unset.
- * @returns {boolean} Returns `true` if the property is deleted, else `false`.
- */
- function baseUnset(object, path) {
- path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
- object = Object(_parent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, path);
- return object == null || delete object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_last_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path))];
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseUnset);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseUpdate.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseUpdate.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
- /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
- /**
- * The base implementation of `_.update`.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to update.
- * @param {Function} updater The function to produce the updated value.
- * @param {Function} [customizer] The function to customize path creation.
- * @returns {Object} Returns `object`.
- */
- function baseUpdate(object, path, updater, customizer) {
- return Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path, updater(Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path)), customizer);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseUpdate);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseValues.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_baseValues.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /**
- * The base implementation of `_.values` and `_.valuesIn` which creates an
- * array of `object` property values corresponding to the property names
- * of `props`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} props The property names to get values for.
- * @returns {Object} Returns the array of property values.
- */
- function baseValues(object, props) {
- return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(props, function(key) {
- return object[key];
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseValues);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseWhile.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_baseWhile.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
- /**
- * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
- * without support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to query.
- * @param {Function} predicate The function invoked per iteration.
- * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Array} Returns the slice of `array`.
- */
- function baseWhile(array, predicate, isDrop, fromRight) {
- var length = array.length,
- index = fromRight ? length : -1;
- while ((fromRight ? index-- : ++index < length) &&
- predicate(array[index], index, array)) {}
- return isDrop
- ? Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
- : Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseWhile);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseWrapperValue.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_baseWrapperValue.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
- /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
- /* harmony import */ var _arrayReduce_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayReduce.js */ "./node_modules/lodash-es/_arrayReduce.js");
- /**
- * The base implementation of `wrapperValue` which returns the result of
- * performing a sequence of actions on the unwrapped `value`, where each
- * successive action is supplied the return value of the previous.
- *
- * @private
- * @param {*} value The unwrapped value.
- * @param {Array} actions Actions to perform to resolve the unwrapped value.
- * @returns {*} Returns the resolved value.
- */
- function baseWrapperValue(value, actions) {
- var result = value;
- if (result instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
- result = result.value();
- }
- return Object(_arrayReduce_js__WEBPACK_IMPORTED_MODULE_2__["default"])(actions, function(result, action) {
- return action.func.apply(action.thisArg, Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])([result], action.args));
- }, result);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseWrapperValue);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseXor.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_baseXor.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
- /**
- * The base implementation of methods like `_.xor`, without support for
- * iteratee shorthands, that accepts an array of arrays to inspect.
- *
- * @private
- * @param {Array} arrays The arrays to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of values.
- */
- function baseXor(arrays, iteratee, comparator) {
- var length = arrays.length;
- if (length < 2) {
- return length ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(arrays[0]) : [];
- }
- var index = -1,
- result = Array(length);
- while (++index < length) {
- var array = arrays[index],
- othIndex = -1;
- while (++othIndex < length) {
- if (othIndex != index) {
- result[index] = Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result[index] || array, arrays[othIndex], iteratee, comparator);
- }
- }
- }
- return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, 1), iteratee, comparator);
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseXor);
- /***/ }),
- /***/ "./node_modules/lodash-es/_baseZipObject.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_baseZipObject.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
- *
- * @private
- * @param {Array} props The property identifiers.
- * @param {Array} values The property values.
- * @param {Function} assignFunc The function to assign values.
- * @returns {Object} Returns the new object.
- */
- function baseZipObject(props, values, assignFunc) {
- var index = -1,
- length = props.length,
- valsLength = values.length,
- result = {};
- while (++index < length) {
- var value = index < valsLength ? values[index] : undefined;
- assignFunc(result, props[index], value);
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (baseZipObject);
- /***/ }),
- /***/ "./node_modules/lodash-es/_cacheHas.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_cacheHas.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Checks if a `cache` value for `key` exists.
- *
- * @private
- * @param {Object} cache The cache to query.
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function cacheHas(cache, key) {
- return cache.has(key);
- }
- /* harmony default export */ __webpack_exports__["default"] = (cacheHas);
- /***/ }),
- /***/ "./node_modules/lodash-es/_castArrayLikeObject.js":
- /*!********************************************************!*\
- !*** ./node_modules/lodash-es/_castArrayLikeObject.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /**
- * Casts `value` to an empty array if it's not an array like object.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {Array|Object} Returns the cast array-like object.
- */
- function castArrayLikeObject(value) {
- return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? value : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (castArrayLikeObject);
- /***/ }),
- /***/ "./node_modules/lodash-es/_castFunction.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_castFunction.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /**
- * Casts `value` to `identity` if it's not a function.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {Function} Returns cast function.
- */
- function castFunction(value) {
- return typeof value == 'function' ? value : _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- }
- /* harmony default export */ __webpack_exports__["default"] = (castFunction);
- /***/ }),
- /***/ "./node_modules/lodash-es/_castPath.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_castPath.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
- /* harmony import */ var _stringToPath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stringToPath.js */ "./node_modules/lodash-es/_stringToPath.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Casts `value` to a path array if it's not one.
- *
- * @private
- * @param {*} value The value to inspect.
- * @param {Object} [object] The object to query keys on.
- * @returns {Array} Returns the cast property path array.
- */
- function castPath(value, object) {
- if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
- return value;
- }
- return Object(_isKey_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, object) ? [value] : Object(_stringToPath_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value));
- }
- /* harmony default export */ __webpack_exports__["default"] = (castPath);
- /***/ }),
- /***/ "./node_modules/lodash-es/_castRest.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_castRest.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /**
- * A `baseRest` alias which can be replaced with `identity` by module
- * replacement plugins.
- *
- * @private
- * @type {Function}
- * @param {Function} func The function to apply a rest parameter to.
- * @returns {Function} Returns the new function.
- */
- var castRest = _baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (castRest);
- /***/ }),
- /***/ "./node_modules/lodash-es/_castSlice.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_castSlice.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
- /**
- * Casts `array` to a slice if it's needed.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {number} start The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the cast slice.
- */
- function castSlice(array, start, end) {
- var length = array.length;
- end = end === undefined ? length : end;
- return (!start && end >= length) ? array : Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, start, end);
- }
- /* harmony default export */ __webpack_exports__["default"] = (castSlice);
- /***/ }),
- /***/ "./node_modules/lodash-es/_charsEndIndex.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_charsEndIndex.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
- /**
- * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
- * that is not found in the character symbols.
- *
- * @private
- * @param {Array} strSymbols The string symbols to inspect.
- * @param {Array} chrSymbols The character symbols to find.
- * @returns {number} Returns the index of the last unmatched string symbol.
- */
- function charsEndIndex(strSymbols, chrSymbols) {
- var index = strSymbols.length;
- while (index-- && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chrSymbols, strSymbols[index], 0) > -1) {}
- return index;
- }
- /* harmony default export */ __webpack_exports__["default"] = (charsEndIndex);
- /***/ }),
- /***/ "./node_modules/lodash-es/_charsStartIndex.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_charsStartIndex.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
- /**
- * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
- * that is not found in the character symbols.
- *
- * @private
- * @param {Array} strSymbols The string symbols to inspect.
- * @param {Array} chrSymbols The character symbols to find.
- * @returns {number} Returns the index of the first unmatched string symbol.
- */
- function charsStartIndex(strSymbols, chrSymbols) {
- var index = -1,
- length = strSymbols.length;
- while (++index < length && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chrSymbols, strSymbols[index], 0) > -1) {}
- return index;
- }
- /* harmony default export */ __webpack_exports__["default"] = (charsStartIndex);
- /***/ }),
- /***/ "./node_modules/lodash-es/_cloneArrayBuffer.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_cloneArrayBuffer.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Uint8Array.js */ "./node_modules/lodash-es/_Uint8Array.js");
- /**
- * Creates a clone of `arrayBuffer`.
- *
- * @private
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
- * @returns {ArrayBuffer} Returns the cloned array buffer.
- */
- function cloneArrayBuffer(arrayBuffer) {
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
- new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__["default"](result).set(new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__["default"](arrayBuffer));
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (cloneArrayBuffer);
- /***/ }),
- /***/ "./node_modules/lodash-es/_cloneBuffer.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_cloneBuffer.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /** Detect free variable `exports`. */
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
- /** Detect free variable `module`. */
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
- /** Detect the popular CommonJS extension `module.exports`. */
- var moduleExports = freeModule && freeModule.exports === freeExports;
- /** Built-in value references. */
- var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Buffer : undefined,
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
- /**
- * Creates a clone of `buffer`.
- *
- * @private
- * @param {Buffer} buffer The buffer to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Buffer} Returns the cloned buffer.
- */
- function cloneBuffer(buffer, isDeep) {
- if (isDeep) {
- return buffer.slice();
- }
- var length = buffer.length,
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
- buffer.copy(result);
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (cloneBuffer);
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
- /***/ }),
- /***/ "./node_modules/lodash-es/_cloneDataView.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_cloneDataView.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
- /**
- * Creates a clone of `dataView`.
- *
- * @private
- * @param {Object} dataView The data view to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned data view.
- */
- function cloneDataView(dataView, isDeep) {
- var buffer = isDeep ? Object(_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
- }
- /* harmony default export */ __webpack_exports__["default"] = (cloneDataView);
- /***/ }),
- /***/ "./node_modules/lodash-es/_cloneRegExp.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_cloneRegExp.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to match `RegExp` flags from their coerced string values. */
- var reFlags = /\w*$/;
- /**
- * Creates a clone of `regexp`.
- *
- * @private
- * @param {Object} regexp The regexp to clone.
- * @returns {Object} Returns the cloned regexp.
- */
- function cloneRegExp(regexp) {
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result.lastIndex = regexp.lastIndex;
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (cloneRegExp);
- /***/ }),
- /***/ "./node_modules/lodash-es/_cloneSymbol.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_cloneSymbol.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
- /** Used to convert symbols to primitives and strings. */
- var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
- /**
- * Creates a clone of the `symbol` object.
- *
- * @private
- * @param {Object} symbol The symbol object to clone.
- * @returns {Object} Returns the cloned symbol object.
- */
- function cloneSymbol(symbol) {
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
- }
- /* harmony default export */ __webpack_exports__["default"] = (cloneSymbol);
- /***/ }),
- /***/ "./node_modules/lodash-es/_cloneTypedArray.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_cloneTypedArray.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
- /**
- * Creates a clone of `typedArray`.
- *
- * @private
- * @param {Object} typedArray The typed array to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned typed array.
- */
- function cloneTypedArray(typedArray, isDeep) {
- var buffer = isDeep ? Object(_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(typedArray.buffer) : typedArray.buffer;
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
- }
- /* harmony default export */ __webpack_exports__["default"] = (cloneTypedArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/_compareAscending.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_compareAscending.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /**
- * Compares values to sort them in ascending order.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {number} Returns the sort order indicator for `value`.
- */
- function compareAscending(value, other) {
- if (value !== other) {
- var valIsDefined = value !== undefined,
- valIsNull = value === null,
- valIsReflexive = value === value,
- valIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- var othIsDefined = other !== undefined,
- othIsNull = other === null,
- othIsReflexive = other === other,
- othIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other);
- if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
- (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
- (valIsNull && othIsDefined && othIsReflexive) ||
- (!valIsDefined && othIsReflexive) ||
- !valIsReflexive) {
- return 1;
- }
- if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
- (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
- (othIsNull && valIsDefined && valIsReflexive) ||
- (!othIsDefined && valIsReflexive) ||
- !othIsReflexive) {
- return -1;
- }
- }
- return 0;
- }
- /* harmony default export */ __webpack_exports__["default"] = (compareAscending);
- /***/ }),
- /***/ "./node_modules/lodash-es/_compareMultiple.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_compareMultiple.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _compareAscending_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_compareAscending.js */ "./node_modules/lodash-es/_compareAscending.js");
- /**
- * Used by `_.orderBy` to compare multiple properties of a value to another
- * and stable sort them.
- *
- * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
- * specify an order of "desc" for descending or "asc" for ascending sort order
- * of corresponding values.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {boolean[]|string[]} orders The order to sort by for each property.
- * @returns {number} Returns the sort order indicator for `object`.
- */
- function compareMultiple(object, other, orders) {
- var index = -1,
- objCriteria = object.criteria,
- othCriteria = other.criteria,
- length = objCriteria.length,
- ordersLength = orders.length;
- while (++index < length) {
- var result = Object(_compareAscending_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objCriteria[index], othCriteria[index]);
- if (result) {
- if (index >= ordersLength) {
- return result;
- }
- var order = orders[index];
- return result * (order == 'desc' ? -1 : 1);
- }
- }
- // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
- // that causes it, under certain circumstances, to provide the same value for
- // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
- // for more details.
- //
- // This also ensures a stable sort in V8 and other engines.
- // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
- return object.index - other.index;
- }
- /* harmony default export */ __webpack_exports__["default"] = (compareMultiple);
- /***/ }),
- /***/ "./node_modules/lodash-es/_composeArgs.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_composeArgs.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max;
- /**
- * Creates an array that is the composition of partially applied arguments,
- * placeholders, and provided arguments into a single array of arguments.
- *
- * @private
- * @param {Array} args The provided arguments.
- * @param {Array} partials The arguments to prepend to those provided.
- * @param {Array} holders The `partials` placeholder indexes.
- * @params {boolean} [isCurried] Specify composing for a curried function.
- * @returns {Array} Returns the new array of composed arguments.
- */
- function composeArgs(args, partials, holders, isCurried) {
- var argsIndex = -1,
- argsLength = args.length,
- holdersLength = holders.length,
- leftIndex = -1,
- leftLength = partials.length,
- rangeLength = nativeMax(argsLength - holdersLength, 0),
- result = Array(leftLength + rangeLength),
- isUncurried = !isCurried;
- while (++leftIndex < leftLength) {
- result[leftIndex] = partials[leftIndex];
- }
- while (++argsIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result[holders[argsIndex]] = args[argsIndex];
- }
- }
- while (rangeLength--) {
- result[leftIndex++] = args[argsIndex++];
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (composeArgs);
- /***/ }),
- /***/ "./node_modules/lodash-es/_composeArgsRight.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_composeArgsRight.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max;
- /**
- * This function is like `composeArgs` except that the arguments composition
- * is tailored for `_.partialRight`.
- *
- * @private
- * @param {Array} args The provided arguments.
- * @param {Array} partials The arguments to append to those provided.
- * @param {Array} holders The `partials` placeholder indexes.
- * @params {boolean} [isCurried] Specify composing for a curried function.
- * @returns {Array} Returns the new array of composed arguments.
- */
- function composeArgsRight(args, partials, holders, isCurried) {
- var argsIndex = -1,
- argsLength = args.length,
- holdersIndex = -1,
- holdersLength = holders.length,
- rightIndex = -1,
- rightLength = partials.length,
- rangeLength = nativeMax(argsLength - holdersLength, 0),
- result = Array(rangeLength + rightLength),
- isUncurried = !isCurried;
- while (++argsIndex < rangeLength) {
- result[argsIndex] = args[argsIndex];
- }
- var offset = argsIndex;
- while (++rightIndex < rightLength) {
- result[offset + rightIndex] = partials[rightIndex];
- }
- while (++holdersIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result[offset + holders[holdersIndex]] = args[argsIndex++];
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (composeArgsRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/_copyArray.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_copyArray.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Copies the values of `source` to `array`.
- *
- * @private
- * @param {Array} source The array to copy values from.
- * @param {Array} [array=[]] The array to copy values to.
- * @returns {Array} Returns `array`.
- */
- function copyArray(source, array) {
- var index = -1,
- length = source.length;
- array || (array = Array(length));
- while (++index < length) {
- array[index] = source[index];
- }
- return array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (copyArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/_copyObject.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_copyObject.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
- /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
- /**
- * Copies properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy properties from.
- * @param {Array} props The property identifiers to copy.
- * @param {Object} [object={}] The object to copy properties to.
- * @param {Function} [customizer] The function to customize copied values.
- * @returns {Object} Returns `object`.
- */
- function copyObject(source, props, object, customizer) {
- var isNew = !object;
- object || (object = {});
- var index = -1,
- length = props.length;
- while (++index < length) {
- var key = props[index];
- var newValue = customizer
- ? customizer(object[key], source[key], key, object, source)
- : undefined;
- if (newValue === undefined) {
- newValue = source[key];
- }
- if (isNew) {
- Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, newValue);
- } else {
- Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, newValue);
- }
- }
- return object;
- }
- /* harmony default export */ __webpack_exports__["default"] = (copyObject);
- /***/ }),
- /***/ "./node_modules/lodash-es/_copySymbols.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_copySymbols.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
- /* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
- /**
- * Copies own symbols of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy symbols from.
- * @param {Object} [object={}] The object to copy symbols to.
- * @returns {Object} Returns `object`.
- */
- function copySymbols(source, object) {
- return Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_getSymbols_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
- }
- /* harmony default export */ __webpack_exports__["default"] = (copySymbols);
- /***/ }),
- /***/ "./node_modules/lodash-es/_copySymbolsIn.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_copySymbolsIn.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
- /* harmony import */ var _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbolsIn.js */ "./node_modules/lodash-es/_getSymbolsIn.js");
- /**
- * Copies own and inherited symbols of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy symbols from.
- * @param {Object} [object={}] The object to copy symbols to.
- * @returns {Object} Returns `object`.
- */
- function copySymbolsIn(source, object) {
- return Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
- }
- /* harmony default export */ __webpack_exports__["default"] = (copySymbolsIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/_coreJsData.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_coreJsData.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /** Used to detect overreaching core-js shims. */
- var coreJsData = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"]['__core-js_shared__'];
- /* harmony default export */ __webpack_exports__["default"] = (coreJsData);
- /***/ }),
- /***/ "./node_modules/lodash-es/_countHolders.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_countHolders.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Gets the number of `placeholder` occurrences in `array`.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} placeholder The placeholder to search for.
- * @returns {number} Returns the placeholder count.
- */
- function countHolders(array, placeholder) {
- var length = array.length,
- result = 0;
- while (length--) {
- if (array[length] === placeholder) {
- ++result;
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (countHolders);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createAggregator.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_createAggregator.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayAggregator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayAggregator.js */ "./node_modules/lodash-es/_arrayAggregator.js");
- /* harmony import */ var _baseAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAggregator.js */ "./node_modules/lodash-es/_baseAggregator.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * Creates a function like `_.groupBy`.
- *
- * @private
- * @param {Function} setter The function to set accumulator values.
- * @param {Function} [initializer] The accumulator object initializer.
- * @returns {Function} Returns the new aggregator function.
- */
- function createAggregator(setter, initializer) {
- return function(collection, iteratee) {
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayAggregator_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"],
- accumulator = initializer ? initializer() : {};
- return func(collection, setter, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2), accumulator);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createAggregator);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createAssigner.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_createAssigner.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /**
- * Creates a function like `_.assign`.
- *
- * @private
- * @param {Function} assigner The function to assign values.
- * @returns {Function} Returns the new assigner function.
- */
- function createAssigner(assigner) {
- return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, sources) {
- var index = -1,
- length = sources.length,
- customizer = length > 1 ? sources[length - 1] : undefined,
- guard = length > 2 ? sources[2] : undefined;
- customizer = (assigner.length > 3 && typeof customizer == 'function')
- ? (length--, customizer)
- : undefined;
- if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined : customizer;
- length = 1;
- }
- object = Object(object);
- while (++index < length) {
- var source = sources[index];
- if (source) {
- assigner(object, source, index, customizer);
- }
- }
- return object;
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (createAssigner);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createBaseEach.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_createBaseEach.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /**
- * Creates a `baseEach` or `baseEachRight` function.
- *
- * @private
- * @param {Function} eachFunc The function to iterate over a collection.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
- function createBaseEach(eachFunc, fromRight) {
- return function(collection, iteratee) {
- if (collection == null) {
- return collection;
- }
- if (!Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection)) {
- return eachFunc(collection, iteratee);
- }
- var length = collection.length,
- index = fromRight ? length : -1,
- iterable = Object(collection);
- while ((fromRight ? index-- : ++index < length)) {
- if (iteratee(iterable[index], index, iterable) === false) {
- break;
- }
- }
- return collection;
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createBaseEach);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createBaseFor.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_createBaseFor.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Creates a base function for methods like `_.forIn` and `_.forOwn`.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
- function createBaseFor(fromRight) {
- return function(object, iteratee, keysFunc) {
- var index = -1,
- iterable = Object(object),
- props = keysFunc(object),
- length = props.length;
- while (length--) {
- var key = props[fromRight ? length : ++index];
- if (iteratee(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object;
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createBaseFor);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createBind.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_createBind.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_FLAG = 1;
- /**
- * Creates a function that wraps `func` to invoke it with the optional `this`
- * binding of `thisArg`.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createBind(func, bitmask, thisArg) {
- var isBind = bitmask & WRAP_BIND_FLAG,
- Ctor = Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func);
- function wrapper() {
- var fn = (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_1__["default"] && this instanceof wrapper) ? Ctor : func;
- return fn.apply(isBind ? thisArg : this, arguments);
- }
- return wrapper;
- }
- /* harmony default export */ __webpack_exports__["default"] = (createBind);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createCaseFirst.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_createCaseFirst.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
- /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
- /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Creates a function like `_.lowerFirst`.
- *
- * @private
- * @param {string} methodName The name of the `String` case method to use.
- * @returns {Function} Returns the new case function.
- */
- function createCaseFirst(methodName) {
- return function(string) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
- var strSymbols = Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string)
- ? Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)
- : undefined;
- var chr = strSymbols
- ? strSymbols[0]
- : string.charAt(0);
- var trailing = strSymbols
- ? Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(strSymbols, 1).join('')
- : string.slice(1);
- return chr[methodName]() + trailing;
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createCaseFirst);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createCompounder.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_createCompounder.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayReduce.js */ "./node_modules/lodash-es/_arrayReduce.js");
- /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
- /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
- /** Used to compose unicode capture groups. */
- var rsApos = "['\u2019]";
- /** Used to match apostrophes. */
- var reApos = RegExp(rsApos, 'g');
- /**
- * Creates a function like `_.camelCase`.
- *
- * @private
- * @param {Function} callback The function to combine each word.
- * @returns {Function} Returns the new compounder function.
- */
- function createCompounder(callback) {
- return function(string) {
- return Object(_arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_words_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_deburr_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string).replace(reApos, '')), callback, '');
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createCompounder);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createCtor.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_createCtor.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /**
- * Creates a function that produces an instance of `Ctor` regardless of
- * whether it was invoked as part of a `new` expression or by `call` or `apply`.
- *
- * @private
- * @param {Function} Ctor The constructor to wrap.
- * @returns {Function} Returns the new wrapped function.
- */
- function createCtor(Ctor) {
- return function() {
- // Use a `switch` statement to work with class constructors. See
- // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
- // for more details.
- var args = arguments;
- switch (args.length) {
- case 0: return new Ctor;
- case 1: return new Ctor(args[0]);
- case 2: return new Ctor(args[0], args[1]);
- case 3: return new Ctor(args[0], args[1], args[2]);
- case 4: return new Ctor(args[0], args[1], args[2], args[3]);
- case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
- case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
- case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
- }
- var thisBinding = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Ctor.prototype),
- result = Ctor.apply(thisBinding, args);
- // Mimic the constructor's `return` behavior.
- // See https://es5.github.io/#x13.2.2 for more details.
- return Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result) ? result : thisBinding;
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createCtor);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createCurry.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_createCurry.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
- /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
- /* harmony import */ var _createHybrid_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createHybrid.js */ "./node_modules/lodash-es/_createHybrid.js");
- /* harmony import */ var _createRecurry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_createRecurry.js */ "./node_modules/lodash-es/_createRecurry.js");
- /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
- /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /**
- * Creates a function that wraps `func` to enable currying.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {number} arity The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createCurry(func, bitmask, arity) {
- var Ctor = Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func);
- function wrapper() {
- var length = arguments.length,
- args = Array(length),
- index = length,
- placeholder = Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_4__["default"])(wrapper);
- while (index--) {
- args[index] = arguments[index];
- }
- var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
- ? []
- : Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_5__["default"])(args, placeholder);
- length -= holders.length;
- if (length < arity) {
- return Object(_createRecurry_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
- func, bitmask, _createHybrid_js__WEBPACK_IMPORTED_MODULE_2__["default"], wrapper.placeholder, undefined,
- args, holders, undefined, undefined, arity - length);
- }
- var fn = (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_6__["default"] && this instanceof wrapper) ? Ctor : func;
- return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(fn, this, args);
- }
- return wrapper;
- }
- /* harmony default export */ __webpack_exports__["default"] = (createCurry);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createFind.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_createFind.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * Creates a `_.find` or `_.findLast` function.
- *
- * @private
- * @param {Function} findIndexFunc The function to find the collection index.
- * @returns {Function} Returns the new find function.
- */
- function createFind(findIndexFunc) {
- return function(collection, predicate, fromIndex) {
- var iterable = Object(collection);
- if (!Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection)) {
- var iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3);
- collection = Object(_keys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection);
- predicate = function(key) { return iteratee(iterable[key], key, iterable); };
- }
- var index = findIndexFunc(collection, predicate, fromIndex);
- return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createFind);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createFlow.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_createFlow.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
- /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
- /* harmony import */ var _getData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getData.js */ "./node_modules/lodash-es/_getData.js");
- /* harmony import */ var _getFuncName_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_getFuncName.js */ "./node_modules/lodash-es/_getFuncName.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isLaziable_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_isLaziable.js */ "./node_modules/lodash-es/_isLaziable.js");
- /** Error message constants. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /** Used to compose bitmasks for function metadata. */
- var WRAP_CURRY_FLAG = 8,
- WRAP_PARTIAL_FLAG = 32,
- WRAP_ARY_FLAG = 128,
- WRAP_REARG_FLAG = 256;
- /**
- * Creates a `_.flow` or `_.flowRight` function.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new flow function.
- */
- function createFlow(fromRight) {
- return Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(funcs) {
- var length = funcs.length,
- index = length,
- prereq = _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.thru;
- if (fromRight) {
- funcs.reverse();
- }
- while (index--) {
- var func = funcs[index];
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (prereq && !wrapper && Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_3__["default"])(func) == 'wrapper') {
- var wrapper = new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]([], true);
- }
- }
- index = wrapper ? index : length;
- while (++index < length) {
- func = funcs[index];
- var funcName = Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_3__["default"])(func),
- data = funcName == 'wrapper' ? Object(_getData_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func) : undefined;
- if (data && Object(_isLaziable_js__WEBPACK_IMPORTED_MODULE_5__["default"])(data[0]) &&
- data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
- !data[4].length && data[9] == 1
- ) {
- wrapper = wrapper[Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_3__["default"])(data[0])].apply(wrapper, data[3]);
- } else {
- wrapper = (func.length == 1 && Object(_isLaziable_js__WEBPACK_IMPORTED_MODULE_5__["default"])(func))
- ? wrapper[funcName]()
- : wrapper.thru(func);
- }
- }
- return function() {
- var args = arguments,
- value = args[0];
- if (wrapper && args.length == 1 && Object(_isArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value)) {
- return wrapper.plant(value).value();
- }
- var index = 0,
- result = length ? funcs[index].apply(this, args) : value;
- while (++index < length) {
- result = funcs[index].call(this, result);
- }
- return result;
- };
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (createFlow);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createHybrid.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_createHybrid.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _composeArgs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_composeArgs.js */ "./node_modules/lodash-es/_composeArgs.js");
- /* harmony import */ var _composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_composeArgsRight.js */ "./node_modules/lodash-es/_composeArgsRight.js");
- /* harmony import */ var _countHolders_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_countHolders.js */ "./node_modules/lodash-es/_countHolders.js");
- /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
- /* harmony import */ var _createRecurry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_createRecurry.js */ "./node_modules/lodash-es/_createRecurry.js");
- /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
- /* harmony import */ var _reorder_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_reorder.js */ "./node_modules/lodash-es/_reorder.js");
- /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_FLAG = 1,
- WRAP_BIND_KEY_FLAG = 2,
- WRAP_CURRY_FLAG = 8,
- WRAP_CURRY_RIGHT_FLAG = 16,
- WRAP_ARY_FLAG = 128,
- WRAP_FLIP_FLAG = 512;
- /**
- * Creates a function that wraps `func` to invoke it with optional `this`
- * binding of `thisArg`, partial application, and currying.
- *
- * @private
- * @param {Function|string} func The function or method name to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to prepend to those provided to
- * the new function.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [partialsRight] The arguments to append to those provided
- * to the new function.
- * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
- var isAry = bitmask & WRAP_ARY_FLAG,
- isBind = bitmask & WRAP_BIND_FLAG,
- isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
- isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
- isFlip = bitmask & WRAP_FLIP_FLAG,
- Ctor = isBindKey ? undefined : Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_3__["default"])(func);
- function wrapper() {
- var length = arguments.length,
- args = Array(length),
- index = length;
- while (index--) {
- args[index] = arguments[index];
- }
- if (isCurried) {
- var placeholder = Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_5__["default"])(wrapper),
- holdersCount = Object(_countHolders_js__WEBPACK_IMPORTED_MODULE_2__["default"])(args, placeholder);
- }
- if (partials) {
- args = Object(_composeArgs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(args, partials, holders, isCurried);
- }
- if (partialsRight) {
- args = Object(_composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__["default"])(args, partialsRight, holdersRight, isCurried);
- }
- length -= holdersCount;
- if (isCurried && length < arity) {
- var newHolders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_7__["default"])(args, placeholder);
- return Object(_createRecurry_js__WEBPACK_IMPORTED_MODULE_4__["default"])(
- func, bitmask, createHybrid, wrapper.placeholder, thisArg,
- args, newHolders, argPos, ary, arity - length
- );
- }
- var thisBinding = isBind ? thisArg : this,
- fn = isBindKey ? thisBinding[func] : func;
- length = args.length;
- if (argPos) {
- args = Object(_reorder_js__WEBPACK_IMPORTED_MODULE_6__["default"])(args, argPos);
- } else if (isFlip && length > 1) {
- args.reverse();
- }
- if (isAry && ary < length) {
- args.length = ary;
- }
- if (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_8__["default"] && this instanceof wrapper) {
- fn = Ctor || Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fn);
- }
- return fn.apply(thisBinding, args);
- }
- return wrapper;
- }
- /* harmony default export */ __webpack_exports__["default"] = (createHybrid);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createInverter.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_createInverter.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseInverter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInverter.js */ "./node_modules/lodash-es/_baseInverter.js");
- /**
- * Creates a function like `_.invertBy`.
- *
- * @private
- * @param {Function} setter The function to set accumulator values.
- * @param {Function} toIteratee The function to resolve iteratees.
- * @returns {Function} Returns the new inverter function.
- */
- function createInverter(setter, toIteratee) {
- return function(object, iteratee) {
- return Object(_baseInverter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, setter, toIteratee(iteratee), {});
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createInverter);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createMathOperation.js":
- /*!********************************************************!*\
- !*** ./node_modules/lodash-es/_createMathOperation.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseToNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToNumber.js */ "./node_modules/lodash-es/_baseToNumber.js");
- /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
- /**
- * Creates a function that performs a mathematical operation on two values.
- *
- * @private
- * @param {Function} operator The function to perform the operation.
- * @param {number} [defaultValue] The value used for `undefined` arguments.
- * @returns {Function} Returns the new mathematical operation function.
- */
- function createMathOperation(operator, defaultValue) {
- return function(value, other) {
- var result;
- if (value === undefined && other === undefined) {
- return defaultValue;
- }
- if (value !== undefined) {
- result = value;
- }
- if (other !== undefined) {
- if (result === undefined) {
- return other;
- }
- if (typeof value == 'string' || typeof other == 'string') {
- value = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
- other = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other);
- } else {
- value = Object(_baseToNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- other = Object(_baseToNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other);
- }
- result = operator(value, other);
- }
- return result;
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createMathOperation);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createOver.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_createOver.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
- /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
- /**
- * Creates a function like `_.over`.
- *
- * @private
- * @param {Function} arrayFunc The function to iterate over iteratees.
- * @returns {Function} Returns the new over function.
- */
- function createOver(arrayFunc) {
- return Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_5__["default"])(function(iteratees) {
- iteratees = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratees, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"]));
- return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(args) {
- var thisArg = this;
- return arrayFunc(iteratees, function(iteratee) {
- return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, thisArg, args);
- });
- });
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (createOver);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createPadding.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_createPadding.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRepeat.js */ "./node_modules/lodash-es/_baseRepeat.js");
- /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
- /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
- /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
- /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
- /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeCeil = Math.ceil;
- /**
- * Creates the padding for `string` based on `length`. The `chars` string
- * is truncated if the number of characters exceeds `length`.
- *
- * @private
- * @param {number} length The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padding for `string`.
- */
- function createPadding(length, chars) {
- chars = chars === undefined ? ' ' : Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(chars);
- var charsLength = chars.length;
- if (charsLength < 2) {
- return charsLength ? Object(_baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars, length) : chars;
- }
- var result = Object(_baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars, nativeCeil(length / Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_4__["default"])(chars)));
- return Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(chars)
- ? Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(result), 0, length).join('')
- : result.slice(0, length);
- }
- /* harmony default export */ __webpack_exports__["default"] = (createPadding);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createPartial.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_createPartial.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
- /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_FLAG = 1;
- /**
- * Creates a function that wraps `func` to invoke it with the `this` binding
- * of `thisArg` and `partials` prepended to the arguments it receives.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {Array} partials The arguments to prepend to those provided to
- * the new function.
- * @returns {Function} Returns the new wrapped function.
- */
- function createPartial(func, bitmask, thisArg, partials) {
- var isBind = bitmask & WRAP_BIND_FLAG,
- Ctor = Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func);
- function wrapper() {
- var argsIndex = -1,
- argsLength = arguments.length,
- leftIndex = -1,
- leftLength = partials.length,
- args = Array(leftLength + argsLength),
- fn = (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_2__["default"] && this instanceof wrapper) ? Ctor : func;
- while (++leftIndex < leftLength) {
- args[leftIndex] = partials[leftIndex];
- }
- while (argsLength--) {
- args[leftIndex++] = arguments[++argsIndex];
- }
- return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(fn, isBind ? thisArg : this, args);
- }
- return wrapper;
- }
- /* harmony default export */ __webpack_exports__["default"] = (createPartial);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createRange.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_createRange.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRange.js */ "./node_modules/lodash-es/_baseRange.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
- /**
- * Creates a `_.range` or `_.rangeRight` function.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new range function.
- */
- function createRange(fromRight) {
- return function(start, end, step) {
- if (step && typeof step != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start, end, step)) {
- end = step = undefined;
- }
- // Ensure the sign of `-0` is preserved.
- start = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(start);
- if (end === undefined) {
- end = start;
- start = 0;
- } else {
- end = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(end);
- }
- step = step === undefined ? (start < end ? 1 : -1) : Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(step);
- return Object(_baseRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])(start, end, step, fromRight);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createRange);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createRecurry.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_createRecurry.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isLaziable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isLaziable.js */ "./node_modules/lodash-es/_isLaziable.js");
- /* harmony import */ var _setData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setData.js */ "./node_modules/lodash-es/_setData.js");
- /* harmony import */ var _setWrapToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setWrapToString.js */ "./node_modules/lodash-es/_setWrapToString.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_FLAG = 1,
- WRAP_BIND_KEY_FLAG = 2,
- WRAP_CURRY_BOUND_FLAG = 4,
- WRAP_CURRY_FLAG = 8,
- WRAP_PARTIAL_FLAG = 32,
- WRAP_PARTIAL_RIGHT_FLAG = 64;
- /**
- * Creates a function that wraps `func` to continue currying.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {Function} wrapFunc The function to create the `func` wrapper.
- * @param {*} placeholder The placeholder value.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to prepend to those provided to
- * the new function.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
- var isCurry = bitmask & WRAP_CURRY_FLAG,
- newHolders = isCurry ? holders : undefined,
- newHoldersRight = isCurry ? undefined : holders,
- newPartials = isCurry ? partials : undefined,
- newPartialsRight = isCurry ? undefined : partials;
- bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
- bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
- if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
- bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
- }
- var newData = [
- func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
- newHoldersRight, argPos, ary, arity
- ];
- var result = wrapFunc.apply(undefined, newData);
- if (Object(_isLaziable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func)) {
- Object(_setData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, newData);
- }
- result.placeholder = placeholder;
- return Object(_setWrapToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result, func, bitmask);
- }
- /* harmony default export */ __webpack_exports__["default"] = (createRecurry);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createRelationalOperation.js":
- /*!**************************************************************!*\
- !*** ./node_modules/lodash-es/_createRelationalOperation.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
- /**
- * Creates a function that performs a relational operation on two values.
- *
- * @private
- * @param {Function} operator The function to perform the operation.
- * @returns {Function} Returns the new relational operation function.
- */
- function createRelationalOperation(operator) {
- return function(value, other) {
- if (!(typeof value == 'string' && typeof other == 'string')) {
- value = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- other = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other);
- }
- return operator(value, other);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createRelationalOperation);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createRound.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_createRound.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeIsFinite = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFinite,
- nativeMin = Math.min;
- /**
- * Creates a function like `_.round`.
- *
- * @private
- * @param {string} methodName The name of the `Math` method to use when rounding.
- * @returns {Function} Returns the new round function.
- */
- function createRound(methodName) {
- var func = Math[methodName];
- return function(number, precision) {
- number = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(number);
- precision = precision == null ? 0 : nativeMin(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(precision), 292);
- if (precision && nativeIsFinite(number)) {
- // Shift with exponential notation to avoid floating-point issues.
- // See [MDN](https://mdn.io/round#Examples) for more details.
- var pair = (Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(number) + 'e').split('e'),
- value = func(pair[0] + 'e' + (+pair[1] + precision));
- pair = (Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) + 'e').split('e');
- return +(pair[0] + 'e' + (+pair[1] - precision));
- }
- return func(number);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createRound);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createSet.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_createSet.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Set_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Set.js */ "./node_modules/lodash-es/_Set.js");
- /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
- /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
- /** Used as references for various `Number` constants. */
- var INFINITY = 1 / 0;
- /**
- * Creates a set object of `values`.
- *
- * @private
- * @param {Array} values The values to add to the set.
- * @returns {Object} Returns the new set.
- */
- var createSet = !(_Set_js__WEBPACK_IMPORTED_MODULE_0__["default"] && (1 / Object(_setToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(new _Set_js__WEBPACK_IMPORTED_MODULE_0__["default"]([,-0]))[1]) == INFINITY) ? _noop_js__WEBPACK_IMPORTED_MODULE_1__["default"] : function(values) {
- return new _Set_js__WEBPACK_IMPORTED_MODULE_0__["default"](values);
- };
- /* harmony default export */ __webpack_exports__["default"] = (createSet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createToPairs.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_createToPairs.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseToPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToPairs.js */ "./node_modules/lodash-es/_baseToPairs.js");
- /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
- /* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
- /* harmony import */ var _setToPairs_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_setToPairs.js */ "./node_modules/lodash-es/_setToPairs.js");
- /** `Object#toString` result references. */
- var mapTag = '[object Map]',
- setTag = '[object Set]';
- /**
- * Creates a `_.toPairs` or `_.toPairsIn` function.
- *
- * @private
- * @param {Function} keysFunc The function to get the keys of a given object.
- * @returns {Function} Returns the new pairs function.
- */
- function createToPairs(keysFunc) {
- return function(object) {
- var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
- if (tag == mapTag) {
- return Object(_mapToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
- }
- if (tag == setTag) {
- return Object(_setToPairs_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object);
- }
- return Object(_baseToPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, keysFunc(object));
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (createToPairs);
- /***/ }),
- /***/ "./node_modules/lodash-es/_createWrap.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_createWrap.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSetData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSetData.js */ "./node_modules/lodash-es/_baseSetData.js");
- /* harmony import */ var _createBind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createBind.js */ "./node_modules/lodash-es/_createBind.js");
- /* harmony import */ var _createCurry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createCurry.js */ "./node_modules/lodash-es/_createCurry.js");
- /* harmony import */ var _createHybrid_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_createHybrid.js */ "./node_modules/lodash-es/_createHybrid.js");
- /* harmony import */ var _createPartial_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_createPartial.js */ "./node_modules/lodash-es/_createPartial.js");
- /* harmony import */ var _getData_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_getData.js */ "./node_modules/lodash-es/_getData.js");
- /* harmony import */ var _mergeData_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_mergeData.js */ "./node_modules/lodash-es/_mergeData.js");
- /* harmony import */ var _setData_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_setData.js */ "./node_modules/lodash-es/_setData.js");
- /* harmony import */ var _setWrapToString_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_setWrapToString.js */ "./node_modules/lodash-es/_setWrapToString.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /** Error message constants. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_FLAG = 1,
- WRAP_BIND_KEY_FLAG = 2,
- WRAP_CURRY_FLAG = 8,
- WRAP_CURRY_RIGHT_FLAG = 16,
- WRAP_PARTIAL_FLAG = 32,
- WRAP_PARTIAL_RIGHT_FLAG = 64;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max;
- /**
- * Creates a function that either curries or invokes `func` with optional
- * `this` binding and partially applied arguments.
- *
- * @private
- * @param {Function|string} func The function or method name to wrap.
- * @param {number} bitmask The bitmask flags.
- * 1 - `_.bind`
- * 2 - `_.bindKey`
- * 4 - `_.curry` or `_.curryRight` of a bound function
- * 8 - `_.curry`
- * 16 - `_.curryRight`
- * 32 - `_.partial`
- * 64 - `_.partialRight`
- * 128 - `_.rearg`
- * 256 - `_.ary`
- * 512 - `_.flip`
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to be partially applied.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
- var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
- if (!isBindKey && typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var length = partials ? partials.length : 0;
- if (!length) {
- bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
- partials = holders = undefined;
- }
- ary = ary === undefined ? ary : nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_9__["default"])(ary), 0);
- arity = arity === undefined ? arity : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_9__["default"])(arity);
- length -= holders ? holders.length : 0;
- if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
- var partialsRight = partials,
- holdersRight = holders;
- partials = holders = undefined;
- }
- var data = isBindKey ? undefined : Object(_getData_js__WEBPACK_IMPORTED_MODULE_5__["default"])(func);
- var newData = [
- func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
- argPos, ary, arity
- ];
- if (data) {
- Object(_mergeData_js__WEBPACK_IMPORTED_MODULE_6__["default"])(newData, data);
- }
- func = newData[0];
- bitmask = newData[1];
- thisArg = newData[2];
- partials = newData[3];
- holders = newData[4];
- arity = newData[9] = newData[9] === undefined
- ? (isBindKey ? 0 : func.length)
- : nativeMax(newData[9] - length, 0);
- if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
- bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
- }
- if (!bitmask || bitmask == WRAP_BIND_FLAG) {
- var result = Object(_createBind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, bitmask, thisArg);
- } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
- result = Object(_createCurry_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func, bitmask, arity);
- } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
- result = Object(_createPartial_js__WEBPACK_IMPORTED_MODULE_4__["default"])(func, bitmask, thisArg, partials);
- } else {
- result = _createHybrid_js__WEBPACK_IMPORTED_MODULE_3__["default"].apply(undefined, newData);
- }
- var setter = data ? _baseSetData_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _setData_js__WEBPACK_IMPORTED_MODULE_7__["default"];
- return Object(_setWrapToString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(setter(result, newData), func, bitmask);
- }
- /* harmony default export */ __webpack_exports__["default"] = (createWrap);
- /***/ }),
- /***/ "./node_modules/lodash-es/_customDefaultsAssignIn.js":
- /*!***********************************************************!*\
- !*** ./node_modules/lodash-es/_customDefaultsAssignIn.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
- * of source objects to the destination object for all destination properties
- * that resolve to `undefined`.
- *
- * @private
- * @param {*} objValue The destination value.
- * @param {*} srcValue The source value.
- * @param {string} key The key of the property to assign.
- * @param {Object} object The parent object of `objValue`.
- * @returns {*} Returns the value to assign.
- */
- function customDefaultsAssignIn(objValue, srcValue, key, object) {
- if (objValue === undefined ||
- (Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
- return srcValue;
- }
- return objValue;
- }
- /* harmony default export */ __webpack_exports__["default"] = (customDefaultsAssignIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/_customDefaultsMerge.js":
- /*!********************************************************!*\
- !*** ./node_modules/lodash-es/_customDefaultsMerge.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /**
- * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
- * objects into destination objects that are passed thru.
- *
- * @private
- * @param {*} objValue The destination value.
- * @param {*} srcValue The source value.
- * @param {string} key The key of the property to merge.
- * @param {Object} object The parent object of `objValue`.
- * @param {Object} source The parent object of `srcValue`.
- * @param {Object} [stack] Tracks traversed source values and their merged
- * counterparts.
- * @returns {*} Returns the value to assign.
- */
- function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
- if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(objValue) && Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(srcValue)) {
- // Recursively merge objects and arrays (susceptible to call stack limits).
- stack.set(srcValue, objValue);
- Object(_baseMerge_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objValue, srcValue, undefined, customDefaultsMerge, stack);
- stack['delete'](srcValue);
- }
- return objValue;
- }
- /* harmony default export */ __webpack_exports__["default"] = (customDefaultsMerge);
- /***/ }),
- /***/ "./node_modules/lodash-es/_customOmitClone.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_customOmitClone.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
- /**
- * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
- * objects.
- *
- * @private
- * @param {*} value The value to inspect.
- * @param {string} key The key of the property to inspect.
- * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
- */
- function customOmitClone(value) {
- return Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? undefined : value;
- }
- /* harmony default export */ __webpack_exports__["default"] = (customOmitClone);
- /***/ }),
- /***/ "./node_modules/lodash-es/_deburrLetter.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_deburrLetter.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePropertyOf.js */ "./node_modules/lodash-es/_basePropertyOf.js");
- /** Used to map Latin Unicode letters to basic Latin letters. */
- var deburredLetters = {
- // Latin-1 Supplement block.
- '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
- '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
- '\xc7': 'C', '\xe7': 'c',
- '\xd0': 'D', '\xf0': 'd',
- '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
- '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
- '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
- '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
- '\xd1': 'N', '\xf1': 'n',
- '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
- '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
- '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
- '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
- '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
- '\xc6': 'Ae', '\xe6': 'ae',
- '\xde': 'Th', '\xfe': 'th',
- '\xdf': 'ss',
- // Latin Extended-A block.
- '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
- '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
- '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
- '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
- '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
- '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
- '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
- '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
- '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
- '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
- '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
- '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
- '\u0134': 'J', '\u0135': 'j',
- '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
- '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
- '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
- '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
- '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
- '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
- '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
- '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
- '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
- '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
- '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
- '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
- '\u0163': 't', '\u0165': 't', '\u0167': 't',
- '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
- '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
- '\u0174': 'W', '\u0175': 'w',
- '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
- '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
- '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
- '\u0132': 'IJ', '\u0133': 'ij',
- '\u0152': 'Oe', '\u0153': 'oe',
- '\u0149': "'n", '\u017f': 's'
- };
- /**
- * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
- * letters to basic Latin letters.
- *
- * @private
- * @param {string} letter The matched letter to deburr.
- * @returns {string} Returns the deburred letter.
- */
- var deburrLetter = Object(_basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(deburredLetters);
- /* harmony default export */ __webpack_exports__["default"] = (deburrLetter);
- /***/ }),
- /***/ "./node_modules/lodash-es/_defineProperty.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_defineProperty.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
- var defineProperty = (function() {
- try {
- var func = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object, 'defineProperty');
- func({}, '', {});
- return func;
- } catch (e) {}
- }());
- /* harmony default export */ __webpack_exports__["default"] = (defineProperty);
- /***/ }),
- /***/ "./node_modules/lodash-es/_equalArrays.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_equalArrays.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
- /* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
- /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
- /** Used to compose bitmasks for value comparisons. */
- var COMPARE_PARTIAL_FLAG = 1,
- COMPARE_UNORDERED_FLAG = 2;
- /**
- * A specialized version of `baseIsEqualDeep` for arrays with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Array} array The array to compare.
- * @param {Array} other The other array to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} stack Tracks traversed `array` and `other` objects.
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
- */
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
- arrLength = array.length,
- othLength = other.length;
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
- return false;
- }
- // Check that cyclic values are equal.
- var arrStacked = stack.get(array);
- var othStacked = stack.get(other);
- if (arrStacked && othStacked) {
- return arrStacked == other && othStacked == array;
- }
- var index = -1,
- result = true,
- seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"] : undefined;
- stack.set(array, other);
- stack.set(other, array);
- // Ignore non-index properties.
- while (++index < arrLength) {
- var arrValue = array[index],
- othValue = other[index];
- if (customizer) {
- var compared = isPartial
- ? customizer(othValue, arrValue, index, other, array, stack)
- : customizer(arrValue, othValue, index, array, other, stack);
- }
- if (compared !== undefined) {
- if (compared) {
- continue;
- }
- result = false;
- break;
- }
- // Recursively compare arrays (susceptible to call stack limits).
- if (seen) {
- if (!Object(_arraySome_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other, function(othValue, othIndex) {
- if (!Object(_cacheHas_js__WEBPACK_IMPORTED_MODULE_2__["default"])(seen, othIndex) &&
- (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
- return seen.push(othIndex);
- }
- })) {
- result = false;
- break;
- }
- } else if (!(
- arrValue === othValue ||
- equalFunc(arrValue, othValue, bitmask, customizer, stack)
- )) {
- result = false;
- break;
- }
- }
- stack['delete'](array);
- stack['delete'](other);
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (equalArrays);
- /***/ }),
- /***/ "./node_modules/lodash-es/_equalByTag.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_equalByTag.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
- /* harmony import */ var _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Uint8Array.js */ "./node_modules/lodash-es/_Uint8Array.js");
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /* harmony import */ var _equalArrays_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_equalArrays.js */ "./node_modules/lodash-es/_equalArrays.js");
- /* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
- /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
- /** Used to compose bitmasks for value comparisons. */
- var COMPARE_PARTIAL_FLAG = 1,
- COMPARE_UNORDERED_FLAG = 2;
- /** `Object#toString` result references. */
- var boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- symbolTag = '[object Symbol]';
- var arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]';
- /** Used to convert symbols to primitives and strings. */
- var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
- /**
- * A specialized version of `baseIsEqualDeep` for comparing objects of
- * the same `toStringTag`.
- *
- * **Note:** This function only supports comparing values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {string} tag The `toStringTag` of the objects to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} stack Tracks traversed `object` and `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
- switch (tag) {
- case dataViewTag:
- if ((object.byteLength != other.byteLength) ||
- (object.byteOffset != other.byteOffset)) {
- return false;
- }
- object = object.buffer;
- other = other.buffer;
- case arrayBufferTag:
- if ((object.byteLength != other.byteLength) ||
- !equalFunc(new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__["default"](object), new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__["default"](other))) {
- return false;
- }
- return true;
- case boolTag:
- case dateTag:
- case numberTag:
- // Coerce booleans to `1` or `0` and dates to milliseconds.
- // Invalid dates are coerced to `NaN`.
- return Object(_eq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(+object, +other);
- case errorTag:
- return object.name == other.name && object.message == other.message;
- case regexpTag:
- case stringTag:
- // Coerce regexes to strings and treat strings, primitives and objects,
- // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
- // for more details.
- return object == (other + '');
- case mapTag:
- var convert = _mapToArray_js__WEBPACK_IMPORTED_MODULE_4__["default"];
- case setTag:
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
- convert || (convert = _setToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
- if (object.size != other.size && !isPartial) {
- return false;
- }
- // Assume cyclic values are equal.
- var stacked = stack.get(object);
- if (stacked) {
- return stacked == other;
- }
- bitmask |= COMPARE_UNORDERED_FLAG;
- // Recursively compare objects (susceptible to call stack limits).
- stack.set(object, other);
- var result = Object(_equalArrays_js__WEBPACK_IMPORTED_MODULE_3__["default"])(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
- stack['delete'](object);
- return result;
- case symbolTag:
- if (symbolValueOf) {
- return symbolValueOf.call(object) == symbolValueOf.call(other);
- }
- }
- return false;
- }
- /* harmony default export */ __webpack_exports__["default"] = (equalByTag);
- /***/ }),
- /***/ "./node_modules/lodash-es/_equalObjects.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_equalObjects.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getAllKeys.js */ "./node_modules/lodash-es/_getAllKeys.js");
- /** Used to compose bitmasks for value comparisons. */
- var COMPARE_PARTIAL_FLAG = 1;
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * A specialized version of `baseIsEqualDeep` for objects with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} stack Tracks traversed `object` and `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
- objProps = Object(_getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object),
- objLength = objProps.length,
- othProps = Object(_getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other),
- othLength = othProps.length;
- if (objLength != othLength && !isPartial) {
- return false;
- }
- var index = objLength;
- while (index--) {
- var key = objProps[index];
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
- return false;
- }
- }
- // Check that cyclic values are equal.
- var objStacked = stack.get(object);
- var othStacked = stack.get(other);
- if (objStacked && othStacked) {
- return objStacked == other && othStacked == object;
- }
- var result = true;
- stack.set(object, other);
- stack.set(other, object);
- var skipCtor = isPartial;
- while (++index < objLength) {
- key = objProps[index];
- var objValue = object[key],
- othValue = other[key];
- if (customizer) {
- var compared = isPartial
- ? customizer(othValue, objValue, key, other, object, stack)
- : customizer(objValue, othValue, key, object, other, stack);
- }
- // Recursively compare objects (susceptible to call stack limits).
- if (!(compared === undefined
- ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
- : compared
- )) {
- result = false;
- break;
- }
- skipCtor || (skipCtor = key == 'constructor');
- }
- if (result && !skipCtor) {
- var objCtor = object.constructor,
- othCtor = other.constructor;
- // Non `Object` object instances with different constructors are not equal.
- if (objCtor != othCtor &&
- ('constructor' in object && 'constructor' in other) &&
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
- result = false;
- }
- }
- stack['delete'](object);
- stack['delete'](other);
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (equalObjects);
- /***/ }),
- /***/ "./node_modules/lodash-es/_escapeHtmlChar.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_escapeHtmlChar.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePropertyOf.js */ "./node_modules/lodash-es/_basePropertyOf.js");
- /** Used to map characters to HTML entities. */
- var htmlEscapes = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": '''
- };
- /**
- * Used by `_.escape` to convert characters to HTML entities.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @returns {string} Returns the escaped character.
- */
- var escapeHtmlChar = Object(_basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(htmlEscapes);
- /* harmony default export */ __webpack_exports__["default"] = (escapeHtmlChar);
- /***/ }),
- /***/ "./node_modules/lodash-es/_escapeStringChar.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_escapeStringChar.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to escape characters for inclusion in compiled string literals. */
- var stringEscapes = {
- '\\': '\\',
- "'": "'",
- '\n': 'n',
- '\r': 'r',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
- };
- /**
- * Used by `_.template` to escape characters for inclusion in compiled string literals.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @returns {string} Returns the escaped character.
- */
- function escapeStringChar(chr) {
- return '\\' + stringEscapes[chr];
- }
- /* harmony default export */ __webpack_exports__["default"] = (escapeStringChar);
- /***/ }),
- /***/ "./node_modules/lodash-es/_flatRest.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_flatRest.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
- /* harmony import */ var _overRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_overRest.js */ "./node_modules/lodash-es/_overRest.js");
- /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");
- /**
- * A specialized version of `baseRest` which flattens the rest array.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @returns {Function} Returns the new function.
- */
- function flatRest(func) {
- return Object(_setToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_overRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, undefined, _flatten_js__WEBPACK_IMPORTED_MODULE_0__["default"]), func + '');
- }
- /* harmony default export */ __webpack_exports__["default"] = (flatRest);
- /***/ }),
- /***/ "./node_modules/lodash-es/_freeGlobal.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_freeGlobal.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
- /* harmony default export */ __webpack_exports__["default"] = (freeGlobal);
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./node_modules/lodash-es/_getAllKeys.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_getAllKeys.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetAllKeys.js */ "./node_modules/lodash-es/_baseGetAllKeys.js");
- /* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * Creates an array of own enumerable property names and symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function getAllKeys(object) {
- return Object(_baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, _keys_js__WEBPACK_IMPORTED_MODULE_2__["default"], _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (getAllKeys);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getAllKeysIn.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_getAllKeysIn.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetAllKeys.js */ "./node_modules/lodash-es/_baseGetAllKeys.js");
- /* harmony import */ var _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbolsIn.js */ "./node_modules/lodash-es/_getSymbolsIn.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /**
- * Creates an array of own and inherited enumerable property names and
- * symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function getAllKeysIn(object) {
- return Object(_baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, _keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"], _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (getAllKeysIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getData.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_getData.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _metaMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_metaMap.js */ "./node_modules/lodash-es/_metaMap.js");
- /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
- /**
- * Gets metadata for `func`.
- *
- * @private
- * @param {Function} func The function to query.
- * @returns {*} Returns the metadata for `func`.
- */
- var getData = !_metaMap_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _noop_js__WEBPACK_IMPORTED_MODULE_1__["default"] : function(func) {
- return _metaMap_js__WEBPACK_IMPORTED_MODULE_0__["default"].get(func);
- };
- /* harmony default export */ __webpack_exports__["default"] = (getData);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getFuncName.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_getFuncName.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _realNames_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_realNames.js */ "./node_modules/lodash-es/_realNames.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Gets the name of `func`.
- *
- * @private
- * @param {Function} func The function to query.
- * @returns {string} Returns the function name.
- */
- function getFuncName(func) {
- var result = (func.name + ''),
- array = _realNames_js__WEBPACK_IMPORTED_MODULE_0__["default"][result],
- length = hasOwnProperty.call(_realNames_js__WEBPACK_IMPORTED_MODULE_0__["default"], result) ? array.length : 0;
- while (length--) {
- var data = array[length],
- otherFunc = data.func;
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (getFuncName);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getHolder.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_getHolder.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Gets the argument placeholder value for `func`.
- *
- * @private
- * @param {Function} func The function to inspect.
- * @returns {*} Returns the placeholder value.
- */
- function getHolder(func) {
- var object = func;
- return object.placeholder;
- }
- /* harmony default export */ __webpack_exports__["default"] = (getHolder);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getMapData.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_getMapData.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isKeyable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isKeyable.js */ "./node_modules/lodash-es/_isKeyable.js");
- /**
- * Gets the data for `map`.
- *
- * @private
- * @param {Object} map The map to query.
- * @param {string} key The reference key.
- * @returns {*} Returns the map data.
- */
- function getMapData(map, key) {
- var data = map.__data__;
- return Object(_isKeyable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key)
- ? data[typeof key == 'string' ? 'string' : 'hash']
- : data.map;
- }
- /* harmony default export */ __webpack_exports__["default"] = (getMapData);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getMatchData.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_getMatchData.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isStrictComparable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isStrictComparable.js */ "./node_modules/lodash-es/_isStrictComparable.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * Gets the property names, values, and compare flags of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the match data of `object`.
- */
- function getMatchData(object) {
- var result = Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object),
- length = result.length;
- while (length--) {
- var key = result[length],
- value = object[key];
- result[length] = [key, value, Object(_isStrictComparable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)];
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (getMatchData);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getNative.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_getNative.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsNative.js */ "./node_modules/lodash-es/_baseIsNative.js");
- /* harmony import */ var _getValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getValue.js */ "./node_modules/lodash-es/_getValue.js");
- /**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
- function getNative(object, key) {
- var value = Object(_getValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key);
- return Object(_baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? value : undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (getNative);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getPrototype.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_getPrototype.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_overArg.js */ "./node_modules/lodash-es/_overArg.js");
- /** Built-in value references. */
- var getPrototype = Object(_overArg_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object.getPrototypeOf, Object);
- /* harmony default export */ __webpack_exports__["default"] = (getPrototype);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getRawTag.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_getRawTag.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var nativeObjectToString = objectProto.toString;
- /** Built-in value references. */
- var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].toStringTag : undefined;
- /**
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the raw `toStringTag`.
- */
- function getRawTag(value) {
- var isOwn = hasOwnProperty.call(value, symToStringTag),
- tag = value[symToStringTag];
- try {
- value[symToStringTag] = undefined;
- var unmasked = true;
- } catch (e) {}
- var result = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (getRawTag);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getSymbols.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_getSymbols.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
- /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Built-in value references. */
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeGetSymbols = Object.getOwnPropertySymbols;
- /**
- * Creates an array of the own enumerable symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
- var getSymbols = !nativeGetSymbols ? _stubArray_js__WEBPACK_IMPORTED_MODULE_1__["default"] : function(object) {
- if (object == null) {
- return [];
- }
- object = Object(object);
- return Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nativeGetSymbols(object), function(symbol) {
- return propertyIsEnumerable.call(object, symbol);
- });
- };
- /* harmony default export */ __webpack_exports__["default"] = (getSymbols);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getSymbolsIn.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_getSymbolsIn.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
- /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
- /* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
- /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeGetSymbols = Object.getOwnPropertySymbols;
- /**
- * Creates an array of the own and inherited enumerable symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
- var getSymbolsIn = !nativeGetSymbols ? _stubArray_js__WEBPACK_IMPORTED_MODULE_3__["default"] : function(object) {
- var result = [];
- while (object) {
- Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, Object(_getSymbols_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object));
- object = Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
- }
- return result;
- };
- /* harmony default export */ __webpack_exports__["default"] = (getSymbolsIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getTag.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/_getTag.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _DataView_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_DataView.js */ "./node_modules/lodash-es/_DataView.js");
- /* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
- /* harmony import */ var _Promise_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_Promise.js */ "./node_modules/lodash-es/_Promise.js");
- /* harmony import */ var _Set_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_Set.js */ "./node_modules/lodash-es/_Set.js");
- /* harmony import */ var _WeakMap_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_WeakMap.js */ "./node_modules/lodash-es/_WeakMap.js");
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _toSource_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_toSource.js */ "./node_modules/lodash-es/_toSource.js");
- /** `Object#toString` result references. */
- var mapTag = '[object Map]',
- objectTag = '[object Object]',
- promiseTag = '[object Promise]',
- setTag = '[object Set]',
- weakMapTag = '[object WeakMap]';
- var dataViewTag = '[object DataView]';
- /** Used to detect maps, sets, and weakmaps. */
- var dataViewCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_DataView_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
- mapCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
- promiseCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_Promise_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
- setCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_Set_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
- weakMapCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_WeakMap_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
- /**
- * Gets the `toStringTag` of `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- var getTag = _baseGetTag_js__WEBPACK_IMPORTED_MODULE_5__["default"];
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
- if ((_DataView_js__WEBPACK_IMPORTED_MODULE_0__["default"] && getTag(new _DataView_js__WEBPACK_IMPORTED_MODULE_0__["default"](new ArrayBuffer(1))) != dataViewTag) ||
- (_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"] && getTag(new _Map_js__WEBPACK_IMPORTED_MODULE_1__["default"]) != mapTag) ||
- (_Promise_js__WEBPACK_IMPORTED_MODULE_2__["default"] && getTag(_Promise_js__WEBPACK_IMPORTED_MODULE_2__["default"].resolve()) != promiseTag) ||
- (_Set_js__WEBPACK_IMPORTED_MODULE_3__["default"] && getTag(new _Set_js__WEBPACK_IMPORTED_MODULE_3__["default"]) != setTag) ||
- (_WeakMap_js__WEBPACK_IMPORTED_MODULE_4__["default"] && getTag(new _WeakMap_js__WEBPACK_IMPORTED_MODULE_4__["default"]) != weakMapTag)) {
- getTag = function(value) {
- var result = Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value),
- Ctor = result == objectTag ? value.constructor : undefined,
- ctorString = Ctor ? Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(Ctor) : '';
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString: return dataViewTag;
- case mapCtorString: return mapTag;
- case promiseCtorString: return promiseTag;
- case setCtorString: return setTag;
- case weakMapCtorString: return weakMapTag;
- }
- }
- return result;
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (getTag);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getValue.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_getValue.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Gets the value at `key` of `object`.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {string} key The key of the property to get.
- * @returns {*} Returns the property value.
- */
- function getValue(object, key) {
- return object == null ? undefined : object[key];
- }
- /* harmony default export */ __webpack_exports__["default"] = (getValue);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getView.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_getView.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max,
- nativeMin = Math.min;
- /**
- * Gets the view, applying any `transforms` to the `start` and `end` positions.
- *
- * @private
- * @param {number} start The start of the view.
- * @param {number} end The end of the view.
- * @param {Array} transforms The transformations to apply to the view.
- * @returns {Object} Returns an object containing the `start` and `end`
- * positions of the view.
- */
- function getView(start, end, transforms) {
- var index = -1,
- length = transforms.length;
- while (++index < length) {
- var data = transforms[index],
- size = data.size;
- switch (data.type) {
- case 'drop': start += size; break;
- case 'dropRight': end -= size; break;
- case 'take': end = nativeMin(end, start + size); break;
- case 'takeRight': start = nativeMax(start, end - size); break;
- }
- }
- return { 'start': start, 'end': end };
- }
- /* harmony default export */ __webpack_exports__["default"] = (getView);
- /***/ }),
- /***/ "./node_modules/lodash-es/_getWrapDetails.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_getWrapDetails.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to match wrap detail comments. */
- var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
- reSplitDetails = /,? & /;
- /**
- * Extracts wrapper details from the `source` body comment.
- *
- * @private
- * @param {string} source The source to inspect.
- * @returns {Array} Returns the wrapper details.
- */
- function getWrapDetails(source) {
- var match = source.match(reWrapDetails);
- return match ? match[1].split(reSplitDetails) : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (getWrapDetails);
- /***/ }),
- /***/ "./node_modules/lodash-es/_hasPath.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_hasPath.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
- /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
- /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
- /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
- /**
- * Checks if `path` exists on `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @param {Function} hasFunc The function to check properties.
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
- */
- function hasPath(object, path, hasFunc) {
- path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
- var index = -1,
- length = path.length,
- result = false;
- while (++index < length) {
- var key = Object(_toKey_js__WEBPACK_IMPORTED_MODULE_5__["default"])(path[index]);
- if (!(result = object != null && hasFunc(object, key))) {
- break;
- }
- object = object[key];
- }
- if (result || ++index != length) {
- return result;
- }
- length = object == null ? 0 : object.length;
- return !!length && Object(_isLength_js__WEBPACK_IMPORTED_MODULE_4__["default"])(length) && Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_3__["default"])(key, length) &&
- (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
- }
- /* harmony default export */ __webpack_exports__["default"] = (hasPath);
- /***/ }),
- /***/ "./node_modules/lodash-es/_hasUnicode.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_hasUnicode.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to compose unicode character classes. */
- var rsAstralRange = '\\ud800-\\udfff',
- rsComboMarksRange = '\\u0300-\\u036f',
- reComboHalfMarksRange = '\\ufe20-\\ufe2f',
- rsComboSymbolsRange = '\\u20d0-\\u20ff',
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
- rsVarRange = '\\ufe0e\\ufe0f';
- /** Used to compose unicode capture groups. */
- var rsZWJ = '\\u200d';
- /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
- var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
- /**
- * Checks if `string` contains Unicode symbols.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {boolean} Returns `true` if a symbol is found, else `false`.
- */
- function hasUnicode(string) {
- return reHasUnicode.test(string);
- }
- /* harmony default export */ __webpack_exports__["default"] = (hasUnicode);
- /***/ }),
- /***/ "./node_modules/lodash-es/_hasUnicodeWord.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_hasUnicodeWord.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to detect strings that need a more robust regexp to match words. */
- var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
- /**
- * Checks if `string` contains a word composed of Unicode symbols.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {boolean} Returns `true` if a word is found, else `false`.
- */
- function hasUnicodeWord(string) {
- return reHasUnicodeWord.test(string);
- }
- /* harmony default export */ __webpack_exports__["default"] = (hasUnicodeWord);
- /***/ }),
- /***/ "./node_modules/lodash-es/_hashClear.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_hashClear.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
- /**
- * Removes all key-value entries from the hash.
- *
- * @private
- * @name clear
- * @memberOf Hash
- */
- function hashClear() {
- this.__data__ = _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? Object(_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(null) : {};
- this.size = 0;
- }
- /* harmony default export */ __webpack_exports__["default"] = (hashClear);
- /***/ }),
- /***/ "./node_modules/lodash-es/_hashDelete.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_hashDelete.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Removes `key` and its value from the hash.
- *
- * @private
- * @name delete
- * @memberOf Hash
- * @param {Object} hash The hash to modify.
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function hashDelete(key) {
- var result = this.has(key) && delete this.__data__[key];
- this.size -= result ? 1 : 0;
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (hashDelete);
- /***/ }),
- /***/ "./node_modules/lodash-es/_hashGet.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_hashGet.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
- /** Used to stand-in for `undefined` hash values. */
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Gets the hash value for `key`.
- *
- * @private
- * @name get
- * @memberOf Hash
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function hashGet(key) {
- var data = this.__data__;
- if (_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
- var result = data[key];
- return result === HASH_UNDEFINED ? undefined : result;
- }
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (hashGet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_hashHas.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_hashHas.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Checks if a hash value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Hash
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function hashHas(key) {
- var data = this.__data__;
- return _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
- }
- /* harmony default export */ __webpack_exports__["default"] = (hashHas);
- /***/ }),
- /***/ "./node_modules/lodash-es/_hashSet.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_hashSet.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
- /** Used to stand-in for `undefined` hash values. */
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
- /**
- * Sets the hash `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Hash
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the hash instance.
- */
- function hashSet(key, value) {
- var data = this.__data__;
- this.size += this.has(key) ? 0 : 1;
- data[key] = (_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] && value === undefined) ? HASH_UNDEFINED : value;
- return this;
- }
- /* harmony default export */ __webpack_exports__["default"] = (hashSet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_initCloneArray.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_initCloneArray.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Initializes an array clone.
- *
- * @private
- * @param {Array} array The array to clone.
- * @returns {Array} Returns the initialized clone.
- */
- function initCloneArray(array) {
- var length = array.length,
- result = new array.constructor(length);
- // Add properties assigned by `RegExp#exec`.
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
- result.index = array.index;
- result.input = array.input;
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (initCloneArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/_initCloneByTag.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_initCloneByTag.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
- /* harmony import */ var _cloneDataView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_cloneDataView.js */ "./node_modules/lodash-es/_cloneDataView.js");
- /* harmony import */ var _cloneRegExp_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cloneRegExp.js */ "./node_modules/lodash-es/_cloneRegExp.js");
- /* harmony import */ var _cloneSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_cloneSymbol.js */ "./node_modules/lodash-es/_cloneSymbol.js");
- /* harmony import */ var _cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_cloneTypedArray.js */ "./node_modules/lodash-es/_cloneTypedArray.js");
- /** `Object#toString` result references. */
- var boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- symbolTag = '[object Symbol]';
- var arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
- /**
- * Initializes an object clone based on its `toStringTag`.
- *
- * **Note:** This function only supports cloning values with tags of
- * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
- *
- * @private
- * @param {Object} object The object to clone.
- * @param {string} tag The `toStringTag` of the object to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneByTag(object, tag, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag:
- return Object(_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object);
- case boolTag:
- case dateTag:
- return new Ctor(+object);
- case dataViewTag:
- return Object(_cloneDataView_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, isDeep);
- case float32Tag: case float64Tag:
- case int8Tag: case int16Tag: case int32Tag:
- case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
- return Object(_cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object, isDeep);
- case mapTag:
- return new Ctor;
- case numberTag:
- case stringTag:
- return new Ctor(object);
- case regexpTag:
- return Object(_cloneRegExp_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
- case setTag:
- return new Ctor;
- case symbolTag:
- return Object(_cloneSymbol_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object);
- }
- }
- /* harmony default export */ __webpack_exports__["default"] = (initCloneByTag);
- /***/ }),
- /***/ "./node_modules/lodash-es/_initCloneObject.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_initCloneObject.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
- /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
- /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
- /**
- * Initializes an object clone.
- *
- * @private
- * @param {Object} object The object to clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneObject(object) {
- return (typeof object.constructor == 'function' && !Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object))
- ? Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object))
- : {};
- }
- /* harmony default export */ __webpack_exports__["default"] = (initCloneObject);
- /***/ }),
- /***/ "./node_modules/lodash-es/_insertWrapDetails.js":
- /*!******************************************************!*\
- !*** ./node_modules/lodash-es/_insertWrapDetails.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to match wrap detail comments. */
- var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
- /**
- * Inserts wrapper `details` in a comment at the top of the `source` body.
- *
- * @private
- * @param {string} source The source to modify.
- * @returns {Array} details The details to insert.
- * @returns {string} Returns the modified source.
- */
- function insertWrapDetails(source, details) {
- var length = details.length;
- if (!length) {
- return source;
- }
- var lastIndex = length - 1;
- details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
- details = details.join(length > 2 ? ', ' : ' ');
- return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
- }
- /* harmony default export */ __webpack_exports__["default"] = (insertWrapDetails);
- /***/ }),
- /***/ "./node_modules/lodash-es/_isFlattenable.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_isFlattenable.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
- /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /** Built-in value references. */
- var spreadableSymbol = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].isConcatSpreadable : undefined;
- /**
- * Checks if `value` is a flattenable `arguments` object or array.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
- */
- function isFlattenable(value) {
- return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) ||
- !!(spreadableSymbol && value && value[spreadableSymbol]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isFlattenable);
- /***/ }),
- /***/ "./node_modules/lodash-es/_isIndex.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_isIndex.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used as references for various `Number` constants. */
- var MAX_SAFE_INTEGER = 9007199254740991;
- /** Used to detect unsigned integer values. */
- var reIsUint = /^(?:0|[1-9]\d*)$/;
- /**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
- function isIndex(value, length) {
- var type = typeof value;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length &&
- (type == 'number' ||
- (type != 'symbol' && reIsUint.test(value))) &&
- (value > -1 && value % 1 == 0 && value < length);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isIndex);
- /***/ }),
- /***/ "./node_modules/lodash-es/_isIterateeCall.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_isIterateeCall.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /**
- * Checks if the given arguments are from an iteratee call.
- *
- * @private
- * @param {*} value The potential iteratee value argument.
- * @param {*} index The potential iteratee index or key argument.
- * @param {*} object The potential iteratee object argument.
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
- * else `false`.
- */
- function isIterateeCall(value, index, object) {
- if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object)) {
- return false;
- }
- var type = typeof index;
- if (type == 'number'
- ? (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object) && Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(index, object.length))
- : (type == 'string' && index in object)
- ) {
- return Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object[index], value);
- }
- return false;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isIterateeCall);
- /***/ }),
- /***/ "./node_modules/lodash-es/_isKey.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/_isKey.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /** Used to match property names within property paths. */
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
- reIsPlainProp = /^\w*$/;
- /**
- * Checks if `value` is a property name and not a property path.
- *
- * @private
- * @param {*} value The value to check.
- * @param {Object} [object] The object to query keys on.
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
- */
- function isKey(value, object) {
- if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
- return false;
- }
- var type = typeof value;
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
- value == null || Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
- return true;
- }
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
- (object != null && value in Object(object));
- }
- /* harmony default export */ __webpack_exports__["default"] = (isKey);
- /***/ }),
- /***/ "./node_modules/lodash-es/_isKeyable.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_isKeyable.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Checks if `value` is suitable for use as unique object key.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
- */
- function isKeyable(value) {
- var type = typeof value;
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
- ? (value !== '__proto__')
- : (value === null);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isKeyable);
- /***/ }),
- /***/ "./node_modules/lodash-es/_isLaziable.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_isLaziable.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
- /* harmony import */ var _getData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getData.js */ "./node_modules/lodash-es/_getData.js");
- /* harmony import */ var _getFuncName_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getFuncName.js */ "./node_modules/lodash-es/_getFuncName.js");
- /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
- /**
- * Checks if `func` has a lazy counterpart.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
- * else `false`.
- */
- function isLaziable(func) {
- var funcName = Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func),
- other = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__["default"][funcName];
- if (typeof other != 'function' || !(funcName in _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype)) {
- return false;
- }
- if (func === other) {
- return true;
- }
- var data = Object(_getData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other);
- return !!data && func === data[0];
- }
- /* harmony default export */ __webpack_exports__["default"] = (isLaziable);
- /***/ }),
- /***/ "./node_modules/lodash-es/_isMaskable.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_isMaskable.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_coreJsData.js */ "./node_modules/lodash-es/_coreJsData.js");
- /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
- /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
- /**
- * Checks if `func` is capable of being masked.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
- */
- var isMaskable = _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"] : _stubFalse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (isMaskable);
- /***/ }),
- /***/ "./node_modules/lodash-es/_isMasked.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_isMasked.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_coreJsData.js */ "./node_modules/lodash-es/_coreJsData.js");
- /** Used to detect methods masquerading as native. */
- var maskSrcKey = (function() {
- var uid = /[^.]+$/.exec(_coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"] && _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"].keys && _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"].keys.IE_PROTO || '');
- return uid ? ('Symbol(src)_1.' + uid) : '';
- }());
- /**
- * Checks if `func` has its source masked.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
- */
- function isMasked(func) {
- return !!maskSrcKey && (maskSrcKey in func);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isMasked);
- /***/ }),
- /***/ "./node_modules/lodash-es/_isPrototype.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_isPrototype.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /**
- * Checks if `value` is likely a prototype object.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
- */
- function isPrototype(value) {
- var Ctor = value && value.constructor,
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
- return value === proto;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isPrototype);
- /***/ }),
- /***/ "./node_modules/lodash-es/_isStrictComparable.js":
- /*!*******************************************************!*\
- !*** ./node_modules/lodash-es/_isStrictComparable.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /**
- * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` if suitable for strict
- * equality comparisons, else `false`.
- */
- function isStrictComparable(value) {
- return value === value && !Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isStrictComparable);
- /***/ }),
- /***/ "./node_modules/lodash-es/_iteratorToArray.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_iteratorToArray.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Converts `iterator` to an array.
- *
- * @private
- * @param {Object} iterator The iterator to convert.
- * @returns {Array} Returns the converted array.
- */
- function iteratorToArray(iterator) {
- var data,
- result = [];
- while (!(data = iterator.next()).done) {
- result.push(data.value);
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (iteratorToArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/_lazyClone.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_lazyClone.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
- /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
- /**
- * Creates a clone of the lazy wrapper object.
- *
- * @private
- * @name clone
- * @memberOf LazyWrapper
- * @returns {Object} Returns the cloned `LazyWrapper` object.
- */
- function lazyClone() {
- var result = new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this.__wrapped__);
- result.__actions__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.__actions__);
- result.__dir__ = this.__dir__;
- result.__filtered__ = this.__filtered__;
- result.__iteratees__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.__iteratees__);
- result.__takeCount__ = this.__takeCount__;
- result.__views__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.__views__);
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (lazyClone);
- /***/ }),
- /***/ "./node_modules/lodash-es/_lazyReverse.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_lazyReverse.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
- /**
- * Reverses the direction of lazy iteration.
- *
- * @private
- * @name reverse
- * @memberOf LazyWrapper
- * @returns {Object} Returns the new reversed `LazyWrapper` object.
- */
- function lazyReverse() {
- if (this.__filtered__) {
- var result = new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this);
- result.__dir__ = -1;
- result.__filtered__ = true;
- } else {
- result = this.clone();
- result.__dir__ *= -1;
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (lazyReverse);
- /***/ }),
- /***/ "./node_modules/lodash-es/_lazyValue.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_lazyValue.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseWrapperValue.js */ "./node_modules/lodash-es/_baseWrapperValue.js");
- /* harmony import */ var _getView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getView.js */ "./node_modules/lodash-es/_getView.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /** Used to indicate the type of lazy iteratees. */
- var LAZY_FILTER_FLAG = 1,
- LAZY_MAP_FLAG = 2;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMin = Math.min;
- /**
- * Extracts the unwrapped value from its lazy wrapper.
- *
- * @private
- * @name value
- * @memberOf LazyWrapper
- * @returns {*} Returns the unwrapped value.
- */
- function lazyValue() {
- var array = this.__wrapped__.value(),
- dir = this.__dir__,
- isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array),
- isRight = dir < 0,
- arrLength = isArr ? array.length : 0,
- view = Object(_getView_js__WEBPACK_IMPORTED_MODULE_1__["default"])(0, arrLength, this.__views__),
- start = view.start,
- end = view.end,
- length = end - start,
- index = isRight ? end : (start - 1),
- iteratees = this.__iteratees__,
- iterLength = iteratees.length,
- resIndex = 0,
- takeCount = nativeMin(length, this.__takeCount__);
- if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
- return Object(_baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, this.__actions__);
- }
- var result = [];
- outer:
- while (length-- && resIndex < takeCount) {
- index += dir;
- var iterIndex = -1,
- value = array[index];
- while (++iterIndex < iterLength) {
- var data = iteratees[iterIndex],
- iteratee = data.iteratee,
- type = data.type,
- computed = iteratee(value);
- if (type == LAZY_MAP_FLAG) {
- value = computed;
- } else if (!computed) {
- if (type == LAZY_FILTER_FLAG) {
- continue outer;
- } else {
- break outer;
- }
- }
- }
- result[resIndex++] = value;
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (lazyValue);
- /***/ }),
- /***/ "./node_modules/lodash-es/_listCacheClear.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_listCacheClear.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Removes all key-value entries from the list cache.
- *
- * @private
- * @name clear
- * @memberOf ListCache
- */
- function listCacheClear() {
- this.__data__ = [];
- this.size = 0;
- }
- /* harmony default export */ __webpack_exports__["default"] = (listCacheClear);
- /***/ }),
- /***/ "./node_modules/lodash-es/_listCacheDelete.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_listCacheDelete.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
- /** Used for built-in method references. */
- var arrayProto = Array.prototype;
- /** Built-in value references. */
- var splice = arrayProto.splice;
- /**
- * Removes `key` and its value from the list cache.
- *
- * @private
- * @name delete
- * @memberOf ListCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function listCacheDelete(key) {
- var data = this.__data__,
- index = Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);
- if (index < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index, 1);
- }
- --this.size;
- return true;
- }
- /* harmony default export */ __webpack_exports__["default"] = (listCacheDelete);
- /***/ }),
- /***/ "./node_modules/lodash-es/_listCacheGet.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_listCacheGet.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
- /**
- * Gets the list cache value for `key`.
- *
- * @private
- * @name get
- * @memberOf ListCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function listCacheGet(key) {
- var data = this.__data__,
- index = Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);
- return index < 0 ? undefined : data[index][1];
- }
- /* harmony default export */ __webpack_exports__["default"] = (listCacheGet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_listCacheHas.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_listCacheHas.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
- /**
- * Checks if a list cache value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf ListCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function listCacheHas(key) {
- return Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.__data__, key) > -1;
- }
- /* harmony default export */ __webpack_exports__["default"] = (listCacheHas);
- /***/ }),
- /***/ "./node_modules/lodash-es/_listCacheSet.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_listCacheSet.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
- /**
- * Sets the list cache `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf ListCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the list cache instance.
- */
- function listCacheSet(key, value) {
- var data = this.__data__,
- index = Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);
- if (index < 0) {
- ++this.size;
- data.push([key, value]);
- } else {
- data[index][1] = value;
- }
- return this;
- }
- /* harmony default export */ __webpack_exports__["default"] = (listCacheSet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_mapCacheClear.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_mapCacheClear.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Hash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Hash.js */ "./node_modules/lodash-es/_Hash.js");
- /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
- /* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
- /**
- * Removes all key-value entries from the map.
- *
- * @private
- * @name clear
- * @memberOf MapCache
- */
- function mapCacheClear() {
- this.size = 0;
- this.__data__ = {
- 'hash': new _Hash_js__WEBPACK_IMPORTED_MODULE_0__["default"],
- 'map': new (_Map_js__WEBPACK_IMPORTED_MODULE_2__["default"] || _ListCache_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
- 'string': new _Hash_js__WEBPACK_IMPORTED_MODULE_0__["default"]
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (mapCacheClear);
- /***/ }),
- /***/ "./node_modules/lodash-es/_mapCacheDelete.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_mapCacheDelete.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
- /**
- * Removes `key` and its value from the map.
- *
- * @private
- * @name delete
- * @memberOf MapCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function mapCacheDelete(key) {
- var result = Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key)['delete'](key);
- this.size -= result ? 1 : 0;
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (mapCacheDelete);
- /***/ }),
- /***/ "./node_modules/lodash-es/_mapCacheGet.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_mapCacheGet.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
- /**
- * Gets the map value for `key`.
- *
- * @private
- * @name get
- * @memberOf MapCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function mapCacheGet(key) {
- return Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key).get(key);
- }
- /* harmony default export */ __webpack_exports__["default"] = (mapCacheGet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_mapCacheHas.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_mapCacheHas.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
- /**
- * Checks if a map value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf MapCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function mapCacheHas(key) {
- return Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key).has(key);
- }
- /* harmony default export */ __webpack_exports__["default"] = (mapCacheHas);
- /***/ }),
- /***/ "./node_modules/lodash-es/_mapCacheSet.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_mapCacheSet.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
- /**
- * Sets the map `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf MapCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the map cache instance.
- */
- function mapCacheSet(key, value) {
- var data = Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key),
- size = data.size;
- data.set(key, value);
- this.size += data.size == size ? 0 : 1;
- return this;
- }
- /* harmony default export */ __webpack_exports__["default"] = (mapCacheSet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_mapToArray.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_mapToArray.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Converts `map` to its key-value pairs.
- *
- * @private
- * @param {Object} map The map to convert.
- * @returns {Array} Returns the key-value pairs.
- */
- function mapToArray(map) {
- var index = -1,
- result = Array(map.size);
- map.forEach(function(value, key) {
- result[++index] = [key, value];
- });
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (mapToArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/_matchesStrictComparable.js":
- /*!************************************************************!*\
- !*** ./node_modules/lodash-es/_matchesStrictComparable.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A specialized version of `matchesProperty` for source values suitable
- * for strict equality comparisons, i.e. `===`.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new spec function.
- */
- function matchesStrictComparable(key, srcValue) {
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === srcValue &&
- (srcValue !== undefined || (key in Object(object)));
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (matchesStrictComparable);
- /***/ }),
- /***/ "./node_modules/lodash-es/_memoizeCapped.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_memoizeCapped.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
- /** Used as the maximum memoize cache size. */
- var MAX_MEMOIZE_SIZE = 500;
- /**
- * A specialized version of `_.memoize` which clears the memoized function's
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
- *
- * @private
- * @param {Function} func The function to have its output memoized.
- * @returns {Function} Returns the new memoized function.
- */
- function memoizeCapped(func) {
- var result = Object(_memoize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, function(key) {
- if (cache.size === MAX_MEMOIZE_SIZE) {
- cache.clear();
- }
- return key;
- });
- var cache = result.cache;
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (memoizeCapped);
- /***/ }),
- /***/ "./node_modules/lodash-es/_mergeData.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_mergeData.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _composeArgs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_composeArgs.js */ "./node_modules/lodash-es/_composeArgs.js");
- /* harmony import */ var _composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_composeArgsRight.js */ "./node_modules/lodash-es/_composeArgsRight.js");
- /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
- /** Used as the internal argument placeholder. */
- var PLACEHOLDER = '__lodash_placeholder__';
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_FLAG = 1,
- WRAP_BIND_KEY_FLAG = 2,
- WRAP_CURRY_BOUND_FLAG = 4,
- WRAP_CURRY_FLAG = 8,
- WRAP_ARY_FLAG = 128,
- WRAP_REARG_FLAG = 256;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMin = Math.min;
- /**
- * Merges the function metadata of `source` into `data`.
- *
- * Merging metadata reduces the number of wrappers used to invoke a function.
- * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
- * may be applied regardless of execution order. Methods like `_.ary` and
- * `_.rearg` modify function arguments, making the order in which they are
- * executed important, preventing the merging of metadata. However, we make
- * an exception for a safe combined case where curried functions have `_.ary`
- * and or `_.rearg` applied.
- *
- * @private
- * @param {Array} data The destination metadata.
- * @param {Array} source The source metadata.
- * @returns {Array} Returns `data`.
- */
- function mergeData(data, source) {
- var bitmask = data[1],
- srcBitmask = source[1],
- newBitmask = bitmask | srcBitmask,
- isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
- var isCombo =
- ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
- ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
- ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
- // Exit early if metadata can't be merged.
- if (!(isCommon || isCombo)) {
- return data;
- }
- // Use source `thisArg` if available.
- if (srcBitmask & WRAP_BIND_FLAG) {
- data[2] = source[2];
- // Set when currying a bound function.
- newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
- }
- // Compose partial arguments.
- var value = source[3];
- if (value) {
- var partials = data[3];
- data[3] = partials ? Object(_composeArgs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(partials, value, source[4]) : value;
- data[4] = partials ? Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data[3], PLACEHOLDER) : source[4];
- }
- // Compose partial right arguments.
- value = source[5];
- if (value) {
- partials = data[5];
- data[5] = partials ? Object(_composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__["default"])(partials, value, source[6]) : value;
- data[6] = partials ? Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data[5], PLACEHOLDER) : source[6];
- }
- // Use source `argPos` if available.
- value = source[7];
- if (value) {
- data[7] = value;
- }
- // Use source `ary` if it's smaller.
- if (srcBitmask & WRAP_ARY_FLAG) {
- data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
- }
- // Use source `arity` if one is not provided.
- if (data[9] == null) {
- data[9] = source[9];
- }
- // Use source `func` and merge bitmasks.
- data[0] = source[0];
- data[1] = newBitmask;
- return data;
- }
- /* harmony default export */ __webpack_exports__["default"] = (mergeData);
- /***/ }),
- /***/ "./node_modules/lodash-es/_metaMap.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_metaMap.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _WeakMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_WeakMap.js */ "./node_modules/lodash-es/_WeakMap.js");
- /** Used to store function metadata. */
- var metaMap = _WeakMap_js__WEBPACK_IMPORTED_MODULE_0__["default"] && new _WeakMap_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (metaMap);
- /***/ }),
- /***/ "./node_modules/lodash-es/_nativeCreate.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_nativeCreate.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
- /* Built-in method references that are verified to be native. */
- var nativeCreate = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object, 'create');
- /* harmony default export */ __webpack_exports__["default"] = (nativeCreate);
- /***/ }),
- /***/ "./node_modules/lodash-es/_nativeKeys.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_nativeKeys.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_overArg.js */ "./node_modules/lodash-es/_overArg.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeKeys = Object(_overArg_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object.keys, Object);
- /* harmony default export */ __webpack_exports__["default"] = (nativeKeys);
- /***/ }),
- /***/ "./node_modules/lodash-es/_nativeKeysIn.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_nativeKeysIn.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This function is like
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * except that it includes inherited enumerable properties.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function nativeKeysIn(object) {
- var result = [];
- if (object != null) {
- for (var key in Object(object)) {
- result.push(key);
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (nativeKeysIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/_nodeUtil.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_nodeUtil.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_freeGlobal.js */ "./node_modules/lodash-es/_freeGlobal.js");
- /** Detect free variable `exports`. */
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
- /** Detect free variable `module`. */
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
- /** Detect the popular CommonJS extension `module.exports`. */
- var moduleExports = freeModule && freeModule.exports === freeExports;
- /** Detect free variable `process` from Node.js. */
- var freeProcess = moduleExports && _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__["default"].process;
- /** Used to access faster Node.js helpers. */
- var nodeUtil = (function() {
- try {
- // Use `util.types` for Node.js 10+.
- var types = freeModule && freeModule.require && freeModule.require('util').types;
- if (types) {
- return types;
- }
- // Legacy `process.binding('util')` for Node.js < 10.
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
- } catch (e) {}
- }());
- /* harmony default export */ __webpack_exports__["default"] = (nodeUtil);
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
- /***/ }),
- /***/ "./node_modules/lodash-es/_objectToString.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_objectToString.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var nativeObjectToString = objectProto.toString;
- /**
- * Converts `value` to a string using `Object.prototype.toString`.
- *
- * @private
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- */
- function objectToString(value) {
- return nativeObjectToString.call(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (objectToString);
- /***/ }),
- /***/ "./node_modules/lodash-es/_overArg.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_overArg.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Creates a unary function that invokes `func` with its argument transformed.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {Function} transform The argument transform.
- * @returns {Function} Returns the new function.
- */
- function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (overArg);
- /***/ }),
- /***/ "./node_modules/lodash-es/_overRest.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_overRest.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max;
- /**
- * A specialized version of `baseRest` which transforms the rest array.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @param {Function} transform The rest array transform.
- * @returns {Function} Returns the new function.
- */
- function overRest(func, start, transform) {
- start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
- return function() {
- var args = arguments,
- index = -1,
- length = nativeMax(args.length - start, 0),
- array = Array(length);
- while (++index < length) {
- array[index] = args[start + index];
- }
- index = -1;
- var otherArgs = Array(start + 1);
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = transform(array);
- return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, otherArgs);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (overRest);
- /***/ }),
- /***/ "./node_modules/lodash-es/_parent.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/_parent.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
- /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
- /**
- * Gets the parent value at `path` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} path The path to get the parent value of.
- * @returns {*} Returns the parent value.
- */
- function parent(object, path) {
- return path.length < 2 ? object : Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, 0, -1));
- }
- /* harmony default export */ __webpack_exports__["default"] = (parent);
- /***/ }),
- /***/ "./node_modules/lodash-es/_reEscape.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_reEscape.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to match template delimiters. */
- var reEscape = /<%-([\s\S]+?)%>/g;
- /* harmony default export */ __webpack_exports__["default"] = (reEscape);
- /***/ }),
- /***/ "./node_modules/lodash-es/_reEvaluate.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_reEvaluate.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to match template delimiters. */
- var reEvaluate = /<%([\s\S]+?)%>/g;
- /* harmony default export */ __webpack_exports__["default"] = (reEvaluate);
- /***/ }),
- /***/ "./node_modules/lodash-es/_reInterpolate.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_reInterpolate.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to match template delimiters. */
- var reInterpolate = /<%=([\s\S]+?)%>/g;
- /* harmony default export */ __webpack_exports__["default"] = (reInterpolate);
- /***/ }),
- /***/ "./node_modules/lodash-es/_realNames.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/_realNames.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to lookup unminified function names. */
- var realNames = {};
- /* harmony default export */ __webpack_exports__["default"] = (realNames);
- /***/ }),
- /***/ "./node_modules/lodash-es/_reorder.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_reorder.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
- /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMin = Math.min;
- /**
- * Reorder `array` according to the specified indexes where the element at
- * the first index is assigned as the first element, the element at
- * the second index is assigned as the second element, and so on.
- *
- * @private
- * @param {Array} array The array to reorder.
- * @param {Array} indexes The arranged array indexes.
- * @returns {Array} Returns `array`.
- */
- function reorder(array, indexes) {
- var arrLength = array.length,
- length = nativeMin(indexes.length, arrLength),
- oldArray = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array);
- while (length--) {
- var index = indexes[length];
- array[length] = Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"])(index, arrLength) ? oldArray[index] : undefined;
- }
- return array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (reorder);
- /***/ }),
- /***/ "./node_modules/lodash-es/_replaceHolders.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_replaceHolders.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used as the internal argument placeholder. */
- var PLACEHOLDER = '__lodash_placeholder__';
- /**
- * Replaces all `placeholder` elements in `array` with an internal placeholder
- * and returns an array of their indexes.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {*} placeholder The placeholder to replace.
- * @returns {Array} Returns the new array of placeholder indexes.
- */
- function replaceHolders(array, placeholder) {
- var index = -1,
- length = array.length,
- resIndex = 0,
- result = [];
- while (++index < length) {
- var value = array[index];
- if (value === placeholder || value === PLACEHOLDER) {
- array[index] = PLACEHOLDER;
- result[resIndex++] = index;
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (replaceHolders);
- /***/ }),
- /***/ "./node_modules/lodash-es/_root.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/_root.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_freeGlobal.js */ "./node_modules/lodash-es/_freeGlobal.js");
- /** Detect free variable `self`. */
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
- /** Used as a reference to the global object. */
- var root = _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__["default"] || freeSelf || Function('return this')();
- /* harmony default export */ __webpack_exports__["default"] = (root);
- /***/ }),
- /***/ "./node_modules/lodash-es/_safeGet.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_safeGet.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the property to get.
- * @returns {*} Returns the property value.
- */
- function safeGet(object, key) {
- if (key === 'constructor' && typeof object[key] === 'function') {
- return;
- }
- if (key == '__proto__') {
- return;
- }
- return object[key];
- }
- /* harmony default export */ __webpack_exports__["default"] = (safeGet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_setCacheAdd.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_setCacheAdd.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to stand-in for `undefined` hash values. */
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
- /**
- * Adds `value` to the array cache.
- *
- * @private
- * @name add
- * @memberOf SetCache
- * @alias push
- * @param {*} value The value to cache.
- * @returns {Object} Returns the cache instance.
- */
- function setCacheAdd(value) {
- this.__data__.set(value, HASH_UNDEFINED);
- return this;
- }
- /* harmony default export */ __webpack_exports__["default"] = (setCacheAdd);
- /***/ }),
- /***/ "./node_modules/lodash-es/_setCacheHas.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_setCacheHas.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Checks if `value` is in the array cache.
- *
- * @private
- * @name has
- * @memberOf SetCache
- * @param {*} value The value to search for.
- * @returns {number} Returns `true` if `value` is found, else `false`.
- */
- function setCacheHas(value) {
- return this.__data__.has(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (setCacheHas);
- /***/ }),
- /***/ "./node_modules/lodash-es/_setData.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/_setData.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSetData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSetData.js */ "./node_modules/lodash-es/_baseSetData.js");
- /* harmony import */ var _shortOut_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shortOut.js */ "./node_modules/lodash-es/_shortOut.js");
- /**
- * Sets metadata for `func`.
- *
- * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
- * period of time, it will trip its breaker and transition to an identity
- * function to avoid garbage collection pauses in V8. See
- * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
- * for more details.
- *
- * @private
- * @param {Function} func The function to associate metadata with.
- * @param {*} data The metadata.
- * @returns {Function} Returns `func`.
- */
- var setData = Object(_shortOut_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseSetData_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (setData);
- /***/ }),
- /***/ "./node_modules/lodash-es/_setToArray.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_setToArray.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Converts `set` to an array of its values.
- *
- * @private
- * @param {Object} set The set to convert.
- * @returns {Array} Returns the values.
- */
- function setToArray(set) {
- var index = -1,
- result = Array(set.size);
- set.forEach(function(value) {
- result[++index] = value;
- });
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (setToArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/_setToPairs.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_setToPairs.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Converts `set` to its value-value pairs.
- *
- * @private
- * @param {Object} set The set to convert.
- * @returns {Array} Returns the value-value pairs.
- */
- function setToPairs(set) {
- var index = -1,
- result = Array(set.size);
- set.forEach(function(value) {
- result[++index] = [value, value];
- });
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (setToPairs);
- /***/ }),
- /***/ "./node_modules/lodash-es/_setToString.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_setToString.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSetToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSetToString.js */ "./node_modules/lodash-es/_baseSetToString.js");
- /* harmony import */ var _shortOut_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shortOut.js */ "./node_modules/lodash-es/_shortOut.js");
- /**
- * Sets the `toString` method of `func` to return `string`.
- *
- * @private
- * @param {Function} func The function to modify.
- * @param {Function} string The `toString` result.
- * @returns {Function} Returns `func`.
- */
- var setToString = Object(_shortOut_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseSetToString_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (setToString);
- /***/ }),
- /***/ "./node_modules/lodash-es/_setWrapToString.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_setWrapToString.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getWrapDetails_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getWrapDetails.js */ "./node_modules/lodash-es/_getWrapDetails.js");
- /* harmony import */ var _insertWrapDetails_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_insertWrapDetails.js */ "./node_modules/lodash-es/_insertWrapDetails.js");
- /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");
- /* harmony import */ var _updateWrapDetails_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_updateWrapDetails.js */ "./node_modules/lodash-es/_updateWrapDetails.js");
- /**
- * Sets the `toString` method of `wrapper` to mimic the source of `reference`
- * with wrapper details in a comment at the top of the source body.
- *
- * @private
- * @param {Function} wrapper The function to modify.
- * @param {Function} reference The reference function.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @returns {Function} Returns `wrapper`.
- */
- function setWrapToString(wrapper, reference, bitmask) {
- var source = (reference + '');
- return Object(_setToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wrapper, Object(_insertWrapDetails_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source, Object(_updateWrapDetails_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_getWrapDetails_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source), bitmask)));
- }
- /* harmony default export */ __webpack_exports__["default"] = (setWrapToString);
- /***/ }),
- /***/ "./node_modules/lodash-es/_shortOut.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_shortOut.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to detect hot functions by number of calls within a span of milliseconds. */
- var HOT_COUNT = 800,
- HOT_SPAN = 16;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeNow = Date.now;
- /**
- * Creates a function that'll short out and invoke `identity` instead
- * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
- * milliseconds.
- *
- * @private
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new shortable function.
- */
- function shortOut(func) {
- var count = 0,
- lastCalled = 0;
- return function() {
- var stamp = nativeNow(),
- remaining = HOT_SPAN - (stamp - lastCalled);
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return arguments[0];
- }
- } else {
- count = 0;
- }
- return func.apply(undefined, arguments);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (shortOut);
- /***/ }),
- /***/ "./node_modules/lodash-es/_shuffleSelf.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_shuffleSelf.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRandom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRandom.js */ "./node_modules/lodash-es/_baseRandom.js");
- /**
- * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
- *
- * @private
- * @param {Array} array The array to shuffle.
- * @param {number} [size=array.length] The size of `array`.
- * @returns {Array} Returns `array`.
- */
- function shuffleSelf(array, size) {
- var index = -1,
- length = array.length,
- lastIndex = length - 1;
- size = size === undefined ? length : size;
- while (++index < size) {
- var rand = Object(_baseRandom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(index, lastIndex),
- value = array[rand];
- array[rand] = array[index];
- array[index] = value;
- }
- array.length = size;
- return array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (shuffleSelf);
- /***/ }),
- /***/ "./node_modules/lodash-es/_stackClear.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_stackClear.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
- /**
- * Removes all key-value entries from the stack.
- *
- * @private
- * @name clear
- * @memberOf Stack
- */
- function stackClear() {
- this.__data__ = new _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- this.size = 0;
- }
- /* harmony default export */ __webpack_exports__["default"] = (stackClear);
- /***/ }),
- /***/ "./node_modules/lodash-es/_stackDelete.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_stackDelete.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Removes `key` and its value from the stack.
- *
- * @private
- * @name delete
- * @memberOf Stack
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function stackDelete(key) {
- var data = this.__data__,
- result = data['delete'](key);
- this.size = data.size;
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (stackDelete);
- /***/ }),
- /***/ "./node_modules/lodash-es/_stackGet.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_stackGet.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Gets the stack value for `key`.
- *
- * @private
- * @name get
- * @memberOf Stack
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function stackGet(key) {
- return this.__data__.get(key);
- }
- /* harmony default export */ __webpack_exports__["default"] = (stackGet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_stackHas.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_stackHas.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Checks if a stack value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Stack
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function stackHas(key) {
- return this.__data__.has(key);
- }
- /* harmony default export */ __webpack_exports__["default"] = (stackHas);
- /***/ }),
- /***/ "./node_modules/lodash-es/_stackSet.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_stackSet.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
- /* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
- /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
- /** Used as the size to enable large array optimizations. */
- var LARGE_ARRAY_SIZE = 200;
- /**
- * Sets the stack `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Stack
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the stack cache instance.
- */
- function stackSet(key, value) {
- var data = this.__data__;
- if (data instanceof _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
- var pairs = data.__data__;
- if (!_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"] || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
- pairs.push([key, value]);
- this.size = ++data.size;
- return this;
- }
- data = this.__data__ = new _MapCache_js__WEBPACK_IMPORTED_MODULE_2__["default"](pairs);
- }
- data.set(key, value);
- this.size = data.size;
- return this;
- }
- /* harmony default export */ __webpack_exports__["default"] = (stackSet);
- /***/ }),
- /***/ "./node_modules/lodash-es/_strictIndexOf.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_strictIndexOf.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A specialized version of `_.indexOf` which performs strict equality
- * comparisons of values, i.e. `===`.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function strictIndexOf(array, value, fromIndex) {
- var index = fromIndex - 1,
- length = array.length;
- while (++index < length) {
- if (array[index] === value) {
- return index;
- }
- }
- return -1;
- }
- /* harmony default export */ __webpack_exports__["default"] = (strictIndexOf);
- /***/ }),
- /***/ "./node_modules/lodash-es/_strictLastIndexOf.js":
- /*!******************************************************!*\
- !*** ./node_modules/lodash-es/_strictLastIndexOf.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * A specialized version of `_.lastIndexOf` which performs strict equality
- * comparisons of values, i.e. `===`.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function strictLastIndexOf(array, value, fromIndex) {
- var index = fromIndex + 1;
- while (index--) {
- if (array[index] === value) {
- return index;
- }
- }
- return index;
- }
- /* harmony default export */ __webpack_exports__["default"] = (strictLastIndexOf);
- /***/ }),
- /***/ "./node_modules/lodash-es/_stringSize.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/_stringSize.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _asciiSize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_asciiSize.js */ "./node_modules/lodash-es/_asciiSize.js");
- /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
- /* harmony import */ var _unicodeSize_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_unicodeSize.js */ "./node_modules/lodash-es/_unicodeSize.js");
- /**
- * Gets the number of symbols in `string`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {number} Returns the string size.
- */
- function stringSize(string) {
- return Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string)
- ? Object(_unicodeSize_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)
- : Object(_asciiSize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
- }
- /* harmony default export */ __webpack_exports__["default"] = (stringSize);
- /***/ }),
- /***/ "./node_modules/lodash-es/_stringToArray.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/_stringToArray.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _asciiToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_asciiToArray.js */ "./node_modules/lodash-es/_asciiToArray.js");
- /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
- /* harmony import */ var _unicodeToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_unicodeToArray.js */ "./node_modules/lodash-es/_unicodeToArray.js");
- /**
- * Converts `string` to an array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the converted array.
- */
- function stringToArray(string) {
- return Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string)
- ? Object(_unicodeToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)
- : Object(_asciiToArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
- }
- /* harmony default export */ __webpack_exports__["default"] = (stringToArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/_stringToPath.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_stringToPath.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _memoizeCapped_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_memoizeCapped.js */ "./node_modules/lodash-es/_memoizeCapped.js");
- /** Used to match property names within property paths. */
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
- /** Used to match backslashes in property paths. */
- var reEscapeChar = /\\(\\)?/g;
- /**
- * Converts `string` to a property path array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the property path array.
- */
- var stringToPath = Object(_memoizeCapped_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(string) {
- var result = [];
- if (string.charCodeAt(0) === 46 /* . */) {
- result.push('');
- }
- string.replace(rePropName, function(match, number, quote, subString) {
- result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
- });
- return result;
- });
- /* harmony default export */ __webpack_exports__["default"] = (stringToPath);
- /***/ }),
- /***/ "./node_modules/lodash-es/_toKey.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/_toKey.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /** Used as references for various `Number` constants. */
- var INFINITY = 1 / 0;
- /**
- * Converts `value` to a string key if it's not a string or symbol.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {string|symbol} Returns the key.
- */
- function toKey(value) {
- if (typeof value == 'string' || Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
- return value;
- }
- var result = (value + '');
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (toKey);
- /***/ }),
- /***/ "./node_modules/lodash-es/_toSource.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/_toSource.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used for built-in method references. */
- var funcProto = Function.prototype;
- /** Used to resolve the decompiled source of functions. */
- var funcToString = funcProto.toString;
- /**
- * Converts `func` to its source code.
- *
- * @private
- * @param {Function} func The function to convert.
- * @returns {string} Returns the source code.
- */
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {}
- try {
- return (func + '');
- } catch (e) {}
- }
- return '';
- }
- /* harmony default export */ __webpack_exports__["default"] = (toSource);
- /***/ }),
- /***/ "./node_modules/lodash-es/_trimmedEndIndex.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/_trimmedEndIndex.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to match a single whitespace character. */
- var reWhitespace = /\s/;
- /**
- * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
- * character of `string`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {number} Returns the index of the last non-whitespace character.
- */
- function trimmedEndIndex(string) {
- var index = string.length;
- while (index-- && reWhitespace.test(string.charAt(index))) {}
- return index;
- }
- /* harmony default export */ __webpack_exports__["default"] = (trimmedEndIndex);
- /***/ }),
- /***/ "./node_modules/lodash-es/_unescapeHtmlChar.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/_unescapeHtmlChar.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePropertyOf.js */ "./node_modules/lodash-es/_basePropertyOf.js");
- /** Used to map HTML entities to characters. */
- var htmlUnescapes = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- ''': "'"
- };
- /**
- * Used by `_.unescape` to convert HTML entities to characters.
- *
- * @private
- * @param {string} chr The matched character to unescape.
- * @returns {string} Returns the unescaped character.
- */
- var unescapeHtmlChar = Object(_basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(htmlUnescapes);
- /* harmony default export */ __webpack_exports__["default"] = (unescapeHtmlChar);
- /***/ }),
- /***/ "./node_modules/lodash-es/_unicodeSize.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/_unicodeSize.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to compose unicode character classes. */
- var rsAstralRange = '\\ud800-\\udfff',
- rsComboMarksRange = '\\u0300-\\u036f',
- reComboHalfMarksRange = '\\ufe20-\\ufe2f',
- rsComboSymbolsRange = '\\u20d0-\\u20ff',
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
- rsVarRange = '\\ufe0e\\ufe0f';
- /** Used to compose unicode capture groups. */
- var rsAstral = '[' + rsAstralRange + ']',
- rsCombo = '[' + rsComboRange + ']',
- rsFitz = '\\ud83c[\\udffb-\\udfff]',
- rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
- rsNonAstral = '[^' + rsAstralRange + ']',
- rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
- rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
- rsZWJ = '\\u200d';
- /** Used to compose unicode regexes. */
- var reOptMod = rsModifier + '?',
- rsOptVar = '[' + rsVarRange + ']?',
- rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
- rsSeq = rsOptVar + reOptMod + rsOptJoin,
- rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
- /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
- var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
- /**
- * Gets the size of a Unicode `string`.
- *
- * @private
- * @param {string} string The string inspect.
- * @returns {number} Returns the string size.
- */
- function unicodeSize(string) {
- var result = reUnicode.lastIndex = 0;
- while (reUnicode.test(string)) {
- ++result;
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (unicodeSize);
- /***/ }),
- /***/ "./node_modules/lodash-es/_unicodeToArray.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/_unicodeToArray.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to compose unicode character classes. */
- var rsAstralRange = '\\ud800-\\udfff',
- rsComboMarksRange = '\\u0300-\\u036f',
- reComboHalfMarksRange = '\\ufe20-\\ufe2f',
- rsComboSymbolsRange = '\\u20d0-\\u20ff',
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
- rsVarRange = '\\ufe0e\\ufe0f';
- /** Used to compose unicode capture groups. */
- var rsAstral = '[' + rsAstralRange + ']',
- rsCombo = '[' + rsComboRange + ']',
- rsFitz = '\\ud83c[\\udffb-\\udfff]',
- rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
- rsNonAstral = '[^' + rsAstralRange + ']',
- rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
- rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
- rsZWJ = '\\u200d';
- /** Used to compose unicode regexes. */
- var reOptMod = rsModifier + '?',
- rsOptVar = '[' + rsVarRange + ']?',
- rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
- rsSeq = rsOptVar + reOptMod + rsOptJoin,
- rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
- /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
- var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
- /**
- * Converts a Unicode `string` to an array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the converted array.
- */
- function unicodeToArray(string) {
- return string.match(reUnicode) || [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (unicodeToArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/_unicodeWords.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_unicodeWords.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used to compose unicode character classes. */
- var rsAstralRange = '\\ud800-\\udfff',
- rsComboMarksRange = '\\u0300-\\u036f',
- reComboHalfMarksRange = '\\ufe20-\\ufe2f',
- rsComboSymbolsRange = '\\u20d0-\\u20ff',
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
- rsDingbatRange = '\\u2700-\\u27bf',
- rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
- rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
- rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
- rsPunctuationRange = '\\u2000-\\u206f',
- rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
- rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
- rsVarRange = '\\ufe0e\\ufe0f',
- rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
- /** Used to compose unicode capture groups. */
- var rsApos = "['\u2019]",
- rsBreak = '[' + rsBreakRange + ']',
- rsCombo = '[' + rsComboRange + ']',
- rsDigits = '\\d+',
- rsDingbat = '[' + rsDingbatRange + ']',
- rsLower = '[' + rsLowerRange + ']',
- rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
- rsFitz = '\\ud83c[\\udffb-\\udfff]',
- rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
- rsNonAstral = '[^' + rsAstralRange + ']',
- rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
- rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
- rsUpper = '[' + rsUpperRange + ']',
- rsZWJ = '\\u200d';
- /** Used to compose unicode regexes. */
- var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
- rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
- rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
- rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
- reOptMod = rsModifier + '?',
- rsOptVar = '[' + rsVarRange + ']?',
- rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
- rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
- rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
- rsSeq = rsOptVar + reOptMod + rsOptJoin,
- rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
- /** Used to match complex or compound words. */
- var reUnicodeWord = RegExp([
- rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
- rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
- rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
- rsUpper + '+' + rsOptContrUpper,
- rsOrdUpper,
- rsOrdLower,
- rsDigits,
- rsEmoji
- ].join('|'), 'g');
- /**
- * Splits a Unicode `string` into an array of its words.
- *
- * @private
- * @param {string} The string to inspect.
- * @returns {Array} Returns the words of `string`.
- */
- function unicodeWords(string) {
- return string.match(reUnicodeWord) || [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (unicodeWords);
- /***/ }),
- /***/ "./node_modules/lodash-es/_updateWrapDetails.js":
- /*!******************************************************!*\
- !*** ./node_modules/lodash-es/_updateWrapDetails.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
- /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_FLAG = 1,
- WRAP_BIND_KEY_FLAG = 2,
- WRAP_CURRY_FLAG = 8,
- WRAP_CURRY_RIGHT_FLAG = 16,
- WRAP_PARTIAL_FLAG = 32,
- WRAP_PARTIAL_RIGHT_FLAG = 64,
- WRAP_ARY_FLAG = 128,
- WRAP_REARG_FLAG = 256,
- WRAP_FLIP_FLAG = 512;
- /** Used to associate wrap methods with their bit flags. */
- var wrapFlags = [
- ['ary', WRAP_ARY_FLAG],
- ['bind', WRAP_BIND_FLAG],
- ['bindKey', WRAP_BIND_KEY_FLAG],
- ['curry', WRAP_CURRY_FLAG],
- ['curryRight', WRAP_CURRY_RIGHT_FLAG],
- ['flip', WRAP_FLIP_FLAG],
- ['partial', WRAP_PARTIAL_FLAG],
- ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
- ['rearg', WRAP_REARG_FLAG]
- ];
- /**
- * Updates wrapper `details` based on `bitmask` flags.
- *
- * @private
- * @returns {Array} details The details to modify.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @returns {Array} Returns `details`.
- */
- function updateWrapDetails(details, bitmask) {
- Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(wrapFlags, function(pair) {
- var value = '_.' + pair[0];
- if ((bitmask & pair[1]) && !Object(_arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"])(details, value)) {
- details.push(value);
- }
- });
- return details.sort();
- }
- /* harmony default export */ __webpack_exports__["default"] = (updateWrapDetails);
- /***/ }),
- /***/ "./node_modules/lodash-es/_wrapperClone.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/_wrapperClone.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
- /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
- /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
- /**
- * Creates a clone of `wrapper`.
- *
- * @private
- * @param {Object} wrapper The wrapper to clone.
- * @returns {Object} Returns the cloned wrapper.
- */
- function wrapperClone(wrapper) {
- if (wrapper instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
- return wrapper.clone();
- }
- var result = new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](wrapper.__wrapped__, wrapper.__chain__);
- result.__actions__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wrapper.__actions__);
- result.__index__ = wrapper.__index__;
- result.__values__ = wrapper.__values__;
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (wrapperClone);
- /***/ }),
- /***/ "./node_modules/lodash-es/add.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/add.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
- /**
- * Adds two numbers.
- *
- * @static
- * @memberOf _
- * @since 3.4.0
- * @category Math
- * @param {number} augend The first number in an addition.
- * @param {number} addend The second number in an addition.
- * @returns {number} Returns the total.
- * @example
- *
- * _.add(6, 4);
- * // => 10
- */
- var add = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(augend, addend) {
- return augend + addend;
- }, 0);
- /* harmony default export */ __webpack_exports__["default"] = (add);
- /***/ }),
- /***/ "./node_modules/lodash-es/after.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/after.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /** Error message constants. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /**
- * The opposite of `_.before`; this method creates a function that invokes
- * `func` once it's called `n` or more times.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {number} n The number of calls before `func` is invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var saves = ['profile', 'settings'];
- *
- * var done = _.after(saves.length, function() {
- * console.log('done saving!');
- * });
- *
- * _.forEach(saves, function(type) {
- * asyncSave({ 'type': type, 'complete': done });
- * });
- * // => Logs 'done saving!' after the two async saves have completed.
- */
- function after(n, func) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n);
- return function() {
- if (--n < 1) {
- return func.apply(this, arguments);
- }
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (after);
- /***/ }),
- /***/ "./node_modules/lodash-es/array.default.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/array.default.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/lodash-es/chunk.js");
- /* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compact.js */ "./node_modules/lodash-es/compact.js");
- /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./concat.js */ "./node_modules/lodash-es/concat.js");
- /* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./difference.js */ "./node_modules/lodash-es/difference.js");
- /* harmony import */ var _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./differenceBy.js */ "./node_modules/lodash-es/differenceBy.js");
- /* harmony import */ var _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./differenceWith.js */ "./node_modules/lodash-es/differenceWith.js");
- /* harmony import */ var _drop_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./drop.js */ "./node_modules/lodash-es/drop.js");
- /* harmony import */ var _dropRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dropRight.js */ "./node_modules/lodash-es/dropRight.js");
- /* harmony import */ var _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dropRightWhile.js */ "./node_modules/lodash-es/dropRightWhile.js");
- /* harmony import */ var _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dropWhile.js */ "./node_modules/lodash-es/dropWhile.js");
- /* harmony import */ var _fill_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./fill.js */ "./node_modules/lodash-es/fill.js");
- /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
- /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
- /* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./first.js */ "./node_modules/lodash-es/first.js");
- /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
- /* harmony import */ var _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./flattenDeep.js */ "./node_modules/lodash-es/flattenDeep.js");
- /* harmony import */ var _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./flattenDepth.js */ "./node_modules/lodash-es/flattenDepth.js");
- /* harmony import */ var _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./fromPairs.js */ "./node_modules/lodash-es/fromPairs.js");
- /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
- /* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/lodash-es/indexOf.js");
- /* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./initial.js */ "./node_modules/lodash-es/initial.js");
- /* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/lodash-es/intersection.js");
- /* harmony import */ var _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./intersectionBy.js */ "./node_modules/lodash-es/intersectionBy.js");
- /* harmony import */ var _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./intersectionWith.js */ "./node_modules/lodash-es/intersectionWith.js");
- /* harmony import */ var _join_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./join.js */ "./node_modules/lodash-es/join.js");
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/lodash-es/lastIndexOf.js");
- /* harmony import */ var _nth_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./nth.js */ "./node_modules/lodash-es/nth.js");
- /* harmony import */ var _pull_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./pull.js */ "./node_modules/lodash-es/pull.js");
- /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
- /* harmony import */ var _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./pullAllBy.js */ "./node_modules/lodash-es/pullAllBy.js");
- /* harmony import */ var _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./pullAllWith.js */ "./node_modules/lodash-es/pullAllWith.js");
- /* harmony import */ var _pullAt_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./pullAt.js */ "./node_modules/lodash-es/pullAt.js");
- /* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./remove.js */ "./node_modules/lodash-es/remove.js");
- /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
- /* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./slice.js */ "./node_modules/lodash-es/slice.js");
- /* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/lodash-es/sortedIndex.js");
- /* harmony import */ var _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./sortedIndexBy.js */ "./node_modules/lodash-es/sortedIndexBy.js");
- /* harmony import */ var _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./sortedIndexOf.js */ "./node_modules/lodash-es/sortedIndexOf.js");
- /* harmony import */ var _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./sortedLastIndex.js */ "./node_modules/lodash-es/sortedLastIndex.js");
- /* harmony import */ var _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./sortedLastIndexBy.js */ "./node_modules/lodash-es/sortedLastIndexBy.js");
- /* harmony import */ var _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./sortedLastIndexOf.js */ "./node_modules/lodash-es/sortedLastIndexOf.js");
- /* harmony import */ var _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./sortedUniq.js */ "./node_modules/lodash-es/sortedUniq.js");
- /* harmony import */ var _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./sortedUniqBy.js */ "./node_modules/lodash-es/sortedUniqBy.js");
- /* harmony import */ var _tail_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./tail.js */ "./node_modules/lodash-es/tail.js");
- /* harmony import */ var _take_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./take.js */ "./node_modules/lodash-es/take.js");
- /* harmony import */ var _takeRight_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./takeRight.js */ "./node_modules/lodash-es/takeRight.js");
- /* harmony import */ var _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./takeRightWhile.js */ "./node_modules/lodash-es/takeRightWhile.js");
- /* harmony import */ var _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./takeWhile.js */ "./node_modules/lodash-es/takeWhile.js");
- /* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./union.js */ "./node_modules/lodash-es/union.js");
- /* harmony import */ var _unionBy_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./unionBy.js */ "./node_modules/lodash-es/unionBy.js");
- /* harmony import */ var _unionWith_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./unionWith.js */ "./node_modules/lodash-es/unionWith.js");
- /* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/lodash-es/uniq.js");
- /* harmony import */ var _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./uniqBy.js */ "./node_modules/lodash-es/uniqBy.js");
- /* harmony import */ var _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./uniqWith.js */ "./node_modules/lodash-es/uniqWith.js");
- /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
- /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
- /* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./without.js */ "./node_modules/lodash-es/without.js");
- /* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./xor.js */ "./node_modules/lodash-es/xor.js");
- /* harmony import */ var _xorBy_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./xorBy.js */ "./node_modules/lodash-es/xorBy.js");
- /* harmony import */ var _xorWith_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./xorWith.js */ "./node_modules/lodash-es/xorWith.js");
- /* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./zip.js */ "./node_modules/lodash-es/zip.js");
- /* harmony import */ var _zipObject_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./zipObject.js */ "./node_modules/lodash-es/zipObject.js");
- /* harmony import */ var _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./zipObjectDeep.js */ "./node_modules/lodash-es/zipObjectDeep.js");
- /* harmony import */ var _zipWith_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./zipWith.js */ "./node_modules/lodash-es/zipWith.js");
- /* harmony default export */ __webpack_exports__["default"] = ({
- chunk: _chunk_js__WEBPACK_IMPORTED_MODULE_0__["default"], compact: _compact_js__WEBPACK_IMPORTED_MODULE_1__["default"], concat: _concat_js__WEBPACK_IMPORTED_MODULE_2__["default"], difference: _difference_js__WEBPACK_IMPORTED_MODULE_3__["default"], differenceBy: _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__["default"],
- differenceWith: _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__["default"], drop: _drop_js__WEBPACK_IMPORTED_MODULE_6__["default"], dropRight: _dropRight_js__WEBPACK_IMPORTED_MODULE_7__["default"], dropRightWhile: _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__["default"], dropWhile: _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__["default"],
- fill: _fill_js__WEBPACK_IMPORTED_MODULE_10__["default"], findIndex: _findIndex_js__WEBPACK_IMPORTED_MODULE_11__["default"], findLastIndex: _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__["default"], first: _first_js__WEBPACK_IMPORTED_MODULE_13__["default"], flatten: _flatten_js__WEBPACK_IMPORTED_MODULE_14__["default"],
- flattenDeep: _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__["default"], flattenDepth: _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__["default"], fromPairs: _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__["default"], head: _head_js__WEBPACK_IMPORTED_MODULE_18__["default"], indexOf: _indexOf_js__WEBPACK_IMPORTED_MODULE_19__["default"],
- initial: _initial_js__WEBPACK_IMPORTED_MODULE_20__["default"], intersection: _intersection_js__WEBPACK_IMPORTED_MODULE_21__["default"], intersectionBy: _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__["default"], intersectionWith: _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__["default"], join: _join_js__WEBPACK_IMPORTED_MODULE_24__["default"],
- last: _last_js__WEBPACK_IMPORTED_MODULE_25__["default"], lastIndexOf: _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__["default"], nth: _nth_js__WEBPACK_IMPORTED_MODULE_27__["default"], pull: _pull_js__WEBPACK_IMPORTED_MODULE_28__["default"], pullAll: _pullAll_js__WEBPACK_IMPORTED_MODULE_29__["default"],
- pullAllBy: _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__["default"], pullAllWith: _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__["default"], pullAt: _pullAt_js__WEBPACK_IMPORTED_MODULE_32__["default"], remove: _remove_js__WEBPACK_IMPORTED_MODULE_33__["default"], reverse: _reverse_js__WEBPACK_IMPORTED_MODULE_34__["default"],
- slice: _slice_js__WEBPACK_IMPORTED_MODULE_35__["default"], sortedIndex: _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__["default"], sortedIndexBy: _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__["default"], sortedIndexOf: _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__["default"], sortedLastIndex: _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__["default"],
- sortedLastIndexBy: _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__["default"], sortedLastIndexOf: _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__["default"], sortedUniq: _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__["default"], sortedUniqBy: _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__["default"], tail: _tail_js__WEBPACK_IMPORTED_MODULE_44__["default"],
- take: _take_js__WEBPACK_IMPORTED_MODULE_45__["default"], takeRight: _takeRight_js__WEBPACK_IMPORTED_MODULE_46__["default"], takeRightWhile: _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__["default"], takeWhile: _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__["default"], union: _union_js__WEBPACK_IMPORTED_MODULE_49__["default"],
- unionBy: _unionBy_js__WEBPACK_IMPORTED_MODULE_50__["default"], unionWith: _unionWith_js__WEBPACK_IMPORTED_MODULE_51__["default"], uniq: _uniq_js__WEBPACK_IMPORTED_MODULE_52__["default"], uniqBy: _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__["default"], uniqWith: _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__["default"],
- unzip: _unzip_js__WEBPACK_IMPORTED_MODULE_55__["default"], unzipWith: _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__["default"], without: _without_js__WEBPACK_IMPORTED_MODULE_57__["default"], xor: _xor_js__WEBPACK_IMPORTED_MODULE_58__["default"], xorBy: _xorBy_js__WEBPACK_IMPORTED_MODULE_59__["default"],
- xorWith: _xorWith_js__WEBPACK_IMPORTED_MODULE_60__["default"], zip: _zip_js__WEBPACK_IMPORTED_MODULE_61__["default"], zipObject: _zipObject_js__WEBPACK_IMPORTED_MODULE_62__["default"], zipObjectDeep: _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__["default"], zipWith: _zipWith_js__WEBPACK_IMPORTED_MODULE_64__["default"]
- });
- /***/ }),
- /***/ "./node_modules/lodash-es/array.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/array.js ***!
- \*****************************************/
- /*! exports provided: chunk, compact, concat, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, findIndex, findLastIndex, first, flatten, flattenDeep, flattenDepth, fromPairs, head, indexOf, initial, intersection, intersectionBy, intersectionWith, join, last, lastIndexOf, nth, pull, pullAll, pullAllBy, pullAllWith, pullAt, remove, reverse, slice, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, tail, take, takeRight, takeRightWhile, takeWhile, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, without, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/lodash-es/chunk.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return _chunk_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compact.js */ "./node_modules/lodash-es/compact.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return _compact_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./concat.js */ "./node_modules/lodash-es/concat.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _concat_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./difference.js */ "./node_modules/lodash-es/difference.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return _difference_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./differenceBy.js */ "./node_modules/lodash-es/differenceBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceBy", function() { return _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./differenceWith.js */ "./node_modules/lodash-es/differenceWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceWith", function() { return _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _drop_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./drop.js */ "./node_modules/lodash-es/drop.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return _drop_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _dropRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dropRight.js */ "./node_modules/lodash-es/dropRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRight", function() { return _dropRight_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dropRightWhile.js */ "./node_modules/lodash-es/dropRightWhile.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRightWhile", function() { return _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dropWhile.js */ "./node_modules/lodash-es/dropWhile.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropWhile", function() { return _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _fill_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./fill.js */ "./node_modules/lodash-es/fill.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return _fill_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _findIndex_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./first.js */ "./node_modules/lodash-es/first.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _first_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return _flatten_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./flattenDeep.js */ "./node_modules/lodash-es/flattenDeep.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDeep", function() { return _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /* harmony import */ var _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./flattenDepth.js */ "./node_modules/lodash-es/flattenDepth.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDepth", function() { return _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
- /* harmony import */ var _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./fromPairs.js */ "./node_modules/lodash-es/fromPairs.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromPairs", function() { return _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "head", function() { return _head_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
- /* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/lodash-es/indexOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return _indexOf_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./initial.js */ "./node_modules/lodash-es/initial.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return _initial_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/lodash-es/intersection.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return _intersection_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
- /* harmony import */ var _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./intersectionBy.js */ "./node_modules/lodash-es/intersectionBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionBy", function() { return _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
- /* harmony import */ var _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./intersectionWith.js */ "./node_modules/lodash-es/intersectionWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionWith", function() { return _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
- /* harmony import */ var _join_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./join.js */ "./node_modules/lodash-es/join.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _join_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _last_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
- /* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/lodash-es/lastIndexOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
- /* harmony import */ var _nth_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./nth.js */ "./node_modules/lodash-es/nth.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nth", function() { return _nth_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
- /* harmony import */ var _pull_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./pull.js */ "./node_modules/lodash-es/pull.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pull", function() { return _pull_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
- /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAll", function() { return _pullAll_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
- /* harmony import */ var _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./pullAllBy.js */ "./node_modules/lodash-es/pullAllBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllBy", function() { return _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
- /* harmony import */ var _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./pullAllWith.js */ "./node_modules/lodash-es/pullAllWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllWith", function() { return _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
- /* harmony import */ var _pullAt_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./pullAt.js */ "./node_modules/lodash-es/pullAt.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAt", function() { return _pullAt_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
- /* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./remove.js */ "./node_modules/lodash-es/remove.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
- /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return _reverse_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
- /* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./slice.js */ "./node_modules/lodash-es/slice.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return _slice_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
- /* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/lodash-es/sortedIndex.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
- /* harmony import */ var _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./sortedIndexBy.js */ "./node_modules/lodash-es/sortedIndexBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexBy", function() { return _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
- /* harmony import */ var _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./sortedIndexOf.js */ "./node_modules/lodash-es/sortedIndexOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexOf", function() { return _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
- /* harmony import */ var _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./sortedLastIndex.js */ "./node_modules/lodash-es/sortedLastIndex.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndex", function() { return _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
- /* harmony import */ var _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./sortedLastIndexBy.js */ "./node_modules/lodash-es/sortedLastIndexBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexBy", function() { return _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
- /* harmony import */ var _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./sortedLastIndexOf.js */ "./node_modules/lodash-es/sortedLastIndexOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexOf", function() { return _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
- /* harmony import */ var _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./sortedUniq.js */ "./node_modules/lodash-es/sortedUniq.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniq", function() { return _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
- /* harmony import */ var _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./sortedUniqBy.js */ "./node_modules/lodash-es/sortedUniqBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniqBy", function() { return _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
- /* harmony import */ var _tail_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./tail.js */ "./node_modules/lodash-es/tail.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return _tail_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
- /* harmony import */ var _take_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./take.js */ "./node_modules/lodash-es/take.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _take_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
- /* harmony import */ var _takeRight_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./takeRight.js */ "./node_modules/lodash-es/takeRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRight", function() { return _takeRight_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
- /* harmony import */ var _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./takeRightWhile.js */ "./node_modules/lodash-es/takeRightWhile.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRightWhile", function() { return _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
- /* harmony import */ var _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./takeWhile.js */ "./node_modules/lodash-es/takeWhile.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__["default"]; });
- /* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./union.js */ "./node_modules/lodash-es/union.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "union", function() { return _union_js__WEBPACK_IMPORTED_MODULE_49__["default"]; });
- /* harmony import */ var _unionBy_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./unionBy.js */ "./node_modules/lodash-es/unionBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionBy", function() { return _unionBy_js__WEBPACK_IMPORTED_MODULE_50__["default"]; });
- /* harmony import */ var _unionWith_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./unionWith.js */ "./node_modules/lodash-es/unionWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionWith", function() { return _unionWith_js__WEBPACK_IMPORTED_MODULE_51__["default"]; });
- /* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/lodash-es/uniq.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return _uniq_js__WEBPACK_IMPORTED_MODULE_52__["default"]; });
- /* harmony import */ var _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./uniqBy.js */ "./node_modules/lodash-es/uniqBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqBy", function() { return _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__["default"]; });
- /* harmony import */ var _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./uniqWith.js */ "./node_modules/lodash-es/uniqWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqWith", function() { return _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__["default"]; });
- /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return _unzip_js__WEBPACK_IMPORTED_MODULE_55__["default"]; });
- /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzipWith", function() { return _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__["default"]; });
- /* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./without.js */ "./node_modules/lodash-es/without.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "without", function() { return _without_js__WEBPACK_IMPORTED_MODULE_57__["default"]; });
- /* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./xor.js */ "./node_modules/lodash-es/xor.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xor", function() { return _xor_js__WEBPACK_IMPORTED_MODULE_58__["default"]; });
- /* harmony import */ var _xorBy_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./xorBy.js */ "./node_modules/lodash-es/xorBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorBy", function() { return _xorBy_js__WEBPACK_IMPORTED_MODULE_59__["default"]; });
- /* harmony import */ var _xorWith_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./xorWith.js */ "./node_modules/lodash-es/xorWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorWith", function() { return _xorWith_js__WEBPACK_IMPORTED_MODULE_60__["default"]; });
- /* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./zip.js */ "./node_modules/lodash-es/zip.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _zip_js__WEBPACK_IMPORTED_MODULE_61__["default"]; });
- /* harmony import */ var _zipObject_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./zipObject.js */ "./node_modules/lodash-es/zipObject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObject", function() { return _zipObject_js__WEBPACK_IMPORTED_MODULE_62__["default"]; });
- /* harmony import */ var _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./zipObjectDeep.js */ "./node_modules/lodash-es/zipObjectDeep.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObjectDeep", function() { return _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__["default"]; });
- /* harmony import */ var _zipWith_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./zipWith.js */ "./node_modules/lodash-es/zipWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipWith", function() { return _zipWith_js__WEBPACK_IMPORTED_MODULE_64__["default"]; });
- /* harmony import */ var _array_default_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./array.default.js */ "./node_modules/lodash-es/array.default.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _array_default_js__WEBPACK_IMPORTED_MODULE_65__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/ary.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/ary.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_ARY_FLAG = 128;
- /**
- * Creates a function that invokes `func`, with up to `n` arguments,
- * ignoring any additional arguments.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} func The function to cap arguments for.
- * @param {number} [n=func.length] The arity cap.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the new capped function.
- * @example
- *
- * _.map(['6', '8', '10'], _.ary(parseInt, 1));
- * // => [6, 8, 10]
- */
- function ary(func, n, guard) {
- n = guard ? undefined : n;
- n = (func && n == null) ? func.length : n;
- return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
- }
- /* harmony default export */ __webpack_exports__["default"] = (ary);
- /***/ }),
- /***/ "./node_modules/lodash-es/assign.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/assign.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
- /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
- /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Assigns own enumerable string keyed properties of source objects to the
- * destination object. Source objects are applied from left to right.
- * Subsequent sources overwrite property assignments of previous sources.
- *
- * **Note:** This method mutates `object` and is loosely based on
- * [`Object.assign`](https://mdn.io/Object/assign).
- *
- * @static
- * @memberOf _
- * @since 0.10.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.assignIn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * function Bar() {
- * this.c = 3;
- * }
- *
- * Foo.prototype.b = 2;
- * Bar.prototype.d = 4;
- *
- * _.assign({ 'a': 0 }, new Foo, new Bar);
- * // => { 'a': 1, 'c': 3 }
- */
- var assign = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(object, source) {
- if (Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_4__["default"])(source) || Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__["default"])(source)) {
- Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_5__["default"])(source), object);
- return;
- }
- for (var key in source) {
- if (hasOwnProperty.call(source, key)) {
- Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, source[key]);
- }
- }
- });
- /* harmony default export */ __webpack_exports__["default"] = (assign);
- /***/ }),
- /***/ "./node_modules/lodash-es/assignIn.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/assignIn.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
- /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /**
- * This method is like `_.assign` except that it iterates over own and
- * inherited source properties.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias extend
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.assign
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * function Bar() {
- * this.c = 3;
- * }
- *
- * Foo.prototype.b = 2;
- * Bar.prototype.d = 4;
- *
- * _.assignIn({ 'a': 0 }, new Foo, new Bar);
- * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
- */
- var assignIn = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source) {
- Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object);
- });
- /* harmony default export */ __webpack_exports__["default"] = (assignIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/assignInWith.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/assignInWith.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
- /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /**
- * This method is like `_.assignIn` except that it accepts `customizer`
- * which is invoked to produce the assigned values. If `customizer` returns
- * `undefined`, assignment is handled by the method instead. The `customizer`
- * is invoked with five arguments: (objValue, srcValue, key, object, source).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias extendWith
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} sources The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @see _.assignWith
- * @example
- *
- * function customizer(objValue, srcValue) {
- * return _.isUndefined(objValue) ? srcValue : objValue;
- * }
- *
- * var defaults = _.partialRight(_.assignInWith, customizer);
- *
- * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
- * // => { 'a': 1, 'b': 2 }
- */
- var assignInWith = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex, customizer) {
- Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object, customizer);
- });
- /* harmony default export */ __webpack_exports__["default"] = (assignInWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/assignWith.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/assignWith.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
- /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * This method is like `_.assign` except that it accepts `customizer`
- * which is invoked to produce the assigned values. If `customizer` returns
- * `undefined`, assignment is handled by the method instead. The `customizer`
- * is invoked with five arguments: (objValue, srcValue, key, object, source).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} sources The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @see _.assignInWith
- * @example
- *
- * function customizer(objValue, srcValue) {
- * return _.isUndefined(objValue) ? srcValue : objValue;
- * }
- *
- * var defaults = _.partialRight(_.assignWith, customizer);
- *
- * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
- * // => { 'a': 1, 'b': 2 }
- */
- var assignWith = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex, customizer) {
- Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object, customizer);
- });
- /* harmony default export */ __webpack_exports__["default"] = (assignWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/at.js":
- /*!**************************************!*\
- !*** ./node_modules/lodash-es/at.js ***!
- \**************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseAt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAt.js */ "./node_modules/lodash-es/_baseAt.js");
- /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
- /**
- * Creates an array of values corresponding to `paths` of `object`.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {...(string|string[])} [paths] The property paths to pick.
- * @returns {Array} Returns the picked values.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
- *
- * _.at(object, ['a[0].b.c', 'a[1]']);
- * // => [3, 4]
- */
- var at = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseAt_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (at);
- /***/ }),
- /***/ "./node_modules/lodash-es/attempt.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/attempt.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
- /**
- * Attempts to invoke `func`, returning either the result or the caught error
- * object. Any additional arguments are provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {Function} func The function to attempt.
- * @param {...*} [args] The arguments to invoke `func` with.
- * @returns {*} Returns the `func` result or error object.
- * @example
- *
- * // Avoid throwing errors for invalid selectors.
- * var elements = _.attempt(function(selector) {
- * return document.querySelectorAll(selector);
- * }, '>_>');
- *
- * if (_.isError(elements)) {
- * elements = [];
- * }
- */
- var attempt = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, args) {
- try {
- return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, undefined, args);
- } catch (e) {
- return Object(_isError_js__WEBPACK_IMPORTED_MODULE_2__["default"])(e) ? e : new Error(e);
- }
- });
- /* harmony default export */ __webpack_exports__["default"] = (attempt);
- /***/ }),
- /***/ "./node_modules/lodash-es/before.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/before.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /** Error message constants. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /**
- * Creates a function that invokes `func`, with the `this` binding and arguments
- * of the created function, while it's called less than `n` times. Subsequent
- * calls to the created function return the result of the last `func` invocation.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {number} n The number of calls at which `func` is no longer invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * jQuery(element).on('click', _.before(5, addContactToList));
- * // => Allows adding up to 4 contacts to the list.
- */
- function before(n, func) {
- var result;
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n);
- return function() {
- if (--n > 0) {
- result = func.apply(this, arguments);
- }
- if (n <= 1) {
- func = undefined;
- }
- return result;
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (before);
- /***/ }),
- /***/ "./node_modules/lodash-es/bind.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/bind.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
- /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
- /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_FLAG = 1,
- WRAP_PARTIAL_FLAG = 32;
- /**
- * Creates a function that invokes `func` with the `this` binding of `thisArg`
- * and `partials` prepended to the arguments it receives.
- *
- * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for partially applied arguments.
- *
- * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
- * property of bound functions.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to bind.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * function greet(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * }
- *
- * var object = { 'user': 'fred' };
- *
- * var bound = _.bind(greet, object, 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * // Bound with placeholders.
- * var bound = _.bind(greet, object, _, '!');
- * bound('hi');
- * // => 'hi fred!'
- */
- var bind = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, thisArg, partials) {
- var bitmask = WRAP_BIND_FLAG;
- if (partials.length) {
- var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(bind));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, bitmask, thisArg, partials, holders);
- });
- // Assign default placeholders.
- bind.placeholder = {};
- /* harmony default export */ __webpack_exports__["default"] = (bind);
- /***/ }),
- /***/ "./node_modules/lodash-es/bindAll.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/bindAll.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
- /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
- /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
- /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
- /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
- /**
- * Binds methods of an object to the object itself, overwriting the existing
- * method.
- *
- * **Note:** This method doesn't set the "length" property of bound functions.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {Object} object The object to bind and assign the bound methods to.
- * @param {...(string|string[])} methodNames The object method names to bind.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var view = {
- * 'label': 'docs',
- * 'click': function() {
- * console.log('clicked ' + this.label);
- * }
- * };
- *
- * _.bindAll(view, ['click']);
- * jQuery(element).on('click', view.click);
- * // => Logs 'clicked docs' when clicked.
- */
- var bindAll = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(object, methodNames) {
- Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(methodNames, function(key) {
- key = Object(_toKey_js__WEBPACK_IMPORTED_MODULE_4__["default"])(key);
- Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, Object(_bind_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object[key], object));
- });
- return object;
- });
- /* harmony default export */ __webpack_exports__["default"] = (bindAll);
- /***/ }),
- /***/ "./node_modules/lodash-es/bindKey.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/bindKey.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
- /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
- /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_FLAG = 1,
- WRAP_BIND_KEY_FLAG = 2,
- WRAP_PARTIAL_FLAG = 32;
- /**
- * Creates a function that invokes the method at `object[key]` with `partials`
- * prepended to the arguments it receives.
- *
- * This method differs from `_.bind` by allowing bound functions to reference
- * methods that may be redefined or don't yet exist. See
- * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
- * for more details.
- *
- * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * @static
- * @memberOf _
- * @since 0.10.0
- * @category Function
- * @param {Object} object The object to invoke the method on.
- * @param {string} key The key of the method.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * var object = {
- * 'user': 'fred',
- * 'greet': function(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * }
- * };
- *
- * var bound = _.bindKey(object, 'greet', 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * object.greet = function(greeting, punctuation) {
- * return greeting + 'ya ' + this.user + punctuation;
- * };
- *
- * bound('!');
- * // => 'hiya fred!'
- *
- * // Bound with placeholders.
- * var bound = _.bindKey(object, 'greet', _, '!');
- * bound('hi');
- * // => 'hiya fred!'
- */
- var bindKey = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, key, partials) {
- var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
- if (partials.length) {
- var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(bindKey));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(key, bitmask, object, partials, holders);
- });
- // Assign default placeholders.
- bindKey.placeholder = {};
- /* harmony default export */ __webpack_exports__["default"] = (bindKey);
- /***/ }),
- /***/ "./node_modules/lodash-es/camelCase.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/camelCase.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
- /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
- /**
- * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the camel cased string.
- * @example
- *
- * _.camelCase('Foo Bar');
- * // => 'fooBar'
- *
- * _.camelCase('--foo-bar--');
- * // => 'fooBar'
- *
- * _.camelCase('__FOO_BAR__');
- * // => 'fooBar'
- */
- var camelCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, word, index) {
- word = word.toLowerCase();
- return result + (index ? Object(_capitalize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(word) : word);
- });
- /* harmony default export */ __webpack_exports__["default"] = (camelCase);
- /***/ }),
- /***/ "./node_modules/lodash-es/capitalize.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/capitalize.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
- /**
- * Converts the first character of `string` to upper case and the remaining
- * to lower case.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to capitalize.
- * @returns {string} Returns the capitalized string.
- * @example
- *
- * _.capitalize('FRED');
- * // => 'Fred'
- */
- function capitalize(string) {
- return Object(_upperFirst_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string).toLowerCase());
- }
- /* harmony default export */ __webpack_exports__["default"] = (capitalize);
- /***/ }),
- /***/ "./node_modules/lodash-es/castArray.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/castArray.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * Casts `value` as an array if it's not one.
- *
- * @static
- * @memberOf _
- * @since 4.4.0
- * @category Lang
- * @param {*} value The value to inspect.
- * @returns {Array} Returns the cast array.
- * @example
- *
- * _.castArray(1);
- * // => [1]
- *
- * _.castArray({ 'a': 1 });
- * // => [{ 'a': 1 }]
- *
- * _.castArray('abc');
- * // => ['abc']
- *
- * _.castArray(null);
- * // => [null]
- *
- * _.castArray(undefined);
- * // => [undefined]
- *
- * _.castArray();
- * // => []
- *
- * var array = [1, 2, 3];
- * console.log(_.castArray(array) === array);
- * // => true
- */
- function castArray() {
- if (!arguments.length) {
- return [];
- }
- var value = arguments[0];
- return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? value : [value];
- }
- /* harmony default export */ __webpack_exports__["default"] = (castArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/ceil.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/ceil.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createRound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRound.js */ "./node_modules/lodash-es/_createRound.js");
- /**
- * Computes `number` rounded up to `precision`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Math
- * @param {number} number The number to round up.
- * @param {number} [precision=0] The precision to round up to.
- * @returns {number} Returns the rounded up number.
- * @example
- *
- * _.ceil(4.006);
- * // => 5
- *
- * _.ceil(6.004, 2);
- * // => 6.01
- *
- * _.ceil(6040, -2);
- * // => 6100
- */
- var ceil = Object(_createRound_js__WEBPACK_IMPORTED_MODULE_0__["default"])('ceil');
- /* harmony default export */ __webpack_exports__["default"] = (ceil);
- /***/ }),
- /***/ "./node_modules/lodash-es/chain.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/chain.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
- /**
- * Creates a `lodash` wrapper instance that wraps `value` with explicit method
- * chain sequences enabled. The result of such sequences must be unwrapped
- * with `_#value`.
- *
- * @static
- * @memberOf _
- * @since 1.3.0
- * @category Seq
- * @param {*} value The value to wrap.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'pebbles', 'age': 1 }
- * ];
- *
- * var youngest = _
- * .chain(users)
- * .sortBy('age')
- * .map(function(o) {
- * return o.user + ' is ' + o.age;
- * })
- * .head()
- * .value();
- * // => 'pebbles is 1'
- */
- function chain(value) {
- var result = Object(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- result.__chain__ = true;
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (chain);
- /***/ }),
- /***/ "./node_modules/lodash-es/chunk.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/chunk.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeCeil = Math.ceil,
- nativeMax = Math.max;
- /**
- * Creates an array of elements split into groups the length of `size`.
- * If `array` can't be split evenly, the final chunk will be the remaining
- * elements.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to process.
- * @param {number} [size=1] The length of each chunk
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the new array of chunks.
- * @example
- *
- * _.chunk(['a', 'b', 'c', 'd'], 2);
- * // => [['a', 'b'], ['c', 'd']]
- *
- * _.chunk(['a', 'b', 'c', 'd'], 3);
- * // => [['a', 'b', 'c'], ['d']]
- */
- function chunk(array, size, guard) {
- if ((guard ? Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, size, guard) : size === undefined)) {
- size = 1;
- } else {
- size = nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(size), 0);
- }
- var length = array == null ? 0 : array.length;
- if (!length || size < 1) {
- return [];
- }
- var index = 0,
- resIndex = 0,
- result = Array(nativeCeil(length / size));
- while (index < length) {
- result[resIndex++] = Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, index, (index += size));
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (chunk);
- /***/ }),
- /***/ "./node_modules/lodash-es/clamp.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/clamp.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
- /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
- /**
- * Clamps `number` within the inclusive `lower` and `upper` bounds.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Number
- * @param {number} number The number to clamp.
- * @param {number} [lower] The lower bound.
- * @param {number} upper The upper bound.
- * @returns {number} Returns the clamped number.
- * @example
- *
- * _.clamp(-10, -5, 5);
- * // => -5
- *
- * _.clamp(10, -5, 5);
- * // => 5
- */
- function clamp(number, lower, upper) {
- if (upper === undefined) {
- upper = lower;
- lower = undefined;
- }
- if (upper !== undefined) {
- upper = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(upper);
- upper = upper === upper ? upper : 0;
- }
- if (lower !== undefined) {
- lower = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(lower);
- lower = lower === lower ? lower : 0;
- }
- return Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(number), lower, upper);
- }
- /* harmony default export */ __webpack_exports__["default"] = (clamp);
- /***/ }),
- /***/ "./node_modules/lodash-es/clone.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/clone.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
- /** Used to compose bitmasks for cloning. */
- var CLONE_SYMBOLS_FLAG = 4;
- /**
- * Creates a shallow clone of `value`.
- *
- * **Note:** This method is loosely based on the
- * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
- * and supports cloning arrays, array buffers, booleans, date objects, maps,
- * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
- * arrays. The own enumerable properties of `arguments` objects are cloned
- * as plain objects. An empty object is returned for uncloneable values such
- * as error objects, functions, DOM nodes, and WeakMaps.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to clone.
- * @returns {*} Returns the cloned value.
- * @see _.cloneDeep
- * @example
- *
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
- *
- * var shallow = _.clone(objects);
- * console.log(shallow[0] === objects[0]);
- * // => true
- */
- function clone(value) {
- return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_SYMBOLS_FLAG);
- }
- /* harmony default export */ __webpack_exports__["default"] = (clone);
- /***/ }),
- /***/ "./node_modules/lodash-es/cloneDeep.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/cloneDeep.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1,
- CLONE_SYMBOLS_FLAG = 4;
- /**
- * This method is like `_.clone` except that it recursively clones `value`.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Lang
- * @param {*} value The value to recursively clone.
- * @returns {*} Returns the deep cloned value.
- * @see _.clone
- * @example
- *
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
- *
- * var deep = _.cloneDeep(objects);
- * console.log(deep[0] === objects[0]);
- * // => false
- */
- function cloneDeep(value) {
- return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
- }
- /* harmony default export */ __webpack_exports__["default"] = (cloneDeep);
- /***/ }),
- /***/ "./node_modules/lodash-es/cloneDeepWith.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/cloneDeepWith.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1,
- CLONE_SYMBOLS_FLAG = 4;
- /**
- * This method is like `_.cloneWith` except that it recursively clones `value`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to recursively clone.
- * @param {Function} [customizer] The function to customize cloning.
- * @returns {*} Returns the deep cloned value.
- * @see _.cloneWith
- * @example
- *
- * function customizer(value) {
- * if (_.isElement(value)) {
- * return value.cloneNode(true);
- * }
- * }
- *
- * var el = _.cloneDeepWith(document.body, customizer);
- *
- * console.log(el === document.body);
- * // => false
- * console.log(el.nodeName);
- * // => 'BODY'
- * console.log(el.childNodes.length);
- * // => 20
- */
- function cloneDeepWith(value, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
- }
- /* harmony default export */ __webpack_exports__["default"] = (cloneDeepWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/cloneWith.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/cloneWith.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
- /** Used to compose bitmasks for cloning. */
- var CLONE_SYMBOLS_FLAG = 4;
- /**
- * This method is like `_.clone` except that it accepts `customizer` which
- * is invoked to produce the cloned value. If `customizer` returns `undefined`,
- * cloning is handled by the method instead. The `customizer` is invoked with
- * up to four arguments; (value [, index|key, object, stack]).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to clone.
- * @param {Function} [customizer] The function to customize cloning.
- * @returns {*} Returns the cloned value.
- * @see _.cloneDeepWith
- * @example
- *
- * function customizer(value) {
- * if (_.isElement(value)) {
- * return value.cloneNode(false);
- * }
- * }
- *
- * var el = _.cloneWith(document.body, customizer);
- *
- * console.log(el === document.body);
- * // => false
- * console.log(el.nodeName);
- * // => 'BODY'
- * console.log(el.childNodes.length);
- * // => 0
- */
- function cloneWith(value, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_SYMBOLS_FLAG, customizer);
- }
- /* harmony default export */ __webpack_exports__["default"] = (cloneWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/collection.default.js":
- /*!******************************************************!*\
- !*** ./node_modules/lodash-es/collection.default.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/lodash-es/countBy.js");
- /* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "./node_modules/lodash-es/each.js");
- /* harmony import */ var _eachRight_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eachRight.js */ "./node_modules/lodash-es/eachRight.js");
- /* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./every.js */ "./node_modules/lodash-es/every.js");
- /* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filter.js */ "./node_modules/lodash-es/filter.js");
- /* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./find.js */ "./node_modules/lodash-es/find.js");
- /* harmony import */ var _findLast_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./findLast.js */ "./node_modules/lodash-es/findLast.js");
- /* harmony import */ var _flatMap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flatMap.js */ "./node_modules/lodash-es/flatMap.js");
- /* harmony import */ var _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flatMapDeep.js */ "./node_modules/lodash-es/flatMapDeep.js");
- /* harmony import */ var _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flatMapDepth.js */ "./node_modules/lodash-es/flatMapDepth.js");
- /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
- /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
- /* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/lodash-es/groupBy.js");
- /* harmony import */ var _includes_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./includes.js */ "./node_modules/lodash-es/includes.js");
- /* harmony import */ var _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./invokeMap.js */ "./node_modules/lodash-es/invokeMap.js");
- /* harmony import */ var _keyBy_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./keyBy.js */ "./node_modules/lodash-es/keyBy.js");
- /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
- /* harmony import */ var _orderBy_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./orderBy.js */ "./node_modules/lodash-es/orderBy.js");
- /* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./partition.js */ "./node_modules/lodash-es/partition.js");
- /* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/lodash-es/reduce.js");
- /* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/lodash-es/reduceRight.js");
- /* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./reject.js */ "./node_modules/lodash-es/reject.js");
- /* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./sample.js */ "./node_modules/lodash-es/sample.js");
- /* harmony import */ var _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./sampleSize.js */ "./node_modules/lodash-es/sampleSize.js");
- /* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/lodash-es/shuffle.js");
- /* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./size.js */ "./node_modules/lodash-es/size.js");
- /* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./some.js */ "./node_modules/lodash-es/some.js");
- /* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/lodash-es/sortBy.js");
- /* harmony default export */ __webpack_exports__["default"] = ({
- countBy: _countBy_js__WEBPACK_IMPORTED_MODULE_0__["default"], each: _each_js__WEBPACK_IMPORTED_MODULE_1__["default"], eachRight: _eachRight_js__WEBPACK_IMPORTED_MODULE_2__["default"], every: _every_js__WEBPACK_IMPORTED_MODULE_3__["default"], filter: _filter_js__WEBPACK_IMPORTED_MODULE_4__["default"],
- find: _find_js__WEBPACK_IMPORTED_MODULE_5__["default"], findLast: _findLast_js__WEBPACK_IMPORTED_MODULE_6__["default"], flatMap: _flatMap_js__WEBPACK_IMPORTED_MODULE_7__["default"], flatMapDeep: _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__["default"], flatMapDepth: _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__["default"],
- forEach: _forEach_js__WEBPACK_IMPORTED_MODULE_10__["default"], forEachRight: _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__["default"], groupBy: _groupBy_js__WEBPACK_IMPORTED_MODULE_12__["default"], includes: _includes_js__WEBPACK_IMPORTED_MODULE_13__["default"], invokeMap: _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__["default"],
- keyBy: _keyBy_js__WEBPACK_IMPORTED_MODULE_15__["default"], map: _map_js__WEBPACK_IMPORTED_MODULE_16__["default"], orderBy: _orderBy_js__WEBPACK_IMPORTED_MODULE_17__["default"], partition: _partition_js__WEBPACK_IMPORTED_MODULE_18__["default"], reduce: _reduce_js__WEBPACK_IMPORTED_MODULE_19__["default"],
- reduceRight: _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__["default"], reject: _reject_js__WEBPACK_IMPORTED_MODULE_21__["default"], sample: _sample_js__WEBPACK_IMPORTED_MODULE_22__["default"], sampleSize: _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__["default"], shuffle: _shuffle_js__WEBPACK_IMPORTED_MODULE_24__["default"],
- size: _size_js__WEBPACK_IMPORTED_MODULE_25__["default"], some: _some_js__WEBPACK_IMPORTED_MODULE_26__["default"], sortBy: _sortBy_js__WEBPACK_IMPORTED_MODULE_27__["default"]
- });
- /***/ }),
- /***/ "./node_modules/lodash-es/collection.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/collection.js ***!
- \**********************************************/
- /*! exports provided: countBy, each, eachRight, every, filter, find, findLast, flatMap, flatMapDeep, flatMapDepth, forEach, forEachRight, groupBy, includes, invokeMap, keyBy, map, orderBy, partition, reduce, reduceRight, reject, sample, sampleSize, shuffle, size, some, sortBy, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/lodash-es/countBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return _countBy_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "./node_modules/lodash-es/each.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "each", function() { return _each_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _eachRight_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eachRight.js */ "./node_modules/lodash-es/eachRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachRight", function() { return _eachRight_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./every.js */ "./node_modules/lodash-es/every.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _every_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filter.js */ "./node_modules/lodash-es/filter.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _filter_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./find.js */ "./node_modules/lodash-es/find.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _find_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _findLast_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./findLast.js */ "./node_modules/lodash-es/findLast.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLast", function() { return _findLast_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _flatMap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flatMap.js */ "./node_modules/lodash-es/flatMap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _flatMap_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flatMapDeep.js */ "./node_modules/lodash-es/flatMapDeep.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDeep", function() { return _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flatMapDepth.js */ "./node_modules/lodash-es/flatMapDepth.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDepth", function() { return _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return _forEach_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEachRight", function() { return _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/lodash-es/groupBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _groupBy_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _includes_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./includes.js */ "./node_modules/lodash-es/includes.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return _includes_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./invokeMap.js */ "./node_modules/lodash-es/invokeMap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invokeMap", function() { return _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _keyBy_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./keyBy.js */ "./node_modules/lodash-es/keyBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyBy", function() { return _keyBy_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _map_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
- /* harmony import */ var _orderBy_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./orderBy.js */ "./node_modules/lodash-es/orderBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "orderBy", function() { return _orderBy_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./partition.js */ "./node_modules/lodash-es/partition.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _partition_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
- /* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/lodash-es/reduce.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _reduce_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/lodash-es/reduceRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./reject.js */ "./node_modules/lodash-es/reject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return _reject_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
- /* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./sample.js */ "./node_modules/lodash-es/sample.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _sample_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
- /* harmony import */ var _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./sampleSize.js */ "./node_modules/lodash-es/sampleSize.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleSize", function() { return _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
- /* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/lodash-es/shuffle.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return _shuffle_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
- /* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./size.js */ "./node_modules/lodash-es/size.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "size", function() { return _size_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
- /* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./some.js */ "./node_modules/lodash-es/some.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "some", function() { return _some_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
- /* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/lodash-es/sortBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return _sortBy_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
- /* harmony import */ var _collection_default_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./collection.default.js */ "./node_modules/lodash-es/collection.default.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _collection_default_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/commit.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/commit.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
- /**
- * Executes the chain sequence and returns the wrapped result.
- *
- * @name commit
- * @memberOf _
- * @since 3.2.0
- * @category Seq
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2];
- * var wrapped = _(array).push(3);
- *
- * console.log(array);
- * // => [1, 2]
- *
- * wrapped = wrapped.commit();
- * console.log(array);
- * // => [1, 2, 3]
- *
- * wrapped.last();
- * // => 3
- *
- * console.log(array);
- * // => [1, 2, 3]
- */
- function wrapperCommit() {
- return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this.value(), this.__chain__);
- }
- /* harmony default export */ __webpack_exports__["default"] = (wrapperCommit);
- /***/ }),
- /***/ "./node_modules/lodash-es/compact.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/compact.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Creates an array with all falsey values removed. The values `false`, `null`,
- * `0`, `""`, `undefined`, and `NaN` are falsey.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to compact.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.compact([0, 1, false, 2, '', 3]);
- * // => [1, 2, 3]
- */
- function compact(array) {
- var index = -1,
- length = array == null ? 0 : array.length,
- resIndex = 0,
- result = [];
- while (++index < length) {
- var value = array[index];
- if (value) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (compact);
- /***/ }),
- /***/ "./node_modules/lodash-es/concat.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/concat.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * Creates a new array concatenating `array` with any additional arrays
- * and/or values.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to concatenate.
- * @param {...*} [values] The values to concatenate.
- * @returns {Array} Returns the new concatenated array.
- * @example
- *
- * var array = [1];
- * var other = _.concat(array, 2, [3], [[4]]);
- *
- * console.log(other);
- * // => [1, 2, 3, [4]]
- *
- * console.log(array);
- * // => [1]
- */
- function concat() {
- var length = arguments.length;
- if (!length) {
- return [];
- }
- var args = Array(length - 1),
- array = arguments[0],
- index = length;
- while (index--) {
- args[index - 1] = arguments[index];
- }
- return Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array) ? Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array) : [array], Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(args, 1));
- }
- /* harmony default export */ __webpack_exports__["default"] = (concat);
- /***/ }),
- /***/ "./node_modules/lodash-es/cond.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/cond.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /** Error message constants. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /**
- * Creates a function that iterates over `pairs` and invokes the corresponding
- * function of the first predicate to return truthy. The predicate-function
- * pairs are invoked with the `this` binding and arguments of the created
- * function.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {Array} pairs The predicate-function pairs.
- * @returns {Function} Returns the new composite function.
- * @example
- *
- * var func = _.cond([
- * [_.matches({ 'a': 1 }), _.constant('matches A')],
- * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
- * [_.stubTrue, _.constant('no match')]
- * ]);
- *
- * func({ 'a': 1, 'b': 2 });
- * // => 'matches A'
- *
- * func({ 'a': 0, 'b': 1 });
- * // => 'matches B'
- *
- * func({ 'a': '1', 'b': '2' });
- * // => 'no match'
- */
- function cond(pairs) {
- var length = pairs == null ? 0 : pairs.length,
- toIteratee = _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"];
- pairs = !length ? [] : Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(pairs, function(pair) {
- if (typeof pair[1] != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return [toIteratee(pair[0]), pair[1]];
- });
- return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(args) {
- var index = -1;
- while (++index < length) {
- var pair = pairs[index];
- if (Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(pair[0], this, args)) {
- return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(pair[1], this, args);
- }
- }
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (cond);
- /***/ }),
- /***/ "./node_modules/lodash-es/conforms.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/conforms.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
- /* harmony import */ var _baseConforms_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseConforms.js */ "./node_modules/lodash-es/_baseConforms.js");
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1;
- /**
- * Creates a function that invokes the predicate properties of `source` with
- * the corresponding property values of a given object, returning `true` if
- * all predicates return truthy, else `false`.
- *
- * **Note:** The created function is equivalent to `_.conformsTo` with
- * `source` partially applied.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {Object} source The object of property predicates to conform to.
- * @returns {Function} Returns the new spec function.
- * @example
- *
- * var objects = [
- * { 'a': 2, 'b': 1 },
- * { 'a': 1, 'b': 2 }
- * ];
- *
- * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
- * // => [{ 'a': 1, 'b': 2 }]
- */
- function conforms(source) {
- return Object(_baseConforms_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, CLONE_DEEP_FLAG));
- }
- /* harmony default export */ __webpack_exports__["default"] = (conforms);
- /***/ }),
- /***/ "./node_modules/lodash-es/conformsTo.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/conformsTo.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseConformsTo.js */ "./node_modules/lodash-es/_baseConformsTo.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * Checks if `object` conforms to `source` by invoking the predicate
- * properties of `source` with the corresponding property values of `object`.
- *
- * **Note:** This method is equivalent to `_.conforms` when `source` is
- * partially applied.
- *
- * @static
- * @memberOf _
- * @since 4.14.0
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property predicates to conform to.
- * @returns {boolean} Returns `true` if `object` conforms, else `false`.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- *
- * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
- * // => true
- *
- * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
- * // => false
- */
- function conformsTo(object, source) {
- return source == null || Object(_baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source));
- }
- /* harmony default export */ __webpack_exports__["default"] = (conformsTo);
- /***/ }),
- /***/ "./node_modules/lodash-es/constant.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/constant.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Creates a function that returns `value`.
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Util
- * @param {*} value The value to return from the new function.
- * @returns {Function} Returns the new constant function.
- * @example
- *
- * var objects = _.times(2, _.constant({ 'a': 1 }));
- *
- * console.log(objects);
- * // => [{ 'a': 1 }, { 'a': 1 }]
- *
- * console.log(objects[0] === objects[1]);
- * // => true
- */
- function constant(value) {
- return function() {
- return value;
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (constant);
- /***/ }),
- /***/ "./node_modules/lodash-es/countBy.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/countBy.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
- /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` thru `iteratee`. The corresponding value of
- * each key is the number of times the key was returned by `iteratee`. The
- * iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 0.5.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.countBy([6.1, 4.2, 6.3], Math.floor);
- * // => { '4': 1, '6': 2 }
- *
- * // The `_.property` iteratee shorthand.
- * _.countBy(['one', 'two', 'three'], 'length');
- * // => { '3': 2, '5': 1 }
- */
- var countBy = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
- if (hasOwnProperty.call(result, key)) {
- ++result[key];
- } else {
- Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, 1);
- }
- });
- /* harmony default export */ __webpack_exports__["default"] = (countBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/create.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/create.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseAssign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssign.js */ "./node_modules/lodash-es/_baseAssign.js");
- /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
- /**
- * Creates an object that inherits from the `prototype` object. If a
- * `properties` object is given, its own enumerable string keyed properties
- * are assigned to the created object.
- *
- * @static
- * @memberOf _
- * @since 2.3.0
- * @category Object
- * @param {Object} prototype The object to inherit from.
- * @param {Object} [properties] The properties to assign to the object.
- * @returns {Object} Returns the new object.
- * @example
- *
- * function Shape() {
- * this.x = 0;
- * this.y = 0;
- * }
- *
- * function Circle() {
- * Shape.call(this);
- * }
- *
- * Circle.prototype = _.create(Shape.prototype, {
- * 'constructor': Circle
- * });
- *
- * var circle = new Circle;
- * circle instanceof Circle;
- * // => true
- *
- * circle instanceof Shape;
- * // => true
- */
- function create(prototype, properties) {
- var result = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_1__["default"])(prototype);
- return properties == null ? result : Object(_baseAssign_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, properties);
- }
- /* harmony default export */ __webpack_exports__["default"] = (create);
- /***/ }),
- /***/ "./node_modules/lodash-es/curry.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/curry.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_CURRY_FLAG = 8;
- /**
- * Creates a function that accepts arguments of `func` and either invokes
- * `func` returning its result, if at least `arity` number of arguments have
- * been provided, or returns a function that accepts the remaining `func`
- * arguments, and so on. The arity of `func` may be specified if `func.length`
- * is not sufficient.
- *
- * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for provided arguments.
- *
- * **Note:** This method doesn't set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curry(abc);
- *
- * curried(1)(2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // Curried with placeholders.
- * curried(1)(_, 3)(2);
- * // => [1, 2, 3]
- */
- function curry(func, arity, guard) {
- arity = guard ? undefined : arity;
- var result = Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
- result.placeholder = curry.placeholder;
- return result;
- }
- // Assign default placeholders.
- curry.placeholder = {};
- /* harmony default export */ __webpack_exports__["default"] = (curry);
- /***/ }),
- /***/ "./node_modules/lodash-es/curryRight.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/curryRight.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_CURRY_RIGHT_FLAG = 16;
- /**
- * This method is like `_.curry` except that arguments are applied to `func`
- * in the manner of `_.partialRight` instead of `_.partial`.
- *
- * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for provided arguments.
- *
- * **Note:** This method doesn't set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curryRight(abc);
- *
- * curried(3)(2)(1);
- * // => [1, 2, 3]
- *
- * curried(2, 3)(1);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // Curried with placeholders.
- * curried(3)(1, _)(2);
- * // => [1, 2, 3]
- */
- function curryRight(func, arity, guard) {
- arity = guard ? undefined : arity;
- var result = Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
- result.placeholder = curryRight.placeholder;
- return result;
- }
- // Assign default placeholders.
- curryRight.placeholder = {};
- /* harmony default export */ __webpack_exports__["default"] = (curryRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/date.default.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/date.default.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
- /* harmony default export */ __webpack_exports__["default"] = ({
- now: _now_js__WEBPACK_IMPORTED_MODULE_0__["default"]
- });
- /***/ }),
- /***/ "./node_modules/lodash-es/date.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/date.js ***!
- \****************************************/
- /*! exports provided: now, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "now", function() { return _now_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _date_default_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./date.default.js */ "./node_modules/lodash-es/date.default.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _date_default_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/debounce.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/debounce.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
- /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
- /** Error message constants. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max,
- nativeMin = Math.min;
- /**
- * Creates a debounced function that delays invoking `func` until after `wait`
- * milliseconds have elapsed since the last time the debounced function was
- * invoked. The debounced function comes with a `cancel` method to cancel
- * delayed `func` invocations and a `flush` method to immediately invoke them.
- * Provide `options` to indicate whether `func` should be invoked on the
- * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
- * with the last arguments provided to the debounced function. Subsequent
- * calls to the debounced function return the result of the last `func`
- * invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the debounced function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.debounce` and `_.throttle`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to debounce.
- * @param {number} [wait=0] The number of milliseconds to delay.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=false]
- * Specify invoking on the leading edge of the timeout.
- * @param {number} [options.maxWait]
- * The maximum time `func` is allowed to be delayed before it's invoked.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new debounced function.
- * @example
- *
- * // Avoid costly calculations while the window size is in flux.
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
- *
- * // Invoke `sendMail` when clicked, debouncing subsequent calls.
- * jQuery(element).on('click', _.debounce(sendMail, 300, {
- * 'leading': true,
- * 'trailing': false
- * }));
- *
- * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
- * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
- * var source = new EventSource('/stream');
- * jQuery(source).on('message', debounced);
- *
- * // Cancel the trailing debounced invocation.
- * jQuery(window).on('popstate', debounced.cancel);
- */
- function debounce(func, wait, options) {
- var lastArgs,
- lastThis,
- maxWait,
- result,
- timerId,
- lastCallTime,
- lastInvokeTime = 0,
- leading = false,
- maxing = false,
- trailing = true;
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- wait = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wait) || 0;
- if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options)) {
- leading = !!options.leading;
- maxing = 'maxWait' in options;
- maxWait = maxing ? nativeMax(Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(options.maxWait) || 0, wait) : maxWait;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
- function invokeFunc(time) {
- var args = lastArgs,
- thisArg = lastThis;
- lastArgs = lastThis = undefined;
- lastInvokeTime = time;
- result = func.apply(thisArg, args);
- return result;
- }
- function leadingEdge(time) {
- // Reset any `maxWait` timer.
- lastInvokeTime = time;
- // Start the timer for the trailing edge.
- timerId = setTimeout(timerExpired, wait);
- // Invoke the leading edge.
- return leading ? invokeFunc(time) : result;
- }
- function remainingWait(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime,
- timeWaiting = wait - timeSinceLastCall;
- return maxing
- ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
- : timeWaiting;
- }
- function shouldInvoke(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime;
- // Either this is the first call, activity has stopped and we're at the
- // trailing edge, the system time has gone backwards and we're treating
- // it as the trailing edge, or we've hit the `maxWait` limit.
- return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
- (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
- }
- function timerExpired() {
- var time = Object(_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])();
- if (shouldInvoke(time)) {
- return trailingEdge(time);
- }
- // Restart the timer.
- timerId = setTimeout(timerExpired, remainingWait(time));
- }
- function trailingEdge(time) {
- timerId = undefined;
- // Only invoke if we have `lastArgs` which means `func` has been
- // debounced at least once.
- if (trailing && lastArgs) {
- return invokeFunc(time);
- }
- lastArgs = lastThis = undefined;
- return result;
- }
- function cancel() {
- if (timerId !== undefined) {
- clearTimeout(timerId);
- }
- lastInvokeTime = 0;
- lastArgs = lastCallTime = lastThis = timerId = undefined;
- }
- function flush() {
- return timerId === undefined ? result : trailingEdge(Object(_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])());
- }
- function debounced() {
- var time = Object(_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])(),
- isInvoking = shouldInvoke(time);
- lastArgs = arguments;
- lastThis = this;
- lastCallTime = time;
- if (isInvoking) {
- if (timerId === undefined) {
- return leadingEdge(lastCallTime);
- }
- if (maxing) {
- // Handle invocations in a tight loop.
- clearTimeout(timerId);
- timerId = setTimeout(timerExpired, wait);
- return invokeFunc(lastCallTime);
- }
- }
- if (timerId === undefined) {
- timerId = setTimeout(timerExpired, wait);
- }
- return result;
- }
- debounced.cancel = cancel;
- debounced.flush = flush;
- return debounced;
- }
- /* harmony default export */ __webpack_exports__["default"] = (debounce);
- /***/ }),
- /***/ "./node_modules/lodash-es/deburr.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/deburr.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _deburrLetter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_deburrLetter.js */ "./node_modules/lodash-es/_deburrLetter.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /** Used to match Latin Unicode letters (excluding mathematical operators). */
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
- /** Used to compose unicode character classes. */
- var rsComboMarksRange = '\\u0300-\\u036f',
- reComboHalfMarksRange = '\\ufe20-\\ufe2f',
- rsComboSymbolsRange = '\\u20d0-\\u20ff',
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
- /** Used to compose unicode capture groups. */
- var rsCombo = '[' + rsComboRange + ']';
- /**
- * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
- * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
- */
- var reComboMark = RegExp(rsCombo, 'g');
- /**
- * Deburrs `string` by converting
- * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
- * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
- * letters to basic Latin letters and removing
- * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to deburr.
- * @returns {string} Returns the deburred string.
- * @example
- *
- * _.deburr('déjà vu');
- * // => 'deja vu'
- */
- function deburr(string) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string);
- return string && string.replace(reLatin, _deburrLetter_js__WEBPACK_IMPORTED_MODULE_0__["default"]).replace(reComboMark, '');
- }
- /* harmony default export */ __webpack_exports__["default"] = (deburr);
- /***/ }),
- /***/ "./node_modules/lodash-es/defaultTo.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/defaultTo.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Checks `value` to determine whether a default value should be returned in
- * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
- * or `undefined`.
- *
- * @static
- * @memberOf _
- * @since 4.14.0
- * @category Util
- * @param {*} value The value to check.
- * @param {*} defaultValue The default value.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * _.defaultTo(1, 10);
- * // => 1
- *
- * _.defaultTo(undefined, 10);
- * // => 10
- */
- function defaultTo(value, defaultValue) {
- return (value == null || value !== value) ? defaultValue : value;
- }
- /* harmony default export */ __webpack_exports__["default"] = (defaultTo);
- /***/ }),
- /***/ "./node_modules/lodash-es/defaults.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/defaults.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Assigns own and inherited enumerable string keyed properties of source
- * objects to the destination object for all destination properties that
- * resolve to `undefined`. Source objects are applied from left to right.
- * Once a property is set, additional values of the same property are ignored.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.defaultsDeep
- * @example
- *
- * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
- * // => { 'a': 1, 'b': 2 }
- */
- var defaults = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, sources) {
- object = Object(object);
- var index = -1;
- var length = sources.length;
- var guard = length > 2 ? sources[2] : undefined;
- if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_2__["default"])(sources[0], sources[1], guard)) {
- length = 1;
- }
- while (++index < length) {
- var source = sources[index];
- var props = Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_3__["default"])(source);
- var propsIndex = -1;
- var propsLength = props.length;
- while (++propsIndex < propsLength) {
- var key = props[propsIndex];
- var value = object[key];
- if (value === undefined ||
- (Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
- object[key] = source[key];
- }
- }
- }
- return object;
- });
- /* harmony default export */ __webpack_exports__["default"] = (defaults);
- /***/ }),
- /***/ "./node_modules/lodash-es/defaultsDeep.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/defaultsDeep.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _customDefaultsMerge_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_customDefaultsMerge.js */ "./node_modules/lodash-es/_customDefaultsMerge.js");
- /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
- /**
- * This method is like `_.defaults` except that it recursively assigns
- * default properties.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.defaults
- * @example
- *
- * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
- * // => { 'a': { 'b': 2, 'c': 3 } }
- */
- var defaultsDeep = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(args) {
- args.push(undefined, _customDefaultsMerge_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
- return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_mergeWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], undefined, args);
- });
- /* harmony default export */ __webpack_exports__["default"] = (defaultsDeep);
- /***/ }),
- /***/ "./node_modules/lodash-es/defer.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/defer.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseDelay_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDelay.js */ "./node_modules/lodash-es/_baseDelay.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /**
- * Defers invoking the `func` until the current call stack has cleared. Any
- * additional arguments are provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to defer.
- * @param {...*} [args] The arguments to invoke `func` with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.defer(function(text) {
- * console.log(text);
- * }, 'deferred');
- * // => Logs 'deferred' after one millisecond.
- */
- var defer = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, args) {
- return Object(_baseDelay_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, 1, args);
- });
- /* harmony default export */ __webpack_exports__["default"] = (defer);
- /***/ }),
- /***/ "./node_modules/lodash-es/delay.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/delay.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseDelay_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDelay.js */ "./node_modules/lodash-es/_baseDelay.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
- /**
- * Invokes `func` after `wait` milliseconds. Any additional arguments are
- * provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {...*} [args] The arguments to invoke `func` with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.delay(function(text) {
- * console.log(text);
- * }, 1000, 'later');
- * // => Logs 'later' after one second.
- */
- var delay = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, wait, args) {
- return Object(_baseDelay_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wait) || 0, args);
- });
- /* harmony default export */ __webpack_exports__["default"] = (delay);
- /***/ }),
- /***/ "./node_modules/lodash-es/difference.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/difference.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /**
- * Creates an array of `array` values not included in the other given arrays
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons. The order and references of result values are
- * determined by the first array.
- *
- * **Note:** Unlike `_.pullAll`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- * @see _.without, _.xor
- * @example
- *
- * _.difference([2, 1], [2, 3]);
- * // => [1]
- */
- var difference = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(array, values) {
- return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array)
- ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(values, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"], true))
- : [];
- });
- /* harmony default export */ __webpack_exports__["default"] = (difference);
- /***/ }),
- /***/ "./node_modules/lodash-es/differenceBy.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/differenceBy.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /**
- * This method is like `_.difference` except that it accepts `iteratee` which
- * is invoked for each element of `array` and `values` to generate the criterion
- * by which they're compared. The order and references of result values are
- * determined by the first array. The iteratee is invoked with one argument:
- * (value).
- *
- * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The values to exclude.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
- * // => [1.2]
- *
- * // The `_.property` iteratee shorthand.
- * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
- * // => [{ 'x': 2 }]
- */
- var differenceBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(array, values) {
- var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(values);
- if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee)) {
- iteratee = undefined;
- }
- return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(array)
- ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(values, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"], true), Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2))
- : [];
- });
- /* harmony default export */ __webpack_exports__["default"] = (differenceBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/differenceWith.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/differenceWith.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /**
- * This method is like `_.difference` except that it accepts `comparator`
- * which is invoked to compare elements of `array` to `values`. The order and
- * references of result values are determined by the first array. The comparator
- * is invoked with two arguments: (arrVal, othVal).
- *
- * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The values to exclude.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- *
- * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
- * // => [{ 'x': 2, 'y': 1 }]
- */
- var differenceWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(array, values) {
- var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(values);
- if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(comparator)) {
- comparator = undefined;
- }
- return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array)
- ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(values, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"], true), undefined, comparator)
- : [];
- });
- /* harmony default export */ __webpack_exports__["default"] = (differenceWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/divide.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/divide.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
- /**
- * Divide two numbers.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Math
- * @param {number} dividend The first number in a division.
- * @param {number} divisor The second number in a division.
- * @returns {number} Returns the quotient.
- * @example
- *
- * _.divide(6, 4);
- * // => 1.5
- */
- var divide = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(dividend, divisor) {
- return dividend / divisor;
- }, 1);
- /* harmony default export */ __webpack_exports__["default"] = (divide);
- /***/ }),
- /***/ "./node_modules/lodash-es/drop.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/drop.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /**
- * Creates a slice of `array` with `n` elements dropped from the beginning.
- *
- * @static
- * @memberOf _
- * @since 0.5.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to drop.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.drop([1, 2, 3]);
- * // => [2, 3]
- *
- * _.drop([1, 2, 3], 2);
- * // => [3]
- *
- * _.drop([1, 2, 3], 5);
- * // => []
- *
- * _.drop([1, 2, 3], 0);
- * // => [1, 2, 3]
- */
- function drop(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
- return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, n < 0 ? 0 : n, length);
- }
- /* harmony default export */ __webpack_exports__["default"] = (drop);
- /***/ }),
- /***/ "./node_modules/lodash-es/dropRight.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/dropRight.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /**
- * Creates a slice of `array` with `n` elements dropped from the end.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to drop.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.dropRight([1, 2, 3]);
- * // => [1, 2]
- *
- * _.dropRight([1, 2, 3], 2);
- * // => [1]
- *
- * _.dropRight([1, 2, 3], 5);
- * // => []
- *
- * _.dropRight([1, 2, 3], 0);
- * // => [1, 2, 3]
- */
- function dropRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
- n = length - n;
- return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 0, n < 0 ? 0 : n);
- }
- /* harmony default export */ __webpack_exports__["default"] = (dropRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/dropRightWhile.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/dropRightWhile.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
- /**
- * Creates a slice of `array` excluding elements dropped from the end.
- * Elements are dropped until `predicate` returns falsey. The predicate is
- * invoked with three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.dropRightWhile(users, function(o) { return !o.active; });
- * // => objects for ['barney']
- *
- * // The `_.matches` iteratee shorthand.
- * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
- * // => objects for ['barney', 'fred']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.dropRightWhile(users, ['active', false]);
- * // => objects for ['barney']
- *
- * // The `_.property` iteratee shorthand.
- * _.dropRightWhile(users, 'active');
- * // => objects for ['barney', 'fred', 'pebbles']
- */
- function dropRightWhile(array, predicate) {
- return (array && array.length)
- ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3), true, true)
- : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (dropRightWhile);
- /***/ }),
- /***/ "./node_modules/lodash-es/dropWhile.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/dropWhile.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
- /**
- * Creates a slice of `array` excluding elements dropped from the beginning.
- * Elements are dropped until `predicate` returns falsey. The predicate is
- * invoked with three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.dropWhile(users, function(o) { return !o.active; });
- * // => objects for ['pebbles']
- *
- * // The `_.matches` iteratee shorthand.
- * _.dropWhile(users, { 'user': 'barney', 'active': false });
- * // => objects for ['fred', 'pebbles']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.dropWhile(users, ['active', false]);
- * // => objects for ['pebbles']
- *
- * // The `_.property` iteratee shorthand.
- * _.dropWhile(users, 'active');
- * // => objects for ['barney', 'fred', 'pebbles']
- */
- function dropWhile(array, predicate) {
- return (array && array.length)
- ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3), true)
- : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (dropWhile);
- /***/ }),
- /***/ "./node_modules/lodash-es/each.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/each.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _forEach_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/eachRight.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/eachRight.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _forEachRight_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/endsWith.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/endsWith.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
- /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Checks if `string` ends with the given target string.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {string} [target] The string to search for.
- * @param {number} [position=string.length] The position to search up to.
- * @returns {boolean} Returns `true` if `string` ends with `target`,
- * else `false`.
- * @example
- *
- * _.endsWith('abc', 'c');
- * // => true
- *
- * _.endsWith('abc', 'b');
- * // => false
- *
- * _.endsWith('abc', 'b', 2);
- * // => true
- */
- function endsWith(string, target, position) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
- target = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(target);
- var length = string.length;
- position = position === undefined
- ? length
- : Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(position), 0, length);
- var end = position;
- position -= target.length;
- return position >= 0 && string.slice(position, end) == target;
- }
- /* harmony default export */ __webpack_exports__["default"] = (endsWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/entries.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/entries.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/entriesIn.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/entriesIn.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toPairsIn_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/eq.js":
- /*!**************************************!*\
- !*** ./node_modules/lodash-es/eq.js ***!
- \**************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Performs a
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * comparison between two values to determine if they are equivalent.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'a': 1 };
- * var other = { 'a': 1 };
- *
- * _.eq(object, object);
- * // => true
- *
- * _.eq(object, other);
- * // => false
- *
- * _.eq('a', 'a');
- * // => true
- *
- * _.eq('a', Object('a'));
- * // => false
- *
- * _.eq(NaN, NaN);
- * // => true
- */
- function eq(value, other) {
- return value === other || (value !== value && other !== other);
- }
- /* harmony default export */ __webpack_exports__["default"] = (eq);
- /***/ }),
- /***/ "./node_modules/lodash-es/escape.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/escape.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _escapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_escapeHtmlChar.js */ "./node_modules/lodash-es/_escapeHtmlChar.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /** Used to match HTML entities and HTML characters. */
- var reUnescapedHtml = /[&<>"']/g,
- reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
- /**
- * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
- * corresponding HTML entities.
- *
- * **Note:** No other characters are escaped. To escape additional
- * characters use a third-party library like [_he_](https://mths.be/he).
- *
- * Though the ">" character is escaped for symmetry, characters like
- * ">" and "/" don't need escaping in HTML and have no special meaning
- * unless they're part of a tag or unquoted attribute value. See
- * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
- * (under "semi-related fun fact") for more details.
- *
- * When working with HTML you should always
- * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
- * XSS vectors.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escape('fred, barney, & pebbles');
- * // => 'fred, barney, & pebbles'
- */
- function escape(string) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string);
- return (string && reHasUnescapedHtml.test(string))
- ? string.replace(reUnescapedHtml, _escapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_0__["default"])
- : string;
- }
- /* harmony default export */ __webpack_exports__["default"] = (escape);
- /***/ }),
- /***/ "./node_modules/lodash-es/escapeRegExp.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/escapeRegExp.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Used to match `RegExp`
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
- */
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
- reHasRegExpChar = RegExp(reRegExpChar.source);
- /**
- * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
- * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escapeRegExp('[lodash](https://lodash.com/)');
- * // => '\[lodash\]\(https://lodash\.com/\)'
- */
- function escapeRegExp(string) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
- return (string && reHasRegExpChar.test(string))
- ? string.replace(reRegExpChar, '\\$&')
- : string;
- }
- /* harmony default export */ __webpack_exports__["default"] = (escapeRegExp);
- /***/ }),
- /***/ "./node_modules/lodash-es/every.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/every.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEvery.js */ "./node_modules/lodash-es/_arrayEvery.js");
- /* harmony import */ var _baseEvery_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEvery.js */ "./node_modules/lodash-es/_baseEvery.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /**
- * Checks if `predicate` returns truthy for **all** elements of `collection`.
- * Iteration is stopped once `predicate` returns falsey. The predicate is
- * invoked with three arguments: (value, index|key, collection).
- *
- * **Note:** This method returns `true` for
- * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
- * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
- * elements of empty collections.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- * @example
- *
- * _.every([true, 1, null, 'yes'], Boolean);
- * // => false
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * // The `_.matches` iteratee shorthand.
- * _.every(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.every(users, ['active', false]);
- * // => true
- *
- * // The `_.property` iteratee shorthand.
- * _.every(users, 'active');
- * // => false
- */
- function every(collection, predicate, guard) {
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseEvery_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection, predicate, guard)) {
- predicate = undefined;
- }
- return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3));
- }
- /* harmony default export */ __webpack_exports__["default"] = (every);
- /***/ }),
- /***/ "./node_modules/lodash-es/extend.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/extend.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _assignIn_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/extendWith.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/extendWith.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _assignInWith_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/fill.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/fill.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFill.js */ "./node_modules/lodash-es/_baseFill.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /**
- * Fills elements of `array` with `value` from `start` up to, but not
- * including, `end`.
- *
- * **Note:** This method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 3.2.0
- * @category Array
- * @param {Array} array The array to fill.
- * @param {*} value The value to fill `array` with.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _.fill(array, 'a');
- * console.log(array);
- * // => ['a', 'a', 'a']
- *
- * _.fill(Array(3), 2);
- * // => [2, 2, 2]
- *
- * _.fill([4, 6, 8, 10], '*', 1, 3);
- * // => [4, '*', '*', 10]
- */
- function fill(array, value, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (start && typeof start != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, value, start)) {
- start = 0;
- end = length;
- }
- return Object(_baseFill_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, start, end);
- }
- /* harmony default export */ __webpack_exports__["default"] = (fill);
- /***/ }),
- /***/ "./node_modules/lodash-es/filter.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/filter.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
- /* harmony import */ var _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFilter.js */ "./node_modules/lodash-es/_baseFilter.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * Iterates over elements of `collection`, returning an array of all elements
- * `predicate` returns truthy for. The predicate is invoked with three
- * arguments: (value, index|key, collection).
- *
- * **Note:** Unlike `_.remove`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- * @see _.reject
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * _.filter(users, function(o) { return !o.active; });
- * // => objects for ['fred']
- *
- * // The `_.matches` iteratee shorthand.
- * _.filter(users, { 'age': 36, 'active': true });
- * // => objects for ['barney']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.filter(users, ['active', false]);
- * // => objects for ['fred']
- *
- * // The `_.property` iteratee shorthand.
- * _.filter(users, 'active');
- * // => objects for ['barney']
- *
- * // Combining several predicates using `_.overEvery` or `_.overSome`.
- * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
- * // => objects for ['fred', 'barney']
- */
- function filter(collection, predicate) {
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3));
- }
- /* harmony default export */ __webpack_exports__["default"] = (filter);
- /***/ }),
- /***/ "./node_modules/lodash-es/find.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/find.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createFind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFind.js */ "./node_modules/lodash-es/_createFind.js");
- /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
- /**
- * Iterates over elements of `collection`, returning the first element
- * `predicate` returns truthy for. The predicate is invoked with three
- * arguments: (value, index|key, collection).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false },
- * { 'user': 'pebbles', 'age': 1, 'active': true }
- * ];
- *
- * _.find(users, function(o) { return o.age < 40; });
- * // => object for 'barney'
- *
- * // The `_.matches` iteratee shorthand.
- * _.find(users, { 'age': 1, 'active': true });
- * // => object for 'pebbles'
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.find(users, ['active', false]);
- * // => object for 'fred'
- *
- * // The `_.property` iteratee shorthand.
- * _.find(users, 'active');
- * // => object for 'barney'
- */
- var find = Object(_createFind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_findIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (find);
- /***/ }),
- /***/ "./node_modules/lodash-es/findIndex.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/findIndex.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max;
- /**
- * This method is like `_.find` except that it returns the index of the first
- * element `predicate` returns truthy for instead of the element itself.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {number} Returns the index of the found element, else `-1`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.findIndex(users, function(o) { return o.user == 'barney'; });
- * // => 0
- *
- * // The `_.matches` iteratee shorthand.
- * _.findIndex(users, { 'user': 'fred', 'active': false });
- * // => 1
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findIndex(users, ['active', false]);
- * // => 0
- *
- * // The `_.property` iteratee shorthand.
- * _.findIndex(users, 'active');
- * // => 2
- */
- function findIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate, 3), index);
- }
- /* harmony default export */ __webpack_exports__["default"] = (findIndex);
- /***/ }),
- /***/ "./node_modules/lodash-es/findKey.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/findKey.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindKey.js */ "./node_modules/lodash-es/_baseFindKey.js");
- /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /**
- * This method is like `_.find` except that it returns the key of the first
- * element `predicate` returns truthy for instead of the element itself.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category Object
- * @param {Object} object The object to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {string|undefined} Returns the key of the matched element,
- * else `undefined`.
- * @example
- *
- * var users = {
- * 'barney': { 'age': 36, 'active': true },
- * 'fred': { 'age': 40, 'active': false },
- * 'pebbles': { 'age': 1, 'active': true }
- * };
- *
- * _.findKey(users, function(o) { return o.age < 40; });
- * // => 'barney' (iteration order is not guaranteed)
- *
- * // The `_.matches` iteratee shorthand.
- * _.findKey(users, { 'age': 1, 'active': true });
- * // => 'pebbles'
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findKey(users, ['active', false]);
- * // => 'fred'
- *
- * // The `_.property` iteratee shorthand.
- * _.findKey(users, 'active');
- * // => 'barney'
- */
- function findKey(object, predicate) {
- return Object(_baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3), _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (findKey);
- /***/ }),
- /***/ "./node_modules/lodash-es/findLast.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/findLast.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createFind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFind.js */ "./node_modules/lodash-es/_createFind.js");
- /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
- /**
- * This method is like `_.find` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=collection.length-1] The index to search from.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * _.findLast([1, 2, 3, 4], function(n) {
- * return n % 2 == 1;
- * });
- * // => 3
- */
- var findLast = Object(_createFind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_findLastIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (findLast);
- /***/ }),
- /***/ "./node_modules/lodash-es/findLastIndex.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/findLastIndex.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max,
- nativeMin = Math.min;
- /**
- * This method is like `_.findIndex` except that it iterates over elements
- * of `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=array.length-1] The index to search from.
- * @returns {number} Returns the index of the found element, else `-1`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
- * // => 2
- *
- * // The `_.matches` iteratee shorthand.
- * _.findLastIndex(users, { 'user': 'barney', 'active': true });
- * // => 0
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findLastIndex(users, ['active', false]);
- * // => 2
- *
- * // The `_.property` iteratee shorthand.
- * _.findLastIndex(users, 'active');
- * // => 0
- */
- function findLastIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = length - 1;
- if (fromIndex !== undefined) {
- index = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(fromIndex);
- index = fromIndex < 0
- ? nativeMax(length + index, 0)
- : nativeMin(index, length - 1);
- }
- return Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate, 3), index, true);
- }
- /* harmony default export */ __webpack_exports__["default"] = (findLastIndex);
- /***/ }),
- /***/ "./node_modules/lodash-es/findLastKey.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/findLastKey.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindKey.js */ "./node_modules/lodash-es/_baseFindKey.js");
- /* harmony import */ var _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwnRight.js */ "./node_modules/lodash-es/_baseForOwnRight.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /**
- * This method is like `_.findKey` except that it iterates over elements of
- * a collection in the opposite order.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Object
- * @param {Object} object The object to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {string|undefined} Returns the key of the matched element,
- * else `undefined`.
- * @example
- *
- * var users = {
- * 'barney': { 'age': 36, 'active': true },
- * 'fred': { 'age': 40, 'active': false },
- * 'pebbles': { 'age': 1, 'active': true }
- * };
- *
- * _.findLastKey(users, function(o) { return o.age < 40; });
- * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
- *
- * // The `_.matches` iteratee shorthand.
- * _.findLastKey(users, { 'age': 36, 'active': true });
- * // => 'barney'
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findLastKey(users, ['active', false]);
- * // => 'fred'
- *
- * // The `_.property` iteratee shorthand.
- * _.findLastKey(users, 'active');
- * // => 'pebbles'
- */
- function findLastKey(object, predicate) {
- return Object(_baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3), _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (findLastKey);
- /***/ }),
- /***/ "./node_modules/lodash-es/first.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/first.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _head_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/flatMap.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/flatMap.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
- /**
- * Creates a flattened array of values by running each element in `collection`
- * thru `iteratee` and flattening the mapped results. The iteratee is invoked
- * with three arguments: (value, index|key, collection).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [n, n];
- * }
- *
- * _.flatMap([1, 2], duplicate);
- * // => [1, 1, 2, 2]
- */
- function flatMap(collection, iteratee) {
- return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_map_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, iteratee), 1);
- }
- /* harmony default export */ __webpack_exports__["default"] = (flatMap);
- /***/ }),
- /***/ "./node_modules/lodash-es/flatMapDeep.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/flatMapDeep.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
- /** Used as references for various `Number` constants. */
- var INFINITY = 1 / 0;
- /**
- * This method is like `_.flatMap` except that it recursively flattens the
- * mapped results.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [[[n, n]]];
- * }
- *
- * _.flatMapDeep([1, 2], duplicate);
- * // => [1, 1, 2, 2]
- */
- function flatMapDeep(collection, iteratee) {
- return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_map_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, iteratee), INFINITY);
- }
- /* harmony default export */ __webpack_exports__["default"] = (flatMapDeep);
- /***/ }),
- /***/ "./node_modules/lodash-es/flatMapDepth.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/flatMapDepth.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /**
- * This method is like `_.flatMap` except that it recursively flattens the
- * mapped results up to `depth` times.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {number} [depth=1] The maximum recursion depth.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [[[n, n]]];
- * }
- *
- * _.flatMapDepth([1, 2], duplicate, 2);
- * // => [[1, 1], [2, 2]]
- */
- function flatMapDepth(collection, iteratee, depth) {
- depth = depth === undefined ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(depth);
- return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_map_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, iteratee), depth);
- }
- /* harmony default export */ __webpack_exports__["default"] = (flatMapDepth);
- /***/ }),
- /***/ "./node_modules/lodash-es/flatten.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/flatten.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /**
- * Flattens `array` a single level deep.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to flatten.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * _.flatten([1, [2, [3, [4]], 5]]);
- * // => [1, 2, [3, [4]], 5]
- */
- function flatten(array) {
- var length = array == null ? 0 : array.length;
- return length ? Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 1) : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (flatten);
- /***/ }),
- /***/ "./node_modules/lodash-es/flattenDeep.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/flattenDeep.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /** Used as references for various `Number` constants. */
- var INFINITY = 1 / 0;
- /**
- * Recursively flattens `array`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to flatten.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * _.flattenDeep([1, [2, [3, [4]], 5]]);
- * // => [1, 2, 3, 4, 5]
- */
- function flattenDeep(array) {
- var length = array == null ? 0 : array.length;
- return length ? Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, INFINITY) : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (flattenDeep);
- /***/ }),
- /***/ "./node_modules/lodash-es/flattenDepth.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/flattenDepth.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /**
- * Recursively flatten `array` up to `depth` times.
- *
- * @static
- * @memberOf _
- * @since 4.4.0
- * @category Array
- * @param {Array} array The array to flatten.
- * @param {number} [depth=1] The maximum recursion depth.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * var array = [1, [2, [3, [4]], 5]];
- *
- * _.flattenDepth(array, 1);
- * // => [1, 2, [3, [4]], 5]
- *
- * _.flattenDepth(array, 2);
- * // => [1, 2, 3, [4], 5]
- */
- function flattenDepth(array, depth) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- depth = depth === undefined ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(depth);
- return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, depth);
- }
- /* harmony default export */ __webpack_exports__["default"] = (flattenDepth);
- /***/ }),
- /***/ "./node_modules/lodash-es/flip.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/flip.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_FLIP_FLAG = 512;
- /**
- * Creates a function that invokes `func` with arguments reversed.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Function
- * @param {Function} func The function to flip arguments for.
- * @returns {Function} Returns the new flipped function.
- * @example
- *
- * var flipped = _.flip(function() {
- * return _.toArray(arguments);
- * });
- *
- * flipped('a', 'b', 'c', 'd');
- * // => ['d', 'c', 'b', 'a']
- */
- function flip(func) {
- return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_FLIP_FLAG);
- }
- /* harmony default export */ __webpack_exports__["default"] = (flip);
- /***/ }),
- /***/ "./node_modules/lodash-es/floor.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/floor.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createRound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRound.js */ "./node_modules/lodash-es/_createRound.js");
- /**
- * Computes `number` rounded down to `precision`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Math
- * @param {number} number The number to round down.
- * @param {number} [precision=0] The precision to round down to.
- * @returns {number} Returns the rounded down number.
- * @example
- *
- * _.floor(4.006);
- * // => 4
- *
- * _.floor(0.046, 2);
- * // => 0.04
- *
- * _.floor(4060, -2);
- * // => 4000
- */
- var floor = Object(_createRound_js__WEBPACK_IMPORTED_MODULE_0__["default"])('floor');
- /* harmony default export */ __webpack_exports__["default"] = (floor);
- /***/ }),
- /***/ "./node_modules/lodash-es/flow.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/flow.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createFlow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFlow.js */ "./node_modules/lodash-es/_createFlow.js");
- /**
- * Creates a function that returns the result of invoking the given functions
- * with the `this` binding of the created function, where each successive
- * invocation is supplied the return value of the previous.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {...(Function|Function[])} [funcs] The functions to invoke.
- * @returns {Function} Returns the new composite function.
- * @see _.flowRight
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flow([_.add, square]);
- * addSquare(1, 2);
- * // => 9
- */
- var flow = Object(_createFlow_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
- /* harmony default export */ __webpack_exports__["default"] = (flow);
- /***/ }),
- /***/ "./node_modules/lodash-es/flowRight.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/flowRight.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createFlow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFlow.js */ "./node_modules/lodash-es/_createFlow.js");
- /**
- * This method is like `_.flow` except that it creates a function that
- * invokes the given functions from right to left.
- *
- * @static
- * @since 3.0.0
- * @memberOf _
- * @category Util
- * @param {...(Function|Function[])} [funcs] The functions to invoke.
- * @returns {Function} Returns the new composite function.
- * @see _.flow
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flowRight([square, _.add]);
- * addSquare(1, 2);
- * // => 9
- */
- var flowRight = Object(_createFlow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(true);
- /* harmony default export */ __webpack_exports__["default"] = (flowRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/forEach.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/forEach.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
- /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
- /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * Iterates over elements of `collection` and invokes `iteratee` for each element.
- * The iteratee is invoked with three arguments: (value, index|key, collection).
- * Iteratee functions may exit iteration early by explicitly returning `false`.
- *
- * **Note:** As with other "Collections" methods, objects with a "length"
- * property are iterated like arrays. To avoid this behavior use `_.forIn`
- * or `_.forOwn` for object iteration.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @alias each
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- * @see _.forEachRight
- * @example
- *
- * _.forEach([1, 2], function(value) {
- * console.log(value);
- * });
- * // => Logs `1` then `2`.
- *
- * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'a' then 'b' (iteration order is not guaranteed).
- */
- function forEach(collection, iteratee) {
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- return func(collection, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee));
- }
- /* harmony default export */ __webpack_exports__["default"] = (forEach);
- /***/ }),
- /***/ "./node_modules/lodash-es/forEachRight.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/forEachRight.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayEachRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEachRight.js */ "./node_modules/lodash-es/_arrayEachRight.js");
- /* harmony import */ var _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEachRight.js */ "./node_modules/lodash-es/_baseEachRight.js");
- /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * This method is like `_.forEach` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @alias eachRight
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- * @see _.forEach
- * @example
- *
- * _.forEachRight([1, 2], function(value) {
- * console.log(value);
- * });
- * // => Logs `2` then `1`.
- */
- function forEachRight(collection, iteratee) {
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayEachRight_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- return func(collection, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee));
- }
- /* harmony default export */ __webpack_exports__["default"] = (forEachRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/forIn.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/forIn.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
- /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /**
- * Iterates over own and inherited enumerable string keyed properties of an
- * object and invokes `iteratee` for each property. The iteratee is invoked
- * with three arguments: (value, key, object). Iteratee functions may exit
- * iteration early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @since 0.3.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forInRight
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forIn(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
- */
- function forIn(object, iteratee) {
- return object == null
- ? object
- : Object(_baseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee), _keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (forIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/forInRight.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/forInRight.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseForRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForRight.js */ "./node_modules/lodash-es/_baseForRight.js");
- /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /**
- * This method is like `_.forIn` except that it iterates over properties of
- * `object` in the opposite order.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forIn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forInRight(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
- */
- function forInRight(object, iteratee) {
- return object == null
- ? object
- : Object(_baseForRight_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee), _keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (forInRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/forOwn.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/forOwn.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
- /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
- /**
- * Iterates over own enumerable string keyed properties of an object and
- * invokes `iteratee` for each property. The iteratee is invoked with three
- * arguments: (value, key, object). Iteratee functions may exit iteration
- * early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @since 0.3.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forOwnRight
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forOwn(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'a' then 'b' (iteration order is not guaranteed).
- */
- function forOwn(object, iteratee) {
- return object && Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee));
- }
- /* harmony default export */ __webpack_exports__["default"] = (forOwn);
- /***/ }),
- /***/ "./node_modules/lodash-es/forOwnRight.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/forOwnRight.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwnRight.js */ "./node_modules/lodash-es/_baseForOwnRight.js");
- /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
- /**
- * This method is like `_.forOwn` except that it iterates over properties of
- * `object` in the opposite order.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forOwn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forOwnRight(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
- */
- function forOwnRight(object, iteratee) {
- return object && Object(_baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee));
- }
- /* harmony default export */ __webpack_exports__["default"] = (forOwnRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/fromPairs.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/fromPairs.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * The inverse of `_.toPairs`; this method returns an object composed
- * from key-value `pairs`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} pairs The key-value pairs.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.fromPairs([['a', 1], ['b', 2]]);
- * // => { 'a': 1, 'b': 2 }
- */
- function fromPairs(pairs) {
- var index = -1,
- length = pairs == null ? 0 : pairs.length,
- result = {};
- while (++index < length) {
- var pair = pairs[index];
- result[pair[0]] = pair[1];
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (fromPairs);
- /***/ }),
- /***/ "./node_modules/lodash-es/function.default.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/function.default.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./after.js */ "./node_modules/lodash-es/after.js");
- /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
- /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
- /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
- /* harmony import */ var _bindKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bindKey.js */ "./node_modules/lodash-es/bindKey.js");
- /* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curry.js */ "./node_modules/lodash-es/curry.js");
- /* harmony import */ var _curryRight_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./curryRight.js */ "./node_modules/lodash-es/curryRight.js");
- /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
- /* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./defer.js */ "./node_modules/lodash-es/defer.js");
- /* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./delay.js */ "./node_modules/lodash-es/delay.js");
- /* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flip.js */ "./node_modules/lodash-es/flip.js");
- /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
- /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
- /* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./once.js */ "./node_modules/lodash-es/once.js");
- /* harmony import */ var _overArgs_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./overArgs.js */ "./node_modules/lodash-es/overArgs.js");
- /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
- /* harmony import */ var _partialRight_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./partialRight.js */ "./node_modules/lodash-es/partialRight.js");
- /* harmony import */ var _rearg_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./rearg.js */ "./node_modules/lodash-es/rearg.js");
- /* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./rest.js */ "./node_modules/lodash-es/rest.js");
- /* harmony import */ var _spread_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./spread.js */ "./node_modules/lodash-es/spread.js");
- /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/lodash-es/throttle.js");
- /* harmony import */ var _unary_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./unary.js */ "./node_modules/lodash-es/unary.js");
- /* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/lodash-es/wrap.js");
- /* harmony default export */ __webpack_exports__["default"] = ({
- after: _after_js__WEBPACK_IMPORTED_MODULE_0__["default"], ary: _ary_js__WEBPACK_IMPORTED_MODULE_1__["default"], before: _before_js__WEBPACK_IMPORTED_MODULE_2__["default"], bind: _bind_js__WEBPACK_IMPORTED_MODULE_3__["default"], bindKey: _bindKey_js__WEBPACK_IMPORTED_MODULE_4__["default"],
- curry: _curry_js__WEBPACK_IMPORTED_MODULE_5__["default"], curryRight: _curryRight_js__WEBPACK_IMPORTED_MODULE_6__["default"], debounce: _debounce_js__WEBPACK_IMPORTED_MODULE_7__["default"], defer: _defer_js__WEBPACK_IMPORTED_MODULE_8__["default"], delay: _delay_js__WEBPACK_IMPORTED_MODULE_9__["default"],
- flip: _flip_js__WEBPACK_IMPORTED_MODULE_10__["default"], memoize: _memoize_js__WEBPACK_IMPORTED_MODULE_11__["default"], negate: _negate_js__WEBPACK_IMPORTED_MODULE_12__["default"], once: _once_js__WEBPACK_IMPORTED_MODULE_13__["default"], overArgs: _overArgs_js__WEBPACK_IMPORTED_MODULE_14__["default"],
- partial: _partial_js__WEBPACK_IMPORTED_MODULE_15__["default"], partialRight: _partialRight_js__WEBPACK_IMPORTED_MODULE_16__["default"], rearg: _rearg_js__WEBPACK_IMPORTED_MODULE_17__["default"], rest: _rest_js__WEBPACK_IMPORTED_MODULE_18__["default"], spread: _spread_js__WEBPACK_IMPORTED_MODULE_19__["default"],
- throttle: _throttle_js__WEBPACK_IMPORTED_MODULE_20__["default"], unary: _unary_js__WEBPACK_IMPORTED_MODULE_21__["default"], wrap: _wrap_js__WEBPACK_IMPORTED_MODULE_22__["default"]
- });
- /***/ }),
- /***/ "./node_modules/lodash-es/function.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/function.js ***!
- \********************************************/
- /*! exports provided: after, ary, before, bind, bindKey, curry, curryRight, debounce, defer, delay, flip, memoize, negate, once, overArgs, partial, partialRight, rearg, rest, spread, throttle, unary, wrap, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./after.js */ "./node_modules/lodash-es/after.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "after", function() { return _after_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ary", function() { return _ary_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "before", function() { return _before_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return _bind_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _bindKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bindKey.js */ "./node_modules/lodash-es/bindKey.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindKey", function() { return _bindKey_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curry.js */ "./node_modules/lodash-es/curry.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curry", function() { return _curry_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _curryRight_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./curryRight.js */ "./node_modules/lodash-es/curryRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curryRight", function() { return _curryRight_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _debounce_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./defer.js */ "./node_modules/lodash-es/defer.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _defer_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./delay.js */ "./node_modules/lodash-es/delay.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _delay_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flip.js */ "./node_modules/lodash-es/flip.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flip", function() { return _flip_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return _memoize_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return _negate_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./once.js */ "./node_modules/lodash-es/once.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "once", function() { return _once_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _overArgs_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./overArgs.js */ "./node_modules/lodash-es/overArgs.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overArgs", function() { return _overArgs_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return _partial_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /* harmony import */ var _partialRight_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./partialRight.js */ "./node_modules/lodash-es/partialRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partialRight", function() { return _partialRight_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
- /* harmony import */ var _rearg_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./rearg.js */ "./node_modules/lodash-es/rearg.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rearg", function() { return _rearg_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./rest.js */ "./node_modules/lodash-es/rest.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return _rest_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
- /* harmony import */ var _spread_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./spread.js */ "./node_modules/lodash-es/spread.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "spread", function() { return _spread_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/lodash-es/throttle.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _throttle_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /* harmony import */ var _unary_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./unary.js */ "./node_modules/lodash-es/unary.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unary", function() { return _unary_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
- /* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/lodash-es/wrap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _wrap_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
- /* harmony import */ var _function_default_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./function.default.js */ "./node_modules/lodash-es/function.default.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _function_default_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/functions.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/functions.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * Creates an array of function property names from own enumerable properties
- * of `object`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to inspect.
- * @returns {Array} Returns the function names.
- * @see _.functionsIn
- * @example
- *
- * function Foo() {
- * this.a = _.constant('a');
- * this.b = _.constant('b');
- * }
- *
- * Foo.prototype.c = _.constant('c');
- *
- * _.functions(new Foo);
- * // => ['a', 'b']
- */
- function functions(object) {
- return object == null ? [] : Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
- }
- /* harmony default export */ __webpack_exports__["default"] = (functions);
- /***/ }),
- /***/ "./node_modules/lodash-es/functionsIn.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/functionsIn.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /**
- * Creates an array of function property names from own and inherited
- * enumerable properties of `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to inspect.
- * @returns {Array} Returns the function names.
- * @see _.functions
- * @example
- *
- * function Foo() {
- * this.a = _.constant('a');
- * this.b = _.constant('b');
- * }
- *
- * Foo.prototype.c = _.constant('c');
- *
- * _.functionsIn(new Foo);
- * // => ['a', 'b', 'c']
- */
- function functionsIn(object) {
- return object == null ? [] : Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
- }
- /* harmony default export */ __webpack_exports__["default"] = (functionsIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/get.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/get.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
- /**
- * Gets the value at `path` of `object`. If the resolved value is
- * `undefined`, the `defaultValue` is returned in its place.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to get.
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.get(object, 'a[0].b.c');
- * // => 3
- *
- * _.get(object, ['a', '0', 'b', 'c']);
- * // => 3
- *
- * _.get(object, 'a.b.c', 'default');
- * // => 'default'
- */
- function get(object, path, defaultValue) {
- var result = object == null ? undefined : Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
- return result === undefined ? defaultValue : result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (get);
- /***/ }),
- /***/ "./node_modules/lodash-es/groupBy.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/groupBy.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
- /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` thru `iteratee`. The order of grouped values
- * is determined by the order they occur in `collection`. The corresponding
- * value of each key is an array of elements responsible for generating the
- * key. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.groupBy([6.1, 4.2, 6.3], Math.floor);
- * // => { '4': [4.2], '6': [6.1, 6.3] }
- *
- * // The `_.property` iteratee shorthand.
- * _.groupBy(['one', 'two', 'three'], 'length');
- * // => { '3': ['one', 'two'], '5': ['three'] }
- */
- var groupBy = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
- if (hasOwnProperty.call(result, key)) {
- result[key].push(value);
- } else {
- Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, [value]);
- }
- });
- /* harmony default export */ __webpack_exports__["default"] = (groupBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/gt.js":
- /*!**************************************!*\
- !*** ./node_modules/lodash-es/gt.js ***!
- \**************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGt.js */ "./node_modules/lodash-es/_baseGt.js");
- /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
- /**
- * Checks if `value` is greater than `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than `other`,
- * else `false`.
- * @see _.lt
- * @example
- *
- * _.gt(3, 1);
- * // => true
- *
- * _.gt(3, 3);
- * // => false
- *
- * _.gt(1, 3);
- * // => false
- */
- var gt = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseGt_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (gt);
- /***/ }),
- /***/ "./node_modules/lodash-es/gte.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/gte.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
- /**
- * Checks if `value` is greater than or equal to `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than or equal to
- * `other`, else `false`.
- * @see _.lte
- * @example
- *
- * _.gte(3, 1);
- * // => true
- *
- * _.gte(3, 3);
- * // => true
- *
- * _.gte(1, 3);
- * // => false
- */
- var gte = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(value, other) {
- return value >= other;
- });
- /* harmony default export */ __webpack_exports__["default"] = (gte);
- /***/ }),
- /***/ "./node_modules/lodash-es/has.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/has.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseHas_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseHas.js */ "./node_modules/lodash-es/_baseHas.js");
- /* harmony import */ var _hasPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasPath.js */ "./node_modules/lodash-es/_hasPath.js");
- /**
- * Checks if `path` is a direct property of `object`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
- * @example
- *
- * var object = { 'a': { 'b': 2 } };
- * var other = _.create({ 'a': _.create({ 'b': 2 }) });
- *
- * _.has(object, 'a');
- * // => true
- *
- * _.has(object, 'a.b');
- * // => true
- *
- * _.has(object, ['a', 'b']);
- * // => true
- *
- * _.has(other, 'a');
- * // => false
- */
- function has(object, path) {
- return object != null && Object(_hasPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path, _baseHas_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (has);
- /***/ }),
- /***/ "./node_modules/lodash-es/hasIn.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/hasIn.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseHasIn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseHasIn.js */ "./node_modules/lodash-es/_baseHasIn.js");
- /* harmony import */ var _hasPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasPath.js */ "./node_modules/lodash-es/_hasPath.js");
- /**
- * Checks if `path` is a direct or inherited property of `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
- * @example
- *
- * var object = _.create({ 'a': _.create({ 'b': 2 }) });
- *
- * _.hasIn(object, 'a');
- * // => true
- *
- * _.hasIn(object, 'a.b');
- * // => true
- *
- * _.hasIn(object, ['a', 'b']);
- * // => true
- *
- * _.hasIn(object, 'b');
- * // => false
- */
- function hasIn(object, path) {
- return object != null && Object(_hasPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path, _baseHasIn_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (hasIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/head.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/head.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Gets the first element of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @alias first
- * @category Array
- * @param {Array} array The array to query.
- * @returns {*} Returns the first element of `array`.
- * @example
- *
- * _.head([1, 2, 3]);
- * // => 1
- *
- * _.head([]);
- * // => undefined
- */
- function head(array) {
- return (array && array.length) ? array[0] : undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (head);
- /***/ }),
- /***/ "./node_modules/lodash-es/identity.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/identity.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This method returns the first argument it receives.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {*} value Any value.
- * @returns {*} Returns `value`.
- * @example
- *
- * var object = { 'a': 1 };
- *
- * console.log(_.identity(object) === object);
- * // => true
- */
- function identity(value) {
- return value;
- }
- /* harmony default export */ __webpack_exports__["default"] = (identity);
- /***/ }),
- /***/ "./node_modules/lodash-es/inRange.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/inRange.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseInRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInRange.js */ "./node_modules/lodash-es/_baseInRange.js");
- /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
- /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
- /**
- * Checks if `n` is between `start` and up to, but not including, `end`. If
- * `end` is not specified, it's set to `start` with `start` then set to `0`.
- * If `start` is greater than `end` the params are swapped to support
- * negative ranges.
- *
- * @static
- * @memberOf _
- * @since 3.3.0
- * @category Number
- * @param {number} number The number to check.
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
- * @see _.range, _.rangeRight
- * @example
- *
- * _.inRange(3, 2, 4);
- * // => true
- *
- * _.inRange(4, 8);
- * // => true
- *
- * _.inRange(4, 2);
- * // => false
- *
- * _.inRange(2, 2);
- * // => false
- *
- * _.inRange(1.2, 2);
- * // => true
- *
- * _.inRange(5.2, 4);
- * // => false
- *
- * _.inRange(-3, -2, -6);
- * // => true
- */
- function inRange(number, start, end) {
- start = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start);
- if (end === undefined) {
- end = start;
- start = 0;
- } else {
- end = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_1__["default"])(end);
- }
- number = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(number);
- return Object(_baseInRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])(number, start, end);
- }
- /* harmony default export */ __webpack_exports__["default"] = (inRange);
- /***/ }),
- /***/ "./node_modules/lodash-es/includes.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/includes.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max;
- /**
- * Checks if `value` is in `collection`. If `collection` is a string, it's
- * checked for a substring of `value`, otherwise
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * is used for equality comparisons. If `fromIndex` is negative, it's used as
- * the offset from the end of `collection`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object|string} collection The collection to inspect.
- * @param {*} value The value to search for.
- * @param {number} [fromIndex=0] The index to search from.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
- * @returns {boolean} Returns `true` if `value` is found, else `false`.
- * @example
- *
- * _.includes([1, 2, 3], 1);
- * // => true
- *
- * _.includes([1, 2, 3], 1, 2);
- * // => false
- *
- * _.includes({ 'a': 1, 'b': 2 }, 1);
- * // => true
- *
- * _.includes('abcd', 'bc');
- * // => true
- */
- function includes(collection, value, fromIndex, guard) {
- collection = Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection) ? collection : Object(_values_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection);
- fromIndex = (fromIndex && !guard) ? Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fromIndex) : 0;
- var length = collection.length;
- if (fromIndex < 0) {
- fromIndex = nativeMax(length + fromIndex, 0);
- }
- return Object(_isString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection)
- ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
- : (!!length && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, value, fromIndex) > -1);
- }
- /* harmony default export */ __webpack_exports__["default"] = (includes);
- /***/ }),
- /***/ "./node_modules/lodash-es/indexOf.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/indexOf.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max;
- /**
- * Gets the index at which the first occurrence of `value` is found in `array`
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons. If `fromIndex` is negative, it's used as the
- * offset from the end of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.indexOf([1, 2, 1, 2], 2);
- * // => 1
- *
- * // Search from the `fromIndex`.
- * _.indexOf([1, 2, 1, 2], 2, 2);
- * // => 3
- */
- function indexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, index);
- }
- /* harmony default export */ __webpack_exports__["default"] = (indexOf);
- /***/ }),
- /***/ "./node_modules/lodash-es/initial.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/initial.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
- /**
- * Gets all but the last element of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to query.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.initial([1, 2, 3]);
- * // => [1, 2]
- */
- function initial(array) {
- var length = array == null ? 0 : array.length;
- return length ? Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 0, -1) : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (initial);
- /***/ }),
- /***/ "./node_modules/lodash-es/intersection.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/intersection.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIntersection.js */ "./node_modules/lodash-es/_baseIntersection.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castArrayLikeObject.js */ "./node_modules/lodash-es/_castArrayLikeObject.js");
- /**
- * Creates an array of unique values that are included in all given arrays
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons. The order and references of result values are
- * determined by the first array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of intersecting values.
- * @example
- *
- * _.intersection([2, 1], [2, 3]);
- * // => [2]
- */
- var intersection = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
- var mapped = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
- return (mapped.length && mapped[0] === arrays[0])
- ? Object(_baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__["default"])(mapped)
- : [];
- });
- /* harmony default export */ __webpack_exports__["default"] = (intersection);
- /***/ }),
- /***/ "./node_modules/lodash-es/intersectionBy.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/intersectionBy.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIntersection.js */ "./node_modules/lodash-es/_baseIntersection.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_castArrayLikeObject.js */ "./node_modules/lodash-es/_castArrayLikeObject.js");
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /**
- * This method is like `_.intersection` except that it accepts `iteratee`
- * which is invoked for each element of each `arrays` to generate the criterion
- * by which they're compared. The order and references of result values are
- * determined by the first array. The iteratee is invoked with one argument:
- * (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of intersecting values.
- * @example
- *
- * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
- * // => [2.1]
- *
- * // The `_.property` iteratee shorthand.
- * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }]
- */
- var intersectionBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(arrays) {
- var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrays),
- mapped = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
- if (iteratee === Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(mapped)) {
- iteratee = undefined;
- } else {
- mapped.pop();
- }
- return (mapped.length && mapped[0] === arrays[0])
- ? Object(_baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__["default"])(mapped, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2))
- : [];
- });
- /* harmony default export */ __webpack_exports__["default"] = (intersectionBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/intersectionWith.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/intersectionWith.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIntersection.js */ "./node_modules/lodash-es/_baseIntersection.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castArrayLikeObject.js */ "./node_modules/lodash-es/_castArrayLikeObject.js");
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /**
- * This method is like `_.intersection` except that it accepts `comparator`
- * which is invoked to compare elements of `arrays`. The order and references
- * of result values are determined by the first array. The comparator is
- * invoked with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of intersecting values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.intersectionWith(objects, others, _.isEqual);
- * // => [{ 'x': 1, 'y': 2 }]
- */
- var intersectionWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
- var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(arrays),
- mapped = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
- comparator = typeof comparator == 'function' ? comparator : undefined;
- if (comparator) {
- mapped.pop();
- }
- return (mapped.length && mapped[0] === arrays[0])
- ? Object(_baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__["default"])(mapped, undefined, comparator)
- : [];
- });
- /* harmony default export */ __webpack_exports__["default"] = (intersectionWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/invert.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/invert.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
- /* harmony import */ var _createInverter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createInverter.js */ "./node_modules/lodash-es/_createInverter.js");
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var nativeObjectToString = objectProto.toString;
- /**
- * Creates an object composed of the inverted keys and values of `object`.
- * If `object` contains duplicate values, subsequent values overwrite
- * property assignments of previous values.
- *
- * @static
- * @memberOf _
- * @since 0.7.0
- * @category Object
- * @param {Object} object The object to invert.
- * @returns {Object} Returns the new inverted object.
- * @example
- *
- * var object = { 'a': 1, 'b': 2, 'c': 1 };
- *
- * _.invert(object);
- * // => { '1': 'c', '2': 'b' }
- */
- var invert = Object(_createInverter_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
- if (value != null &&
- typeof value.toString != 'function') {
- value = nativeObjectToString.call(value);
- }
- result[value] = key;
- }, Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_identity_js__WEBPACK_IMPORTED_MODULE_2__["default"]));
- /* harmony default export */ __webpack_exports__["default"] = (invert);
- /***/ }),
- /***/ "./node_modules/lodash-es/invertBy.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/invertBy.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _createInverter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createInverter.js */ "./node_modules/lodash-es/_createInverter.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var nativeObjectToString = objectProto.toString;
- /**
- * This method is like `_.invert` except that the inverted object is generated
- * from the results of running each element of `object` thru `iteratee`. The
- * corresponding inverted value of each inverted key is an array of keys
- * responsible for generating the inverted value. The iteratee is invoked
- * with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.1.0
- * @category Object
- * @param {Object} object The object to invert.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Object} Returns the new inverted object.
- * @example
- *
- * var object = { 'a': 1, 'b': 2, 'c': 1 };
- *
- * _.invertBy(object);
- * // => { '1': ['a', 'c'], '2': ['b'] }
- *
- * _.invertBy(object, function(value) {
- * return 'group' + value;
- * });
- * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
- */
- var invertBy = Object(_createInverter_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
- if (value != null &&
- typeof value.toString != 'function') {
- value = nativeObjectToString.call(value);
- }
- if (hasOwnProperty.call(result, value)) {
- result[value].push(key);
- } else {
- result[value] = [key];
- }
- }, _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (invertBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/invoke.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/invoke.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /**
- * Invokes the method at `path` of `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the method to invoke.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {*} Returns the result of the invoked method.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
- *
- * _.invoke(object, 'a[0].b.c.slice', 1, 3);
- * // => [2, 3]
- */
- var invoke = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (invoke);
- /***/ }),
- /***/ "./node_modules/lodash-es/invokeMap.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/invokeMap.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
- /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
- /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /**
- * Invokes the method at `path` of each element in `collection`, returning
- * an array of the results of each invoked method. Any additional arguments
- * are provided to each invoked method. If `path` is a function, it's invoked
- * for, and `this` bound to, each element in `collection`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Array|Function|string} path The path of the method to invoke or
- * the function invoked per iteration.
- * @param {...*} [args] The arguments to invoke each method with.
- * @returns {Array} Returns the array of results.
- * @example
- *
- * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
- * // => [[1, 5, 7], [1, 2, 3]]
- *
- * _.invokeMap([123, 456], String.prototype.split, '');
- * // => [['1', '2', '3'], ['4', '5', '6']]
- */
- var invokeMap = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(collection, path, args) {
- var index = -1,
- isFunc = typeof path == 'function',
- result = Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) ? Array(collection.length) : [];
- Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, function(value) {
- result[++index] = isFunc ? Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, value, args) : Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value, path, args);
- });
- return result;
- });
- /* harmony default export */ __webpack_exports__["default"] = (invokeMap);
- /***/ }),
- /***/ "./node_modules/lodash-es/isArguments.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/isArguments.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsArguments.js */ "./node_modules/lodash-es/_baseIsArguments.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /** Built-in value references. */
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
- /**
- * Checks if `value` is likely an `arguments` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- * else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
- var isArguments = Object(_baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function() { return arguments; }()) ? _baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"] : function(value) {
- return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && hasOwnProperty.call(value, 'callee') &&
- !propertyIsEnumerable.call(value, 'callee');
- };
- /* harmony default export */ __webpack_exports__["default"] = (isArguments);
- /***/ }),
- /***/ "./node_modules/lodash-es/isArray.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/isArray.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(document.body.children);
- * // => false
- *
- * _.isArray('abc');
- * // => false
- *
- * _.isArray(_.noop);
- * // => false
- */
- var isArray = Array.isArray;
- /* harmony default export */ __webpack_exports__["default"] = (isArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/isArrayBuffer.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/isArrayBuffer.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsArrayBuffer.js */ "./node_modules/lodash-es/_baseIsArrayBuffer.js");
- /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
- /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
- /* Node.js helper references. */
- var nodeIsArrayBuffer = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isArrayBuffer;
- /**
- * Checks if `value` is classified as an `ArrayBuffer` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
- * @example
- *
- * _.isArrayBuffer(new ArrayBuffer(2));
- * // => true
- *
- * _.isArrayBuffer(new Array(2));
- * // => false
- */
- var isArrayBuffer = nodeIsArrayBuffer ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsArrayBuffer) : _baseIsArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (isArrayBuffer);
- /***/ }),
- /***/ "./node_modules/lodash-es/isArrayLike.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/isArrayLike.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
- /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
- /**
- * Checks if `value` is array-like. A value is considered array-like if it's
- * not a function and has a `value.length` that's an integer greater than or
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- * @example
- *
- * _.isArrayLike([1, 2, 3]);
- * // => true
- *
- * _.isArrayLike(document.body.children);
- * // => true
- *
- * _.isArrayLike('abc');
- * // => true
- *
- * _.isArrayLike(_.noop);
- * // => false
- */
- function isArrayLike(value) {
- return value != null && Object(_isLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value.length) && !Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isArrayLike);
- /***/ }),
- /***/ "./node_modules/lodash-es/isArrayLikeObject.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/isArrayLikeObject.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /**
- * This method is like `_.isArrayLike` except that it also checks if `value`
- * is an object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array-like object,
- * else `false`.
- * @example
- *
- * _.isArrayLikeObject([1, 2, 3]);
- * // => true
- *
- * _.isArrayLikeObject(document.body.children);
- * // => true
- *
- * _.isArrayLikeObject('abc');
- * // => false
- *
- * _.isArrayLikeObject(_.noop);
- * // => false
- */
- function isArrayLikeObject(value) {
- return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isArrayLikeObject);
- /***/ }),
- /***/ "./node_modules/lodash-es/isBoolean.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/isBoolean.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var boolTag = '[object Boolean]';
- /**
- * Checks if `value` is classified as a boolean primitive or object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
- * @example
- *
- * _.isBoolean(false);
- * // => true
- *
- * _.isBoolean(null);
- * // => false
- */
- function isBoolean(value) {
- return value === true || value === false ||
- (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == boolTag);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isBoolean);
- /***/ }),
- /***/ "./node_modules/lodash-es/isBuffer.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/isBuffer.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
- /** Detect free variable `exports`. */
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
- /** Detect free variable `module`. */
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
- /** Detect the popular CommonJS extension `module.exports`. */
- var moduleExports = freeModule && freeModule.exports === freeExports;
- /** Built-in value references. */
- var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Buffer : undefined;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
- /**
- * Checks if `value` is a buffer.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
- * @example
- *
- * _.isBuffer(new Buffer(2));
- * // => true
- *
- * _.isBuffer(new Uint8Array(2));
- * // => false
- */
- var isBuffer = nativeIsBuffer || _stubFalse_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (isBuffer);
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
- /***/ }),
- /***/ "./node_modules/lodash-es/isDate.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/isDate.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsDate.js */ "./node_modules/lodash-es/_baseIsDate.js");
- /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
- /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
- /* Node.js helper references. */
- var nodeIsDate = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isDate;
- /**
- * Checks if `value` is classified as a `Date` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
- * @example
- *
- * _.isDate(new Date);
- * // => true
- *
- * _.isDate('Mon April 23 2012');
- * // => false
- */
- var isDate = nodeIsDate ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsDate) : _baseIsDate_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (isDate);
- /***/ }),
- /***/ "./node_modules/lodash-es/isElement.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/isElement.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
- /**
- * Checks if `value` is likely a DOM element.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
- * @example
- *
- * _.isElement(document.body);
- * // => true
- *
- * _.isElement('<body>');
- * // => false
- */
- function isElement(value) {
- return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && value.nodeType === 1 && !Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isElement);
- /***/ }),
- /***/ "./node_modules/lodash-es/isEmpty.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/isEmpty.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
- /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
- /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
- /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
- /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
- /** `Object#toString` result references. */
- var mapTag = '[object Map]',
- setTag = '[object Set]';
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Checks if `value` is an empty object, collection, map, or set.
- *
- * Objects are considered empty if they have no own enumerable string keyed
- * properties.
- *
- * Array-like values such as `arguments` objects, arrays, buffers, strings, or
- * jQuery-like collections are considered empty if they have a `length` of `0`.
- * Similarly, maps and sets are considered empty if they have a `size` of `0`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is empty, else `false`.
- * @example
- *
- * _.isEmpty(null);
- * // => true
- *
- * _.isEmpty(true);
- * // => true
- *
- * _.isEmpty(1);
- * // => true
- *
- * _.isEmpty([1, 2, 3]);
- * // => false
- *
- * _.isEmpty({ 'a': 1 });
- * // => false
- */
- function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value) &&
- (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) || typeof value == 'string' || typeof value.splice == 'function' ||
- Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value) || Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__["default"])(value) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value))) {
- return !value.length;
- }
- var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
- if (tag == mapTag || tag == setTag) {
- return !value.size;
- }
- if (Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value)) {
- return !Object(_baseKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value).length;
- }
- for (var key in value) {
- if (hasOwnProperty.call(value, key)) {
- return false;
- }
- }
- return true;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isEmpty);
- /***/ }),
- /***/ "./node_modules/lodash-es/isEqual.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/isEqual.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
- /**
- * Performs a deep comparison between two values to determine if they are
- * equivalent.
- *
- * **Note:** This method supports comparing arrays, array buffers, booleans,
- * date objects, error objects, maps, numbers, `Object` objects, regexes,
- * sets, strings, symbols, and typed arrays. `Object` objects are compared
- * by their own, not inherited, enumerable properties. Functions and DOM
- * nodes are compared by strict equality, i.e. `===`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'a': 1 };
- * var other = { 'a': 1 };
- *
- * _.isEqual(object, other);
- * // => true
- *
- * object === other;
- * // => false
- */
- function isEqual(value, other) {
- return Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isEqual);
- /***/ }),
- /***/ "./node_modules/lodash-es/isEqualWith.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/isEqualWith.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
- /**
- * This method is like `_.isEqual` except that it accepts `customizer` which
- * is invoked to compare values. If `customizer` returns `undefined`, comparisons
- * are handled by the method instead. The `customizer` is invoked with up to
- * six arguments: (objValue, othValue [, index|key, object, other, stack]).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {Function} [customizer] The function to customize comparisons.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * function isGreeting(value) {
- * return /^h(?:i|ello)$/.test(value);
- * }
- *
- * function customizer(objValue, othValue) {
- * if (isGreeting(objValue) && isGreeting(othValue)) {
- * return true;
- * }
- * }
- *
- * var array = ['hello', 'goodbye'];
- * var other = ['hi', 'goodbye'];
- *
- * _.isEqualWith(array, other, customizer);
- * // => true
- */
- function isEqualWith(value, other, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- var result = customizer ? customizer(value, other) : undefined;
- return result === undefined ? Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other, undefined, customizer) : !!result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isEqualWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/isError.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/isError.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
- /** `Object#toString` result references. */
- var domExcTag = '[object DOMException]',
- errorTag = '[object Error]';
- /**
- * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
- * `SyntaxError`, `TypeError`, or `URIError` object.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
- * @example
- *
- * _.isError(new Error);
- * // => true
- *
- * _.isError(Error);
- * // => false
- */
- function isError(value) {
- if (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
- return false;
- }
- var tag = Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- return tag == errorTag || tag == domExcTag ||
- (typeof value.message == 'string' && typeof value.name == 'string' && !Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value));
- }
- /* harmony default export */ __webpack_exports__["default"] = (isError);
- /***/ }),
- /***/ "./node_modules/lodash-es/isFinite.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/isFinite.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeIsFinite = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFinite;
- /**
- * Checks if `value` is a finite primitive number.
- *
- * **Note:** This method is based on
- * [`Number.isFinite`](https://mdn.io/Number/isFinite).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
- * @example
- *
- * _.isFinite(3);
- * // => true
- *
- * _.isFinite(Number.MIN_VALUE);
- * // => true
- *
- * _.isFinite(Infinity);
- * // => false
- *
- * _.isFinite('3');
- * // => false
- */
- function isFinite(value) {
- return typeof value == 'number' && nativeIsFinite(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isFinite);
- /***/ }),
- /***/ "./node_modules/lodash-es/isFunction.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/isFunction.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /** `Object#toString` result references. */
- var asyncTag = '[object AsyncFunction]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]',
- proxyTag = '[object Proxy]';
- /**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
- function isFunction(value) {
- if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
- return false;
- }
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
- var tag = Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isFunction);
- /***/ }),
- /***/ "./node_modules/lodash-es/isInteger.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/isInteger.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /**
- * Checks if `value` is an integer.
- *
- * **Note:** This method is based on
- * [`Number.isInteger`](https://mdn.io/Number/isInteger).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
- * @example
- *
- * _.isInteger(3);
- * // => true
- *
- * _.isInteger(Number.MIN_VALUE);
- * // => false
- *
- * _.isInteger(Infinity);
- * // => false
- *
- * _.isInteger('3');
- * // => false
- */
- function isInteger(value) {
- return typeof value == 'number' && value == Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isInteger);
- /***/ }),
- /***/ "./node_modules/lodash-es/isLength.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/isLength.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used as references for various `Number` constants. */
- var MAX_SAFE_INTEGER = 9007199254740991;
- /**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This method is loosely based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- * @example
- *
- * _.isLength(3);
- * // => true
- *
- * _.isLength(Number.MIN_VALUE);
- * // => false
- *
- * _.isLength(Infinity);
- * // => false
- *
- * _.isLength('3');
- * // => false
- */
- function isLength(value) {
- return typeof value == 'number' &&
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isLength);
- /***/ }),
- /***/ "./node_modules/lodash-es/isMap.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/isMap.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMap.js */ "./node_modules/lodash-es/_baseIsMap.js");
- /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
- /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
- /* Node.js helper references. */
- var nodeIsMap = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isMap;
- /**
- * Checks if `value` is classified as a `Map` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
- * @example
- *
- * _.isMap(new Map);
- * // => true
- *
- * _.isMap(new WeakMap);
- * // => false
- */
- var isMap = nodeIsMap ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsMap) : _baseIsMap_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (isMap);
- /***/ }),
- /***/ "./node_modules/lodash-es/isMatch.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/isMatch.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMatch.js */ "./node_modules/lodash-es/_baseIsMatch.js");
- /* harmony import */ var _getMatchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getMatchData.js */ "./node_modules/lodash-es/_getMatchData.js");
- /**
- * Performs a partial deep comparison between `object` and `source` to
- * determine if `object` contains equivalent property values.
- *
- * **Note:** This method is equivalent to `_.matches` when `source` is
- * partially applied.
- *
- * Partial comparisons will match empty array and empty object `source`
- * values against any array or object value, respectively. See `_.isEqual`
- * for a list of supported value comparisons.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- *
- * _.isMatch(object, { 'b': 2 });
- * // => true
- *
- * _.isMatch(object, { 'b': 1 });
- * // => false
- */
- function isMatch(object, source) {
- return object === source || Object(_baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, Object(_getMatchData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source));
- }
- /* harmony default export */ __webpack_exports__["default"] = (isMatch);
- /***/ }),
- /***/ "./node_modules/lodash-es/isMatchWith.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/isMatchWith.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMatch.js */ "./node_modules/lodash-es/_baseIsMatch.js");
- /* harmony import */ var _getMatchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getMatchData.js */ "./node_modules/lodash-es/_getMatchData.js");
- /**
- * This method is like `_.isMatch` except that it accepts `customizer` which
- * is invoked to compare values. If `customizer` returns `undefined`, comparisons
- * are handled by the method instead. The `customizer` is invoked with five
- * arguments: (objValue, srcValue, index|key, object, source).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @param {Function} [customizer] The function to customize comparisons.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- * @example
- *
- * function isGreeting(value) {
- * return /^h(?:i|ello)$/.test(value);
- * }
- *
- * function customizer(objValue, srcValue) {
- * if (isGreeting(objValue) && isGreeting(srcValue)) {
- * return true;
- * }
- * }
- *
- * var object = { 'greeting': 'hello' };
- * var source = { 'greeting': 'hi' };
- *
- * _.isMatchWith(object, source, customizer);
- * // => true
- */
- function isMatchWith(object, source, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return Object(_baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, Object(_getMatchData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), customizer);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isMatchWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/isNaN.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/isNaN.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
- /**
- * Checks if `value` is `NaN`.
- *
- * **Note:** This method is based on
- * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
- * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
- * `undefined` and other non-number values.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
- * @example
- *
- * _.isNaN(NaN);
- * // => true
- *
- * _.isNaN(new Number(NaN));
- * // => true
- *
- * isNaN(undefined);
- * // => true
- *
- * _.isNaN(undefined);
- * // => false
- */
- function isNaN(value) {
- // An `NaN` primitive is the only value that is not equal to itself.
- // Perform the `toStringTag` check first to avoid errors with some
- // ActiveX objects in IE.
- return Object(_isNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && value != +value;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isNaN);
- /***/ }),
- /***/ "./node_modules/lodash-es/isNative.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/isNative.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsNative.js */ "./node_modules/lodash-es/_baseIsNative.js");
- /* harmony import */ var _isMaskable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isMaskable.js */ "./node_modules/lodash-es/_isMaskable.js");
- /** Error message constants. */
- var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.';
- /**
- * Checks if `value` is a pristine native function.
- *
- * **Note:** This method can't reliably detect native functions in the presence
- * of the core-js package because core-js circumvents this kind of detection.
- * Despite multiple requests, the core-js maintainer has made it clear: any
- * attempt to fix the detection will be obstructed. As a result, we're left
- * with little choice but to throw an error. Unfortunately, this also affects
- * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
- * which rely on core-js.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function,
- * else `false`.
- * @example
- *
- * _.isNative(Array.prototype.push);
- * // => true
- *
- * _.isNative(_);
- * // => false
- */
- function isNative(value) {
- if (Object(_isMaskable_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
- throw new Error(CORE_ERROR_TEXT);
- }
- return Object(_baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isNative);
- /***/ }),
- /***/ "./node_modules/lodash-es/isNil.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/isNil.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Checks if `value` is `null` or `undefined`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
- * @example
- *
- * _.isNil(null);
- * // => true
- *
- * _.isNil(void 0);
- * // => true
- *
- * _.isNil(NaN);
- * // => false
- */
- function isNil(value) {
- return value == null;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isNil);
- /***/ }),
- /***/ "./node_modules/lodash-es/isNull.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/isNull.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Checks if `value` is `null`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
- * @example
- *
- * _.isNull(null);
- * // => true
- *
- * _.isNull(void 0);
- * // => false
- */
- function isNull(value) {
- return value === null;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isNull);
- /***/ }),
- /***/ "./node_modules/lodash-es/isNumber.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/isNumber.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var numberTag = '[object Number]';
- /**
- * Checks if `value` is classified as a `Number` primitive or object.
- *
- * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
- * classified as numbers, use the `_.isFinite` method.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a number, else `false`.
- * @example
- *
- * _.isNumber(3);
- * // => true
- *
- * _.isNumber(Number.MIN_VALUE);
- * // => true
- *
- * _.isNumber(Infinity);
- * // => true
- *
- * _.isNumber('3');
- * // => false
- */
- function isNumber(value) {
- return typeof value == 'number' ||
- (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == numberTag);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isNumber);
- /***/ }),
- /***/ "./node_modules/lodash-es/isObject.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/isObject.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
- function isObject(value) {
- var type = typeof value;
- return value != null && (type == 'object' || type == 'function');
- }
- /* harmony default export */ __webpack_exports__["default"] = (isObject);
- /***/ }),
- /***/ "./node_modules/lodash-es/isObjectLike.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/isObjectLike.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
- function isObjectLike(value) {
- return value != null && typeof value == 'object';
- }
- /* harmony default export */ __webpack_exports__["default"] = (isObjectLike);
- /***/ }),
- /***/ "./node_modules/lodash-es/isPlainObject.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/isPlainObject.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var objectTag = '[object Object]';
- /** Used for built-in method references. */
- var funcProto = Function.prototype,
- objectProto = Object.prototype;
- /** Used to resolve the decompiled source of functions. */
- var funcToString = funcProto.toString;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /** Used to infer the `Object` constructor. */
- var objectCtorString = funcToString.call(Object);
- /**
- * Checks if `value` is a plain object, that is, an object created by the
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
- *
- * @static
- * @memberOf _
- * @since 0.8.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * _.isPlainObject(new Foo);
- * // => false
- *
- * _.isPlainObject([1, 2, 3]);
- * // => false
- *
- * _.isPlainObject({ 'x': 0, 'y': 0 });
- * // => true
- *
- * _.isPlainObject(Object.create(null));
- * // => true
- */
- function isPlainObject(value) {
- if (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) != objectTag) {
- return false;
- }
- var proto = Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
- if (proto === null) {
- return true;
- }
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
- return typeof Ctor == 'function' && Ctor instanceof Ctor &&
- funcToString.call(Ctor) == objectCtorString;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isPlainObject);
- /***/ }),
- /***/ "./node_modules/lodash-es/isRegExp.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/isRegExp.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsRegExp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsRegExp.js */ "./node_modules/lodash-es/_baseIsRegExp.js");
- /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
- /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
- /* Node.js helper references. */
- var nodeIsRegExp = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isRegExp;
- /**
- * Checks if `value` is classified as a `RegExp` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
- * @example
- *
- * _.isRegExp(/abc/);
- * // => true
- *
- * _.isRegExp('/abc/');
- * // => false
- */
- var isRegExp = nodeIsRegExp ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsRegExp) : _baseIsRegExp_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (isRegExp);
- /***/ }),
- /***/ "./node_modules/lodash-es/isSafeInteger.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/isSafeInteger.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
- /** Used as references for various `Number` constants. */
- var MAX_SAFE_INTEGER = 9007199254740991;
- /**
- * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
- * double precision number which isn't the result of a rounded unsafe integer.
- *
- * **Note:** This method is based on
- * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
- * @example
- *
- * _.isSafeInteger(3);
- * // => true
- *
- * _.isSafeInteger(Number.MIN_VALUE);
- * // => false
- *
- * _.isSafeInteger(Infinity);
- * // => false
- *
- * _.isSafeInteger('3');
- * // => false
- */
- function isSafeInteger(value) {
- return Object(_isInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isSafeInteger);
- /***/ }),
- /***/ "./node_modules/lodash-es/isSet.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/isSet.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsSet.js */ "./node_modules/lodash-es/_baseIsSet.js");
- /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
- /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
- /* Node.js helper references. */
- var nodeIsSet = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isSet;
- /**
- * Checks if `value` is classified as a `Set` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
- * @example
- *
- * _.isSet(new Set);
- * // => true
- *
- * _.isSet(new WeakSet);
- * // => false
- */
- var isSet = nodeIsSet ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsSet) : _baseIsSet_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (isSet);
- /***/ }),
- /***/ "./node_modules/lodash-es/isString.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/isString.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var stringTag = '[object String]';
- /**
- * Checks if `value` is classified as a `String` primitive or object.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a string, else `false`.
- * @example
- *
- * _.isString('abc');
- * // => true
- *
- * _.isString(1);
- * // => false
- */
- function isString(value) {
- return typeof value == 'string' ||
- (!Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == stringTag);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isString);
- /***/ }),
- /***/ "./node_modules/lodash-es/isSymbol.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/isSymbol.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var symbolTag = '[object Symbol]';
- /**
- * Checks if `value` is classified as a `Symbol` primitive or object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
- * @example
- *
- * _.isSymbol(Symbol.iterator);
- * // => true
- *
- * _.isSymbol('abc');
- * // => false
- */
- function isSymbol(value) {
- return typeof value == 'symbol' ||
- (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == symbolTag);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isSymbol);
- /***/ }),
- /***/ "./node_modules/lodash-es/isTypedArray.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/isTypedArray.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIsTypedArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsTypedArray.js */ "./node_modules/lodash-es/_baseIsTypedArray.js");
- /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
- /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
- /* Node.js helper references. */
- var nodeIsTypedArray = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isTypedArray;
- /**
- * Checks if `value` is classified as a typed array.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
- * @example
- *
- * _.isTypedArray(new Uint8Array);
- * // => true
- *
- * _.isTypedArray([]);
- * // => false
- */
- var isTypedArray = nodeIsTypedArray ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsTypedArray) : _baseIsTypedArray_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (isTypedArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/isUndefined.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/isUndefined.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Checks if `value` is `undefined`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
- * @example
- *
- * _.isUndefined(void 0);
- * // => true
- *
- * _.isUndefined(null);
- * // => false
- */
- function isUndefined(value) {
- return value === undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isUndefined);
- /***/ }),
- /***/ "./node_modules/lodash-es/isWeakMap.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/isWeakMap.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var weakMapTag = '[object WeakMap]';
- /**
- * Checks if `value` is classified as a `WeakMap` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
- * @example
- *
- * _.isWeakMap(new WeakMap);
- * // => true
- *
- * _.isWeakMap(new Map);
- * // => false
- */
- function isWeakMap(value) {
- return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_getTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == weakMapTag;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isWeakMap);
- /***/ }),
- /***/ "./node_modules/lodash-es/isWeakSet.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/isWeakSet.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /** `Object#toString` result references. */
- var weakSetTag = '[object WeakSet]';
- /**
- * Checks if `value` is classified as a `WeakSet` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
- * @example
- *
- * _.isWeakSet(new WeakSet);
- * // => true
- *
- * _.isWeakSet(new Set);
- * // => false
- */
- function isWeakSet(value) {
- return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == weakSetTag;
- }
- /* harmony default export */ __webpack_exports__["default"] = (isWeakSet);
- /***/ }),
- /***/ "./node_modules/lodash-es/iteratee.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/iteratee.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1;
- /**
- * Creates a function that invokes `func` with the arguments of the created
- * function. If `func` is a property name, the created function returns the
- * property value for a given element. If `func` is an array or object, the
- * created function returns `true` for elements that contain the equivalent
- * source properties, otherwise it returns `false`.
- *
- * @static
- * @since 4.0.0
- * @memberOf _
- * @category Util
- * @param {*} [func=_.identity] The value to convert to a callback.
- * @returns {Function} Returns the callback.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * // The `_.matches` iteratee shorthand.
- * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
- * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.filter(users, _.iteratee(['user', 'fred']));
- * // => [{ 'user': 'fred', 'age': 40 }]
- *
- * // The `_.property` iteratee shorthand.
- * _.map(users, _.iteratee('user'));
- * // => ['barney', 'fred']
- *
- * // Create custom iteratee shorthands.
- * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
- * return !_.isRegExp(func) ? iteratee(func) : function(string) {
- * return func.test(string);
- * };
- * });
- *
- * _.filter(['abc', 'def'], /ef/);
- * // => ['def']
- */
- function iteratee(func) {
- return Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(typeof func == 'function' ? func : Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, CLONE_DEEP_FLAG));
- }
- /* harmony default export */ __webpack_exports__["default"] = (iteratee);
- /***/ }),
- /***/ "./node_modules/lodash-es/join.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/join.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used for built-in method references. */
- var arrayProto = Array.prototype;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeJoin = arrayProto.join;
- /**
- * Converts all elements in `array` into a string separated by `separator`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to convert.
- * @param {string} [separator=','] The element separator.
- * @returns {string} Returns the joined string.
- * @example
- *
- * _.join(['a', 'b', 'c'], '~');
- * // => 'a~b~c'
- */
- function join(array, separator) {
- return array == null ? '' : nativeJoin.call(array, separator);
- }
- /* harmony default export */ __webpack_exports__["default"] = (join);
- /***/ }),
- /***/ "./node_modules/lodash-es/kebabCase.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/kebabCase.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
- /**
- * Converts `string` to
- * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the kebab cased string.
- * @example
- *
- * _.kebabCase('Foo Bar');
- * // => 'foo-bar'
- *
- * _.kebabCase('fooBar');
- * // => 'foo-bar'
- *
- * _.kebabCase('__FOO_BAR__');
- * // => 'foo-bar'
- */
- var kebabCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
- return result + (index ? '-' : '') + word.toLowerCase();
- });
- /* harmony default export */ __webpack_exports__["default"] = (kebabCase);
- /***/ }),
- /***/ "./node_modules/lodash-es/keyBy.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/keyBy.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
- /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` thru `iteratee`. The corresponding value of
- * each key is the last element responsible for generating the key. The
- * iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * var array = [
- * { 'dir': 'left', 'code': 97 },
- * { 'dir': 'right', 'code': 100 }
- * ];
- *
- * _.keyBy(array, function(o) {
- * return String.fromCharCode(o.code);
- * });
- * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
- *
- * _.keyBy(array, 'dir');
- * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
- */
- var keyBy = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
- Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, value);
- });
- /* harmony default export */ __webpack_exports__["default"] = (keyBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/keys.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/keys.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayLikeKeys.js */ "./node_modules/lodash-es/_arrayLikeKeys.js");
- /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
- function keys(object) {
- return Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object) ? Object(_arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object) : Object(_baseKeys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
- }
- /* harmony default export */ __webpack_exports__["default"] = (keys);
- /***/ }),
- /***/ "./node_modules/lodash-es/keysIn.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/keysIn.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayLikeKeys.js */ "./node_modules/lodash-es/_arrayLikeKeys.js");
- /* harmony import */ var _baseKeysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseKeysIn.js */ "./node_modules/lodash-es/_baseKeysIn.js");
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /**
- * Creates an array of the own and inherited enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keysIn(new Foo);
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
- */
- function keysIn(object) {
- return Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object) ? Object(_arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, true) : Object(_baseKeysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
- }
- /* harmony default export */ __webpack_exports__["default"] = (keysIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/lang.default.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/lang.default.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _castArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./castArray.js */ "./node_modules/lodash-es/castArray.js");
- /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clone.js */ "./node_modules/lodash-es/clone.js");
- /* harmony import */ var _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
- /* harmony import */ var _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cloneDeepWith.js */ "./node_modules/lodash-es/cloneDeepWith.js");
- /* harmony import */ var _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cloneWith.js */ "./node_modules/lodash-es/cloneWith.js");
- /* harmony import */ var _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./conformsTo.js */ "./node_modules/lodash-es/conformsTo.js");
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /* harmony import */ var _gt_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./gt.js */ "./node_modules/lodash-es/gt.js");
- /* harmony import */ var _gte_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./gte.js */ "./node_modules/lodash-es/gte.js");
- /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/lodash-es/isArrayBuffer.js");
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/lodash-es/isBoolean.js");
- /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
- /* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/lodash-es/isDate.js");
- /* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/lodash-es/isElement.js");
- /* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/lodash-es/isEmpty.js");
- /* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/lodash-es/isEqual.js");
- /* harmony import */ var _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./isEqualWith.js */ "./node_modules/lodash-es/isEqualWith.js");
- /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
- /* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/lodash-es/isFinite.js");
- /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
- /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
- /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
- /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
- /* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/lodash-es/isMatch.js");
- /* harmony import */ var _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./isMatchWith.js */ "./node_modules/lodash-es/isMatchWith.js");
- /* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/lodash-es/isNaN.js");
- /* harmony import */ var _isNative_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./isNative.js */ "./node_modules/lodash-es/isNative.js");
- /* harmony import */ var _isNil_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./isNil.js */ "./node_modules/lodash-es/isNil.js");
- /* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/lodash-es/isNull.js");
- /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
- /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
- /* harmony import */ var _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./isSafeInteger.js */ "./node_modules/lodash-es/isSafeInteger.js");
- /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
- /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
- /* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/lodash-es/isUndefined.js");
- /* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/lodash-es/isWeakMap.js");
- /* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/lodash-es/isWeakSet.js");
- /* harmony import */ var _lt_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./lt.js */ "./node_modules/lodash-es/lt.js");
- /* harmony import */ var _lte_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./lte.js */ "./node_modules/lodash-es/lte.js");
- /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
- /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
- /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
- /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
- /* harmony import */ var _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./toSafeInteger.js */ "./node_modules/lodash-es/toSafeInteger.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /* harmony default export */ __webpack_exports__["default"] = ({
- castArray: _castArray_js__WEBPACK_IMPORTED_MODULE_0__["default"], clone: _clone_js__WEBPACK_IMPORTED_MODULE_1__["default"], cloneDeep: _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__["default"], cloneDeepWith: _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], cloneWith: _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__["default"],
- conformsTo: _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__["default"], eq: _eq_js__WEBPACK_IMPORTED_MODULE_6__["default"], gt: _gt_js__WEBPACK_IMPORTED_MODULE_7__["default"], gte: _gte_js__WEBPACK_IMPORTED_MODULE_8__["default"], isArguments: _isArguments_js__WEBPACK_IMPORTED_MODULE_9__["default"],
- isArray: _isArray_js__WEBPACK_IMPORTED_MODULE_10__["default"], isArrayBuffer: _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__["default"], isArrayLike: _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__["default"], isArrayLikeObject: _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__["default"], isBoolean: _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__["default"],
- isBuffer: _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__["default"], isDate: _isDate_js__WEBPACK_IMPORTED_MODULE_16__["default"], isElement: _isElement_js__WEBPACK_IMPORTED_MODULE_17__["default"], isEmpty: _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__["default"], isEqual: _isEqual_js__WEBPACK_IMPORTED_MODULE_19__["default"],
- isEqualWith: _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__["default"], isError: _isError_js__WEBPACK_IMPORTED_MODULE_21__["default"], isFinite: _isFinite_js__WEBPACK_IMPORTED_MODULE_22__["default"], isFunction: _isFunction_js__WEBPACK_IMPORTED_MODULE_23__["default"], isInteger: _isInteger_js__WEBPACK_IMPORTED_MODULE_24__["default"],
- isLength: _isLength_js__WEBPACK_IMPORTED_MODULE_25__["default"], isMap: _isMap_js__WEBPACK_IMPORTED_MODULE_26__["default"], isMatch: _isMatch_js__WEBPACK_IMPORTED_MODULE_27__["default"], isMatchWith: _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__["default"], isNaN: _isNaN_js__WEBPACK_IMPORTED_MODULE_29__["default"],
- isNative: _isNative_js__WEBPACK_IMPORTED_MODULE_30__["default"], isNil: _isNil_js__WEBPACK_IMPORTED_MODULE_31__["default"], isNull: _isNull_js__WEBPACK_IMPORTED_MODULE_32__["default"], isNumber: _isNumber_js__WEBPACK_IMPORTED_MODULE_33__["default"], isObject: _isObject_js__WEBPACK_IMPORTED_MODULE_34__["default"],
- isObjectLike: _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__["default"], isPlainObject: _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__["default"], isRegExp: _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__["default"], isSafeInteger: _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__["default"], isSet: _isSet_js__WEBPACK_IMPORTED_MODULE_39__["default"],
- isString: _isString_js__WEBPACK_IMPORTED_MODULE_40__["default"], isSymbol: _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__["default"], isTypedArray: _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__["default"], isUndefined: _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__["default"], isWeakMap: _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__["default"],
- isWeakSet: _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__["default"], lt: _lt_js__WEBPACK_IMPORTED_MODULE_46__["default"], lte: _lte_js__WEBPACK_IMPORTED_MODULE_47__["default"], toArray: _toArray_js__WEBPACK_IMPORTED_MODULE_48__["default"], toFinite: _toFinite_js__WEBPACK_IMPORTED_MODULE_49__["default"],
- toInteger: _toInteger_js__WEBPACK_IMPORTED_MODULE_50__["default"], toLength: _toLength_js__WEBPACK_IMPORTED_MODULE_51__["default"], toNumber: _toNumber_js__WEBPACK_IMPORTED_MODULE_52__["default"], toPlainObject: _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__["default"], toSafeInteger: _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__["default"],
- toString: _toString_js__WEBPACK_IMPORTED_MODULE_55__["default"]
- });
- /***/ }),
- /***/ "./node_modules/lodash-es/lang.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/lang.js ***!
- \****************************************/
- /*! exports provided: castArray, clone, cloneDeep, cloneDeepWith, cloneWith, conformsTo, eq, gt, gte, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, lt, lte, toArray, toFinite, toInteger, toLength, toNumber, toPlainObject, toSafeInteger, toString, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _castArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./castArray.js */ "./node_modules/lodash-es/castArray.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "castArray", function() { return _castArray_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clone.js */ "./node_modules/lodash-es/clone.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return _clone_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeep", function() { return _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cloneDeepWith.js */ "./node_modules/lodash-es/cloneDeepWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeepWith", function() { return _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cloneWith.js */ "./node_modules/lodash-es/cloneWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneWith", function() { return _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./conformsTo.js */ "./node_modules/lodash-es/conformsTo.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conformsTo", function() { return _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eq", function() { return _eq_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _gt_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./gt.js */ "./node_modules/lodash-es/gt.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gt", function() { return _gt_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _gte_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./gte.js */ "./node_modules/lodash-es/gte.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gte", function() { return _gte_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return _isArguments_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _isArray_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/lodash-es/isArrayBuffer.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLikeObject", function() { return _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/lodash-es/isBoolean.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBuffer", function() { return _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/lodash-es/isDate.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return _isDate_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
- /* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/lodash-es/isElement.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _isElement_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/lodash-es/isEmpty.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
- /* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/lodash-es/isEqual.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return _isEqual_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./isEqualWith.js */ "./node_modules/lodash-es/isEqualWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqualWith", function() { return _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _isError_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
- /* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/lodash-es/isFinite.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return _isFinite_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
- /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return _isFunction_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
- /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInteger", function() { return _isInteger_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
- /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _isLength_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
- /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return _isMap_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
- /* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/lodash-es/isMatch.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return _isMatch_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
- /* harmony import */ var _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./isMatchWith.js */ "./node_modules/lodash-es/isMatchWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatchWith", function() { return _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
- /* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/lodash-es/isNaN.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return _isNaN_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
- /* harmony import */ var _isNative_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./isNative.js */ "./node_modules/lodash-es/isNative.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return _isNative_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
- /* harmony import */ var _isNil_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./isNil.js */ "./node_modules/lodash-es/isNil.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return _isNil_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
- /* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/lodash-es/isNull.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return _isNull_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
- /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return _isNumber_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _isObject_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObjectLike", function() { return _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
- /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
- /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
- /* harmony import */ var _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./isSafeInteger.js */ "./node_modules/lodash-es/isSafeInteger.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSafeInteger", function() { return _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
- /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return _isSet_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
- /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _isString_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
- /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
- /* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/lodash-es/isUndefined.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
- /* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/lodash-es/isWeakMap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
- /* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/lodash-es/isWeakSet.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
- /* harmony import */ var _lt_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./lt.js */ "./node_modules/lodash-es/lt.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lt", function() { return _lt_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
- /* harmony import */ var _lte_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./lte.js */ "./node_modules/lodash-es/lte.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lte", function() { return _lte_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
- /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _toArray_js__WEBPACK_IMPORTED_MODULE_48__["default"]; });
- /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toFinite", function() { return _toFinite_js__WEBPACK_IMPORTED_MODULE_49__["default"]; });
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toInteger", function() { return _toInteger_js__WEBPACK_IMPORTED_MODULE_50__["default"]; });
- /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLength", function() { return _toLength_js__WEBPACK_IMPORTED_MODULE_51__["default"]; });
- /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toNumber", function() { return _toNumber_js__WEBPACK_IMPORTED_MODULE_52__["default"]; });
- /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPlainObject", function() { return _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__["default"]; });
- /* harmony import */ var _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./toSafeInteger.js */ "./node_modules/lodash-es/toSafeInteger.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toSafeInteger", function() { return _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__["default"]; });
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return _toString_js__WEBPACK_IMPORTED_MODULE_55__["default"]; });
- /* harmony import */ var _lang_default_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./lang.default.js */ "./node_modules/lodash-es/lang.default.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _lang_default_js__WEBPACK_IMPORTED_MODULE_56__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/last.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/last.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Gets the last element of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to query.
- * @returns {*} Returns the last element of `array`.
- * @example
- *
- * _.last([1, 2, 3]);
- * // => 3
- */
- function last(array) {
- var length = array == null ? 0 : array.length;
- return length ? array[length - 1] : undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (last);
- /***/ }),
- /***/ "./node_modules/lodash-es/lastIndexOf.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/lastIndexOf.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
- /* harmony import */ var _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsNaN.js */ "./node_modules/lodash-es/_baseIsNaN.js");
- /* harmony import */ var _strictLastIndexOf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_strictLastIndexOf.js */ "./node_modules/lodash-es/_strictLastIndexOf.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max,
- nativeMin = Math.min;
- /**
- * This method is like `_.indexOf` except that it iterates over elements of
- * `array` from right to left.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} [fromIndex=array.length-1] The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.lastIndexOf([1, 2, 1, 2], 2);
- * // => 3
- *
- * // Search from the `fromIndex`.
- * _.lastIndexOf([1, 2, 1, 2], 2, 2);
- * // => 1
- */
- function lastIndexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = length;
- if (fromIndex !== undefined) {
- index = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fromIndex);
- index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
- }
- return value === value
- ? Object(_strictLastIndexOf_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, value, index)
- : Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__["default"], index, true);
- }
- /* harmony default export */ __webpack_exports__["default"] = (lastIndexOf);
- /***/ }),
- /***/ "./node_modules/lodash-es/lodash.default.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/lodash.default.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array.js */ "./node_modules/lodash-es/array.js");
- /* harmony import */ var _collection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collection.js */ "./node_modules/lodash-es/collection.js");
- /* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./date.js */ "./node_modules/lodash-es/date.js");
- /* harmony import */ var _function_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./function.js */ "./node_modules/lodash-es/function.js");
- /* harmony import */ var _lang_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lang.js */ "./node_modules/lodash-es/lang.js");
- /* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./math.js */ "./node_modules/lodash-es/math.js");
- /* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./number.js */ "./node_modules/lodash-es/number.js");
- /* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./object.js */ "./node_modules/lodash-es/object.js");
- /* harmony import */ var _seq_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./seq.js */ "./node_modules/lodash-es/seq.js");
- /* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./string.js */ "./node_modules/lodash-es/string.js");
- /* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./util.js */ "./node_modules/lodash-es/util.js");
- /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
- /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
- /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
- /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
- /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
- /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
- /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
- /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _createHybrid_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./_createHybrid.js */ "./node_modules/lodash-es/_createHybrid.js");
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /* harmony import */ var _lazyClone_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./_lazyClone.js */ "./node_modules/lodash-es/_lazyClone.js");
- /* harmony import */ var _lazyReverse_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./_lazyReverse.js */ "./node_modules/lodash-es/_lazyReverse.js");
- /* harmony import */ var _lazyValue_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./_lazyValue.js */ "./node_modules/lodash-es/_lazyValue.js");
- /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
- /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
- /* harmony import */ var _realNames_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./_realNames.js */ "./node_modules/lodash-es/_realNames.js");
- /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
- /**
- * @license
- * Lodash (Custom Build) <https://lodash.com/>
- * Build: `lodash modularize exports="es" -o ./`
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
- /** Used as the semantic version number. */
- var VERSION = '4.17.21';
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_KEY_FLAG = 2;
- /** Used to indicate the type of lazy iteratees. */
- var LAZY_FILTER_FLAG = 1,
- LAZY_WHILE_FLAG = 3;
- /** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = 4294967295;
- /** Used for built-in method references. */
- var arrayProto = Array.prototype,
- objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /** Built-in value references. */
- var symIterator = _Symbol_js__WEBPACK_IMPORTED_MODULE_13__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_13__["default"].iterator : undefined;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max,
- nativeMin = Math.min;
- // wrap `_.mixin` so it works when provided only one argument
- var mixin = (function(func) {
- return function(object, source, options) {
- if (options == null) {
- var isObj = Object(_isObject_js__WEBPACK_IMPORTED_MODULE_24__["default"])(source),
- props = isObj && Object(_keys_js__WEBPACK_IMPORTED_MODULE_25__["default"])(source),
- methodNames = props && props.length && Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_17__["default"])(source, props);
- if (!(methodNames ? methodNames.length : isObj)) {
- options = source;
- source = object;
- object = this;
- }
- }
- return func(object, source, options);
- };
- }(_mixin_js__WEBPACK_IMPORTED_MODULE_30__["default"]));
- // Add methods that return wrapped values in chain sequences.
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].after = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].after;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].ary = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].ary;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assign = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assign;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assignIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignIn;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assignInWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignInWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assignWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].at = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].at;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].before = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].before;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].bind = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].bind;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].bindAll = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].bindAll;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].bindKey = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].bindKey;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].castArray = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].castArray;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].chain = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].chain;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].chunk = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].chunk;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].compact = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].compact;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].concat = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].concat;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cond = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].cond;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].conforms = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].conforms;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].constant = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].constant;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].countBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].countBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].create = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].create;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].curry = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].curry;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].curryRight = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].curryRight;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].debounce = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].debounce;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defaults = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].defaults;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defaultsDeep = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].defaultsDeep;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defer = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].defer;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].delay = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].delay;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].difference = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].difference;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].differenceBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].differenceBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].differenceWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].differenceWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].drop = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].drop;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].dropRight = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].dropRight;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].dropRightWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].dropRightWhile;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].dropWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].dropWhile;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].fill = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].fill;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].filter = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].filter;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatMap = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].flatMap;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatMapDeep = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].flatMapDeep;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatMapDepth = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].flatMapDepth;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatten = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].flatten;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flattenDeep = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].flattenDeep;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flattenDepth = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].flattenDepth;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flip = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].flip;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flow = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].flow;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flowRight = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].flowRight;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].fromPairs = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].fromPairs;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].functions = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].functions;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].functionsIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].functionsIn;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].groupBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].groupBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].initial = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].initial;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].intersection = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].intersection;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].intersectionBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].intersectionBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].intersectionWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].intersectionWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invert = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].invert;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invertBy = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].invertBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invokeMap = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].invokeMap;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].iteratee = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].iteratee;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].keyBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].keyBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].keys = _keys_js__WEBPACK_IMPORTED_MODULE_25__["default"];
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].keysIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].keysIn;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].map = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].map;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mapKeys = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].mapKeys;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mapValues = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].mapValues;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].matches = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].matches;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].matchesProperty = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].matchesProperty;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].memoize = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].memoize;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].merge = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].merge;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mergeWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].mergeWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].method = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].method;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].methodOf = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].methodOf;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mixin = mixin;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].negate = _negate_js__WEBPACK_IMPORTED_MODULE_31__["default"];
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].nthArg = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].nthArg;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].omit = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].omit;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].omitBy = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].omitBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].once = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].once;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].orderBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].orderBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].over = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].over;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].overArgs = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].overArgs;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].overEvery = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].overEvery;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].overSome = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].overSome;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].partial = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].partial;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].partialRight = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].partialRight;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].partition = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].partition;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pick = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].pick;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pickBy = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].pickBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].property = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].property;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].propertyOf = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].propertyOf;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pull = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pull;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAll = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAll;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAllBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAllBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAllWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAllWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAt = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAt;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].range = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].range;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].rangeRight = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].rangeRight;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].rearg = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].rearg;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reject = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].reject;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].remove = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].remove;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].rest = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].rest;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reverse = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].reverse;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sampleSize = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].sampleSize;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].set = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].set;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].setWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].setWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].shuffle = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].shuffle;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].slice = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].slice;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].sortBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedUniq = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedUniq;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedUniqBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedUniqBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].split = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].split;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].spread = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].spread;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].tail = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].tail;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].take = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].take;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].takeRight = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].takeRight;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].takeRightWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].takeRightWhile;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].takeWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].takeWhile;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].tap = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].tap;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].throttle = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].throttle;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].thru = _thru_js__WEBPACK_IMPORTED_MODULE_33__["default"];
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toArray = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toArray;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPairs = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairs;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPairsIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairsIn;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPath = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].toPath;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPlainObject = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toPlainObject;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].transform = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].transform;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unary = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].unary;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].union = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].union;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unionBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unionBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unionWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unionWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniq = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].uniq;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniqBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].uniqBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniqWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].uniqWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unset = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].unset;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unzip = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unzip;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unzipWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unzipWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].update = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].update;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].updateWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].updateWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].values = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].values;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].valuesIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].valuesIn;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].without = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].without;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].words = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].words;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].wrap = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].wrap;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].xor = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].xor;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].xorBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].xorBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].xorWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].xorWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zip = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zip;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zipObject = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zipObject;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zipObjectDeep = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zipObjectDeep;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zipWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zipWith;
- // Add aliases.
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].entries = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairs;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].entriesIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairsIn;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].extend = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignIn;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].extendWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignInWith;
- // Add methods to `lodash.prototype`.
- mixin(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"]);
- // Add methods that return unwrapped values in chain sequences.
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].add = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].add;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].attempt = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].attempt;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].camelCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].camelCase;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].capitalize = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].capitalize;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].ceil = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].ceil;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].clamp = _number_js__WEBPACK_IMPORTED_MODULE_6__["default"].clamp;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].clone = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].clone;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cloneDeep = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].cloneDeep;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cloneDeepWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].cloneDeepWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cloneWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].cloneWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].conformsTo = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].conformsTo;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].deburr = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].deburr;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defaultTo = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].defaultTo;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].divide = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].divide;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].endsWith = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].endsWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].eq = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].eq;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].escape = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].escape;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].escapeRegExp = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].escapeRegExp;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].every = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].every;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].find = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].find;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].findIndex;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findKey = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].findKey;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findLast = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].findLast;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findLastIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].findLastIndex;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findLastKey = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].findLastKey;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].floor = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].floor;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forEach = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forEachRight = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEachRight;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forIn;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forInRight = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forInRight;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forOwn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forOwn;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forOwnRight = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forOwnRight;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].get = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].get;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].gt = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].gt;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].gte = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].gte;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].has = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].has;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].hasIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].hasIn;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].head = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].head;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].identity = _identity_js__WEBPACK_IMPORTED_MODULE_22__["default"];
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].includes = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].includes;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].indexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].indexOf;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].inRange = _number_js__WEBPACK_IMPORTED_MODULE_6__["default"].inRange;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invoke = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].invoke;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArguments = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArguments;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArray = _isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"];
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArrayBuffer = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArrayBuffer;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArrayLike = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArrayLike;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArrayLikeObject = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArrayLikeObject;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isBoolean = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isBoolean;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isBuffer = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isBuffer;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isDate = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isDate;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isElement = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isElement;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isEmpty = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isEmpty;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isEqual = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isEqual;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isEqualWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isEqualWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isError = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isError;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isFinite = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isFinite;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isFunction = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isFunction;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isInteger = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isInteger;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isLength = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isLength;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isMap = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isMap;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isMatch = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isMatch;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isMatchWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isMatchWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNaN = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNaN;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNative = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNative;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNil = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNil;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNull = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNull;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNumber = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNumber;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isObject = _isObject_js__WEBPACK_IMPORTED_MODULE_24__["default"];
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isObjectLike = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isObjectLike;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isPlainObject = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isPlainObject;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isRegExp = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isRegExp;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isSafeInteger = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isSafeInteger;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isSet = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isSet;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isString = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isString;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isSymbol = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isSymbol;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isTypedArray = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isTypedArray;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isUndefined = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isUndefined;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isWeakMap = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isWeakMap;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isWeakSet = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isWeakSet;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].join = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].join;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].kebabCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].kebabCase;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].last = _last_js__WEBPACK_IMPORTED_MODULE_26__["default"];
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lastIndexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].lastIndexOf;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lowerCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].lowerCase;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lowerFirst = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].lowerFirst;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lt = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].lt;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lte = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].lte;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].max = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].max;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].maxBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].maxBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mean = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].mean;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].meanBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].meanBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].min = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].min;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].minBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].minBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubArray = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubArray;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubFalse = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubFalse;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubObject = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubObject;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubString = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubString;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubTrue = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubTrue;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].multiply = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].multiply;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].nth = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].nth;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].noop = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].noop;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].now = _date_js__WEBPACK_IMPORTED_MODULE_2__["default"].now;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pad = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].pad;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].padEnd = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].padEnd;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].padStart = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].padStart;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].parseInt = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].parseInt;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].random = _number_js__WEBPACK_IMPORTED_MODULE_6__["default"].random;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reduce = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].reduce;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reduceRight = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].reduceRight;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].repeat = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].repeat;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].replace = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].replace;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].result = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].result;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].round = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].round;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sample = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].sample;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].size = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].size;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].snakeCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].snakeCase;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].some = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].some;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedIndex;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedIndexBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedIndexBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedIndexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedIndexOf;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedLastIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedLastIndex;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedLastIndexBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedLastIndexBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedLastIndexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedLastIndexOf;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].startCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].startCase;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].startsWith = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].startsWith;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].subtract = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].subtract;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sum = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].sum;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sumBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].sumBy;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].template = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].template;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].times = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].times;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toFinite = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toFinite;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toInteger = _toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"];
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toLength = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toLength;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toLower = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].toLower;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toNumber = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toNumber;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toSafeInteger = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toSafeInteger;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toString = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toString;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toUpper = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].toUpper;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].trim = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].trim;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].trimEnd = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].trimEnd;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].trimStart = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].trimStart;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].truncate = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].truncate;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unescape = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].unescape;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniqueId = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].uniqueId;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].upperCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].upperCase;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].upperFirst = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].upperFirst;
- // Add aliases.
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].each = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].eachRight = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEachRight;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].first = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].head;
- mixin(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], (function() {
- var source = {};
- Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"])(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], function(func, methodName) {
- if (!hasOwnProperty.call(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype, methodName)) {
- source[methodName] = func;
- }
- });
- return source;
- }()), { 'chain': false });
- /**
- * The semantic version number.
- *
- * @static
- * @memberOf _
- * @type {string}
- */
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].VERSION = VERSION;
- (_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].templateSettings = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].templateSettings).imports._ = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"];
- // Assign default placeholders.
- Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"][methodName].placeholder = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"];
- });
- // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
- Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['drop', 'take'], function(methodName, index) {
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function(n) {
- n = n === undefined ? 1 : nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"])(n), 0);
- var result = (this.__filtered__ && !index)
- ? new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this)
- : this.clone();
- if (result.__filtered__) {
- result.__takeCount__ = nativeMin(n, result.__takeCount__);
- } else {
- result.__views__.push({
- 'size': nativeMin(n, MAX_ARRAY_LENGTH),
- 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
- });
- }
- return result;
- };
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName + 'Right'] = function(n) {
- return this.reverse()[methodName](n).reverse();
- };
- });
- // Add `LazyWrapper` methods that accept an `iteratee` value.
- Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['filter', 'map', 'takeWhile'], function(methodName, index) {
- var type = index + 1,
- isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function(iteratee) {
- var result = this.clone();
- result.__iteratees__.push({
- 'iteratee': Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_19__["default"])(iteratee, 3),
- 'type': type
- });
- result.__filtered__ = result.__filtered__ || isFilter;
- return result;
- };
- });
- // Add `LazyWrapper` methods for `_.head` and `_.last`.
- Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['head', 'last'], function(methodName, index) {
- var takeName = 'take' + (index ? 'Right' : '');
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function() {
- return this[takeName](1).value()[0];
- };
- });
- // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
- Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['initial', 'tail'], function(methodName, index) {
- var dropName = 'drop' + (index ? '' : 'Right');
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function() {
- return this.__filtered__ ? new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this) : this[dropName](1);
- };
- });
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.compact = function() {
- return this.filter(_identity_js__WEBPACK_IMPORTED_MODULE_22__["default"]);
- };
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.find = function(predicate) {
- return this.filter(predicate).head();
- };
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.findLast = function(predicate) {
- return this.reverse().find(predicate);
- };
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.invokeMap = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_20__["default"])(function(path, args) {
- if (typeof path == 'function') {
- return new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this);
- }
- return this.map(function(value) {
- return Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_18__["default"])(value, path, args);
- });
- });
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.reject = function(predicate) {
- return this.filter(Object(_negate_js__WEBPACK_IMPORTED_MODULE_31__["default"])(Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_19__["default"])(predicate)));
- };
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.slice = function(start, end) {
- start = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"])(start);
- var result = this;
- if (result.__filtered__ && (start > 0 || end < 0)) {
- return new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](result);
- }
- if (start < 0) {
- result = result.takeRight(-start);
- } else if (start) {
- result = result.drop(start);
- }
- if (end !== undefined) {
- end = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"])(end);
- result = end < 0 ? result.dropRight(-end) : result.take(end - start);
- }
- return result;
- };
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.takeRightWhile = function(predicate) {
- return this.reverse().takeWhile(predicate).reverse();
- };
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.toArray = function() {
- return this.take(MAX_ARRAY_LENGTH);
- };
- // Add `LazyWrapper` methods to `lodash.prototype`.
- Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"])(_LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype, function(func, methodName) {
- var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
- isTaker = /^(?:head|last)$/.test(methodName),
- lodashFunc = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"][isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
- retUnwrapped = isTaker || /^find/.test(methodName);
- if (!lodashFunc) {
- return;
- }
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype[methodName] = function() {
- var value = this.__wrapped__,
- args = isTaker ? [1] : arguments,
- isLazy = value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"],
- iteratee = args[0],
- useLazy = isLazy || Object(_isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"])(value);
- var interceptor = function(value) {
- var result = lodashFunc.apply(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_15__["default"])([value], args));
- return (isTaker && chainAll) ? result[0] : result;
- };
- if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
- // Avoid lazy use if the iteratee has a "length" value other than `1`.
- isLazy = useLazy = false;
- }
- var chainAll = this.__chain__,
- isHybrid = !!this.__actions__.length,
- isUnwrapped = retUnwrapped && !chainAll,
- onlyLazy = isLazy && !isHybrid;
- if (!retUnwrapped && useLazy) {
- value = onlyLazy ? value : new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this);
- var result = func.apply(value, args);
- result.__actions__.push({ 'func': _thru_js__WEBPACK_IMPORTED_MODULE_33__["default"], 'args': [interceptor], 'thisArg': undefined });
- return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_12__["default"](result, chainAll);
- }
- if (isUnwrapped && onlyLazy) {
- return func.apply(this, args);
- }
- result = this.thru(interceptor);
- return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
- };
- });
- // Add `Array` methods to `lodash.prototype`.
- Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
- var func = arrayProto[methodName],
- chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
- retUnwrapped = /^(?:pop|shift)$/.test(methodName);
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype[methodName] = function() {
- var args = arguments;
- if (retUnwrapped && !this.__chain__) {
- var value = this.value();
- return func.apply(Object(_isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"])(value) ? value : [], args);
- }
- return this[chainName](function(value) {
- return func.apply(Object(_isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"])(value) ? value : [], args);
- });
- };
- });
- // Map minified method names to their real names.
- Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"])(_LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype, function(func, methodName) {
- var lodashFunc = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"][methodName];
- if (lodashFunc) {
- var key = lodashFunc.name + '';
- if (!hasOwnProperty.call(_realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"], key)) {
- _realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"][key] = [];
- }
- _realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"][key].push({ 'name': methodName, 'func': lodashFunc });
- }
- });
- _realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"][Object(_createHybrid_js__WEBPACK_IMPORTED_MODULE_21__["default"])(undefined, WRAP_BIND_KEY_FLAG).name] = [{
- 'name': 'wrapper',
- 'func': undefined
- }];
- // Add methods to `LazyWrapper`.
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.clone = _lazyClone_js__WEBPACK_IMPORTED_MODULE_27__["default"];
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.reverse = _lazyReverse_js__WEBPACK_IMPORTED_MODULE_28__["default"];
- _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.value = _lazyValue_js__WEBPACK_IMPORTED_MODULE_29__["default"];
- // Add chain sequence methods to the `lodash` wrapper.
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.at = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].at;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.chain = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].wrapperChain;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.commit = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].commit;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.next = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].next;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.plant = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].plant;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.reverse = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].reverse;
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.toJSON = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.valueOf = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.value = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].value;
- // Add lazy aliases.
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.first = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.head;
- if (symIterator) {
- _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype[symIterator] = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].toIterator;
- }
- /* harmony default export */ __webpack_exports__["default"] = (_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"]);
- /***/ }),
- /***/ "./node_modules/lodash-es/lodash.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/lodash.js ***!
- \******************************************/
- /*! exports provided: add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chain, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, commit, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, each, eachRight, endsWith, entries, entriesIn, eq, escape, escapeRegExp, every, extend, extendWith, fill, filter, find, findIndex, findKey, findLast, findLastIndex, findLastKey, first, flatMap, flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, floor, flow, flowRight, forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, fromPairs, functions, functionsIn, get, groupBy, gt, gte, has, hasIn, head, identity, inRange, includes, indexOf, initial, intersection, intersectionBy, intersectionWith, invert, invertBy, invoke, invokeMap, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, iteratee, join, kebabCase, keyBy, keys, keysIn, last, lastIndexOf, lodash, lowerCase, lowerFirst, lt, lte, map, mapKeys, mapValues, matches, matchesProperty, max, maxBy, mean, meanBy, memoize, merge, mergeWith, method, methodOf, min, minBy, mixin, multiply, negate, next, noop, now, nth, nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, pad, padEnd, padStart, parseInt, partial, partialRight, partition, pick, pickBy, plant, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, random, range, rangeRight, rearg, reduce, reduceRight, reject, remove, repeat, replace, rest, result, reverse, round, sample, sampleSize, set, setWith, shuffle, size, slice, snakeCase, some, sortBy, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, split, spread, startCase, startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, tap, template, templateSettings, throttle, thru, times, toArray, toFinite, toInteger, toIterator, toJSON, toLength, toLower, toNumber, toPairs, toPairsIn, toPath, toPlainObject, toSafeInteger, toString, toUpper, transform, trim, trimEnd, trimStart, truncate, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, uniqueId, unset, unzip, unzipWith, update, updateWith, upperCase, upperFirst, value, valueOf, values, valuesIn, without, words, wrap, wrapperAt, wrapperChain, wrapperCommit, wrapperLodash, wrapperNext, wrapperPlant, wrapperReverse, wrapperToIterator, wrapperValue, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "./node_modules/lodash-es/add.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "add", function() { return _add_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./after.js */ "./node_modules/lodash-es/after.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "after", function() { return _after_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ary", function() { return _ary_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _assign_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assign.js */ "./node_modules/lodash-es/assign.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return _assign_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignIn", function() { return _assignIn_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignInWith", function() { return _assignInWith_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _assignWith_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./assignWith.js */ "./node_modules/lodash-es/assignWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignWith", function() { return _assignWith_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _at_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./at.js */ "./node_modules/lodash-es/at.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "at", function() { return _at_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attempt", function() { return _attempt_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "before", function() { return _before_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return _bind_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/lodash-es/bindAll.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return _bindAll_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _bindKey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./bindKey.js */ "./node_modules/lodash-es/bindKey.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindKey", function() { return _bindKey_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _camelCase_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./camelCase.js */ "./node_modules/lodash-es/camelCase.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "camelCase", function() { return _camelCase_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "capitalize", function() { return _capitalize_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _castArray_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./castArray.js */ "./node_modules/lodash-es/castArray.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "castArray", function() { return _castArray_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /* harmony import */ var _ceil_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./ceil.js */ "./node_modules/lodash-es/ceil.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return _ceil_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
- /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return _chain_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/lodash-es/chunk.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return _chunk_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
- /* harmony import */ var _clamp_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./clamp.js */ "./node_modules/lodash-es/clamp.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return _clamp_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./clone.js */ "./node_modules/lodash-es/clone.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return _clone_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /* harmony import */ var _cloneDeep_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeep", function() { return _cloneDeep_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
- /* harmony import */ var _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./cloneDeepWith.js */ "./node_modules/lodash-es/cloneDeepWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeepWith", function() { return _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
- /* harmony import */ var _cloneWith_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./cloneWith.js */ "./node_modules/lodash-es/cloneWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneWith", function() { return _cloneWith_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
- /* harmony import */ var _commit_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./commit.js */ "./node_modules/lodash-es/commit.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "commit", function() { return _commit_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
- /* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./compact.js */ "./node_modules/lodash-es/compact.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return _compact_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
- /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./concat.js */ "./node_modules/lodash-es/concat.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _concat_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
- /* harmony import */ var _cond_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./cond.js */ "./node_modules/lodash-es/cond.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cond", function() { return _cond_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
- /* harmony import */ var _conforms_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./conforms.js */ "./node_modules/lodash-es/conforms.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conforms", function() { return _conforms_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
- /* harmony import */ var _conformsTo_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./conformsTo.js */ "./node_modules/lodash-es/conformsTo.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conformsTo", function() { return _conformsTo_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
- /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return _constant_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
- /* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/lodash-es/countBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return _countBy_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
- /* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./create.js */ "./node_modules/lodash-es/create.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "create", function() { return _create_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
- /* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./curry.js */ "./node_modules/lodash-es/curry.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curry", function() { return _curry_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
- /* harmony import */ var _curryRight_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./curryRight.js */ "./node_modules/lodash-es/curryRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curryRight", function() { return _curryRight_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
- /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _debounce_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
- /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deburr", function() { return _deburr_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
- /* harmony import */ var _defaultTo_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./defaultTo.js */ "./node_modules/lodash-es/defaultTo.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultTo", function() { return _defaultTo_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
- /* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/lodash-es/defaults.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return _defaults_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
- /* harmony import */ var _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./defaultsDeep.js */ "./node_modules/lodash-es/defaultsDeep.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultsDeep", function() { return _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
- /* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./defer.js */ "./node_modules/lodash-es/defer.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _defer_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
- /* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./delay.js */ "./node_modules/lodash-es/delay.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _delay_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
- /* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./difference.js */ "./node_modules/lodash-es/difference.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return _difference_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
- /* harmony import */ var _differenceBy_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./differenceBy.js */ "./node_modules/lodash-es/differenceBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceBy", function() { return _differenceBy_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
- /* harmony import */ var _differenceWith_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./differenceWith.js */ "./node_modules/lodash-es/differenceWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceWith", function() { return _differenceWith_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
- /* harmony import */ var _divide_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./divide.js */ "./node_modules/lodash-es/divide.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return _divide_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
- /* harmony import */ var _drop_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./drop.js */ "./node_modules/lodash-es/drop.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return _drop_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
- /* harmony import */ var _dropRight_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./dropRight.js */ "./node_modules/lodash-es/dropRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRight", function() { return _dropRight_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
- /* harmony import */ var _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./dropRightWhile.js */ "./node_modules/lodash-es/dropRightWhile.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRightWhile", function() { return _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_48__["default"]; });
- /* harmony import */ var _dropWhile_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./dropWhile.js */ "./node_modules/lodash-es/dropWhile.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropWhile", function() { return _dropWhile_js__WEBPACK_IMPORTED_MODULE_49__["default"]; });
- /* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./each.js */ "./node_modules/lodash-es/each.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "each", function() { return _each_js__WEBPACK_IMPORTED_MODULE_50__["default"]; });
- /* harmony import */ var _eachRight_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./eachRight.js */ "./node_modules/lodash-es/eachRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachRight", function() { return _eachRight_js__WEBPACK_IMPORTED_MODULE_51__["default"]; });
- /* harmony import */ var _endsWith_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./endsWith.js */ "./node_modules/lodash-es/endsWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return _endsWith_js__WEBPACK_IMPORTED_MODULE_52__["default"]; });
- /* harmony import */ var _entries_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./entries.js */ "./node_modules/lodash-es/entries.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entries", function() { return _entries_js__WEBPACK_IMPORTED_MODULE_53__["default"]; });
- /* harmony import */ var _entriesIn_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./entriesIn.js */ "./node_modules/lodash-es/entriesIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entriesIn", function() { return _entriesIn_js__WEBPACK_IMPORTED_MODULE_54__["default"]; });
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eq", function() { return _eq_js__WEBPACK_IMPORTED_MODULE_55__["default"]; });
- /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return _escape_js__WEBPACK_IMPORTED_MODULE_56__["default"]; });
- /* harmony import */ var _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./escapeRegExp.js */ "./node_modules/lodash-es/escapeRegExp.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escapeRegExp", function() { return _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_57__["default"]; });
- /* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./every.js */ "./node_modules/lodash-es/every.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _every_js__WEBPACK_IMPORTED_MODULE_58__["default"]; });
- /* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./extend.js */ "./node_modules/lodash-es/extend.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return _extend_js__WEBPACK_IMPORTED_MODULE_59__["default"]; });
- /* harmony import */ var _extendWith_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./extendWith.js */ "./node_modules/lodash-es/extendWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extendWith", function() { return _extendWith_js__WEBPACK_IMPORTED_MODULE_60__["default"]; });
- /* harmony import */ var _fill_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./fill.js */ "./node_modules/lodash-es/fill.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return _fill_js__WEBPACK_IMPORTED_MODULE_61__["default"]; });
- /* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./filter.js */ "./node_modules/lodash-es/filter.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _filter_js__WEBPACK_IMPORTED_MODULE_62__["default"]; });
- /* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./find.js */ "./node_modules/lodash-es/find.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _find_js__WEBPACK_IMPORTED_MODULE_63__["default"]; });
- /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _findIndex_js__WEBPACK_IMPORTED_MODULE_64__["default"]; });
- /* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/lodash-es/findKey.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return _findKey_js__WEBPACK_IMPORTED_MODULE_65__["default"]; });
- /* harmony import */ var _findLast_js__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./findLast.js */ "./node_modules/lodash-es/findLast.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLast", function() { return _findLast_js__WEBPACK_IMPORTED_MODULE_66__["default"]; });
- /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return _findLastIndex_js__WEBPACK_IMPORTED_MODULE_67__["default"]; });
- /* harmony import */ var _findLastKey_js__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./findLastKey.js */ "./node_modules/lodash-es/findLastKey.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastKey", function() { return _findLastKey_js__WEBPACK_IMPORTED_MODULE_68__["default"]; });
- /* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./first.js */ "./node_modules/lodash-es/first.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _first_js__WEBPACK_IMPORTED_MODULE_69__["default"]; });
- /* harmony import */ var _flatMap_js__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./flatMap.js */ "./node_modules/lodash-es/flatMap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _flatMap_js__WEBPACK_IMPORTED_MODULE_70__["default"]; });
- /* harmony import */ var _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./flatMapDeep.js */ "./node_modules/lodash-es/flatMapDeep.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDeep", function() { return _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_71__["default"]; });
- /* harmony import */ var _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./flatMapDepth.js */ "./node_modules/lodash-es/flatMapDepth.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDepth", function() { return _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_72__["default"]; });
- /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return _flatten_js__WEBPACK_IMPORTED_MODULE_73__["default"]; });
- /* harmony import */ var _flattenDeep_js__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./flattenDeep.js */ "./node_modules/lodash-es/flattenDeep.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDeep", function() { return _flattenDeep_js__WEBPACK_IMPORTED_MODULE_74__["default"]; });
- /* harmony import */ var _flattenDepth_js__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./flattenDepth.js */ "./node_modules/lodash-es/flattenDepth.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDepth", function() { return _flattenDepth_js__WEBPACK_IMPORTED_MODULE_75__["default"]; });
- /* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./flip.js */ "./node_modules/lodash-es/flip.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flip", function() { return _flip_js__WEBPACK_IMPORTED_MODULE_76__["default"]; });
- /* harmony import */ var _floor_js__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./floor.js */ "./node_modules/lodash-es/floor.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return _floor_js__WEBPACK_IMPORTED_MODULE_77__["default"]; });
- /* harmony import */ var _flow_js__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./flow.js */ "./node_modules/lodash-es/flow.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flow", function() { return _flow_js__WEBPACK_IMPORTED_MODULE_78__["default"]; });
- /* harmony import */ var _flowRight_js__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./flowRight.js */ "./node_modules/lodash-es/flowRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flowRight", function() { return _flowRight_js__WEBPACK_IMPORTED_MODULE_79__["default"]; });
- /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return _forEach_js__WEBPACK_IMPORTED_MODULE_80__["default"]; });
- /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEachRight", function() { return _forEachRight_js__WEBPACK_IMPORTED_MODULE_81__["default"]; });
- /* harmony import */ var _forIn_js__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./forIn.js */ "./node_modules/lodash-es/forIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forIn", function() { return _forIn_js__WEBPACK_IMPORTED_MODULE_82__["default"]; });
- /* harmony import */ var _forInRight_js__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./forInRight.js */ "./node_modules/lodash-es/forInRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forInRight", function() { return _forInRight_js__WEBPACK_IMPORTED_MODULE_83__["default"]; });
- /* harmony import */ var _forOwn_js__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./forOwn.js */ "./node_modules/lodash-es/forOwn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwn", function() { return _forOwn_js__WEBPACK_IMPORTED_MODULE_84__["default"]; });
- /* harmony import */ var _forOwnRight_js__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./forOwnRight.js */ "./node_modules/lodash-es/forOwnRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwnRight", function() { return _forOwnRight_js__WEBPACK_IMPORTED_MODULE_85__["default"]; });
- /* harmony import */ var _fromPairs_js__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./fromPairs.js */ "./node_modules/lodash-es/fromPairs.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromPairs", function() { return _fromPairs_js__WEBPACK_IMPORTED_MODULE_86__["default"]; });
- /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./functions.js */ "./node_modules/lodash-es/functions.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return _functions_js__WEBPACK_IMPORTED_MODULE_87__["default"]; });
- /* harmony import */ var _functionsIn_js__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./functionsIn.js */ "./node_modules/lodash-es/functionsIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functionsIn", function() { return _functionsIn_js__WEBPACK_IMPORTED_MODULE_88__["default"]; });
- /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "get", function() { return _get_js__WEBPACK_IMPORTED_MODULE_89__["default"]; });
- /* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/lodash-es/groupBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _groupBy_js__WEBPACK_IMPORTED_MODULE_90__["default"]; });
- /* harmony import */ var _gt_js__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./gt.js */ "./node_modules/lodash-es/gt.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gt", function() { return _gt_js__WEBPACK_IMPORTED_MODULE_91__["default"]; });
- /* harmony import */ var _gte_js__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./gte.js */ "./node_modules/lodash-es/gte.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gte", function() { return _gte_js__WEBPACK_IMPORTED_MODULE_92__["default"]; });
- /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./has.js */ "./node_modules/lodash-es/has.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "has", function() { return _has_js__WEBPACK_IMPORTED_MODULE_93__["default"]; });
- /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasIn", function() { return _hasIn_js__WEBPACK_IMPORTED_MODULE_94__["default"]; });
- /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "head", function() { return _head_js__WEBPACK_IMPORTED_MODULE_95__["default"]; });
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _identity_js__WEBPACK_IMPORTED_MODULE_96__["default"]; });
- /* harmony import */ var _inRange_js__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./inRange.js */ "./node_modules/lodash-es/inRange.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inRange", function() { return _inRange_js__WEBPACK_IMPORTED_MODULE_97__["default"]; });
- /* harmony import */ var _includes_js__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./includes.js */ "./node_modules/lodash-es/includes.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return _includes_js__WEBPACK_IMPORTED_MODULE_98__["default"]; });
- /* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/lodash-es/indexOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return _indexOf_js__WEBPACK_IMPORTED_MODULE_99__["default"]; });
- /* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./initial.js */ "./node_modules/lodash-es/initial.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return _initial_js__WEBPACK_IMPORTED_MODULE_100__["default"]; });
- /* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/lodash-es/intersection.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return _intersection_js__WEBPACK_IMPORTED_MODULE_101__["default"]; });
- /* harmony import */ var _intersectionBy_js__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./intersectionBy.js */ "./node_modules/lodash-es/intersectionBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionBy", function() { return _intersectionBy_js__WEBPACK_IMPORTED_MODULE_102__["default"]; });
- /* harmony import */ var _intersectionWith_js__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./intersectionWith.js */ "./node_modules/lodash-es/intersectionWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionWith", function() { return _intersectionWith_js__WEBPACK_IMPORTED_MODULE_103__["default"]; });
- /* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./invert.js */ "./node_modules/lodash-es/invert.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return _invert_js__WEBPACK_IMPORTED_MODULE_104__["default"]; });
- /* harmony import */ var _invertBy_js__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(/*! ./invertBy.js */ "./node_modules/lodash-es/invertBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invertBy", function() { return _invertBy_js__WEBPACK_IMPORTED_MODULE_105__["default"]; });
- /* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/lodash-es/invoke.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return _invoke_js__WEBPACK_IMPORTED_MODULE_106__["default"]; });
- /* harmony import */ var _invokeMap_js__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(/*! ./invokeMap.js */ "./node_modules/lodash-es/invokeMap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invokeMap", function() { return _invokeMap_js__WEBPACK_IMPORTED_MODULE_107__["default"]; });
- /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return _isArguments_js__WEBPACK_IMPORTED_MODULE_108__["default"]; });
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _isArray_js__WEBPACK_IMPORTED_MODULE_109__["default"]; });
- /* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/lodash-es/isArrayBuffer.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_110__["default"]; });
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return _isArrayLike_js__WEBPACK_IMPORTED_MODULE_111__["default"]; });
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLikeObject", function() { return _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_112__["default"]; });
- /* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/lodash-es/isBoolean.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return _isBoolean_js__WEBPACK_IMPORTED_MODULE_113__["default"]; });
- /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBuffer", function() { return _isBuffer_js__WEBPACK_IMPORTED_MODULE_114__["default"]; });
- /* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/lodash-es/isDate.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return _isDate_js__WEBPACK_IMPORTED_MODULE_115__["default"]; });
- /* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/lodash-es/isElement.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _isElement_js__WEBPACK_IMPORTED_MODULE_116__["default"]; });
- /* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/lodash-es/isEmpty.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _isEmpty_js__WEBPACK_IMPORTED_MODULE_117__["default"]; });
- /* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/lodash-es/isEqual.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return _isEqual_js__WEBPACK_IMPORTED_MODULE_118__["default"]; });
- /* harmony import */ var _isEqualWith_js__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(/*! ./isEqualWith.js */ "./node_modules/lodash-es/isEqualWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqualWith", function() { return _isEqualWith_js__WEBPACK_IMPORTED_MODULE_119__["default"]; });
- /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _isError_js__WEBPACK_IMPORTED_MODULE_120__["default"]; });
- /* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/lodash-es/isFinite.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return _isFinite_js__WEBPACK_IMPORTED_MODULE_121__["default"]; });
- /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return _isFunction_js__WEBPACK_IMPORTED_MODULE_122__["default"]; });
- /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInteger", function() { return _isInteger_js__WEBPACK_IMPORTED_MODULE_123__["default"]; });
- /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _isLength_js__WEBPACK_IMPORTED_MODULE_124__["default"]; });
- /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return _isMap_js__WEBPACK_IMPORTED_MODULE_125__["default"]; });
- /* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/lodash-es/isMatch.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return _isMatch_js__WEBPACK_IMPORTED_MODULE_126__["default"]; });
- /* harmony import */ var _isMatchWith_js__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(/*! ./isMatchWith.js */ "./node_modules/lodash-es/isMatchWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatchWith", function() { return _isMatchWith_js__WEBPACK_IMPORTED_MODULE_127__["default"]; });
- /* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/lodash-es/isNaN.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return _isNaN_js__WEBPACK_IMPORTED_MODULE_128__["default"]; });
- /* harmony import */ var _isNative_js__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(/*! ./isNative.js */ "./node_modules/lodash-es/isNative.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return _isNative_js__WEBPACK_IMPORTED_MODULE_129__["default"]; });
- /* harmony import */ var _isNil_js__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(/*! ./isNil.js */ "./node_modules/lodash-es/isNil.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return _isNil_js__WEBPACK_IMPORTED_MODULE_130__["default"]; });
- /* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_131__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/lodash-es/isNull.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return _isNull_js__WEBPACK_IMPORTED_MODULE_131__["default"]; });
- /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_132__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return _isNumber_js__WEBPACK_IMPORTED_MODULE_132__["default"]; });
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_133__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _isObject_js__WEBPACK_IMPORTED_MODULE_133__["default"]; });
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_134__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObjectLike", function() { return _isObjectLike_js__WEBPACK_IMPORTED_MODULE_134__["default"]; });
- /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_135__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _isPlainObject_js__WEBPACK_IMPORTED_MODULE_135__["default"]; });
- /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_136__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _isRegExp_js__WEBPACK_IMPORTED_MODULE_136__["default"]; });
- /* harmony import */ var _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_137__ = __webpack_require__(/*! ./isSafeInteger.js */ "./node_modules/lodash-es/isSafeInteger.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSafeInteger", function() { return _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_137__["default"]; });
- /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_138__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return _isSet_js__WEBPACK_IMPORTED_MODULE_138__["default"]; });
- /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_139__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _isString_js__WEBPACK_IMPORTED_MODULE_139__["default"]; });
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_140__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return _isSymbol_js__WEBPACK_IMPORTED_MODULE_140__["default"]; });
- /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return _isTypedArray_js__WEBPACK_IMPORTED_MODULE_141__["default"]; });
- /* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/lodash-es/isUndefined.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return _isUndefined_js__WEBPACK_IMPORTED_MODULE_142__["default"]; });
- /* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/lodash-es/isWeakMap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return _isWeakMap_js__WEBPACK_IMPORTED_MODULE_143__["default"]; });
- /* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/lodash-es/isWeakSet.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return _isWeakSet_js__WEBPACK_IMPORTED_MODULE_144__["default"]; });
- /* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/lodash-es/iteratee.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return _iteratee_js__WEBPACK_IMPORTED_MODULE_145__["default"]; });
- /* harmony import */ var _join_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(/*! ./join.js */ "./node_modules/lodash-es/join.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _join_js__WEBPACK_IMPORTED_MODULE_146__["default"]; });
- /* harmony import */ var _kebabCase_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(/*! ./kebabCase.js */ "./node_modules/lodash-es/kebabCase.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "kebabCase", function() { return _kebabCase_js__WEBPACK_IMPORTED_MODULE_147__["default"]; });
- /* harmony import */ var _keyBy_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(/*! ./keyBy.js */ "./node_modules/lodash-es/keyBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyBy", function() { return _keyBy_js__WEBPACK_IMPORTED_MODULE_148__["default"]; });
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return _keys_js__WEBPACK_IMPORTED_MODULE_149__["default"]; });
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keysIn", function() { return _keysIn_js__WEBPACK_IMPORTED_MODULE_150__["default"]; });
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _last_js__WEBPACK_IMPORTED_MODULE_151__["default"]; });
- /* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/lodash-es/lastIndexOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_152__["default"]; });
- /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lodash", function() { return _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_153__["default"]; });
- /* harmony import */ var _lowerCase_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(/*! ./lowerCase.js */ "./node_modules/lodash-es/lowerCase.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerCase", function() { return _lowerCase_js__WEBPACK_IMPORTED_MODULE_154__["default"]; });
- /* harmony import */ var _lowerFirst_js__WEBPACK_IMPORTED_MODULE_155__ = __webpack_require__(/*! ./lowerFirst.js */ "./node_modules/lodash-es/lowerFirst.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerFirst", function() { return _lowerFirst_js__WEBPACK_IMPORTED_MODULE_155__["default"]; });
- /* harmony import */ var _lt_js__WEBPACK_IMPORTED_MODULE_156__ = __webpack_require__(/*! ./lt.js */ "./node_modules/lodash-es/lt.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lt", function() { return _lt_js__WEBPACK_IMPORTED_MODULE_156__["default"]; });
- /* harmony import */ var _lte_js__WEBPACK_IMPORTED_MODULE_157__ = __webpack_require__(/*! ./lte.js */ "./node_modules/lodash-es/lte.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lte", function() { return _lte_js__WEBPACK_IMPORTED_MODULE_157__["default"]; });
- /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _map_js__WEBPACK_IMPORTED_MODULE_158__["default"]; });
- /* harmony import */ var _mapKeys_js__WEBPACK_IMPORTED_MODULE_159__ = __webpack_require__(/*! ./mapKeys.js */ "./node_modules/lodash-es/mapKeys.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapKeys", function() { return _mapKeys_js__WEBPACK_IMPORTED_MODULE_159__["default"]; });
- /* harmony import */ var _mapValues_js__WEBPACK_IMPORTED_MODULE_160__ = __webpack_require__(/*! ./mapValues.js */ "./node_modules/lodash-es/mapValues.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapValues", function() { return _mapValues_js__WEBPACK_IMPORTED_MODULE_160__["default"]; });
- /* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_161__ = __webpack_require__(/*! ./matches.js */ "./node_modules/lodash-es/matches.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return _matches_js__WEBPACK_IMPORTED_MODULE_161__["default"]; });
- /* harmony import */ var _matchesProperty_js__WEBPACK_IMPORTED_MODULE_162__ = __webpack_require__(/*! ./matchesProperty.js */ "./node_modules/lodash-es/matchesProperty.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matchesProperty", function() { return _matchesProperty_js__WEBPACK_IMPORTED_MODULE_162__["default"]; });
- /* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_163__ = __webpack_require__(/*! ./max.js */ "./node_modules/lodash-es/max.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _max_js__WEBPACK_IMPORTED_MODULE_163__["default"]; });
- /* harmony import */ var _maxBy_js__WEBPACK_IMPORTED_MODULE_164__ = __webpack_require__(/*! ./maxBy.js */ "./node_modules/lodash-es/maxBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maxBy", function() { return _maxBy_js__WEBPACK_IMPORTED_MODULE_164__["default"]; });
- /* harmony import */ var _mean_js__WEBPACK_IMPORTED_MODULE_165__ = __webpack_require__(/*! ./mean.js */ "./node_modules/lodash-es/mean.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mean", function() { return _mean_js__WEBPACK_IMPORTED_MODULE_165__["default"]; });
- /* harmony import */ var _meanBy_js__WEBPACK_IMPORTED_MODULE_166__ = __webpack_require__(/*! ./meanBy.js */ "./node_modules/lodash-es/meanBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "meanBy", function() { return _meanBy_js__WEBPACK_IMPORTED_MODULE_166__["default"]; });
- /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_167__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return _memoize_js__WEBPACK_IMPORTED_MODULE_167__["default"]; });
- /* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_168__ = __webpack_require__(/*! ./merge.js */ "./node_modules/lodash-es/merge.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _merge_js__WEBPACK_IMPORTED_MODULE_168__["default"]; });
- /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_169__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeWith", function() { return _mergeWith_js__WEBPACK_IMPORTED_MODULE_169__["default"]; });
- /* harmony import */ var _method_js__WEBPACK_IMPORTED_MODULE_170__ = __webpack_require__(/*! ./method.js */ "./node_modules/lodash-es/method.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "method", function() { return _method_js__WEBPACK_IMPORTED_MODULE_170__["default"]; });
- /* harmony import */ var _methodOf_js__WEBPACK_IMPORTED_MODULE_171__ = __webpack_require__(/*! ./methodOf.js */ "./node_modules/lodash-es/methodOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "methodOf", function() { return _methodOf_js__WEBPACK_IMPORTED_MODULE_171__["default"]; });
- /* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_172__ = __webpack_require__(/*! ./min.js */ "./node_modules/lodash-es/min.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _min_js__WEBPACK_IMPORTED_MODULE_172__["default"]; });
- /* harmony import */ var _minBy_js__WEBPACK_IMPORTED_MODULE_173__ = __webpack_require__(/*! ./minBy.js */ "./node_modules/lodash-es/minBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "minBy", function() { return _minBy_js__WEBPACK_IMPORTED_MODULE_173__["default"]; });
- /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_174__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return _mixin_js__WEBPACK_IMPORTED_MODULE_174__["default"]; });
- /* harmony import */ var _multiply_js__WEBPACK_IMPORTED_MODULE_175__ = __webpack_require__(/*! ./multiply.js */ "./node_modules/lodash-es/multiply.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return _multiply_js__WEBPACK_IMPORTED_MODULE_175__["default"]; });
- /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_176__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return _negate_js__WEBPACK_IMPORTED_MODULE_176__["default"]; });
- /* harmony import */ var _next_js__WEBPACK_IMPORTED_MODULE_177__ = __webpack_require__(/*! ./next.js */ "./node_modules/lodash-es/next.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "next", function() { return _next_js__WEBPACK_IMPORTED_MODULE_177__["default"]; });
- /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_178__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _noop_js__WEBPACK_IMPORTED_MODULE_178__["default"]; });
- /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_179__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "now", function() { return _now_js__WEBPACK_IMPORTED_MODULE_179__["default"]; });
- /* harmony import */ var _nth_js__WEBPACK_IMPORTED_MODULE_180__ = __webpack_require__(/*! ./nth.js */ "./node_modules/lodash-es/nth.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nth", function() { return _nth_js__WEBPACK_IMPORTED_MODULE_180__["default"]; });
- /* harmony import */ var _nthArg_js__WEBPACK_IMPORTED_MODULE_181__ = __webpack_require__(/*! ./nthArg.js */ "./node_modules/lodash-es/nthArg.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nthArg", function() { return _nthArg_js__WEBPACK_IMPORTED_MODULE_181__["default"]; });
- /* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_182__ = __webpack_require__(/*! ./omit.js */ "./node_modules/lodash-es/omit.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return _omit_js__WEBPACK_IMPORTED_MODULE_182__["default"]; });
- /* harmony import */ var _omitBy_js__WEBPACK_IMPORTED_MODULE_183__ = __webpack_require__(/*! ./omitBy.js */ "./node_modules/lodash-es/omitBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omitBy", function() { return _omitBy_js__WEBPACK_IMPORTED_MODULE_183__["default"]; });
- /* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_184__ = __webpack_require__(/*! ./once.js */ "./node_modules/lodash-es/once.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "once", function() { return _once_js__WEBPACK_IMPORTED_MODULE_184__["default"]; });
- /* harmony import */ var _orderBy_js__WEBPACK_IMPORTED_MODULE_185__ = __webpack_require__(/*! ./orderBy.js */ "./node_modules/lodash-es/orderBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "orderBy", function() { return _orderBy_js__WEBPACK_IMPORTED_MODULE_185__["default"]; });
- /* harmony import */ var _over_js__WEBPACK_IMPORTED_MODULE_186__ = __webpack_require__(/*! ./over.js */ "./node_modules/lodash-es/over.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "over", function() { return _over_js__WEBPACK_IMPORTED_MODULE_186__["default"]; });
- /* harmony import */ var _overArgs_js__WEBPACK_IMPORTED_MODULE_187__ = __webpack_require__(/*! ./overArgs.js */ "./node_modules/lodash-es/overArgs.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overArgs", function() { return _overArgs_js__WEBPACK_IMPORTED_MODULE_187__["default"]; });
- /* harmony import */ var _overEvery_js__WEBPACK_IMPORTED_MODULE_188__ = __webpack_require__(/*! ./overEvery.js */ "./node_modules/lodash-es/overEvery.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overEvery", function() { return _overEvery_js__WEBPACK_IMPORTED_MODULE_188__["default"]; });
- /* harmony import */ var _overSome_js__WEBPACK_IMPORTED_MODULE_189__ = __webpack_require__(/*! ./overSome.js */ "./node_modules/lodash-es/overSome.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overSome", function() { return _overSome_js__WEBPACK_IMPORTED_MODULE_189__["default"]; });
- /* harmony import */ var _pad_js__WEBPACK_IMPORTED_MODULE_190__ = __webpack_require__(/*! ./pad.js */ "./node_modules/lodash-es/pad.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return _pad_js__WEBPACK_IMPORTED_MODULE_190__["default"]; });
- /* harmony import */ var _padEnd_js__WEBPACK_IMPORTED_MODULE_191__ = __webpack_require__(/*! ./padEnd.js */ "./node_modules/lodash-es/padEnd.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padEnd", function() { return _padEnd_js__WEBPACK_IMPORTED_MODULE_191__["default"]; });
- /* harmony import */ var _padStart_js__WEBPACK_IMPORTED_MODULE_192__ = __webpack_require__(/*! ./padStart.js */ "./node_modules/lodash-es/padStart.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padStart", function() { return _padStart_js__WEBPACK_IMPORTED_MODULE_192__["default"]; });
- /* harmony import */ var _parseInt_js__WEBPACK_IMPORTED_MODULE_193__ = __webpack_require__(/*! ./parseInt.js */ "./node_modules/lodash-es/parseInt.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseInt", function() { return _parseInt_js__WEBPACK_IMPORTED_MODULE_193__["default"]; });
- /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_194__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return _partial_js__WEBPACK_IMPORTED_MODULE_194__["default"]; });
- /* harmony import */ var _partialRight_js__WEBPACK_IMPORTED_MODULE_195__ = __webpack_require__(/*! ./partialRight.js */ "./node_modules/lodash-es/partialRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partialRight", function() { return _partialRight_js__WEBPACK_IMPORTED_MODULE_195__["default"]; });
- /* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_196__ = __webpack_require__(/*! ./partition.js */ "./node_modules/lodash-es/partition.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _partition_js__WEBPACK_IMPORTED_MODULE_196__["default"]; });
- /* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_197__ = __webpack_require__(/*! ./pick.js */ "./node_modules/lodash-es/pick.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return _pick_js__WEBPACK_IMPORTED_MODULE_197__["default"]; });
- /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_198__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pickBy", function() { return _pickBy_js__WEBPACK_IMPORTED_MODULE_198__["default"]; });
- /* harmony import */ var _plant_js__WEBPACK_IMPORTED_MODULE_199__ = __webpack_require__(/*! ./plant.js */ "./node_modules/lodash-es/plant.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "plant", function() { return _plant_js__WEBPACK_IMPORTED_MODULE_199__["default"]; });
- /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_200__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "property", function() { return _property_js__WEBPACK_IMPORTED_MODULE_200__["default"]; });
- /* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_201__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/lodash-es/propertyOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return _propertyOf_js__WEBPACK_IMPORTED_MODULE_201__["default"]; });
- /* harmony import */ var _pull_js__WEBPACK_IMPORTED_MODULE_202__ = __webpack_require__(/*! ./pull.js */ "./node_modules/lodash-es/pull.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pull", function() { return _pull_js__WEBPACK_IMPORTED_MODULE_202__["default"]; });
- /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_203__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAll", function() { return _pullAll_js__WEBPACK_IMPORTED_MODULE_203__["default"]; });
- /* harmony import */ var _pullAllBy_js__WEBPACK_IMPORTED_MODULE_204__ = __webpack_require__(/*! ./pullAllBy.js */ "./node_modules/lodash-es/pullAllBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllBy", function() { return _pullAllBy_js__WEBPACK_IMPORTED_MODULE_204__["default"]; });
- /* harmony import */ var _pullAllWith_js__WEBPACK_IMPORTED_MODULE_205__ = __webpack_require__(/*! ./pullAllWith.js */ "./node_modules/lodash-es/pullAllWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllWith", function() { return _pullAllWith_js__WEBPACK_IMPORTED_MODULE_205__["default"]; });
- /* harmony import */ var _pullAt_js__WEBPACK_IMPORTED_MODULE_206__ = __webpack_require__(/*! ./pullAt.js */ "./node_modules/lodash-es/pullAt.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAt", function() { return _pullAt_js__WEBPACK_IMPORTED_MODULE_206__["default"]; });
- /* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_207__ = __webpack_require__(/*! ./random.js */ "./node_modules/lodash-es/random.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "random", function() { return _random_js__WEBPACK_IMPORTED_MODULE_207__["default"]; });
- /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_208__ = __webpack_require__(/*! ./range.js */ "./node_modules/lodash-es/range.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _range_js__WEBPACK_IMPORTED_MODULE_208__["default"]; });
- /* harmony import */ var _rangeRight_js__WEBPACK_IMPORTED_MODULE_209__ = __webpack_require__(/*! ./rangeRight.js */ "./node_modules/lodash-es/rangeRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rangeRight", function() { return _rangeRight_js__WEBPACK_IMPORTED_MODULE_209__["default"]; });
- /* harmony import */ var _rearg_js__WEBPACK_IMPORTED_MODULE_210__ = __webpack_require__(/*! ./rearg.js */ "./node_modules/lodash-es/rearg.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rearg", function() { return _rearg_js__WEBPACK_IMPORTED_MODULE_210__["default"]; });
- /* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_211__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/lodash-es/reduce.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _reduce_js__WEBPACK_IMPORTED_MODULE_211__["default"]; });
- /* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_212__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/lodash-es/reduceRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return _reduceRight_js__WEBPACK_IMPORTED_MODULE_212__["default"]; });
- /* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_213__ = __webpack_require__(/*! ./reject.js */ "./node_modules/lodash-es/reject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return _reject_js__WEBPACK_IMPORTED_MODULE_213__["default"]; });
- /* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_214__ = __webpack_require__(/*! ./remove.js */ "./node_modules/lodash-es/remove.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove_js__WEBPACK_IMPORTED_MODULE_214__["default"]; });
- /* harmony import */ var _repeat_js__WEBPACK_IMPORTED_MODULE_215__ = __webpack_require__(/*! ./repeat.js */ "./node_modules/lodash-es/repeat.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _repeat_js__WEBPACK_IMPORTED_MODULE_215__["default"]; });
- /* harmony import */ var _replace_js__WEBPACK_IMPORTED_MODULE_216__ = __webpack_require__(/*! ./replace.js */ "./node_modules/lodash-es/replace.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return _replace_js__WEBPACK_IMPORTED_MODULE_216__["default"]; });
- /* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_217__ = __webpack_require__(/*! ./rest.js */ "./node_modules/lodash-es/rest.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return _rest_js__WEBPACK_IMPORTED_MODULE_217__["default"]; });
- /* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_218__ = __webpack_require__(/*! ./result.js */ "./node_modules/lodash-es/result.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "result", function() { return _result_js__WEBPACK_IMPORTED_MODULE_218__["default"]; });
- /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_219__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return _reverse_js__WEBPACK_IMPORTED_MODULE_219__["default"]; });
- /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_220__ = __webpack_require__(/*! ./round.js */ "./node_modules/lodash-es/round.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "round", function() { return _round_js__WEBPACK_IMPORTED_MODULE_220__["default"]; });
- /* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_221__ = __webpack_require__(/*! ./sample.js */ "./node_modules/lodash-es/sample.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _sample_js__WEBPACK_IMPORTED_MODULE_221__["default"]; });
- /* harmony import */ var _sampleSize_js__WEBPACK_IMPORTED_MODULE_222__ = __webpack_require__(/*! ./sampleSize.js */ "./node_modules/lodash-es/sampleSize.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleSize", function() { return _sampleSize_js__WEBPACK_IMPORTED_MODULE_222__["default"]; });
- /* harmony import */ var _set_js__WEBPACK_IMPORTED_MODULE_223__ = __webpack_require__(/*! ./set.js */ "./node_modules/lodash-es/set.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "set", function() { return _set_js__WEBPACK_IMPORTED_MODULE_223__["default"]; });
- /* harmony import */ var _setWith_js__WEBPACK_IMPORTED_MODULE_224__ = __webpack_require__(/*! ./setWith.js */ "./node_modules/lodash-es/setWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setWith", function() { return _setWith_js__WEBPACK_IMPORTED_MODULE_224__["default"]; });
- /* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_225__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/lodash-es/shuffle.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return _shuffle_js__WEBPACK_IMPORTED_MODULE_225__["default"]; });
- /* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_226__ = __webpack_require__(/*! ./size.js */ "./node_modules/lodash-es/size.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "size", function() { return _size_js__WEBPACK_IMPORTED_MODULE_226__["default"]; });
- /* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_227__ = __webpack_require__(/*! ./slice.js */ "./node_modules/lodash-es/slice.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return _slice_js__WEBPACK_IMPORTED_MODULE_227__["default"]; });
- /* harmony import */ var _snakeCase_js__WEBPACK_IMPORTED_MODULE_228__ = __webpack_require__(/*! ./snakeCase.js */ "./node_modules/lodash-es/snakeCase.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "snakeCase", function() { return _snakeCase_js__WEBPACK_IMPORTED_MODULE_228__["default"]; });
- /* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_229__ = __webpack_require__(/*! ./some.js */ "./node_modules/lodash-es/some.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "some", function() { return _some_js__WEBPACK_IMPORTED_MODULE_229__["default"]; });
- /* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_230__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/lodash-es/sortBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return _sortBy_js__WEBPACK_IMPORTED_MODULE_230__["default"]; });
- /* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_231__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/lodash-es/sortedIndex.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return _sortedIndex_js__WEBPACK_IMPORTED_MODULE_231__["default"]; });
- /* harmony import */ var _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_232__ = __webpack_require__(/*! ./sortedIndexBy.js */ "./node_modules/lodash-es/sortedIndexBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexBy", function() { return _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_232__["default"]; });
- /* harmony import */ var _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_233__ = __webpack_require__(/*! ./sortedIndexOf.js */ "./node_modules/lodash-es/sortedIndexOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexOf", function() { return _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_233__["default"]; });
- /* harmony import */ var _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_234__ = __webpack_require__(/*! ./sortedLastIndex.js */ "./node_modules/lodash-es/sortedLastIndex.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndex", function() { return _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_234__["default"]; });
- /* harmony import */ var _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_235__ = __webpack_require__(/*! ./sortedLastIndexBy.js */ "./node_modules/lodash-es/sortedLastIndexBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexBy", function() { return _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_235__["default"]; });
- /* harmony import */ var _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_236__ = __webpack_require__(/*! ./sortedLastIndexOf.js */ "./node_modules/lodash-es/sortedLastIndexOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexOf", function() { return _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_236__["default"]; });
- /* harmony import */ var _sortedUniq_js__WEBPACK_IMPORTED_MODULE_237__ = __webpack_require__(/*! ./sortedUniq.js */ "./node_modules/lodash-es/sortedUniq.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniq", function() { return _sortedUniq_js__WEBPACK_IMPORTED_MODULE_237__["default"]; });
- /* harmony import */ var _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_238__ = __webpack_require__(/*! ./sortedUniqBy.js */ "./node_modules/lodash-es/sortedUniqBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniqBy", function() { return _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_238__["default"]; });
- /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_239__ = __webpack_require__(/*! ./split.js */ "./node_modules/lodash-es/split.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "split", function() { return _split_js__WEBPACK_IMPORTED_MODULE_239__["default"]; });
- /* harmony import */ var _spread_js__WEBPACK_IMPORTED_MODULE_240__ = __webpack_require__(/*! ./spread.js */ "./node_modules/lodash-es/spread.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "spread", function() { return _spread_js__WEBPACK_IMPORTED_MODULE_240__["default"]; });
- /* harmony import */ var _startCase_js__WEBPACK_IMPORTED_MODULE_241__ = __webpack_require__(/*! ./startCase.js */ "./node_modules/lodash-es/startCase.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startCase", function() { return _startCase_js__WEBPACK_IMPORTED_MODULE_241__["default"]; });
- /* harmony import */ var _startsWith_js__WEBPACK_IMPORTED_MODULE_242__ = __webpack_require__(/*! ./startsWith.js */ "./node_modules/lodash-es/startsWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return _startsWith_js__WEBPACK_IMPORTED_MODULE_242__["default"]; });
- /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_243__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubArray", function() { return _stubArray_js__WEBPACK_IMPORTED_MODULE_243__["default"]; });
- /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_244__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubFalse", function() { return _stubFalse_js__WEBPACK_IMPORTED_MODULE_244__["default"]; });
- /* harmony import */ var _stubObject_js__WEBPACK_IMPORTED_MODULE_245__ = __webpack_require__(/*! ./stubObject.js */ "./node_modules/lodash-es/stubObject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubObject", function() { return _stubObject_js__WEBPACK_IMPORTED_MODULE_245__["default"]; });
- /* harmony import */ var _stubString_js__WEBPACK_IMPORTED_MODULE_246__ = __webpack_require__(/*! ./stubString.js */ "./node_modules/lodash-es/stubString.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubString", function() { return _stubString_js__WEBPACK_IMPORTED_MODULE_246__["default"]; });
- /* harmony import */ var _stubTrue_js__WEBPACK_IMPORTED_MODULE_247__ = __webpack_require__(/*! ./stubTrue.js */ "./node_modules/lodash-es/stubTrue.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubTrue", function() { return _stubTrue_js__WEBPACK_IMPORTED_MODULE_247__["default"]; });
- /* harmony import */ var _subtract_js__WEBPACK_IMPORTED_MODULE_248__ = __webpack_require__(/*! ./subtract.js */ "./node_modules/lodash-es/subtract.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return _subtract_js__WEBPACK_IMPORTED_MODULE_248__["default"]; });
- /* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_249__ = __webpack_require__(/*! ./sum.js */ "./node_modules/lodash-es/sum.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return _sum_js__WEBPACK_IMPORTED_MODULE_249__["default"]; });
- /* harmony import */ var _sumBy_js__WEBPACK_IMPORTED_MODULE_250__ = __webpack_require__(/*! ./sumBy.js */ "./node_modules/lodash-es/sumBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sumBy", function() { return _sumBy_js__WEBPACK_IMPORTED_MODULE_250__["default"]; });
- /* harmony import */ var _tail_js__WEBPACK_IMPORTED_MODULE_251__ = __webpack_require__(/*! ./tail.js */ "./node_modules/lodash-es/tail.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return _tail_js__WEBPACK_IMPORTED_MODULE_251__["default"]; });
- /* harmony import */ var _take_js__WEBPACK_IMPORTED_MODULE_252__ = __webpack_require__(/*! ./take.js */ "./node_modules/lodash-es/take.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _take_js__WEBPACK_IMPORTED_MODULE_252__["default"]; });
- /* harmony import */ var _takeRight_js__WEBPACK_IMPORTED_MODULE_253__ = __webpack_require__(/*! ./takeRight.js */ "./node_modules/lodash-es/takeRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRight", function() { return _takeRight_js__WEBPACK_IMPORTED_MODULE_253__["default"]; });
- /* harmony import */ var _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_254__ = __webpack_require__(/*! ./takeRightWhile.js */ "./node_modules/lodash-es/takeRightWhile.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRightWhile", function() { return _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_254__["default"]; });
- /* harmony import */ var _takeWhile_js__WEBPACK_IMPORTED_MODULE_255__ = __webpack_require__(/*! ./takeWhile.js */ "./node_modules/lodash-es/takeWhile.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _takeWhile_js__WEBPACK_IMPORTED_MODULE_255__["default"]; });
- /* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_256__ = __webpack_require__(/*! ./tap.js */ "./node_modules/lodash-es/tap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _tap_js__WEBPACK_IMPORTED_MODULE_256__["default"]; });
- /* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_257__ = __webpack_require__(/*! ./template.js */ "./node_modules/lodash-es/template.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "template", function() { return _template_js__WEBPACK_IMPORTED_MODULE_257__["default"]; });
- /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_258__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return _templateSettings_js__WEBPACK_IMPORTED_MODULE_258__["default"]; });
- /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_259__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/lodash-es/throttle.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _throttle_js__WEBPACK_IMPORTED_MODULE_259__["default"]; });
- /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_260__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thru", function() { return _thru_js__WEBPACK_IMPORTED_MODULE_260__["default"]; });
- /* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_261__ = __webpack_require__(/*! ./times.js */ "./node_modules/lodash-es/times.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "times", function() { return _times_js__WEBPACK_IMPORTED_MODULE_261__["default"]; });
- /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_262__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _toArray_js__WEBPACK_IMPORTED_MODULE_262__["default"]; });
- /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_263__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toFinite", function() { return _toFinite_js__WEBPACK_IMPORTED_MODULE_263__["default"]; });
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_264__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toInteger", function() { return _toInteger_js__WEBPACK_IMPORTED_MODULE_264__["default"]; });
- /* harmony import */ var _toIterator_js__WEBPACK_IMPORTED_MODULE_265__ = __webpack_require__(/*! ./toIterator.js */ "./node_modules/lodash-es/toIterator.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toIterator", function() { return _toIterator_js__WEBPACK_IMPORTED_MODULE_265__["default"]; });
- /* harmony import */ var _toJSON_js__WEBPACK_IMPORTED_MODULE_266__ = __webpack_require__(/*! ./toJSON.js */ "./node_modules/lodash-es/toJSON.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toJSON", function() { return _toJSON_js__WEBPACK_IMPORTED_MODULE_266__["default"]; });
- /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_267__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLength", function() { return _toLength_js__WEBPACK_IMPORTED_MODULE_267__["default"]; });
- /* harmony import */ var _toLower_js__WEBPACK_IMPORTED_MODULE_268__ = __webpack_require__(/*! ./toLower.js */ "./node_modules/lodash-es/toLower.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLower", function() { return _toLower_js__WEBPACK_IMPORTED_MODULE_268__["default"]; });
- /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_269__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toNumber", function() { return _toNumber_js__WEBPACK_IMPORTED_MODULE_269__["default"]; });
- /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_270__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairs", function() { return _toPairs_js__WEBPACK_IMPORTED_MODULE_270__["default"]; });
- /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_271__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairsIn", function() { return _toPairsIn_js__WEBPACK_IMPORTED_MODULE_271__["default"]; });
- /* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_272__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/lodash-es/toPath.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return _toPath_js__WEBPACK_IMPORTED_MODULE_272__["default"]; });
- /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_273__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPlainObject", function() { return _toPlainObject_js__WEBPACK_IMPORTED_MODULE_273__["default"]; });
- /* harmony import */ var _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_274__ = __webpack_require__(/*! ./toSafeInteger.js */ "./node_modules/lodash-es/toSafeInteger.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toSafeInteger", function() { return _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_274__["default"]; });
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_275__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return _toString_js__WEBPACK_IMPORTED_MODULE_275__["default"]; });
- /* harmony import */ var _toUpper_js__WEBPACK_IMPORTED_MODULE_276__ = __webpack_require__(/*! ./toUpper.js */ "./node_modules/lodash-es/toUpper.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUpper", function() { return _toUpper_js__WEBPACK_IMPORTED_MODULE_276__["default"]; });
- /* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_277__ = __webpack_require__(/*! ./transform.js */ "./node_modules/lodash-es/transform.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return _transform_js__WEBPACK_IMPORTED_MODULE_277__["default"]; });
- /* harmony import */ var _trim_js__WEBPACK_IMPORTED_MODULE_278__ = __webpack_require__(/*! ./trim.js */ "./node_modules/lodash-es/trim.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return _trim_js__WEBPACK_IMPORTED_MODULE_278__["default"]; });
- /* harmony import */ var _trimEnd_js__WEBPACK_IMPORTED_MODULE_279__ = __webpack_require__(/*! ./trimEnd.js */ "./node_modules/lodash-es/trimEnd.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimEnd", function() { return _trimEnd_js__WEBPACK_IMPORTED_MODULE_279__["default"]; });
- /* harmony import */ var _trimStart_js__WEBPACK_IMPORTED_MODULE_280__ = __webpack_require__(/*! ./trimStart.js */ "./node_modules/lodash-es/trimStart.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimStart", function() { return _trimStart_js__WEBPACK_IMPORTED_MODULE_280__["default"]; });
- /* harmony import */ var _truncate_js__WEBPACK_IMPORTED_MODULE_281__ = __webpack_require__(/*! ./truncate.js */ "./node_modules/lodash-es/truncate.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return _truncate_js__WEBPACK_IMPORTED_MODULE_281__["default"]; });
- /* harmony import */ var _unary_js__WEBPACK_IMPORTED_MODULE_282__ = __webpack_require__(/*! ./unary.js */ "./node_modules/lodash-es/unary.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unary", function() { return _unary_js__WEBPACK_IMPORTED_MODULE_282__["default"]; });
- /* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_283__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/lodash-es/unescape.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return _unescape_js__WEBPACK_IMPORTED_MODULE_283__["default"]; });
- /* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_284__ = __webpack_require__(/*! ./union.js */ "./node_modules/lodash-es/union.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "union", function() { return _union_js__WEBPACK_IMPORTED_MODULE_284__["default"]; });
- /* harmony import */ var _unionBy_js__WEBPACK_IMPORTED_MODULE_285__ = __webpack_require__(/*! ./unionBy.js */ "./node_modules/lodash-es/unionBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionBy", function() { return _unionBy_js__WEBPACK_IMPORTED_MODULE_285__["default"]; });
- /* harmony import */ var _unionWith_js__WEBPACK_IMPORTED_MODULE_286__ = __webpack_require__(/*! ./unionWith.js */ "./node_modules/lodash-es/unionWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionWith", function() { return _unionWith_js__WEBPACK_IMPORTED_MODULE_286__["default"]; });
- /* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_287__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/lodash-es/uniq.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return _uniq_js__WEBPACK_IMPORTED_MODULE_287__["default"]; });
- /* harmony import */ var _uniqBy_js__WEBPACK_IMPORTED_MODULE_288__ = __webpack_require__(/*! ./uniqBy.js */ "./node_modules/lodash-es/uniqBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqBy", function() { return _uniqBy_js__WEBPACK_IMPORTED_MODULE_288__["default"]; });
- /* harmony import */ var _uniqWith_js__WEBPACK_IMPORTED_MODULE_289__ = __webpack_require__(/*! ./uniqWith.js */ "./node_modules/lodash-es/uniqWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqWith", function() { return _uniqWith_js__WEBPACK_IMPORTED_MODULE_289__["default"]; });
- /* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_290__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/lodash-es/uniqueId.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return _uniqueId_js__WEBPACK_IMPORTED_MODULE_290__["default"]; });
- /* harmony import */ var _unset_js__WEBPACK_IMPORTED_MODULE_291__ = __webpack_require__(/*! ./unset.js */ "./node_modules/lodash-es/unset.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unset", function() { return _unset_js__WEBPACK_IMPORTED_MODULE_291__["default"]; });
- /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_292__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return _unzip_js__WEBPACK_IMPORTED_MODULE_292__["default"]; });
- /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_293__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzipWith", function() { return _unzipWith_js__WEBPACK_IMPORTED_MODULE_293__["default"]; });
- /* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_294__ = __webpack_require__(/*! ./update.js */ "./node_modules/lodash-es/update.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "update", function() { return _update_js__WEBPACK_IMPORTED_MODULE_294__["default"]; });
- /* harmony import */ var _updateWith_js__WEBPACK_IMPORTED_MODULE_295__ = __webpack_require__(/*! ./updateWith.js */ "./node_modules/lodash-es/updateWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateWith", function() { return _updateWith_js__WEBPACK_IMPORTED_MODULE_295__["default"]; });
- /* harmony import */ var _upperCase_js__WEBPACK_IMPORTED_MODULE_296__ = __webpack_require__(/*! ./upperCase.js */ "./node_modules/lodash-es/upperCase.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperCase", function() { return _upperCase_js__WEBPACK_IMPORTED_MODULE_296__["default"]; });
- /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_297__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return _upperFirst_js__WEBPACK_IMPORTED_MODULE_297__["default"]; });
- /* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_298__ = __webpack_require__(/*! ./value.js */ "./node_modules/lodash-es/value.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "value", function() { return _value_js__WEBPACK_IMPORTED_MODULE_298__["default"]; });
- /* harmony import */ var _valueOf_js__WEBPACK_IMPORTED_MODULE_299__ = __webpack_require__(/*! ./valueOf.js */ "./node_modules/lodash-es/valueOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valueOf", function() { return _valueOf_js__WEBPACK_IMPORTED_MODULE_299__["default"]; });
- /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_300__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "values", function() { return _values_js__WEBPACK_IMPORTED_MODULE_300__["default"]; });
- /* harmony import */ var _valuesIn_js__WEBPACK_IMPORTED_MODULE_301__ = __webpack_require__(/*! ./valuesIn.js */ "./node_modules/lodash-es/valuesIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valuesIn", function() { return _valuesIn_js__WEBPACK_IMPORTED_MODULE_301__["default"]; });
- /* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_302__ = __webpack_require__(/*! ./without.js */ "./node_modules/lodash-es/without.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "without", function() { return _without_js__WEBPACK_IMPORTED_MODULE_302__["default"]; });
- /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_303__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "words", function() { return _words_js__WEBPACK_IMPORTED_MODULE_303__["default"]; });
- /* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_304__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/lodash-es/wrap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _wrap_js__WEBPACK_IMPORTED_MODULE_304__["default"]; });
- /* harmony import */ var _wrapperAt_js__WEBPACK_IMPORTED_MODULE_305__ = __webpack_require__(/*! ./wrapperAt.js */ "./node_modules/lodash-es/wrapperAt.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperAt", function() { return _wrapperAt_js__WEBPACK_IMPORTED_MODULE_305__["default"]; });
- /* harmony import */ var _wrapperChain_js__WEBPACK_IMPORTED_MODULE_306__ = __webpack_require__(/*! ./wrapperChain.js */ "./node_modules/lodash-es/wrapperChain.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperChain", function() { return _wrapperChain_js__WEBPACK_IMPORTED_MODULE_306__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperCommit", function() { return _commit_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperLodash", function() { return _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_153__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperNext", function() { return _next_js__WEBPACK_IMPORTED_MODULE_177__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperPlant", function() { return _plant_js__WEBPACK_IMPORTED_MODULE_199__["default"]; });
- /* harmony import */ var _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_307__ = __webpack_require__(/*! ./wrapperReverse.js */ "./node_modules/lodash-es/wrapperReverse.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperReverse", function() { return _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_307__["default"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperToIterator", function() { return _toIterator_js__WEBPACK_IMPORTED_MODULE_265__["default"]; });
- /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_308__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperValue", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_308__["default"]; });
- /* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_309__ = __webpack_require__(/*! ./xor.js */ "./node_modules/lodash-es/xor.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xor", function() { return _xor_js__WEBPACK_IMPORTED_MODULE_309__["default"]; });
- /* harmony import */ var _xorBy_js__WEBPACK_IMPORTED_MODULE_310__ = __webpack_require__(/*! ./xorBy.js */ "./node_modules/lodash-es/xorBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorBy", function() { return _xorBy_js__WEBPACK_IMPORTED_MODULE_310__["default"]; });
- /* harmony import */ var _xorWith_js__WEBPACK_IMPORTED_MODULE_311__ = __webpack_require__(/*! ./xorWith.js */ "./node_modules/lodash-es/xorWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorWith", function() { return _xorWith_js__WEBPACK_IMPORTED_MODULE_311__["default"]; });
- /* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_312__ = __webpack_require__(/*! ./zip.js */ "./node_modules/lodash-es/zip.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _zip_js__WEBPACK_IMPORTED_MODULE_312__["default"]; });
- /* harmony import */ var _zipObject_js__WEBPACK_IMPORTED_MODULE_313__ = __webpack_require__(/*! ./zipObject.js */ "./node_modules/lodash-es/zipObject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObject", function() { return _zipObject_js__WEBPACK_IMPORTED_MODULE_313__["default"]; });
- /* harmony import */ var _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_314__ = __webpack_require__(/*! ./zipObjectDeep.js */ "./node_modules/lodash-es/zipObjectDeep.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObjectDeep", function() { return _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_314__["default"]; });
- /* harmony import */ var _zipWith_js__WEBPACK_IMPORTED_MODULE_315__ = __webpack_require__(/*! ./zipWith.js */ "./node_modules/lodash-es/zipWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipWith", function() { return _zipWith_js__WEBPACK_IMPORTED_MODULE_315__["default"]; });
- /* harmony import */ var _lodash_default_js__WEBPACK_IMPORTED_MODULE_316__ = __webpack_require__(/*! ./lodash.default.js */ "./node_modules/lodash-es/lodash.default.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _lodash_default_js__WEBPACK_IMPORTED_MODULE_316__["default"]; });
- /**
- * @license
- * Lodash (Custom Build) <https://lodash.com/>
- * Build: `lodash modularize exports="es" -o ./`
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
- /***/ }),
- /***/ "./node_modules/lodash-es/lowerCase.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/lowerCase.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
- /**
- * Converts `string`, as space separated words, to lower case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the lower cased string.
- * @example
- *
- * _.lowerCase('--Foo-Bar--');
- * // => 'foo bar'
- *
- * _.lowerCase('fooBar');
- * // => 'foo bar'
- *
- * _.lowerCase('__FOO_BAR__');
- * // => 'foo bar'
- */
- var lowerCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
- return result + (index ? ' ' : '') + word.toLowerCase();
- });
- /* harmony default export */ __webpack_exports__["default"] = (lowerCase);
- /***/ }),
- /***/ "./node_modules/lodash-es/lowerFirst.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/lowerFirst.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCaseFirst.js */ "./node_modules/lodash-es/_createCaseFirst.js");
- /**
- * Converts the first character of `string` to lower case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.lowerFirst('Fred');
- * // => 'fred'
- *
- * _.lowerFirst('FRED');
- * // => 'fRED'
- */
- var lowerFirst = Object(_createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__["default"])('toLowerCase');
- /* harmony default export */ __webpack_exports__["default"] = (lowerFirst);
- /***/ }),
- /***/ "./node_modules/lodash-es/lt.js":
- /*!**************************************!*\
- !*** ./node_modules/lodash-es/lt.js ***!
- \**************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseLt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseLt.js */ "./node_modules/lodash-es/_baseLt.js");
- /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
- /**
- * Checks if `value` is less than `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than `other`,
- * else `false`.
- * @see _.gt
- * @example
- *
- * _.lt(1, 3);
- * // => true
- *
- * _.lt(3, 3);
- * // => false
- *
- * _.lt(3, 1);
- * // => false
- */
- var lt = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseLt_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (lt);
- /***/ }),
- /***/ "./node_modules/lodash-es/lte.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/lte.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
- /**
- * Checks if `value` is less than or equal to `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than or equal to
- * `other`, else `false`.
- * @see _.gte
- * @example
- *
- * _.lte(1, 3);
- * // => true
- *
- * _.lte(3, 3);
- * // => true
- *
- * _.lte(3, 1);
- * // => false
- */
- var lte = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(value, other) {
- return value <= other;
- });
- /* harmony default export */ __webpack_exports__["default"] = (lte);
- /***/ }),
- /***/ "./node_modules/lodash-es/map.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/map.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseMap.js */ "./node_modules/lodash-es/_baseMap.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * Creates an array of values by running each element in `collection` thru
- * `iteratee`. The iteratee is invoked with three arguments:
- * (value, index|key, collection).
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
- *
- * The guarded methods are:
- * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
- * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
- * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
- * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * _.map([4, 8], square);
- * // => [16, 64]
- *
- * _.map({ 'a': 4, 'b': 8 }, square);
- * // => [16, 64] (iteration order is not guaranteed)
- *
- * var users = [
- * { 'user': 'barney' },
- * { 'user': 'fred' }
- * ];
- *
- * // The `_.property` iteratee shorthand.
- * _.map(users, 'user');
- * // => ['barney', 'fred']
- */
- function map(collection, iteratee) {
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseMap_js__WEBPACK_IMPORTED_MODULE_2__["default"];
- return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 3));
- }
- /* harmony default export */ __webpack_exports__["default"] = (map);
- /***/ }),
- /***/ "./node_modules/lodash-es/mapKeys.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/mapKeys.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
- /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /**
- * The opposite of `_.mapValues`; this method creates an object with the
- * same values as `object` and keys generated by running each own enumerable
- * string keyed property of `object` thru `iteratee`. The iteratee is invoked
- * with three arguments: (value, key, object).
- *
- * @static
- * @memberOf _
- * @since 3.8.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns the new mapped object.
- * @see _.mapValues
- * @example
- *
- * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
- * return key + value;
- * });
- * // => { 'a1': 1, 'b2': 2 }
- */
- function mapKeys(object, iteratee) {
- var result = {};
- iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 3);
- Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, function(value, key, object) {
- Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, iteratee(value, key, object), value);
- });
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (mapKeys);
- /***/ }),
- /***/ "./node_modules/lodash-es/mapValues.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/mapValues.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
- /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /**
- * Creates an object with the same keys as `object` and values generated
- * by running each own enumerable string keyed property of `object` thru
- * `iteratee`. The iteratee is invoked with three arguments:
- * (value, key, object).
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns the new mapped object.
- * @see _.mapKeys
- * @example
- *
- * var users = {
- * 'fred': { 'user': 'fred', 'age': 40 },
- * 'pebbles': { 'user': 'pebbles', 'age': 1 }
- * };
- *
- * _.mapValues(users, function(o) { return o.age; });
- * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
- *
- * // The `_.property` iteratee shorthand.
- * _.mapValues(users, 'age');
- * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
- */
- function mapValues(object, iteratee) {
- var result = {};
- iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 3);
- Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, function(value, key, object) {
- Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, iteratee(value, key, object));
- });
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (mapValues);
- /***/ }),
- /***/ "./node_modules/lodash-es/matches.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/matches.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
- /* harmony import */ var _baseMatches_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMatches.js */ "./node_modules/lodash-es/_baseMatches.js");
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1;
- /**
- * Creates a function that performs a partial deep comparison between a given
- * object and `source`, returning `true` if the given object has equivalent
- * property values, else `false`.
- *
- * **Note:** The created function is equivalent to `_.isMatch` with `source`
- * partially applied.
- *
- * Partial comparisons will match empty array and empty object `source`
- * values against any array or object value, respectively. See `_.isEqual`
- * for a list of supported value comparisons.
- *
- * **Note:** Multiple values can be checked by combining several matchers
- * using `_.overSome`
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new spec function.
- * @example
- *
- * var objects = [
- * { 'a': 1, 'b': 2, 'c': 3 },
- * { 'a': 4, 'b': 5, 'c': 6 }
- * ];
- *
- * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
- * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
- *
- * // Checking for several possible values
- * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
- * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
- */
- function matches(source) {
- return Object(_baseMatches_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, CLONE_DEEP_FLAG));
- }
- /* harmony default export */ __webpack_exports__["default"] = (matches);
- /***/ }),
- /***/ "./node_modules/lodash-es/matchesProperty.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/matchesProperty.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
- /* harmony import */ var _baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMatchesProperty.js */ "./node_modules/lodash-es/_baseMatchesProperty.js");
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1;
- /**
- * Creates a function that performs a partial deep comparison between the
- * value at `path` of a given object to `srcValue`, returning `true` if the
- * object value is equivalent, else `false`.
- *
- * **Note:** Partial comparisons will match empty array and empty object
- * `srcValue` values against any array or object value, respectively. See
- * `_.isEqual` for a list of supported value comparisons.
- *
- * **Note:** Multiple values can be checked by combining several matchers
- * using `_.overSome`
- *
- * @static
- * @memberOf _
- * @since 3.2.0
- * @category Util
- * @param {Array|string} path The path of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new spec function.
- * @example
- *
- * var objects = [
- * { 'a': 1, 'b': 2, 'c': 3 },
- * { 'a': 4, 'b': 5, 'c': 6 }
- * ];
- *
- * _.find(objects, _.matchesProperty('a', 4));
- * // => { 'a': 4, 'b': 5, 'c': 6 }
- *
- * // Checking for several possible values
- * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
- * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
- */
- function matchesProperty(path, srcValue) {
- return Object(_baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(srcValue, CLONE_DEEP_FLAG));
- }
- /* harmony default export */ __webpack_exports__["default"] = (matchesProperty);
- /***/ }),
- /***/ "./node_modules/lodash-es/math.default.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/math.default.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "./node_modules/lodash-es/add.js");
- /* harmony import */ var _ceil_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ceil.js */ "./node_modules/lodash-es/ceil.js");
- /* harmony import */ var _divide_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./divide.js */ "./node_modules/lodash-es/divide.js");
- /* harmony import */ var _floor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./floor.js */ "./node_modules/lodash-es/floor.js");
- /* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./max.js */ "./node_modules/lodash-es/max.js");
- /* harmony import */ var _maxBy_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./maxBy.js */ "./node_modules/lodash-es/maxBy.js");
- /* harmony import */ var _mean_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mean.js */ "./node_modules/lodash-es/mean.js");
- /* harmony import */ var _meanBy_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./meanBy.js */ "./node_modules/lodash-es/meanBy.js");
- /* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./min.js */ "./node_modules/lodash-es/min.js");
- /* harmony import */ var _minBy_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./minBy.js */ "./node_modules/lodash-es/minBy.js");
- /* harmony import */ var _multiply_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./multiply.js */ "./node_modules/lodash-es/multiply.js");
- /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./round.js */ "./node_modules/lodash-es/round.js");
- /* harmony import */ var _subtract_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./subtract.js */ "./node_modules/lodash-es/subtract.js");
- /* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./sum.js */ "./node_modules/lodash-es/sum.js");
- /* harmony import */ var _sumBy_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sumBy.js */ "./node_modules/lodash-es/sumBy.js");
- /* harmony default export */ __webpack_exports__["default"] = ({
- add: _add_js__WEBPACK_IMPORTED_MODULE_0__["default"], ceil: _ceil_js__WEBPACK_IMPORTED_MODULE_1__["default"], divide: _divide_js__WEBPACK_IMPORTED_MODULE_2__["default"], floor: _floor_js__WEBPACK_IMPORTED_MODULE_3__["default"], max: _max_js__WEBPACK_IMPORTED_MODULE_4__["default"],
- maxBy: _maxBy_js__WEBPACK_IMPORTED_MODULE_5__["default"], mean: _mean_js__WEBPACK_IMPORTED_MODULE_6__["default"], meanBy: _meanBy_js__WEBPACK_IMPORTED_MODULE_7__["default"], min: _min_js__WEBPACK_IMPORTED_MODULE_8__["default"], minBy: _minBy_js__WEBPACK_IMPORTED_MODULE_9__["default"],
- multiply: _multiply_js__WEBPACK_IMPORTED_MODULE_10__["default"], round: _round_js__WEBPACK_IMPORTED_MODULE_11__["default"], subtract: _subtract_js__WEBPACK_IMPORTED_MODULE_12__["default"], sum: _sum_js__WEBPACK_IMPORTED_MODULE_13__["default"], sumBy: _sumBy_js__WEBPACK_IMPORTED_MODULE_14__["default"]
- });
- /***/ }),
- /***/ "./node_modules/lodash-es/math.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/math.js ***!
- \****************************************/
- /*! exports provided: add, ceil, divide, floor, max, maxBy, mean, meanBy, min, minBy, multiply, round, subtract, sum, sumBy, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "./node_modules/lodash-es/add.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "add", function() { return _add_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _ceil_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ceil.js */ "./node_modules/lodash-es/ceil.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return _ceil_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _divide_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./divide.js */ "./node_modules/lodash-es/divide.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return _divide_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _floor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./floor.js */ "./node_modules/lodash-es/floor.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return _floor_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./max.js */ "./node_modules/lodash-es/max.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _max_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _maxBy_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./maxBy.js */ "./node_modules/lodash-es/maxBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maxBy", function() { return _maxBy_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _mean_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mean.js */ "./node_modules/lodash-es/mean.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mean", function() { return _mean_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _meanBy_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./meanBy.js */ "./node_modules/lodash-es/meanBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "meanBy", function() { return _meanBy_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./min.js */ "./node_modules/lodash-es/min.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _min_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _minBy_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./minBy.js */ "./node_modules/lodash-es/minBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "minBy", function() { return _minBy_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _multiply_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./multiply.js */ "./node_modules/lodash-es/multiply.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return _multiply_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./round.js */ "./node_modules/lodash-es/round.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "round", function() { return _round_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _subtract_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./subtract.js */ "./node_modules/lodash-es/subtract.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return _subtract_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./sum.js */ "./node_modules/lodash-es/sum.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return _sum_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _sumBy_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sumBy.js */ "./node_modules/lodash-es/sumBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sumBy", function() { return _sumBy_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _math_default_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./math.default.js */ "./node_modules/lodash-es/math.default.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _math_default_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/max.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/max.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
- /* harmony import */ var _baseGt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGt.js */ "./node_modules/lodash-es/_baseGt.js");
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /**
- * Computes the maximum value of `array`. If `array` is empty or falsey,
- * `undefined` is returned.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {*} Returns the maximum value.
- * @example
- *
- * _.max([4, 2, 8, 6]);
- * // => 8
- *
- * _.max([]);
- * // => undefined
- */
- function max(array) {
- return (array && array.length)
- ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"], _baseGt_js__WEBPACK_IMPORTED_MODULE_1__["default"])
- : undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (max);
- /***/ }),
- /***/ "./node_modules/lodash-es/maxBy.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/maxBy.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
- /* harmony import */ var _baseGt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGt.js */ "./node_modules/lodash-es/_baseGt.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /**
- * This method is like `_.max` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the criterion by which
- * the value is ranked. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {*} Returns the maximum value.
- * @example
- *
- * var objects = [{ 'n': 1 }, { 'n': 2 }];
- *
- * _.maxBy(objects, function(o) { return o.n; });
- * // => { 'n': 2 }
- *
- * // The `_.property` iteratee shorthand.
- * _.maxBy(objects, 'n');
- * // => { 'n': 2 }
- */
- function maxBy(array, iteratee) {
- return (array && array.length)
- ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2), _baseGt_js__WEBPACK_IMPORTED_MODULE_1__["default"])
- : undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (maxBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/mean.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/mean.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseMean_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMean.js */ "./node_modules/lodash-es/_baseMean.js");
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /**
- * Computes the mean of the values in `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {number} Returns the mean.
- * @example
- *
- * _.mean([4, 2, 8, 6]);
- * // => 5
- */
- function mean(array) {
- return Object(_baseMean_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (mean);
- /***/ }),
- /***/ "./node_modules/lodash-es/meanBy.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/meanBy.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseMean_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMean.js */ "./node_modules/lodash-es/_baseMean.js");
- /**
- * This method is like `_.mean` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the value to be averaged.
- * The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the mean.
- * @example
- *
- * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
- *
- * _.meanBy(objects, function(o) { return o.n; });
- * // => 5
- *
- * // The `_.property` iteratee shorthand.
- * _.meanBy(objects, 'n');
- * // => 5
- */
- function meanBy(array, iteratee) {
- return Object(_baseMean_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2));
- }
- /* harmony default export */ __webpack_exports__["default"] = (meanBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/memoize.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/memoize.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
- /** Error message constants. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /**
- * Creates a function that memoizes the result of `func`. If `resolver` is
- * provided, it determines the cache key for storing the result based on the
- * arguments provided to the memoized function. By default, the first argument
- * provided to the memoized function is used as the map cache key. The `func`
- * is invoked with the `this` binding of the memoized function.
- *
- * **Note:** The cache is exposed as the `cache` property on the memoized
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
- * constructor with one whose instances implement the
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to have its output memoized.
- * @param {Function} [resolver] The function to resolve the cache key.
- * @returns {Function} Returns the new memoized function.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- * var other = { 'c': 3, 'd': 4 };
- *
- * var values = _.memoize(_.values);
- * values(object);
- * // => [1, 2]
- *
- * values(other);
- * // => [3, 4]
- *
- * object.a = 2;
- * values(object);
- * // => [1, 2]
- *
- * // Modify the result cache.
- * values.cache.set(object, ['a', 'b']);
- * values(object);
- * // => ['a', 'b']
- *
- * // Replace `_.memoize.Cache`.
- * _.memoize.Cache = WeakMap;
- */
- function memoize(func, resolver) {
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var memoized = function() {
- var args = arguments,
- key = resolver ? resolver.apply(this, args) : args[0],
- cache = memoized.cache;
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result = func.apply(this, args);
- memoized.cache = cache.set(key, result) || cache;
- return result;
- };
- memoized.cache = new (memoize.Cache || _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- return memoized;
- }
- // Expose `MapCache`.
- memoize.Cache = _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (memoize);
- /***/ }),
- /***/ "./node_modules/lodash-es/merge.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/merge.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
- /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
- /**
- * This method is like `_.assign` except that it recursively merges own and
- * inherited enumerable string keyed properties of source objects into the
- * destination object. Source properties that resolve to `undefined` are
- * skipped if a destination value exists. Array and plain object properties
- * are merged recursively. Other objects and value types are overridden by
- * assignment. Source objects are applied from left to right. Subsequent
- * sources overwrite property assignments of previous sources.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 0.5.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = {
- * 'a': [{ 'b': 2 }, { 'd': 4 }]
- * };
- *
- * var other = {
- * 'a': [{ 'c': 3 }, { 'e': 5 }]
- * };
- *
- * _.merge(object, other);
- * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
- */
- var merge = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex) {
- Object(_baseMerge_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, srcIndex);
- });
- /* harmony default export */ __webpack_exports__["default"] = (merge);
- /***/ }),
- /***/ "./node_modules/lodash-es/mergeWith.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/mergeWith.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
- /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
- /**
- * This method is like `_.merge` except that it accepts `customizer` which
- * is invoked to produce the merged values of the destination and source
- * properties. If `customizer` returns `undefined`, merging is handled by the
- * method instead. The `customizer` is invoked with six arguments:
- * (objValue, srcValue, key, object, source, stack).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} sources The source objects.
- * @param {Function} customizer The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function customizer(objValue, srcValue) {
- * if (_.isArray(objValue)) {
- * return objValue.concat(srcValue);
- * }
- * }
- *
- * var object = { 'a': [1], 'b': [2] };
- * var other = { 'a': [3], 'b': [4] };
- *
- * _.mergeWith(object, other, customizer);
- * // => { 'a': [1, 3], 'b': [2, 4] }
- */
- var mergeWith = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex, customizer) {
- Object(_baseMerge_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, srcIndex, customizer);
- });
- /* harmony default export */ __webpack_exports__["default"] = (mergeWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/method.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/method.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /**
- * Creates a function that invokes the method at `path` of a given object.
- * Any additional arguments are provided to the invoked method.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Util
- * @param {Array|string} path The path of the method to invoke.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Function} Returns the new invoker function.
- * @example
- *
- * var objects = [
- * { 'a': { 'b': _.constant(2) } },
- * { 'a': { 'b': _.constant(1) } }
- * ];
- *
- * _.map(objects, _.method('a.b'));
- * // => [2, 1]
- *
- * _.map(objects, _.method(['a', 'b']));
- * // => [2, 1]
- */
- var method = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(path, args) {
- return function(object) {
- return Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, args);
- };
- });
- /* harmony default export */ __webpack_exports__["default"] = (method);
- /***/ }),
- /***/ "./node_modules/lodash-es/methodOf.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/methodOf.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /**
- * The opposite of `_.method`; this method creates a function that invokes
- * the method at a given path of `object`. Any additional arguments are
- * provided to the invoked method.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Util
- * @param {Object} object The object to query.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Function} Returns the new invoker function.
- * @example
- *
- * var array = _.times(3, _.constant),
- * object = { 'a': array, 'b': array, 'c': array };
- *
- * _.map(['a[2]', 'c[0]'], _.methodOf(object));
- * // => [2, 0]
- *
- * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
- * // => [2, 0]
- */
- var methodOf = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, args) {
- return function(path) {
- return Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, args);
- };
- });
- /* harmony default export */ __webpack_exports__["default"] = (methodOf);
- /***/ }),
- /***/ "./node_modules/lodash-es/min.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/min.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
- /* harmony import */ var _baseLt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseLt.js */ "./node_modules/lodash-es/_baseLt.js");
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /**
- * Computes the minimum value of `array`. If `array` is empty or falsey,
- * `undefined` is returned.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {*} Returns the minimum value.
- * @example
- *
- * _.min([4, 2, 8, 6]);
- * // => 2
- *
- * _.min([]);
- * // => undefined
- */
- function min(array) {
- return (array && array.length)
- ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"], _baseLt_js__WEBPACK_IMPORTED_MODULE_1__["default"])
- : undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (min);
- /***/ }),
- /***/ "./node_modules/lodash-es/minBy.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/minBy.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseLt_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseLt.js */ "./node_modules/lodash-es/_baseLt.js");
- /**
- * This method is like `_.min` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the criterion by which
- * the value is ranked. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {*} Returns the minimum value.
- * @example
- *
- * var objects = [{ 'n': 1 }, { 'n': 2 }];
- *
- * _.minBy(objects, function(o) { return o.n; });
- * // => { 'n': 1 }
- *
- * // The `_.property` iteratee shorthand.
- * _.minBy(objects, 'n');
- * // => { 'n': 1 }
- */
- function minBy(array, iteratee) {
- return (array && array.length)
- ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 2), _baseLt_js__WEBPACK_IMPORTED_MODULE_2__["default"])
- : undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (minBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/mixin.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/mixin.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
- /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
- /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
- /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
- /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * Adds all own enumerable string keyed function properties of a source
- * object to the destination object. If `object` is a function, then methods
- * are added to its prototype as well.
- *
- * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
- * avoid conflicts caused by modifying the original.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {Function|Object} [object=lodash] The destination object.
- * @param {Object} source The object of functions to add.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
- * @returns {Function|Object} Returns `object`.
- * @example
- *
- * function vowels(string) {
- * return _.filter(string, function(v) {
- * return /[aeiou]/i.test(v);
- * });
- * }
- *
- * _.mixin({ 'vowels': vowels });
- * _.vowels('fred');
- * // => ['e']
- *
- * _('fred').vowels().value();
- * // => ['e']
- *
- * _.mixin({ 'vowels': vowels }, { 'chain': false });
- * _('fred').vowels();
- * // => ['e']
- */
- function mixin(object, source, options) {
- var props = Object(_keys_js__WEBPACK_IMPORTED_MODULE_6__["default"])(source),
- methodNames = Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source, props);
- var chain = !(Object(_isObject_js__WEBPACK_IMPORTED_MODULE_5__["default"])(options) && 'chain' in options) || !!options.chain,
- isFunc = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object);
- Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(methodNames, function(methodName) {
- var func = source[methodName];
- object[methodName] = func;
- if (isFunc) {
- object.prototype[methodName] = function() {
- var chainAll = this.__chain__;
- if (chain || chainAll) {
- var result = object(this.__wrapped__),
- actions = result.__actions__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this.__actions__);
- actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
- result.__chain__ = chainAll;
- return result;
- }
- return func.apply(object, Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])([this.value()], arguments));
- };
- }
- });
- return object;
- }
- /* harmony default export */ __webpack_exports__["default"] = (mixin);
- /***/ }),
- /***/ "./node_modules/lodash-es/multiply.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/multiply.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
- /**
- * Multiply two numbers.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Math
- * @param {number} multiplier The first number in a multiplication.
- * @param {number} multiplicand The second number in a multiplication.
- * @returns {number} Returns the product.
- * @example
- *
- * _.multiply(6, 4);
- * // => 24
- */
- var multiply = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(multiplier, multiplicand) {
- return multiplier * multiplicand;
- }, 1);
- /* harmony default export */ __webpack_exports__["default"] = (multiply);
- /***/ }),
- /***/ "./node_modules/lodash-es/negate.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/negate.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Error message constants. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /**
- * Creates a function that negates the result of the predicate `func`. The
- * `func` predicate is invoked with the `this` binding and arguments of the
- * created function.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} predicate The predicate to negate.
- * @returns {Function} Returns the new negated function.
- * @example
- *
- * function isEven(n) {
- * return n % 2 == 0;
- * }
- *
- * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
- * // => [1, 3, 5]
- */
- function negate(predicate) {
- if (typeof predicate != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return function() {
- var args = arguments;
- switch (args.length) {
- case 0: return !predicate.call(this);
- case 1: return !predicate.call(this, args[0]);
- case 2: return !predicate.call(this, args[0], args[1]);
- case 3: return !predicate.call(this, args[0], args[1], args[2]);
- }
- return !predicate.apply(this, args);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (negate);
- /***/ }),
- /***/ "./node_modules/lodash-es/next.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/next.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
- /**
- * Gets the next value on a wrapped object following the
- * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
- *
- * @name next
- * @memberOf _
- * @since 4.0.0
- * @category Seq
- * @returns {Object} Returns the next iterator value.
- * @example
- *
- * var wrapped = _([1, 2]);
- *
- * wrapped.next();
- * // => { 'done': false, 'value': 1 }
- *
- * wrapped.next();
- * // => { 'done': false, 'value': 2 }
- *
- * wrapped.next();
- * // => { 'done': true, 'value': undefined }
- */
- function wrapperNext() {
- if (this.__values__ === undefined) {
- this.__values__ = Object(_toArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.value());
- }
- var done = this.__index__ >= this.__values__.length,
- value = done ? undefined : this.__values__[this.__index__++];
- return { 'done': done, 'value': value };
- }
- /* harmony default export */ __webpack_exports__["default"] = (wrapperNext);
- /***/ }),
- /***/ "./node_modules/lodash-es/noop.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/noop.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This method returns `undefined`.
- *
- * @static
- * @memberOf _
- * @since 2.3.0
- * @category Util
- * @example
- *
- * _.times(2, _.noop);
- * // => [undefined, undefined]
- */
- function noop() {
- // No operation performed.
- }
- /* harmony default export */ __webpack_exports__["default"] = (noop);
- /***/ }),
- /***/ "./node_modules/lodash-es/now.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/now.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /**
- * Gets the timestamp of the number of milliseconds that have elapsed since
- * the Unix epoch (1 January 1970 00:00:00 UTC).
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Date
- * @returns {number} Returns the timestamp.
- * @example
- *
- * _.defer(function(stamp) {
- * console.log(_.now() - stamp);
- * }, _.now());
- * // => Logs the number of milliseconds it took for the deferred invocation.
- */
- var now = function() {
- return _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Date.now();
- };
- /* harmony default export */ __webpack_exports__["default"] = (now);
- /***/ }),
- /***/ "./node_modules/lodash-es/nth.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/nth.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseNth_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseNth.js */ "./node_modules/lodash-es/_baseNth.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /**
- * Gets the element at index `n` of `array`. If `n` is negative, the nth
- * element from the end is returned.
- *
- * @static
- * @memberOf _
- * @since 4.11.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=0] The index of the element to return.
- * @returns {*} Returns the nth element of `array`.
- * @example
- *
- * var array = ['a', 'b', 'c', 'd'];
- *
- * _.nth(array, 1);
- * // => 'b'
- *
- * _.nth(array, -2);
- * // => 'c';
- */
- function nth(array, n) {
- return (array && array.length) ? Object(_baseNth_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n)) : undefined;
- }
- /* harmony default export */ __webpack_exports__["default"] = (nth);
- /***/ }),
- /***/ "./node_modules/lodash-es/nthArg.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/nthArg.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseNth_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseNth.js */ "./node_modules/lodash-es/_baseNth.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /**
- * Creates a function that gets the argument at index `n`. If `n` is negative,
- * the nth argument from the end is returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {number} [n=0] The index of the argument to return.
- * @returns {Function} Returns the new pass-thru function.
- * @example
- *
- * var func = _.nthArg(1);
- * func('a', 'b', 'c', 'd');
- * // => 'b'
- *
- * var func = _.nthArg(-2);
- * func('a', 'b', 'c', 'd');
- * // => 'c'
- */
- function nthArg(n) {
- n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(n);
- return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(args) {
- return Object(_baseNth_js__WEBPACK_IMPORTED_MODULE_0__["default"])(args, n);
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (nthArg);
- /***/ }),
- /***/ "./node_modules/lodash-es/number.default.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/number.default.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _clamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clamp.js */ "./node_modules/lodash-es/clamp.js");
- /* harmony import */ var _inRange_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inRange.js */ "./node_modules/lodash-es/inRange.js");
- /* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./random.js */ "./node_modules/lodash-es/random.js");
- /* harmony default export */ __webpack_exports__["default"] = ({
- clamp: _clamp_js__WEBPACK_IMPORTED_MODULE_0__["default"], inRange: _inRange_js__WEBPACK_IMPORTED_MODULE_1__["default"], random: _random_js__WEBPACK_IMPORTED_MODULE_2__["default"]
- });
- /***/ }),
- /***/ "./node_modules/lodash-es/number.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/number.js ***!
- \******************************************/
- /*! exports provided: clamp, inRange, random, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _clamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clamp.js */ "./node_modules/lodash-es/clamp.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return _clamp_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _inRange_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inRange.js */ "./node_modules/lodash-es/inRange.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inRange", function() { return _inRange_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./random.js */ "./node_modules/lodash-es/random.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "random", function() { return _random_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _number_default_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./number.default.js */ "./node_modules/lodash-es/number.default.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _number_default_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/object.default.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/object.default.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assign.js */ "./node_modules/lodash-es/assign.js");
- /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
- /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
- /* harmony import */ var _assignWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assignWith.js */ "./node_modules/lodash-es/assignWith.js");
- /* harmony import */ var _at_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./at.js */ "./node_modules/lodash-es/at.js");
- /* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create.js */ "./node_modules/lodash-es/create.js");
- /* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/lodash-es/defaults.js");
- /* harmony import */ var _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./defaultsDeep.js */ "./node_modules/lodash-es/defaultsDeep.js");
- /* harmony import */ var _entries_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./entries.js */ "./node_modules/lodash-es/entries.js");
- /* harmony import */ var _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./entriesIn.js */ "./node_modules/lodash-es/entriesIn.js");
- /* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./extend.js */ "./node_modules/lodash-es/extend.js");
- /* harmony import */ var _extendWith_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./extendWith.js */ "./node_modules/lodash-es/extendWith.js");
- /* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/lodash-es/findKey.js");
- /* harmony import */ var _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./findLastKey.js */ "./node_modules/lodash-es/findLastKey.js");
- /* harmony import */ var _forIn_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./forIn.js */ "./node_modules/lodash-es/forIn.js");
- /* harmony import */ var _forInRight_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./forInRight.js */ "./node_modules/lodash-es/forInRight.js");
- /* harmony import */ var _forOwn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./forOwn.js */ "./node_modules/lodash-es/forOwn.js");
- /* harmony import */ var _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./forOwnRight.js */ "./node_modules/lodash-es/forOwnRight.js");
- /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./functions.js */ "./node_modules/lodash-es/functions.js");
- /* harmony import */ var _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./functionsIn.js */ "./node_modules/lodash-es/functionsIn.js");
- /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
- /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./has.js */ "./node_modules/lodash-es/has.js");
- /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
- /* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./invert.js */ "./node_modules/lodash-es/invert.js");
- /* harmony import */ var _invertBy_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./invertBy.js */ "./node_modules/lodash-es/invertBy.js");
- /* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/lodash-es/invoke.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /* harmony import */ var _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./mapKeys.js */ "./node_modules/lodash-es/mapKeys.js");
- /* harmony import */ var _mapValues_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./mapValues.js */ "./node_modules/lodash-es/mapValues.js");
- /* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./merge.js */ "./node_modules/lodash-es/merge.js");
- /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
- /* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./omit.js */ "./node_modules/lodash-es/omit.js");
- /* harmony import */ var _omitBy_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./omitBy.js */ "./node_modules/lodash-es/omitBy.js");
- /* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./pick.js */ "./node_modules/lodash-es/pick.js");
- /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
- /* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./result.js */ "./node_modules/lodash-es/result.js");
- /* harmony import */ var _set_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./set.js */ "./node_modules/lodash-es/set.js");
- /* harmony import */ var _setWith_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./setWith.js */ "./node_modules/lodash-es/setWith.js");
- /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
- /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
- /* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./transform.js */ "./node_modules/lodash-es/transform.js");
- /* harmony import */ var _unset_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./unset.js */ "./node_modules/lodash-es/unset.js");
- /* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./update.js */ "./node_modules/lodash-es/update.js");
- /* harmony import */ var _updateWith_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./updateWith.js */ "./node_modules/lodash-es/updateWith.js");
- /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
- /* harmony import */ var _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./valuesIn.js */ "./node_modules/lodash-es/valuesIn.js");
- /* harmony default export */ __webpack_exports__["default"] = ({
- assign: _assign_js__WEBPACK_IMPORTED_MODULE_0__["default"], assignIn: _assignIn_js__WEBPACK_IMPORTED_MODULE_1__["default"], assignInWith: _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__["default"], assignWith: _assignWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], at: _at_js__WEBPACK_IMPORTED_MODULE_4__["default"],
- create: _create_js__WEBPACK_IMPORTED_MODULE_5__["default"], defaults: _defaults_js__WEBPACK_IMPORTED_MODULE_6__["default"], defaultsDeep: _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__["default"], entries: _entries_js__WEBPACK_IMPORTED_MODULE_8__["default"], entriesIn: _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__["default"],
- extend: _extend_js__WEBPACK_IMPORTED_MODULE_10__["default"], extendWith: _extendWith_js__WEBPACK_IMPORTED_MODULE_11__["default"], findKey: _findKey_js__WEBPACK_IMPORTED_MODULE_12__["default"], findLastKey: _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__["default"], forIn: _forIn_js__WEBPACK_IMPORTED_MODULE_14__["default"],
- forInRight: _forInRight_js__WEBPACK_IMPORTED_MODULE_15__["default"], forOwn: _forOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"], forOwnRight: _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__["default"], functions: _functions_js__WEBPACK_IMPORTED_MODULE_18__["default"], functionsIn: _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__["default"],
- get: _get_js__WEBPACK_IMPORTED_MODULE_20__["default"], has: _has_js__WEBPACK_IMPORTED_MODULE_21__["default"], hasIn: _hasIn_js__WEBPACK_IMPORTED_MODULE_22__["default"], invert: _invert_js__WEBPACK_IMPORTED_MODULE_23__["default"], invertBy: _invertBy_js__WEBPACK_IMPORTED_MODULE_24__["default"],
- invoke: _invoke_js__WEBPACK_IMPORTED_MODULE_25__["default"], keys: _keys_js__WEBPACK_IMPORTED_MODULE_26__["default"], keysIn: _keysIn_js__WEBPACK_IMPORTED_MODULE_27__["default"], mapKeys: _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__["default"], mapValues: _mapValues_js__WEBPACK_IMPORTED_MODULE_29__["default"],
- merge: _merge_js__WEBPACK_IMPORTED_MODULE_30__["default"], mergeWith: _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__["default"], omit: _omit_js__WEBPACK_IMPORTED_MODULE_32__["default"], omitBy: _omitBy_js__WEBPACK_IMPORTED_MODULE_33__["default"], pick: _pick_js__WEBPACK_IMPORTED_MODULE_34__["default"],
- pickBy: _pickBy_js__WEBPACK_IMPORTED_MODULE_35__["default"], result: _result_js__WEBPACK_IMPORTED_MODULE_36__["default"], set: _set_js__WEBPACK_IMPORTED_MODULE_37__["default"], setWith: _setWith_js__WEBPACK_IMPORTED_MODULE_38__["default"], toPairs: _toPairs_js__WEBPACK_IMPORTED_MODULE_39__["default"],
- toPairsIn: _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__["default"], transform: _transform_js__WEBPACK_IMPORTED_MODULE_41__["default"], unset: _unset_js__WEBPACK_IMPORTED_MODULE_42__["default"], update: _update_js__WEBPACK_IMPORTED_MODULE_43__["default"], updateWith: _updateWith_js__WEBPACK_IMPORTED_MODULE_44__["default"],
- values: _values_js__WEBPACK_IMPORTED_MODULE_45__["default"], valuesIn: _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__["default"]
- });
- /***/ }),
- /***/ "./node_modules/lodash-es/object.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/object.js ***!
- \******************************************/
- /*! exports provided: assign, assignIn, assignInWith, assignWith, at, create, defaults, defaultsDeep, entries, entriesIn, extend, extendWith, findKey, findLastKey, forIn, forInRight, forOwn, forOwnRight, functions, functionsIn, get, has, hasIn, invert, invertBy, invoke, keys, keysIn, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, result, set, setWith, toPairs, toPairsIn, transform, unset, update, updateWith, values, valuesIn, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assign.js */ "./node_modules/lodash-es/assign.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return _assign_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignIn", function() { return _assignIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignInWith", function() { return _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _assignWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assignWith.js */ "./node_modules/lodash-es/assignWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignWith", function() { return _assignWith_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _at_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./at.js */ "./node_modules/lodash-es/at.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "at", function() { return _at_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create.js */ "./node_modules/lodash-es/create.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "create", function() { return _create_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/lodash-es/defaults.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return _defaults_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./defaultsDeep.js */ "./node_modules/lodash-es/defaultsDeep.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultsDeep", function() { return _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _entries_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./entries.js */ "./node_modules/lodash-es/entries.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entries", function() { return _entries_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./entriesIn.js */ "./node_modules/lodash-es/entriesIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entriesIn", function() { return _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./extend.js */ "./node_modules/lodash-es/extend.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return _extend_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _extendWith_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./extendWith.js */ "./node_modules/lodash-es/extendWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extendWith", function() { return _extendWith_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/lodash-es/findKey.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return _findKey_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./findLastKey.js */ "./node_modules/lodash-es/findLastKey.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastKey", function() { return _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _forIn_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./forIn.js */ "./node_modules/lodash-es/forIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forIn", function() { return _forIn_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _forInRight_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./forInRight.js */ "./node_modules/lodash-es/forInRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forInRight", function() { return _forInRight_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /* harmony import */ var _forOwn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./forOwn.js */ "./node_modules/lodash-es/forOwn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwn", function() { return _forOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
- /* harmony import */ var _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./forOwnRight.js */ "./node_modules/lodash-es/forOwnRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwnRight", function() { return _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./functions.js */ "./node_modules/lodash-es/functions.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return _functions_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
- /* harmony import */ var _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./functionsIn.js */ "./node_modules/lodash-es/functionsIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functionsIn", function() { return _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "get", function() { return _get_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./has.js */ "./node_modules/lodash-es/has.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "has", function() { return _has_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
- /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasIn", function() { return _hasIn_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
- /* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./invert.js */ "./node_modules/lodash-es/invert.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return _invert_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
- /* harmony import */ var _invertBy_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./invertBy.js */ "./node_modules/lodash-es/invertBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invertBy", function() { return _invertBy_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
- /* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/lodash-es/invoke.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return _invoke_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return _keys_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keysIn", function() { return _keysIn_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
- /* harmony import */ var _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./mapKeys.js */ "./node_modules/lodash-es/mapKeys.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapKeys", function() { return _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
- /* harmony import */ var _mapValues_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./mapValues.js */ "./node_modules/lodash-es/mapValues.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapValues", function() { return _mapValues_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
- /* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./merge.js */ "./node_modules/lodash-es/merge.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _merge_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
- /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeWith", function() { return _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
- /* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./omit.js */ "./node_modules/lodash-es/omit.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return _omit_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
- /* harmony import */ var _omitBy_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./omitBy.js */ "./node_modules/lodash-es/omitBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omitBy", function() { return _omitBy_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
- /* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./pick.js */ "./node_modules/lodash-es/pick.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return _pick_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
- /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pickBy", function() { return _pickBy_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
- /* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./result.js */ "./node_modules/lodash-es/result.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "result", function() { return _result_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
- /* harmony import */ var _set_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./set.js */ "./node_modules/lodash-es/set.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "set", function() { return _set_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
- /* harmony import */ var _setWith_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./setWith.js */ "./node_modules/lodash-es/setWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setWith", function() { return _setWith_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
- /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairs", function() { return _toPairs_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
- /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairsIn", function() { return _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
- /* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./transform.js */ "./node_modules/lodash-es/transform.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return _transform_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
- /* harmony import */ var _unset_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./unset.js */ "./node_modules/lodash-es/unset.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unset", function() { return _unset_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
- /* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./update.js */ "./node_modules/lodash-es/update.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "update", function() { return _update_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
- /* harmony import */ var _updateWith_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./updateWith.js */ "./node_modules/lodash-es/updateWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateWith", function() { return _updateWith_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
- /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "values", function() { return _values_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
- /* harmony import */ var _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./valuesIn.js */ "./node_modules/lodash-es/valuesIn.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valuesIn", function() { return _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
- /* harmony import */ var _object_default_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./object.default.js */ "./node_modules/lodash-es/object.default.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _object_default_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/omit.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/omit.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
- /* harmony import */ var _baseUnset_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUnset.js */ "./node_modules/lodash-es/_baseUnset.js");
- /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
- /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
- /* harmony import */ var _customOmitClone_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_customOmitClone.js */ "./node_modules/lodash-es/_customOmitClone.js");
- /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
- /* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1,
- CLONE_FLAT_FLAG = 2,
- CLONE_SYMBOLS_FLAG = 4;
- /**
- * The opposite of `_.pick`; this method creates an object composed of the
- * own and inherited enumerable property paths of `object` that are not omitted.
- *
- * **Note:** This method is considerably slower than `_.pick`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The source object.
- * @param {...(string|string[])} [paths] The property paths to omit.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.omit(object, ['a', 'c']);
- * // => { 'b': '2' }
- */
- var omit = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function(object, paths) {
- var result = {};
- if (object == null) {
- return result;
- }
- var isDeep = false;
- paths = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(paths, function(path) {
- path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_3__["default"])(path, object);
- isDeep || (isDeep = path.length > 1);
- return path;
- });
- Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object, Object(_getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_7__["default"])(object), result);
- if (isDeep) {
- result = Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, _customOmitClone_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
- }
- var length = paths.length;
- while (length--) {
- Object(_baseUnset_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result, paths[length]);
- }
- return result;
- });
- /* harmony default export */ __webpack_exports__["default"] = (omit);
- /***/ }),
- /***/ "./node_modules/lodash-es/omitBy.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/omitBy.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
- /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
- /**
- * The opposite of `_.pickBy`; this method creates an object composed of
- * the own and inherited enumerable string keyed properties of `object` that
- * `predicate` doesn't return truthy for. The predicate is invoked with two
- * arguments: (value, key).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The source object.
- * @param {Function} [predicate=_.identity] The function invoked per property.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.omitBy(object, _.isNumber);
- * // => { 'b': '2' }
- */
- function omitBy(object, predicate) {
- return Object(_pickBy_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, Object(_negate_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate)));
- }
- /* harmony default export */ __webpack_exports__["default"] = (omitBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/once.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/once.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
- /**
- * Creates a function that is restricted to invoking `func` once. Repeat calls
- * to the function return the value of the first invocation. The `func` is
- * invoked with the `this` binding and arguments of the created function.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var initialize = _.once(createApplication);
- * initialize();
- * initialize();
- * // => `createApplication` is invoked once
- */
- function once(func) {
- return Object(_before_js__WEBPACK_IMPORTED_MODULE_0__["default"])(2, func);
- }
- /* harmony default export */ __webpack_exports__["default"] = (once);
- /***/ }),
- /***/ "./node_modules/lodash-es/orderBy.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/orderBy.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseOrderBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseOrderBy.js */ "./node_modules/lodash-es/_baseOrderBy.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * This method is like `_.sortBy` except that it allows specifying the sort
- * orders of the iteratees to sort by. If `orders` is unspecified, all values
- * are sorted in ascending order. Otherwise, specify an order of "desc" for
- * descending or "asc" for ascending sort order of corresponding values.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
- * The iteratees to sort by.
- * @param {string[]} [orders] The sort orders of `iteratees`.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 34 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'barney', 'age': 36 }
- * ];
- *
- * // Sort by `user` in ascending order and by `age` in descending order.
- * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
- * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
- */
- function orderBy(collection, iteratees, orders, guard) {
- if (collection == null) {
- return [];
- }
- if (!Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratees)) {
- iteratees = iteratees == null ? [] : [iteratees];
- }
- orders = guard ? undefined : orders;
- if (!Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(orders)) {
- orders = orders == null ? [] : [orders];
- }
- return Object(_baseOrderBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, iteratees, orders);
- }
- /* harmony default export */ __webpack_exports__["default"] = (orderBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/over.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/over.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _createOver_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createOver.js */ "./node_modules/lodash-es/_createOver.js");
- /**
- * Creates a function that invokes `iteratees` with the arguments it receives
- * and returns their results.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {...(Function|Function[])} [iteratees=[_.identity]]
- * The iteratees to invoke.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var func = _.over([Math.max, Math.min]);
- *
- * func(1, 2, 3, 4);
- * // => [4, 1]
- */
- var over = Object(_createOver_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (over);
- /***/ }),
- /***/ "./node_modules/lodash-es/overArgs.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/overArgs.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
- /* harmony import */ var _castRest_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_castRest.js */ "./node_modules/lodash-es/_castRest.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMin = Math.min;
- /**
- * Creates a function that invokes `func` with its arguments transformed.
- *
- * @static
- * @since 4.0.0
- * @memberOf _
- * @category Function
- * @param {Function} func The function to wrap.
- * @param {...(Function|Function[])} [transforms=[_.identity]]
- * The argument transforms.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function doubled(n) {
- * return n * 2;
- * }
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var func = _.overArgs(function(x, y) {
- * return [x, y];
- * }, [square, doubled]);
- *
- * func(9, 3);
- * // => [81, 6]
- *
- * func(10, 5);
- * // => [100, 10]
- */
- var overArgs = Object(_castRest_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function(func, transforms) {
- transforms = (transforms.length == 1 && Object(_isArray_js__WEBPACK_IMPORTED_MODULE_7__["default"])(transforms[0]))
- ? Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(transforms[0], Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__["default"]))
- : Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_2__["default"])(transforms, 1), Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__["default"]));
- var funcsLength = transforms.length;
- return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_4__["default"])(function(args) {
- var index = -1,
- length = nativeMin(args.length, funcsLength);
- while (++index < length) {
- args[index] = transforms[index].call(this, args[index]);
- }
- return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, args);
- });
- });
- /* harmony default export */ __webpack_exports__["default"] = (overArgs);
- /***/ }),
- /***/ "./node_modules/lodash-es/overEvery.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/overEvery.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEvery.js */ "./node_modules/lodash-es/_arrayEvery.js");
- /* harmony import */ var _createOver_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createOver.js */ "./node_modules/lodash-es/_createOver.js");
- /**
- * Creates a function that checks if **all** of the `predicates` return
- * truthy when invoked with the arguments it receives.
- *
- * Following shorthands are possible for providing predicates.
- * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
- * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {...(Function|Function[])} [predicates=[_.identity]]
- * The predicates to check.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var func = _.overEvery([Boolean, isFinite]);
- *
- * func('1');
- * // => true
- *
- * func(null);
- * // => false
- *
- * func(NaN);
- * // => false
- */
- var overEvery = Object(_createOver_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (overEvery);
- /***/ }),
- /***/ "./node_modules/lodash-es/overSome.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/overSome.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
- /* harmony import */ var _createOver_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createOver.js */ "./node_modules/lodash-es/_createOver.js");
- /**
- * Creates a function that checks if **any** of the `predicates` return
- * truthy when invoked with the arguments it receives.
- *
- * Following shorthands are possible for providing predicates.
- * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
- * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {...(Function|Function[])} [predicates=[_.identity]]
- * The predicates to check.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var func = _.overSome([Boolean, isFinite]);
- *
- * func('1');
- * // => true
- *
- * func(null);
- * // => true
- *
- * func(NaN);
- * // => false
- *
- * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
- * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
- */
- var overSome = Object(_createOver_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_arraySome_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (overSome);
- /***/ }),
- /***/ "./node_modules/lodash-es/pad.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/pad.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createPadding_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPadding.js */ "./node_modules/lodash-es/_createPadding.js");
- /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeCeil = Math.ceil,
- nativeFloor = Math.floor;
- /**
- * Pads `string` on the left and right sides if it's shorter than `length`.
- * Padding characters are truncated if they can't be evenly divided by `length`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.pad('abc', 8);
- * // => ' abc '
- *
- * _.pad('abc', 8, '_-');
- * // => '_-abc_-_'
- *
- * _.pad('abc', 3);
- * // => 'abc'
- */
- function pad(string, length, chars) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
- length = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length);
- var strLength = length ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) : 0;
- if (!length || strLength >= length) {
- return string;
- }
- var mid = (length - strLength) / 2;
- return (
- Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nativeFloor(mid), chars) +
- string +
- Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nativeCeil(mid), chars)
- );
- }
- /* harmony default export */ __webpack_exports__["default"] = (pad);
- /***/ }),
- /***/ "./node_modules/lodash-es/padEnd.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/padEnd.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createPadding_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPadding.js */ "./node_modules/lodash-es/_createPadding.js");
- /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Pads `string` on the right side if it's shorter than `length`. Padding
- * characters are truncated if they exceed `length`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.padEnd('abc', 6);
- * // => 'abc '
- *
- * _.padEnd('abc', 6, '_-');
- * // => 'abc_-_'
- *
- * _.padEnd('abc', 3);
- * // => 'abc'
- */
- function padEnd(string, length, chars) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
- length = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length);
- var strLength = length ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) : 0;
- return (length && strLength < length)
- ? (string + Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(length - strLength, chars))
- : string;
- }
- /* harmony default export */ __webpack_exports__["default"] = (padEnd);
- /***/ }),
- /***/ "./node_modules/lodash-es/padStart.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/padStart.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createPadding_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPadding.js */ "./node_modules/lodash-es/_createPadding.js");
- /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Pads `string` on the left side if it's shorter than `length`. Padding
- * characters are truncated if they exceed `length`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.padStart('abc', 6);
- * // => ' abc'
- *
- * _.padStart('abc', 6, '_-');
- * // => '_-_abc'
- *
- * _.padStart('abc', 3);
- * // => 'abc'
- */
- function padStart(string, length, chars) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
- length = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length);
- var strLength = length ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) : 0;
- return (length && strLength < length)
- ? (Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(length - strLength, chars) + string)
- : string;
- }
- /* harmony default export */ __webpack_exports__["default"] = (padStart);
- /***/ }),
- /***/ "./node_modules/lodash-es/parseInt.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/parseInt.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /** Used to match leading whitespace. */
- var reTrimStart = /^\s+/;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeParseInt = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].parseInt;
- /**
- * Converts `string` to an integer of the specified radix. If `radix` is
- * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
- * hexadecimal, in which case a `radix` of `16` is used.
- *
- * **Note:** This method aligns with the
- * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category String
- * @param {string} string The string to convert.
- * @param {number} [radix=10] The radix to interpret `value` by.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.parseInt('08');
- * // => 8
- *
- * _.map(['6', '08', '10'], _.parseInt);
- * // => [6, 8, 10]
- */
- function parseInt(string, radix, guard) {
- if (guard || radix == null) {
- radix = 0;
- } else if (radix) {
- radix = +radix;
- }
- return nativeParseInt(Object(_toString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string).replace(reTrimStart, ''), radix || 0);
- }
- /* harmony default export */ __webpack_exports__["default"] = (parseInt);
- /***/ }),
- /***/ "./node_modules/lodash-es/partial.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/partial.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
- /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
- /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_PARTIAL_FLAG = 32;
- /**
- * Creates a function that invokes `func` with `partials` prepended to the
- * arguments it receives. This method is like `_.bind` except it does **not**
- * alter the `this` binding.
- *
- * The `_.partial.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method doesn't set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @since 0.2.0
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * function greet(greeting, name) {
- * return greeting + ' ' + name;
- * }
- *
- * var sayHelloTo = _.partial(greet, 'hello');
- * sayHelloTo('fred');
- * // => 'hello fred'
- *
- * // Partially applied with placeholders.
- * var greetFred = _.partial(greet, _, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- */
- var partial = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, partials) {
- var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(partial));
- return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
- });
- // Assign default placeholders.
- partial.placeholder = {};
- /* harmony default export */ __webpack_exports__["default"] = (partial);
- /***/ }),
- /***/ "./node_modules/lodash-es/partialRight.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/partialRight.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
- /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
- /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_PARTIAL_RIGHT_FLAG = 64;
- /**
- * This method is like `_.partial` except that partially applied arguments
- * are appended to the arguments it receives.
- *
- * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method doesn't set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * function greet(greeting, name) {
- * return greeting + ' ' + name;
- * }
- *
- * var greetFred = _.partialRight(greet, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- *
- * // Partially applied with placeholders.
- * var sayHelloTo = _.partialRight(greet, 'hello', _);
- * sayHelloTo('fred');
- * // => 'hello fred'
- */
- var partialRight = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, partials) {
- var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(partialRight));
- return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
- });
- // Assign default placeholders.
- partialRight.placeholder = {};
- /* harmony default export */ __webpack_exports__["default"] = (partialRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/partition.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/partition.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
- /**
- * Creates an array of elements split into two groups, the first of which
- * contains elements `predicate` returns truthy for, the second of which
- * contains elements `predicate` returns falsey for. The predicate is
- * invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the array of grouped elements.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true },
- * { 'user': 'pebbles', 'age': 1, 'active': false }
- * ];
- *
- * _.partition(users, function(o) { return o.active; });
- * // => objects for [['fred'], ['barney', 'pebbles']]
- *
- * // The `_.matches` iteratee shorthand.
- * _.partition(users, { 'age': 1, 'active': false });
- * // => objects for [['pebbles'], ['barney', 'fred']]
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.partition(users, ['active', false]);
- * // => objects for [['barney', 'pebbles'], ['fred']]
- *
- * // The `_.property` iteratee shorthand.
- * _.partition(users, 'active');
- * // => objects for [['fred'], ['barney', 'pebbles']]
- */
- var partition = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, value, key) {
- result[key ? 0 : 1].push(value);
- }, function() { return [[], []]; });
- /* harmony default export */ __webpack_exports__["default"] = (partition);
- /***/ }),
- /***/ "./node_modules/lodash-es/pick.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/pick.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _basePick_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePick.js */ "./node_modules/lodash-es/_basePick.js");
- /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
- /**
- * Creates an object composed of the picked `object` properties.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The source object.
- * @param {...(string|string[])} [paths] The property paths to pick.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.pick(object, ['a', 'c']);
- * // => { 'a': 1, 'c': 3 }
- */
- var pick = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, paths) {
- return object == null ? {} : Object(_basePick_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths);
- });
- /* harmony default export */ __webpack_exports__["default"] = (pick);
- /***/ }),
- /***/ "./node_modules/lodash-es/pickBy.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/pickBy.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _basePickBy_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_basePickBy.js */ "./node_modules/lodash-es/_basePickBy.js");
- /* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
- /**
- * Creates an object composed of the `object` properties `predicate` returns
- * truthy for. The predicate is invoked with two arguments: (value, key).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The source object.
- * @param {Function} [predicate=_.identity] The function invoked per property.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.pickBy(object, _.isNumber);
- * // => { 'a': 1, 'c': 3 }
- */
- function pickBy(object, predicate) {
- if (object == null) {
- return {};
- }
- var props = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object), function(prop) {
- return [prop];
- });
- predicate = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate);
- return Object(_basePickBy_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, props, function(value, path) {
- return predicate(value, path[0]);
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (pickBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/plant.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/plant.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
- /* harmony import */ var _wrapperClone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_wrapperClone.js */ "./node_modules/lodash-es/_wrapperClone.js");
- /**
- * Creates a clone of the chain sequence planting `value` as the wrapped value.
- *
- * @name plant
- * @memberOf _
- * @since 3.2.0
- * @category Seq
- * @param {*} value The value to plant.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var wrapped = _([1, 2]).map(square);
- * var other = wrapped.plant([3, 4]);
- *
- * other.value();
- * // => [9, 16]
- *
- * wrapped.value();
- * // => [1, 4]
- */
- function wrapperPlant(value) {
- var result,
- parent = this;
- while (parent instanceof _baseLodash_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
- var clone = Object(_wrapperClone_js__WEBPACK_IMPORTED_MODULE_1__["default"])(parent);
- clone.__index__ = 0;
- clone.__values__ = undefined;
- if (result) {
- previous.__wrapped__ = clone;
- } else {
- result = clone;
- }
- var previous = clone;
- parent = parent.__wrapped__;
- }
- previous.__wrapped__ = value;
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (wrapperPlant);
- /***/ }),
- /***/ "./node_modules/lodash-es/property.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/property.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseProperty.js */ "./node_modules/lodash-es/_baseProperty.js");
- /* harmony import */ var _basePropertyDeep_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePropertyDeep.js */ "./node_modules/lodash-es/_basePropertyDeep.js");
- /* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
- /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
- /**
- * Creates a function that returns the value at `path` of a given object.
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Util
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new accessor function.
- * @example
- *
- * var objects = [
- * { 'a': { 'b': 2 } },
- * { 'a': { 'b': 1 } }
- * ];
- *
- * _.map(objects, _.property('a.b'));
- * // => [2, 1]
- *
- * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
- * // => [1, 2]
- */
- function property(path) {
- return Object(_isKey_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path) ? Object(_baseProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toKey_js__WEBPACK_IMPORTED_MODULE_3__["default"])(path)) : Object(_basePropertyDeep_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path);
- }
- /* harmony default export */ __webpack_exports__["default"] = (property);
- /***/ }),
- /***/ "./node_modules/lodash-es/propertyOf.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/propertyOf.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
- /**
- * The opposite of `_.property`; this method creates a function that returns
- * the value at a given path of `object`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {Object} object The object to query.
- * @returns {Function} Returns the new accessor function.
- * @example
- *
- * var array = [0, 1, 2],
- * object = { 'a': array, 'b': array, 'c': array };
- *
- * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
- * // => [2, 0]
- *
- * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
- * // => [2, 0]
- */
- function propertyOf(object) {
- return function(path) {
- return object == null ? undefined : Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (propertyOf);
- /***/ }),
- /***/ "./node_modules/lodash-es/pull.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/pull.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
- /**
- * Removes all given values from `array` using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
- * to remove elements from an array by predicate.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {...*} [values] The values to remove.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
- *
- * _.pull(array, 'a', 'c');
- * console.log(array);
- * // => ['b', 'b']
- */
- var pull = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_pullAll_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (pull);
- /***/ }),
- /***/ "./node_modules/lodash-es/pullAll.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/pullAll.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _basePullAll_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePullAll.js */ "./node_modules/lodash-es/_basePullAll.js");
- /**
- * This method is like `_.pull` except that it accepts an array of values to remove.
- *
- * **Note:** Unlike `_.difference`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
- *
- * _.pullAll(array, ['a', 'c']);
- * console.log(array);
- * // => ['b', 'b']
- */
- function pullAll(array, values) {
- return (array && array.length && values && values.length)
- ? Object(_basePullAll_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, values)
- : array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (pullAll);
- /***/ }),
- /***/ "./node_modules/lodash-es/pullAllBy.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/pullAllBy.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _basePullAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePullAll.js */ "./node_modules/lodash-es/_basePullAll.js");
- /**
- * This method is like `_.pullAll` except that it accepts `iteratee` which is
- * invoked for each element of `array` and `values` to generate the criterion
- * by which they're compared. The iteratee is invoked with one argument: (value).
- *
- * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
- *
- * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
- * console.log(array);
- * // => [{ 'x': 2 }]
- */
- function pullAllBy(array, values, iteratee) {
- return (array && array.length && values && values.length)
- ? Object(_basePullAll_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, values, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2))
- : array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (pullAllBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/pullAllWith.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/pullAllWith.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _basePullAll_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePullAll.js */ "./node_modules/lodash-es/_basePullAll.js");
- /**
- * This method is like `_.pullAll` except that it accepts `comparator` which
- * is invoked to compare elements of `array` to `values`. The comparator is
- * invoked with two arguments: (arrVal, othVal).
- *
- * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 4.6.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
- *
- * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
- * console.log(array);
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
- */
- function pullAllWith(array, values, comparator) {
- return (array && array.length && values && values.length)
- ? Object(_basePullAll_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, values, undefined, comparator)
- : array;
- }
- /* harmony default export */ __webpack_exports__["default"] = (pullAllWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/pullAt.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/pullAt.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseAt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAt.js */ "./node_modules/lodash-es/_baseAt.js");
- /* harmony import */ var _basePullAt_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_basePullAt.js */ "./node_modules/lodash-es/_basePullAt.js");
- /* harmony import */ var _compareAscending_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_compareAscending.js */ "./node_modules/lodash-es/_compareAscending.js");
- /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
- /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
- /**
- * Removes elements from `array` corresponding to `indexes` and returns an
- * array of removed elements.
- *
- * **Note:** Unlike `_.at`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {...(number|number[])} [indexes] The indexes of elements to remove.
- * @returns {Array} Returns the new array of removed elements.
- * @example
- *
- * var array = ['a', 'b', 'c', 'd'];
- * var pulled = _.pullAt(array, [1, 3]);
- *
- * console.log(array);
- * // => ['a', 'c']
- *
- * console.log(pulled);
- * // => ['b', 'd']
- */
- var pullAt = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_4__["default"])(function(array, indexes) {
- var length = array == null ? 0 : array.length,
- result = Object(_baseAt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, indexes);
- Object(_basePullAt_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(indexes, function(index) {
- return Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_5__["default"])(index, length) ? +index : index;
- }).sort(_compareAscending_js__WEBPACK_IMPORTED_MODULE_3__["default"]));
- return result;
- });
- /* harmony default export */ __webpack_exports__["default"] = (pullAt);
- /***/ }),
- /***/ "./node_modules/lodash-es/random.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/random.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRandom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRandom.js */ "./node_modules/lodash-es/_baseRandom.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
- /** Built-in method references without a dependency on `root`. */
- var freeParseFloat = parseFloat;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMin = Math.min,
- nativeRandom = Math.random;
- /**
- * Produces a random number between the inclusive `lower` and `upper` bounds.
- * If only one argument is provided a number between `0` and the given number
- * is returned. If `floating` is `true`, or either `lower` or `upper` are
- * floats, a floating-point number is returned instead of an integer.
- *
- * **Note:** JavaScript follows the IEEE-754 standard for resolving
- * floating-point values which can produce unexpected results.
- *
- * @static
- * @memberOf _
- * @since 0.7.0
- * @category Number
- * @param {number} [lower=0] The lower bound.
- * @param {number} [upper=1] The upper bound.
- * @param {boolean} [floating] Specify returning a floating-point number.
- * @returns {number} Returns the random number.
- * @example
- *
- * _.random(0, 5);
- * // => an integer between 0 and 5
- *
- * _.random(5);
- * // => also an integer between 0 and 5
- *
- * _.random(5, true);
- * // => a floating-point number between 0 and 5
- *
- * _.random(1.2, 5.2);
- * // => a floating-point number between 1.2 and 5.2
- */
- function random(lower, upper, floating) {
- if (floating && typeof floating != 'boolean' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(lower, upper, floating)) {
- upper = floating = undefined;
- }
- if (floating === undefined) {
- if (typeof upper == 'boolean') {
- floating = upper;
- upper = undefined;
- }
- else if (typeof lower == 'boolean') {
- floating = lower;
- lower = undefined;
- }
- }
- if (lower === undefined && upper === undefined) {
- lower = 0;
- upper = 1;
- }
- else {
- lower = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(lower);
- if (upper === undefined) {
- upper = lower;
- lower = 0;
- } else {
- upper = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(upper);
- }
- }
- if (lower > upper) {
- var temp = lower;
- lower = upper;
- upper = temp;
- }
- if (floating || lower % 1 || upper % 1) {
- var rand = nativeRandom();
- return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
- }
- return Object(_baseRandom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(lower, upper);
- }
- /* harmony default export */ __webpack_exports__["default"] = (random);
- /***/ }),
- /***/ "./node_modules/lodash-es/range.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/range.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRange.js */ "./node_modules/lodash-es/_createRange.js");
- /**
- * Creates an array of numbers (positive and/or negative) progressing from
- * `start` up to, but not including, `end`. A step of `-1` is used if a negative
- * `start` is specified without an `end` or `step`. If `end` is not specified,
- * it's set to `start` with `start` then set to `0`.
- *
- * **Note:** JavaScript follows the IEEE-754 standard for resolving
- * floating-point values which can produce unexpected results.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @param {number} [step=1] The value to increment or decrement by.
- * @returns {Array} Returns the range of numbers.
- * @see _.inRange, _.rangeRight
- * @example
- *
- * _.range(4);
- * // => [0, 1, 2, 3]
- *
- * _.range(-4);
- * // => [0, -1, -2, -3]
- *
- * _.range(1, 5);
- * // => [1, 2, 3, 4]
- *
- * _.range(0, 20, 5);
- * // => [0, 5, 10, 15]
- *
- * _.range(0, -4, -1);
- * // => [0, -1, -2, -3]
- *
- * _.range(1, 4, 0);
- * // => [1, 1, 1]
- *
- * _.range(0);
- * // => []
- */
- var range = Object(_createRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
- /* harmony default export */ __webpack_exports__["default"] = (range);
- /***/ }),
- /***/ "./node_modules/lodash-es/rangeRight.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/rangeRight.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRange.js */ "./node_modules/lodash-es/_createRange.js");
- /**
- * This method is like `_.range` except that it populates values in
- * descending order.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @param {number} [step=1] The value to increment or decrement by.
- * @returns {Array} Returns the range of numbers.
- * @see _.inRange, _.range
- * @example
- *
- * _.rangeRight(4);
- * // => [3, 2, 1, 0]
- *
- * _.rangeRight(-4);
- * // => [-3, -2, -1, 0]
- *
- * _.rangeRight(1, 5);
- * // => [4, 3, 2, 1]
- *
- * _.rangeRight(0, 20, 5);
- * // => [15, 10, 5, 0]
- *
- * _.rangeRight(0, -4, -1);
- * // => [-3, -2, -1, 0]
- *
- * _.rangeRight(1, 4, 0);
- * // => [1, 1, 1]
- *
- * _.rangeRight(0);
- * // => []
- */
- var rangeRight = Object(_createRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])(true);
- /* harmony default export */ __webpack_exports__["default"] = (rangeRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/rearg.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/rearg.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
- /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
- /** Used to compose bitmasks for function metadata. */
- var WRAP_REARG_FLAG = 256;
- /**
- * Creates a function that invokes `func` with arguments arranged according
- * to the specified `indexes` where the argument value at the first index is
- * provided as the first argument, the argument value at the second index is
- * provided as the second argument, and so on.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} func The function to rearrange arguments for.
- * @param {...(number|number[])} indexes The arranged argument indexes.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var rearged = _.rearg(function(a, b, c) {
- * return [a, b, c];
- * }, [2, 0, 1]);
- *
- * rearged('b', 'c', 'a')
- * // => ['a', 'b', 'c']
- */
- var rearg = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, indexes) {
- return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
- });
- /* harmony default export */ __webpack_exports__["default"] = (rearg);
- /***/ }),
- /***/ "./node_modules/lodash-es/reduce.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/reduce.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayReduce.js */ "./node_modules/lodash-es/_arrayReduce.js");
- /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseReduce.js */ "./node_modules/lodash-es/_baseReduce.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * Reduces `collection` to a value which is the accumulated result of running
- * each element in `collection` thru `iteratee`, where each successive
- * invocation is supplied the return value of the previous. If `accumulator`
- * is not given, the first element of `collection` is used as the initial
- * value. The iteratee is invoked with four arguments:
- * (accumulator, value, index|key, collection).
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.reduce`, `_.reduceRight`, and `_.transform`.
- *
- * The guarded methods are:
- * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
- * and `sortBy`
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @returns {*} Returns the accumulated value.
- * @see _.reduceRight
- * @example
- *
- * _.reduce([1, 2], function(sum, n) {
- * return sum + n;
- * }, 0);
- * // => 3
- *
- * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
- * (result[value] || (result[value] = [])).push(key);
- * return result;
- * }, {});
- * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
- */
- function reduce(collection, iteratee, accumulator) {
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) ? _arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__["default"],
- initAccum = arguments.length < 3;
- return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 4), accumulator, initAccum, _baseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (reduce);
- /***/ }),
- /***/ "./node_modules/lodash-es/reduceRight.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/reduceRight.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayReduceRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayReduceRight.js */ "./node_modules/lodash-es/_arrayReduceRight.js");
- /* harmony import */ var _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEachRight.js */ "./node_modules/lodash-es/_baseEachRight.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseReduce.js */ "./node_modules/lodash-es/_baseReduce.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * This method is like `_.reduce` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @returns {*} Returns the accumulated value.
- * @see _.reduce
- * @example
- *
- * var array = [[0, 1], [2, 3], [4, 5]];
- *
- * _.reduceRight(array, function(flattened, other) {
- * return flattened.concat(other);
- * }, []);
- * // => [4, 5, 2, 3, 0, 1]
- */
- function reduceRight(collection, iteratee, accumulator) {
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) ? _arrayReduceRight_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__["default"],
- initAccum = arguments.length < 3;
- return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 4), accumulator, initAccum, _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (reduceRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/reject.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/reject.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
- /* harmony import */ var _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFilter.js */ "./node_modules/lodash-es/_baseFilter.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
- /**
- * The opposite of `_.filter`; this method returns the elements of `collection`
- * that `predicate` does **not** return truthy for.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- * @see _.filter
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true }
- * ];
- *
- * _.reject(users, function(o) { return !o.active; });
- * // => objects for ['fred']
- *
- * // The `_.matches` iteratee shorthand.
- * _.reject(users, { 'age': 40, 'active': true });
- * // => objects for ['barney']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.reject(users, ['active', false]);
- * // => objects for ['fred']
- *
- * // The `_.property` iteratee shorthand.
- * _.reject(users, 'active');
- * // => objects for ['barney']
- */
- function reject(collection, predicate) {
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- return func(collection, Object(_negate_js__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3)));
- }
- /* harmony default export */ __webpack_exports__["default"] = (reject);
- /***/ }),
- /***/ "./node_modules/lodash-es/remove.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/remove.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _basePullAt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePullAt.js */ "./node_modules/lodash-es/_basePullAt.js");
- /**
- * Removes all elements from `array` that `predicate` returns truthy for
- * and returns an array of the removed elements. The predicate is invoked
- * with three arguments: (value, index, array).
- *
- * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
- * to pull elements from an array by value.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new array of removed elements.
- * @example
- *
- * var array = [1, 2, 3, 4];
- * var evens = _.remove(array, function(n) {
- * return n % 2 == 0;
- * });
- *
- * console.log(array);
- * // => [1, 3]
- *
- * console.log(evens);
- * // => [2, 4]
- */
- function remove(array, predicate) {
- var result = [];
- if (!(array && array.length)) {
- return result;
- }
- var index = -1,
- indexes = [],
- length = array.length;
- predicate = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3);
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result.push(value);
- indexes.push(index);
- }
- }
- Object(_basePullAt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, indexes);
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (remove);
- /***/ }),
- /***/ "./node_modules/lodash-es/repeat.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/repeat.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRepeat.js */ "./node_modules/lodash-es/_baseRepeat.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Repeats the given string `n` times.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to repeat.
- * @param {number} [n=1] The number of times to repeat the string.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the repeated string.
- * @example
- *
- * _.repeat('*', 3);
- * // => '***'
- *
- * _.repeat('abc', 2);
- * // => 'abcabc'
- *
- * _.repeat('abc', 0);
- * // => ''
- */
- function repeat(string, n, guard) {
- if ((guard ? Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string, n, guard) : n === undefined)) {
- n = 1;
- } else {
- n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(n);
- }
- return Object(_baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string), n);
- }
- /* harmony default export */ __webpack_exports__["default"] = (repeat);
- /***/ }),
- /***/ "./node_modules/lodash-es/replace.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/replace.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Replaces matches for `pattern` in `string` with `replacement`.
- *
- * **Note:** This method is based on
- * [`String#replace`](https://mdn.io/String/replace).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to modify.
- * @param {RegExp|string} pattern The pattern to replace.
- * @param {Function|string} replacement The match replacement.
- * @returns {string} Returns the modified string.
- * @example
- *
- * _.replace('Hi Fred', 'Fred', 'Barney');
- * // => 'Hi Barney'
- */
- function replace() {
- var args = arguments,
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(args[0]);
- return args.length < 3 ? string : string.replace(args[1], args[2]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (replace);
- /***/ }),
- /***/ "./node_modules/lodash-es/rest.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/rest.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /** Error message constants. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /**
- * Creates a function that invokes `func` with the `this` binding of the
- * created function and arguments from `start` and beyond provided as
- * an array.
- *
- * **Note:** This method is based on the
- * [rest parameter](https://mdn.io/rest_parameters).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Function
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.rest(function(what, names) {
- * return what + ' ' + _.initial(names).join(', ') +
- * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
- * });
- *
- * say('hello', 'fred', 'barney', 'pebbles');
- * // => 'hello fred, barney, & pebbles'
- */
- function rest(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = start === undefined ? start : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start);
- return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, start);
- }
- /* harmony default export */ __webpack_exports__["default"] = (rest);
- /***/ }),
- /***/ "./node_modules/lodash-es/result.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/result.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
- /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
- /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
- /**
- * This method is like `_.get` except that if the resolved value is a
- * function it's invoked with the `this` binding of its parent object and
- * its result is returned.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to resolve.
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
- *
- * _.result(object, 'a[0].b.c1');
- * // => 3
- *
- * _.result(object, 'a[0].b.c2');
- * // => 4
- *
- * _.result(object, 'a[0].b.c3', 'default');
- * // => 'default'
- *
- * _.result(object, 'a[0].b.c3', _.constant('default'));
- * // => 'default'
- */
- function result(object, path, defaultValue) {
- path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
- var index = -1,
- length = path.length;
- // Ensure the loop is entered when path is empty.
- if (!length) {
- length = 1;
- object = undefined;
- }
- while (++index < length) {
- var value = object == null ? undefined : object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path[index])];
- if (value === undefined) {
- index = length;
- value = defaultValue;
- }
- object = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) ? value.call(object) : value;
- }
- return object;
- }
- /* harmony default export */ __webpack_exports__["default"] = (result);
- /***/ }),
- /***/ "./node_modules/lodash-es/reverse.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/reverse.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /** Used for built-in method references. */
- var arrayProto = Array.prototype;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeReverse = arrayProto.reverse;
- /**
- * Reverses `array` so that the first element becomes the last, the second
- * element becomes the second to last, and so on.
- *
- * **Note:** This method mutates `array` and is based on
- * [`Array#reverse`](https://mdn.io/Array/reverse).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _.reverse(array);
- * // => [3, 2, 1]
- *
- * console.log(array);
- * // => [3, 2, 1]
- */
- function reverse(array) {
- return array == null ? array : nativeReverse.call(array);
- }
- /* harmony default export */ __webpack_exports__["default"] = (reverse);
- /***/ }),
- /***/ "./node_modules/lodash-es/round.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/round.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createRound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRound.js */ "./node_modules/lodash-es/_createRound.js");
- /**
- * Computes `number` rounded to `precision`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Math
- * @param {number} number The number to round.
- * @param {number} [precision=0] The precision to round to.
- * @returns {number} Returns the rounded number.
- * @example
- *
- * _.round(4.006);
- * // => 4
- *
- * _.round(4.006, 2);
- * // => 4.01
- *
- * _.round(4060, -2);
- * // => 4100
- */
- var round = Object(_createRound_js__WEBPACK_IMPORTED_MODULE_0__["default"])('round');
- /* harmony default export */ __webpack_exports__["default"] = (round);
- /***/ }),
- /***/ "./node_modules/lodash-es/sample.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/sample.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arraySample_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySample.js */ "./node_modules/lodash-es/_arraySample.js");
- /* harmony import */ var _baseSample_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSample.js */ "./node_modules/lodash-es/_baseSample.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * Gets a random element from `collection`.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to sample.
- * @returns {*} Returns the random element.
- * @example
- *
- * _.sample([1, 2, 3, 4]);
- * // => 2
- */
- function sample(collection) {
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection) ? _arraySample_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseSample_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- return func(collection);
- }
- /* harmony default export */ __webpack_exports__["default"] = (sample);
- /***/ }),
- /***/ "./node_modules/lodash-es/sampleSize.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/sampleSize.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arraySampleSize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySampleSize.js */ "./node_modules/lodash-es/_arraySampleSize.js");
- /* harmony import */ var _baseSampleSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSampleSize.js */ "./node_modules/lodash-es/_baseSampleSize.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /**
- * Gets `n` random elements at unique keys from `collection` up to the
- * size of `collection`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to sample.
- * @param {number} [n=1] The number of elements to sample.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the random elements.
- * @example
- *
- * _.sampleSize([1, 2, 3], 2);
- * // => [3, 1]
- *
- * _.sampleSize([1, 2, 3], 4);
- * // => [2, 3, 1]
- */
- function sampleSize(collection, n, guard) {
- if ((guard ? Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection, n, guard) : n === undefined)) {
- n = 1;
- } else {
- n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_4__["default"])(n);
- }
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection) ? _arraySampleSize_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseSampleSize_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- return func(collection, n);
- }
- /* harmony default export */ __webpack_exports__["default"] = (sampleSize);
- /***/ }),
- /***/ "./node_modules/lodash-es/seq.default.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/seq.default.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperAt.js */ "./node_modules/lodash-es/wrapperAt.js");
- /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
- /* harmony import */ var _commit_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commit.js */ "./node_modules/lodash-es/commit.js");
- /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
- /* harmony import */ var _next_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./next.js */ "./node_modules/lodash-es/next.js");
- /* harmony import */ var _plant_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./plant.js */ "./node_modules/lodash-es/plant.js");
- /* harmony import */ var _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./wrapperReverse.js */ "./node_modules/lodash-es/wrapperReverse.js");
- /* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tap.js */ "./node_modules/lodash-es/tap.js");
- /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
- /* harmony import */ var _toIterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./toIterator.js */ "./node_modules/lodash-es/toIterator.js");
- /* harmony import */ var _toJSON_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./toJSON.js */ "./node_modules/lodash-es/toJSON.js");
- /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
- /* harmony import */ var _valueOf_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./valueOf.js */ "./node_modules/lodash-es/valueOf.js");
- /* harmony import */ var _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./wrapperChain.js */ "./node_modules/lodash-es/wrapperChain.js");
- /* harmony default export */ __webpack_exports__["default"] = ({
- at: _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__["default"], chain: _chain_js__WEBPACK_IMPORTED_MODULE_1__["default"], commit: _commit_js__WEBPACK_IMPORTED_MODULE_2__["default"], lodash: _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__["default"], next: _next_js__WEBPACK_IMPORTED_MODULE_4__["default"],
- plant: _plant_js__WEBPACK_IMPORTED_MODULE_5__["default"], reverse: _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__["default"], tap: _tap_js__WEBPACK_IMPORTED_MODULE_7__["default"], thru: _thru_js__WEBPACK_IMPORTED_MODULE_8__["default"], toIterator: _toIterator_js__WEBPACK_IMPORTED_MODULE_9__["default"],
- toJSON: _toJSON_js__WEBPACK_IMPORTED_MODULE_10__["default"], value: _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__["default"], valueOf: _valueOf_js__WEBPACK_IMPORTED_MODULE_12__["default"], wrapperChain: _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__["default"]
- });
- /***/ }),
- /***/ "./node_modules/lodash-es/seq.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/seq.js ***!
- \***************************************/
- /*! exports provided: at, chain, commit, lodash, next, plant, reverse, tap, thru, toIterator, toJSON, value, valueOf, wrapperChain, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperAt.js */ "./node_modules/lodash-es/wrapperAt.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "at", function() { return _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return _chain_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _commit_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commit.js */ "./node_modules/lodash-es/commit.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "commit", function() { return _commit_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lodash", function() { return _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _next_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./next.js */ "./node_modules/lodash-es/next.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "next", function() { return _next_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _plant_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./plant.js */ "./node_modules/lodash-es/plant.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "plant", function() { return _plant_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./wrapperReverse.js */ "./node_modules/lodash-es/wrapperReverse.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tap.js */ "./node_modules/lodash-es/tap.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _tap_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thru", function() { return _thru_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _toIterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./toIterator.js */ "./node_modules/lodash-es/toIterator.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toIterator", function() { return _toIterator_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _toJSON_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./toJSON.js */ "./node_modules/lodash-es/toJSON.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toJSON", function() { return _toJSON_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "value", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _valueOf_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./valueOf.js */ "./node_modules/lodash-es/valueOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valueOf", function() { return _valueOf_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./wrapperChain.js */ "./node_modules/lodash-es/wrapperChain.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperChain", function() { return _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _seq_default_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./seq.default.js */ "./node_modules/lodash-es/seq.default.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _seq_default_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/set.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/set.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
- /**
- * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
- * it's created. Arrays are created for missing index properties while objects
- * are created for all other missing properties. Use `_.setWith` to customize
- * `path` creation.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.set(object, 'a[0].b.c', 4);
- * console.log(object.a[0].b.c);
- * // => 4
- *
- * _.set(object, ['x', '0', 'y', 'z'], 5);
- * console.log(object.x[0].y.z);
- * // => 5
- */
- function set(object, path, value) {
- return object == null ? object : Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (set);
- /***/ }),
- /***/ "./node_modules/lodash-es/setWith.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/setWith.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
- /**
- * This method is like `_.set` except that it accepts `customizer` which is
- * invoked to produce the objects of `path`. If `customizer` returns `undefined`
- * path creation is handled by the method instead. The `customizer` is invoked
- * with three arguments: (nsValue, key, nsObject).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = {};
- *
- * _.setWith(object, '[0][1]', 'a', Object);
- * // => { '0': { '1': 'a' } }
- */
- function setWith(object, path, value, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return object == null ? object : Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, value, customizer);
- }
- /* harmony default export */ __webpack_exports__["default"] = (setWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/shuffle.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/shuffle.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayShuffle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayShuffle.js */ "./node_modules/lodash-es/_arrayShuffle.js");
- /* harmony import */ var _baseShuffle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseShuffle.js */ "./node_modules/lodash-es/_baseShuffle.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /**
- * Creates an array of shuffled values, using a version of the
- * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to shuffle.
- * @returns {Array} Returns the new shuffled array.
- * @example
- *
- * _.shuffle([1, 2, 3, 4]);
- * // => [4, 1, 3, 2]
- */
- function shuffle(collection) {
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection) ? _arrayShuffle_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseShuffle_js__WEBPACK_IMPORTED_MODULE_1__["default"];
- return func(collection);
- }
- /* harmony default export */ __webpack_exports__["default"] = (shuffle);
- /***/ }),
- /***/ "./node_modules/lodash-es/size.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/size.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
- /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
- /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
- /** `Object#toString` result references. */
- var mapTag = '[object Map]',
- setTag = '[object Set]';
- /**
- * Gets the size of `collection` by returning its length for array-like
- * values or the number of own enumerable string keyed properties for objects.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object|string} collection The collection to inspect.
- * @returns {number} Returns the collection size.
- * @example
- *
- * _.size([1, 2, 3]);
- * // => 3
- *
- * _.size({ 'a': 1, 'b': 2 });
- * // => 2
- *
- * _.size('pebbles');
- * // => 7
- */
- function size(collection) {
- if (collection == null) {
- return 0;
- }
- if (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection)) {
- return Object(_isString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) : collection.length;
- }
- var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection);
- if (tag == mapTag || tag == setTag) {
- return collection.size;
- }
- return Object(_baseKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection).length;
- }
- /* harmony default export */ __webpack_exports__["default"] = (size);
- /***/ }),
- /***/ "./node_modules/lodash-es/slice.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/slice.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /**
- * Creates a slice of `array` from `start` up to, but not including, `end`.
- *
- * **Note:** This method is used instead of
- * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
- * returned.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to slice.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the slice of `array`.
- */
- function slice(array, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (end && typeof end != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, start, end)) {
- start = 0;
- end = length;
- }
- else {
- start = start == null ? 0 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(start);
- end = end === undefined ? length : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(end);
- }
- return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, start, end);
- }
- /* harmony default export */ __webpack_exports__["default"] = (slice);
- /***/ }),
- /***/ "./node_modules/lodash-es/snakeCase.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/snakeCase.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
- /**
- * Converts `string` to
- * [snake case](https://en.wikipedia.org/wiki/Snake_case).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the snake cased string.
- * @example
- *
- * _.snakeCase('Foo Bar');
- * // => 'foo_bar'
- *
- * _.snakeCase('fooBar');
- * // => 'foo_bar'
- *
- * _.snakeCase('--FOO-BAR--');
- * // => 'foo_bar'
- */
- var snakeCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
- return result + (index ? '_' : '') + word.toLowerCase();
- });
- /* harmony default export */ __webpack_exports__["default"] = (snakeCase);
- /***/ }),
- /***/ "./node_modules/lodash-es/some.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/some.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseSome_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseSome.js */ "./node_modules/lodash-es/_baseSome.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /**
- * Checks if `predicate` returns truthy for **any** element of `collection`.
- * Iteration is stopped once `predicate` returns truthy. The predicate is
- * invoked with three arguments: (value, index|key, collection).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- * @example
- *
- * _.some([null, 0, 'yes', false], Boolean);
- * // => true
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false }
- * ];
- *
- * // The `_.matches` iteratee shorthand.
- * _.some(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.some(users, ['active', false]);
- * // => true
- *
- * // The `_.property` iteratee shorthand.
- * _.some(users, 'active');
- * // => true
- */
- function some(collection, predicate, guard) {
- var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arraySome_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseSome_js__WEBPACK_IMPORTED_MODULE_2__["default"];
- if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection, predicate, guard)) {
- predicate = undefined;
- }
- return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate, 3));
- }
- /* harmony default export */ __webpack_exports__["default"] = (some);
- /***/ }),
- /***/ "./node_modules/lodash-es/sortBy.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/sortBy.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _baseOrderBy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseOrderBy.js */ "./node_modules/lodash-es/_baseOrderBy.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /**
- * Creates an array of elements, sorted in ascending order by the results of
- * running each element in a collection thru each iteratee. This method
- * performs a stable sort, that is, it preserves the original sort order of
- * equal elements. The iteratees are invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {...(Function|Function[])} [iteratees=[_.identity]]
- * The iteratees to sort by.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 30 },
- * { 'user': 'barney', 'age': 34 }
- * ];
- *
- * _.sortBy(users, [function(o) { return o.user; }]);
- * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
- *
- * _.sortBy(users, ['user', 'age']);
- * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
- */
- var sortBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(collection, iteratees) {
- if (collection == null) {
- return [];
- }
- var length = iteratees.length;
- if (length > 1 && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection, iteratees[0], iteratees[1])) {
- iteratees = [];
- } else if (length > 2 && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(iteratees[0], iteratees[1], iteratees[2])) {
- iteratees = [iteratees[0]];
- }
- return Object(_baseOrderBy_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, 1), []);
- });
- /* harmony default export */ __webpack_exports__["default"] = (sortBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/sortedIndex.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash-es/sortedIndex.js ***!
- \***********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
- /**
- * Uses a binary search to determine the lowest index at which `value`
- * should be inserted into `array` in order to maintain its sort order.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * _.sortedIndex([30, 50], 40);
- * // => 1
- */
- function sortedIndex(array, value) {
- return Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (sortedIndex);
- /***/ }),
- /***/ "./node_modules/lodash-es/sortedIndexBy.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/sortedIndexBy.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSortedIndexBy.js */ "./node_modules/lodash-es/_baseSortedIndexBy.js");
- /**
- * This method is like `_.sortedIndex` except that it accepts `iteratee`
- * which is invoked for `value` and each element of `array` to compute their
- * sort ranking. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * var objects = [{ 'x': 4 }, { 'x': 5 }];
- *
- * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
- * // => 0
- *
- * // The `_.property` iteratee shorthand.
- * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
- * // => 0
- */
- function sortedIndexBy(array, value, iteratee) {
- return Object(_baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, value, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2));
- }
- /* harmony default export */ __webpack_exports__["default"] = (sortedIndexBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/sortedIndexOf.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/sortedIndexOf.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /**
- * This method is like `_.indexOf` except that it performs a binary
- * search on a sorted `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
- * // => 1
- */
- function sortedIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index = Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value);
- if (index < length && Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
- /* harmony default export */ __webpack_exports__["default"] = (sortedIndexOf);
- /***/ }),
- /***/ "./node_modules/lodash-es/sortedLastIndex.js":
- /*!***************************************************!*\
- !*** ./node_modules/lodash-es/sortedLastIndex.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
- /**
- * This method is like `_.sortedIndex` except that it returns the highest
- * index at which `value` should be inserted into `array` in order to
- * maintain its sort order.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
- * // => 4
- */
- function sortedLastIndex(array, value) {
- return Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, true);
- }
- /* harmony default export */ __webpack_exports__["default"] = (sortedLastIndex);
- /***/ }),
- /***/ "./node_modules/lodash-es/sortedLastIndexBy.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/sortedLastIndexBy.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSortedIndexBy.js */ "./node_modules/lodash-es/_baseSortedIndexBy.js");
- /**
- * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
- * which is invoked for `value` and each element of `array` to compute their
- * sort ranking. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * var objects = [{ 'x': 4 }, { 'x': 5 }];
- *
- * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
- * // => 1
- *
- * // The `_.property` iteratee shorthand.
- * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
- * // => 1
- */
- function sortedLastIndexBy(array, value, iteratee) {
- return Object(_baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, value, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2), true);
- }
- /* harmony default export */ __webpack_exports__["default"] = (sortedLastIndexBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/sortedLastIndexOf.js":
- /*!*****************************************************!*\
- !*** ./node_modules/lodash-es/sortedLastIndexOf.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
- /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
- /**
- * This method is like `_.lastIndexOf` except that it performs a binary
- * search on a sorted `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
- * // => 3
- */
- function sortedLastIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index = Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, true) - 1;
- if (Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
- /* harmony default export */ __webpack_exports__["default"] = (sortedLastIndexOf);
- /***/ }),
- /***/ "./node_modules/lodash-es/sortedUniq.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/sortedUniq.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedUniq.js */ "./node_modules/lodash-es/_baseSortedUniq.js");
- /**
- * This method is like `_.uniq` except that it's designed and optimized
- * for sorted arrays.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.sortedUniq([1, 1, 2]);
- * // => [1, 2]
- */
- function sortedUniq(array) {
- return (array && array.length)
- ? Object(_baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array)
- : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (sortedUniq);
- /***/ }),
- /***/ "./node_modules/lodash-es/sortedUniqBy.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/sortedUniqBy.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSortedUniq.js */ "./node_modules/lodash-es/_baseSortedUniq.js");
- /**
- * This method is like `_.uniqBy` except that it's designed and optimized
- * for sorted arrays.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
- * // => [1.1, 2.3]
- */
- function sortedUniqBy(array, iteratee) {
- return (array && array.length)
- ? Object(_baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2))
- : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (sortedUniqBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/split.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/split.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
- /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
- /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
- /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = 4294967295;
- /**
- * Splits `string` by `separator`.
- *
- * **Note:** This method is based on
- * [`String#split`](https://mdn.io/String/split).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to split.
- * @param {RegExp|string} separator The separator pattern to split by.
- * @param {number} [limit] The length to truncate results to.
- * @returns {Array} Returns the string segments.
- * @example
- *
- * _.split('a-b-c', '-', 2);
- * // => ['a', 'b']
- */
- function split(string, separator, limit) {
- if (limit && typeof limit != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string, separator, limit)) {
- separator = limit = undefined;
- }
- limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
- if (!limit) {
- return [];
- }
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string);
- if (string && (
- typeof separator == 'string' ||
- (separator != null && !Object(_isRegExp_js__WEBPACK_IMPORTED_MODULE_4__["default"])(separator))
- )) {
- separator = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(separator);
- if (!separator && Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)) {
- return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(string), 0, limit);
- }
- }
- return string.split(separator, limit);
- }
- /* harmony default export */ __webpack_exports__["default"] = (split);
- /***/ }),
- /***/ "./node_modules/lodash-es/spread.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/spread.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
- /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /** Error message constants. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max;
- /**
- * Creates a function that invokes `func` with the `this` binding of the
- * create function and an array of arguments much like
- * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
- *
- * **Note:** This method is based on the
- * [spread operator](https://mdn.io/spread_operator).
- *
- * @static
- * @memberOf _
- * @since 3.2.0
- * @category Function
- * @param {Function} func The function to spread arguments over.
- * @param {number} [start=0] The start position of the spread.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.spread(function(who, what) {
- * return who + ' says ' + what;
- * });
- *
- * say(['fred', 'hello']);
- * // => 'fred says hello'
- *
- * var numbers = Promise.all([
- * Promise.resolve(40),
- * Promise.resolve(36)
- * ]);
- *
- * numbers.then(_.spread(function(x, y) {
- * return x + y;
- * }));
- * // => a Promise of 76
- */
- function spread(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = start == null ? 0 : nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_4__["default"])(start), 0);
- return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(args) {
- var array = args[start],
- otherArgs = Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_3__["default"])(args, 0, start);
- if (array) {
- Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])(otherArgs, array);
- }
- return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, otherArgs);
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (spread);
- /***/ }),
- /***/ "./node_modules/lodash-es/startCase.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/startCase.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
- /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
- /**
- * Converts `string` to
- * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
- *
- * @static
- * @memberOf _
- * @since 3.1.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the start cased string.
- * @example
- *
- * _.startCase('--foo-bar--');
- * // => 'Foo Bar'
- *
- * _.startCase('fooBar');
- * // => 'Foo Bar'
- *
- * _.startCase('__FOO_BAR__');
- * // => 'FOO BAR'
- */
- var startCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
- return result + (index ? ' ' : '') + Object(_upperFirst_js__WEBPACK_IMPORTED_MODULE_1__["default"])(word);
- });
- /* harmony default export */ __webpack_exports__["default"] = (startCase);
- /***/ }),
- /***/ "./node_modules/lodash-es/startsWith.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/startsWith.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
- /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Checks if `string` starts with the given target string.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {string} [target] The string to search for.
- * @param {number} [position=0] The position to search from.
- * @returns {boolean} Returns `true` if `string` starts with `target`,
- * else `false`.
- * @example
- *
- * _.startsWith('abc', 'a');
- * // => true
- *
- * _.startsWith('abc', 'b');
- * // => false
- *
- * _.startsWith('abc', 'b', 1);
- * // => true
- */
- function startsWith(string, target, position) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
- position = position == null
- ? 0
- : Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(position), 0, string.length);
- target = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(target);
- return string.slice(position, position + target.length) == target;
- }
- /* harmony default export */ __webpack_exports__["default"] = (startsWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/string.default.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/string.default.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _camelCase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./camelCase.js */ "./node_modules/lodash-es/camelCase.js");
- /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
- /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
- /* harmony import */ var _endsWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./endsWith.js */ "./node_modules/lodash-es/endsWith.js");
- /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
- /* harmony import */ var _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./escapeRegExp.js */ "./node_modules/lodash-es/escapeRegExp.js");
- /* harmony import */ var _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./kebabCase.js */ "./node_modules/lodash-es/kebabCase.js");
- /* harmony import */ var _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lowerCase.js */ "./node_modules/lodash-es/lowerCase.js");
- /* harmony import */ var _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lowerFirst.js */ "./node_modules/lodash-es/lowerFirst.js");
- /* harmony import */ var _pad_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pad.js */ "./node_modules/lodash-es/pad.js");
- /* harmony import */ var _padEnd_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./padEnd.js */ "./node_modules/lodash-es/padEnd.js");
- /* harmony import */ var _padStart_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./padStart.js */ "./node_modules/lodash-es/padStart.js");
- /* harmony import */ var _parseInt_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./parseInt.js */ "./node_modules/lodash-es/parseInt.js");
- /* harmony import */ var _repeat_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./repeat.js */ "./node_modules/lodash-es/repeat.js");
- /* harmony import */ var _replace_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./replace.js */ "./node_modules/lodash-es/replace.js");
- /* harmony import */ var _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./snakeCase.js */ "./node_modules/lodash-es/snakeCase.js");
- /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./split.js */ "./node_modules/lodash-es/split.js");
- /* harmony import */ var _startCase_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./startCase.js */ "./node_modules/lodash-es/startCase.js");
- /* harmony import */ var _startsWith_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./startsWith.js */ "./node_modules/lodash-es/startsWith.js");
- /* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./template.js */ "./node_modules/lodash-es/template.js");
- /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
- /* harmony import */ var _toLower_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./toLower.js */ "./node_modules/lodash-es/toLower.js");
- /* harmony import */ var _toUpper_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./toUpper.js */ "./node_modules/lodash-es/toUpper.js");
- /* harmony import */ var _trim_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./trim.js */ "./node_modules/lodash-es/trim.js");
- /* harmony import */ var _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./trimEnd.js */ "./node_modules/lodash-es/trimEnd.js");
- /* harmony import */ var _trimStart_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./trimStart.js */ "./node_modules/lodash-es/trimStart.js");
- /* harmony import */ var _truncate_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./truncate.js */ "./node_modules/lodash-es/truncate.js");
- /* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/lodash-es/unescape.js");
- /* harmony import */ var _upperCase_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./upperCase.js */ "./node_modules/lodash-es/upperCase.js");
- /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
- /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
- /* harmony default export */ __webpack_exports__["default"] = ({
- camelCase: _camelCase_js__WEBPACK_IMPORTED_MODULE_0__["default"], capitalize: _capitalize_js__WEBPACK_IMPORTED_MODULE_1__["default"], deburr: _deburr_js__WEBPACK_IMPORTED_MODULE_2__["default"], endsWith: _endsWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], escape: _escape_js__WEBPACK_IMPORTED_MODULE_4__["default"],
- escapeRegExp: _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__["default"], kebabCase: _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__["default"], lowerCase: _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__["default"], lowerFirst: _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__["default"], pad: _pad_js__WEBPACK_IMPORTED_MODULE_9__["default"],
- padEnd: _padEnd_js__WEBPACK_IMPORTED_MODULE_10__["default"], padStart: _padStart_js__WEBPACK_IMPORTED_MODULE_11__["default"], parseInt: _parseInt_js__WEBPACK_IMPORTED_MODULE_12__["default"], repeat: _repeat_js__WEBPACK_IMPORTED_MODULE_13__["default"], replace: _replace_js__WEBPACK_IMPORTED_MODULE_14__["default"],
- snakeCase: _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__["default"], split: _split_js__WEBPACK_IMPORTED_MODULE_16__["default"], startCase: _startCase_js__WEBPACK_IMPORTED_MODULE_17__["default"], startsWith: _startsWith_js__WEBPACK_IMPORTED_MODULE_18__["default"], template: _template_js__WEBPACK_IMPORTED_MODULE_19__["default"],
- templateSettings: _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__["default"], toLower: _toLower_js__WEBPACK_IMPORTED_MODULE_21__["default"], toUpper: _toUpper_js__WEBPACK_IMPORTED_MODULE_22__["default"], trim: _trim_js__WEBPACK_IMPORTED_MODULE_23__["default"], trimEnd: _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__["default"],
- trimStart: _trimStart_js__WEBPACK_IMPORTED_MODULE_25__["default"], truncate: _truncate_js__WEBPACK_IMPORTED_MODULE_26__["default"], unescape: _unescape_js__WEBPACK_IMPORTED_MODULE_27__["default"], upperCase: _upperCase_js__WEBPACK_IMPORTED_MODULE_28__["default"], upperFirst: _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__["default"],
- words: _words_js__WEBPACK_IMPORTED_MODULE_30__["default"]
- });
- /***/ }),
- /***/ "./node_modules/lodash-es/string.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/string.js ***!
- \******************************************/
- /*! exports provided: camelCase, capitalize, deburr, endsWith, escape, escapeRegExp, kebabCase, lowerCase, lowerFirst, pad, padEnd, padStart, parseInt, repeat, replace, snakeCase, split, startCase, startsWith, template, templateSettings, toLower, toUpper, trim, trimEnd, trimStart, truncate, unescape, upperCase, upperFirst, words, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _camelCase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./camelCase.js */ "./node_modules/lodash-es/camelCase.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "camelCase", function() { return _camelCase_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "capitalize", function() { return _capitalize_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deburr", function() { return _deburr_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _endsWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./endsWith.js */ "./node_modules/lodash-es/endsWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return _endsWith_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return _escape_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./escapeRegExp.js */ "./node_modules/lodash-es/escapeRegExp.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escapeRegExp", function() { return _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./kebabCase.js */ "./node_modules/lodash-es/kebabCase.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "kebabCase", function() { return _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lowerCase.js */ "./node_modules/lodash-es/lowerCase.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerCase", function() { return _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lowerFirst.js */ "./node_modules/lodash-es/lowerFirst.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerFirst", function() { return _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _pad_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pad.js */ "./node_modules/lodash-es/pad.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return _pad_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _padEnd_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./padEnd.js */ "./node_modules/lodash-es/padEnd.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padEnd", function() { return _padEnd_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _padStart_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./padStart.js */ "./node_modules/lodash-es/padStart.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padStart", function() { return _padStart_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _parseInt_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./parseInt.js */ "./node_modules/lodash-es/parseInt.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseInt", function() { return _parseInt_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _repeat_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./repeat.js */ "./node_modules/lodash-es/repeat.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _repeat_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _replace_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./replace.js */ "./node_modules/lodash-es/replace.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return _replace_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./snakeCase.js */ "./node_modules/lodash-es/snakeCase.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "snakeCase", function() { return _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./split.js */ "./node_modules/lodash-es/split.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "split", function() { return _split_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
- /* harmony import */ var _startCase_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./startCase.js */ "./node_modules/lodash-es/startCase.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startCase", function() { return _startCase_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony import */ var _startsWith_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./startsWith.js */ "./node_modules/lodash-es/startsWith.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return _startsWith_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
- /* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./template.js */ "./node_modules/lodash-es/template.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "template", function() { return _template_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /* harmony import */ var _toLower_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./toLower.js */ "./node_modules/lodash-es/toLower.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLower", function() { return _toLower_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
- /* harmony import */ var _toUpper_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./toUpper.js */ "./node_modules/lodash-es/toUpper.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUpper", function() { return _toUpper_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
- /* harmony import */ var _trim_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./trim.js */ "./node_modules/lodash-es/trim.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return _trim_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
- /* harmony import */ var _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./trimEnd.js */ "./node_modules/lodash-es/trimEnd.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimEnd", function() { return _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
- /* harmony import */ var _trimStart_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./trimStart.js */ "./node_modules/lodash-es/trimStart.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimStart", function() { return _trimStart_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
- /* harmony import */ var _truncate_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./truncate.js */ "./node_modules/lodash-es/truncate.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return _truncate_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
- /* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/lodash-es/unescape.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return _unescape_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
- /* harmony import */ var _upperCase_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./upperCase.js */ "./node_modules/lodash-es/upperCase.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperCase", function() { return _upperCase_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
- /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
- /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "words", function() { return _words_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
- /* harmony import */ var _string_default_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./string.default.js */ "./node_modules/lodash-es/string.default.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _string_default_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/stubArray.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/stubArray.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This method returns a new empty array.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {Array} Returns the new empty array.
- * @example
- *
- * var arrays = _.times(2, _.stubArray);
- *
- * console.log(arrays);
- * // => [[], []]
- *
- * console.log(arrays[0] === arrays[1]);
- * // => false
- */
- function stubArray() {
- return [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (stubArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/stubFalse.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/stubFalse.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This method returns `false`.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {boolean} Returns `false`.
- * @example
- *
- * _.times(2, _.stubFalse);
- * // => [false, false]
- */
- function stubFalse() {
- return false;
- }
- /* harmony default export */ __webpack_exports__["default"] = (stubFalse);
- /***/ }),
- /***/ "./node_modules/lodash-es/stubObject.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/stubObject.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This method returns a new empty object.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {Object} Returns the new empty object.
- * @example
- *
- * var objects = _.times(2, _.stubObject);
- *
- * console.log(objects);
- * // => [{}, {}]
- *
- * console.log(objects[0] === objects[1]);
- * // => false
- */
- function stubObject() {
- return {};
- }
- /* harmony default export */ __webpack_exports__["default"] = (stubObject);
- /***/ }),
- /***/ "./node_modules/lodash-es/stubString.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/stubString.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This method returns an empty string.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {string} Returns the empty string.
- * @example
- *
- * _.times(2, _.stubString);
- * // => ['', '']
- */
- function stubString() {
- return '';
- }
- /* harmony default export */ __webpack_exports__["default"] = (stubString);
- /***/ }),
- /***/ "./node_modules/lodash-es/stubTrue.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/stubTrue.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This method returns `true`.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {boolean} Returns `true`.
- * @example
- *
- * _.times(2, _.stubTrue);
- * // => [true, true]
- */
- function stubTrue() {
- return true;
- }
- /* harmony default export */ __webpack_exports__["default"] = (stubTrue);
- /***/ }),
- /***/ "./node_modules/lodash-es/subtract.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/subtract.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
- /**
- * Subtract two numbers.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {number} minuend The first number in a subtraction.
- * @param {number} subtrahend The second number in a subtraction.
- * @returns {number} Returns the difference.
- * @example
- *
- * _.subtract(6, 4);
- * // => 2
- */
- var subtract = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(minuend, subtrahend) {
- return minuend - subtrahend;
- }, 0);
- /* harmony default export */ __webpack_exports__["default"] = (subtract);
- /***/ }),
- /***/ "./node_modules/lodash-es/sum.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/sum.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSum.js */ "./node_modules/lodash-es/_baseSum.js");
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /**
- * Computes the sum of the values in `array`.
- *
- * @static
- * @memberOf _
- * @since 3.4.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {number} Returns the sum.
- * @example
- *
- * _.sum([4, 2, 8, 6]);
- * // => 20
- */
- function sum(array) {
- return (array && array.length)
- ? Object(_baseSum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"])
- : 0;
- }
- /* harmony default export */ __webpack_exports__["default"] = (sum);
- /***/ }),
- /***/ "./node_modules/lodash-es/sumBy.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/sumBy.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseSum_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSum.js */ "./node_modules/lodash-es/_baseSum.js");
- /**
- * This method is like `_.sum` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the value to be summed.
- * The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the sum.
- * @example
- *
- * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
- *
- * _.sumBy(objects, function(o) { return o.n; });
- * // => 20
- *
- * // The `_.property` iteratee shorthand.
- * _.sumBy(objects, 'n');
- * // => 20
- */
- function sumBy(array, iteratee) {
- return (array && array.length)
- ? Object(_baseSum_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2))
- : 0;
- }
- /* harmony default export */ __webpack_exports__["default"] = (sumBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/tail.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/tail.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
- /**
- * Gets all but the first element of `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.tail([1, 2, 3]);
- * // => [2, 3]
- */
- function tail(array) {
- var length = array == null ? 0 : array.length;
- return length ? Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 1, length) : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (tail);
- /***/ }),
- /***/ "./node_modules/lodash-es/take.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/take.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /**
- * Creates a slice of `array` with `n` elements taken from the beginning.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.take([1, 2, 3]);
- * // => [1]
- *
- * _.take([1, 2, 3], 2);
- * // => [1, 2]
- *
- * _.take([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.take([1, 2, 3], 0);
- * // => []
- */
- function take(array, n, guard) {
- if (!(array && array.length)) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
- return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 0, n < 0 ? 0 : n);
- }
- /* harmony default export */ __webpack_exports__["default"] = (take);
- /***/ }),
- /***/ "./node_modules/lodash-es/takeRight.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/takeRight.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /**
- * Creates a slice of `array` with `n` elements taken from the end.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.takeRight([1, 2, 3]);
- * // => [3]
- *
- * _.takeRight([1, 2, 3], 2);
- * // => [2, 3]
- *
- * _.takeRight([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.takeRight([1, 2, 3], 0);
- * // => []
- */
- function takeRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
- n = length - n;
- return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, n < 0 ? 0 : n, length);
- }
- /* harmony default export */ __webpack_exports__["default"] = (takeRight);
- /***/ }),
- /***/ "./node_modules/lodash-es/takeRightWhile.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/takeRightWhile.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
- /**
- * Creates a slice of `array` with elements taken from the end. Elements are
- * taken until `predicate` returns falsey. The predicate is invoked with
- * three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.takeRightWhile(users, function(o) { return !o.active; });
- * // => objects for ['fred', 'pebbles']
- *
- * // The `_.matches` iteratee shorthand.
- * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
- * // => objects for ['pebbles']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.takeRightWhile(users, ['active', false]);
- * // => objects for ['fred', 'pebbles']
- *
- * // The `_.property` iteratee shorthand.
- * _.takeRightWhile(users, 'active');
- * // => []
- */
- function takeRightWhile(array, predicate) {
- return (array && array.length)
- ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3), false, true)
- : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (takeRightWhile);
- /***/ }),
- /***/ "./node_modules/lodash-es/takeWhile.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/takeWhile.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
- /**
- * Creates a slice of `array` with elements taken from the beginning. Elements
- * are taken until `predicate` returns falsey. The predicate is invoked with
- * three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.takeWhile(users, function(o) { return !o.active; });
- * // => objects for ['barney', 'fred']
- *
- * // The `_.matches` iteratee shorthand.
- * _.takeWhile(users, { 'user': 'barney', 'active': false });
- * // => objects for ['barney']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.takeWhile(users, ['active', false]);
- * // => objects for ['barney', 'fred']
- *
- * // The `_.property` iteratee shorthand.
- * _.takeWhile(users, 'active');
- * // => []
- */
- function takeWhile(array, predicate) {
- return (array && array.length)
- ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3))
- : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (takeWhile);
- /***/ }),
- /***/ "./node_modules/lodash-es/tap.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/tap.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This method invokes `interceptor` and returns `value`. The interceptor
- * is invoked with one argument; (value). The purpose of this method is to
- * "tap into" a method chain sequence in order to modify intermediate results.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Seq
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @returns {*} Returns `value`.
- * @example
- *
- * _([1, 2, 3])
- * .tap(function(array) {
- * // Mutate input array.
- * array.pop();
- * })
- * .reverse()
- * .value();
- * // => [2, 1]
- */
- function tap(value, interceptor) {
- interceptor(value);
- return value;
- }
- /* harmony default export */ __webpack_exports__["default"] = (tap);
- /***/ }),
- /***/ "./node_modules/lodash-es/template.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/template.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
- /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
- /* harmony import */ var _baseValues_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseValues.js */ "./node_modules/lodash-es/_baseValues.js");
- /* harmony import */ var _customDefaultsAssignIn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_customDefaultsAssignIn.js */ "./node_modules/lodash-es/_customDefaultsAssignIn.js");
- /* harmony import */ var _escapeStringChar_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_escapeStringChar.js */ "./node_modules/lodash-es/_escapeStringChar.js");
- /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
- /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /* harmony import */ var _reInterpolate_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_reInterpolate.js */ "./node_modules/lodash-es/_reInterpolate.js");
- /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /** Error message constants. */
- var INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
- /** Used to match empty string literals in compiled template source. */
- var reEmptyStringLeading = /\b__p \+= '';/g,
- reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
- reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
- /**
- * Used to validate the `validate` option in `_.template` variable.
- *
- * Forbids characters which could potentially change the meaning of the function argument definition:
- * - "()," (modification of function parameters)
- * - "=" (default value)
- * - "[]{}" (destructuring of function parameters)
- * - "/" (beginning of a comment)
- * - whitespace
- */
- var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
- /**
- * Used to match
- * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
- */
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
- /** Used to ensure capturing order of template delimiters. */
- var reNoMatch = /($^)/;
- /** Used to match unescaped characters in compiled string literals. */
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Creates a compiled template function that can interpolate data properties
- * in "interpolate" delimiters, HTML-escape interpolated data properties in
- * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
- * properties may be accessed as free variables in the template. If a setting
- * object is given, it takes precedence over `_.templateSettings` values.
- *
- * **Note:** In the development build `_.template` utilizes
- * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
- * for easier debugging.
- *
- * For more information on precompiling templates see
- * [lodash's custom builds documentation](https://lodash.com/custom-builds).
- *
- * For more information on Chrome extension sandboxes see
- * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category String
- * @param {string} [string=''] The template string.
- * @param {Object} [options={}] The options object.
- * @param {RegExp} [options.escape=_.templateSettings.escape]
- * The HTML "escape" delimiter.
- * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
- * The "evaluate" delimiter.
- * @param {Object} [options.imports=_.templateSettings.imports]
- * An object to import into the template as free variables.
- * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
- * The "interpolate" delimiter.
- * @param {string} [options.sourceURL='templateSources[n]']
- * The sourceURL of the compiled template.
- * @param {string} [options.variable='obj']
- * The data object variable name.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the compiled template function.
- * @example
- *
- * // Use the "interpolate" delimiter to create a compiled template.
- * var compiled = _.template('hello <%= user %>!');
- * compiled({ 'user': 'fred' });
- * // => 'hello fred!'
- *
- * // Use the HTML "escape" delimiter to escape data property values.
- * var compiled = _.template('<b><%- value %></b>');
- * compiled({ 'value': '<script>' });
- * // => '<b><script></b>'
- *
- * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
- * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
- * compiled({ 'users': ['fred', 'barney'] });
- * // => '<li>fred</li><li>barney</li>'
- *
- * // Use the internal `print` function in "evaluate" delimiters.
- * var compiled = _.template('<% print("hello " + user); %>!');
- * compiled({ 'user': 'barney' });
- * // => 'hello barney!'
- *
- * // Use the ES template literal delimiter as an "interpolate" delimiter.
- * // Disable support by replacing the "interpolate" delimiter.
- * var compiled = _.template('hello ${ user }!');
- * compiled({ 'user': 'pebbles' });
- * // => 'hello pebbles!'
- *
- * // Use backslashes to treat delimiters as plain text.
- * var compiled = _.template('<%= "\\<%- value %\\>" %>');
- * compiled({ 'value': 'ignored' });
- * // => '<%- value %>'
- *
- * // Use the `imports` option to import `jQuery` as `jq`.
- * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
- * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
- * compiled({ 'users': ['fred', 'barney'] });
- * // => '<li>fred</li><li>barney</li>'
- *
- * // Use the `sourceURL` option to specify a custom sourceURL for the template.
- * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
- * compiled(data);
- * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
- *
- * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
- * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
- * compiled.source;
- * // => function(data) {
- * // var __t, __p = '';
- * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
- * // return __p;
- * // }
- *
- * // Use custom template delimiters.
- * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
- * var compiled = _.template('hello {{ user }}!');
- * compiled({ 'user': 'mustache' });
- * // => 'hello mustache!'
- *
- * // Use the `source` property to inline compiled templates for meaningful
- * // line numbers in error messages and stack traces.
- * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
- * var JST = {\
- * "main": ' + _.template(mainText).source + '\
- * };\
- * ');
- */
- function template(string, options, guard) {
- // Based on John Resig's `tmpl` implementation
- // (http://ejohn.org/blog/javascript-micro-templating/)
- // and Laura Doktorova's doT.js (https://github.com/olado/doT).
- var settings = _templateSettings_js__WEBPACK_IMPORTED_MODULE_9__["default"].imports._.templateSettings || _templateSettings_js__WEBPACK_IMPORTED_MODULE_9__["default"];
- if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string, options, guard)) {
- options = undefined;
- }
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_10__["default"])(string);
- options = Object(_assignInWith_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options, settings, _customDefaultsAssignIn_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
- var imports = Object(_assignInWith_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options.imports, settings.imports, _customDefaultsAssignIn_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
- importsKeys = Object(_keys_js__WEBPACK_IMPORTED_MODULE_7__["default"])(imports),
- importsValues = Object(_baseValues_js__WEBPACK_IMPORTED_MODULE_2__["default"])(imports, importsKeys);
- var isEscaping,
- isEvaluating,
- index = 0,
- interpolate = options.interpolate || reNoMatch,
- source = "__p += '";
- // Compile the regexp to match each delimiter.
- var reDelimiters = RegExp(
- (options.escape || reNoMatch).source + '|' +
- interpolate.source + '|' +
- (interpolate === _reInterpolate_js__WEBPACK_IMPORTED_MODULE_8__["default"] ? reEsTemplate : reNoMatch).source + '|' +
- (options.evaluate || reNoMatch).source + '|$'
- , 'g');
- // Use a sourceURL for easier debugging.
- // The sourceURL gets injected into the source that's eval-ed, so be careful
- // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
- // and escape the comment, thus injecting code that gets evaled.
- var sourceURL = hasOwnProperty.call(options, 'sourceURL')
- ? ('//# sourceURL=' +
- (options.sourceURL + '').replace(/\s/g, ' ') +
- '\n')
- : '';
- string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
- interpolateValue || (interpolateValue = esTemplateValue);
- // Escape characters that can't be included in string literals.
- source += string.slice(index, offset).replace(reUnescapedString, _escapeStringChar_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
- // Replace delimiters with snippets.
- if (escapeValue) {
- isEscaping = true;
- source += "' +\n__e(" + escapeValue + ") +\n'";
- }
- if (evaluateValue) {
- isEvaluating = true;
- source += "';\n" + evaluateValue + ";\n__p += '";
- }
- if (interpolateValue) {
- source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
- }
- index = offset + match.length;
- // The JS engine embedded in Adobe products needs `match` returned in
- // order to produce the correct `offset` value.
- return match;
- });
- source += "';\n";
- // If `variable` is not specified wrap a with-statement around the generated
- // code to add the data object to the top of the scope chain.
- var variable = hasOwnProperty.call(options, 'variable') && options.variable;
- if (!variable) {
- source = 'with (obj) {\n' + source + '\n}\n';
- }
- // Throw an error if a forbidden character was found in `variable`, to prevent
- // potential command injection attacks.
- else if (reForbiddenIdentifierChars.test(variable)) {
- throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
- }
- // Cleanup code by stripping empty strings.
- source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
- .replace(reEmptyStringMiddle, '$1')
- .replace(reEmptyStringTrailing, '$1;');
- // Frame code as the function body.
- source = 'function(' + (variable || 'obj') + ') {\n' +
- (variable
- ? ''
- : 'obj || (obj = {});\n'
- ) +
- "var __t, __p = ''" +
- (isEscaping
- ? ', __e = _.escape'
- : ''
- ) +
- (isEvaluating
- ? ', __j = Array.prototype.join;\n' +
- "function print() { __p += __j.call(arguments, '') }\n"
- : ';\n'
- ) +
- source +
- 'return __p\n}';
- var result = Object(_attempt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function() {
- return Function(importsKeys, sourceURL + 'return ' + source)
- .apply(undefined, importsValues);
- });
- // Provide the compiled function's source by its `toString` method or
- // the `source` property as a convenience for inlining compiled templates.
- result.source = source;
- if (Object(_isError_js__WEBPACK_IMPORTED_MODULE_5__["default"])(result)) {
- throw result;
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (template);
- /***/ }),
- /***/ "./node_modules/lodash-es/templateSettings.js":
- /*!****************************************************!*\
- !*** ./node_modules/lodash-es/templateSettings.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
- /* harmony import */ var _reEscape_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_reEscape.js */ "./node_modules/lodash-es/_reEscape.js");
- /* harmony import */ var _reEvaluate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_reEvaluate.js */ "./node_modules/lodash-es/_reEvaluate.js");
- /* harmony import */ var _reInterpolate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_reInterpolate.js */ "./node_modules/lodash-es/_reInterpolate.js");
- /**
- * By default, the template delimiters used by lodash are like those in
- * embedded Ruby (ERB) as well as ES2015 template strings. Change the
- * following template settings to use alternative delimiters.
- *
- * @static
- * @memberOf _
- * @type {Object}
- */
- var templateSettings = {
- /**
- * Used to detect `data` property values to be HTML-escaped.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- 'escape': _reEscape_js__WEBPACK_IMPORTED_MODULE_1__["default"],
- /**
- * Used to detect code to be evaluated.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- 'evaluate': _reEvaluate_js__WEBPACK_IMPORTED_MODULE_2__["default"],
- /**
- * Used to detect `data` property values to inject.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- 'interpolate': _reInterpolate_js__WEBPACK_IMPORTED_MODULE_3__["default"],
- /**
- * Used to reference the data object in the template text.
- *
- * @memberOf _.templateSettings
- * @type {string}
- */
- 'variable': '',
- /**
- * Used to import variables into the compiled template.
- *
- * @memberOf _.templateSettings
- * @type {Object}
- */
- 'imports': {
- /**
- * A reference to the `lodash` function.
- *
- * @memberOf _.templateSettings.imports
- * @type {Function}
- */
- '_': { 'escape': _escape_js__WEBPACK_IMPORTED_MODULE_0__["default"] }
- }
- };
- /* harmony default export */ __webpack_exports__["default"] = (templateSettings);
- /***/ }),
- /***/ "./node_modules/lodash-es/throttle.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/throttle.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /** Error message constants. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /**
- * Creates a throttled function that only invokes `func` at most once per
- * every `wait` milliseconds. The throttled function comes with a `cancel`
- * method to cancel delayed `func` invocations and a `flush` method to
- * immediately invoke them. Provide `options` to indicate whether `func`
- * should be invoked on the leading and/or trailing edge of the `wait`
- * timeout. The `func` is invoked with the last arguments provided to the
- * throttled function. Subsequent calls to the throttled function return the
- * result of the last `func` invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the throttled function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.throttle` and `_.debounce`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to throttle.
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=true]
- * Specify invoking on the leading edge of the timeout.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new throttled function.
- * @example
- *
- * // Avoid excessively updating the position while scrolling.
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
- *
- * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
- * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
- * jQuery(element).on('click', throttled);
- *
- * // Cancel the trailing throttled invocation.
- * jQuery(window).on('popstate', throttled.cancel);
- */
- function throttle(func, wait, options) {
- var leading = true,
- trailing = true;
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(options)) {
- leading = 'leading' in options ? !!options.leading : leading;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
- return Object(_debounce_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, wait, {
- 'leading': leading,
- 'maxWait': wait,
- 'trailing': trailing
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (throttle);
- /***/ }),
- /***/ "./node_modules/lodash-es/thru.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/thru.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This method is like `_.tap` except that it returns the result of `interceptor`.
- * The purpose of this method is to "pass thru" values replacing intermediate
- * results in a method chain sequence.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Seq
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @returns {*} Returns the result of `interceptor`.
- * @example
- *
- * _(' abc ')
- * .chain()
- * .trim()
- * .thru(function(value) {
- * return [value];
- * })
- * .value();
- * // => ['abc']
- */
- function thru(value, interceptor) {
- return interceptor(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (thru);
- /***/ }),
- /***/ "./node_modules/lodash-es/times.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/times.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
- /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /** Used as references for various `Number` constants. */
- var MAX_SAFE_INTEGER = 9007199254740991;
- /** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = 4294967295;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMin = Math.min;
- /**
- * Invokes the iteratee `n` times, returning an array of the results of
- * each invocation. The iteratee is invoked with one argument; (index).
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the array of results.
- * @example
- *
- * _.times(3, String);
- * // => ['0', '1', '2']
- *
- * _.times(4, _.constant(0));
- * // => [0, 0, 0, 0]
- */
- function times(n, iteratee) {
- n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(n);
- if (n < 1 || n > MAX_SAFE_INTEGER) {
- return [];
- }
- var index = MAX_ARRAY_LENGTH,
- length = nativeMin(n, MAX_ARRAY_LENGTH);
- iteratee = Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee);
- n -= MAX_ARRAY_LENGTH;
- var result = Object(_baseTimes_js__WEBPACK_IMPORTED_MODULE_0__["default"])(length, iteratee);
- while (++index < n) {
- iteratee(index);
- }
- return result;
- }
- /* harmony default export */ __webpack_exports__["default"] = (times);
- /***/ }),
- /***/ "./node_modules/lodash-es/toArray.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/toArray.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
- /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
- /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
- /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
- /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
- /* harmony import */ var _iteratorToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_iteratorToArray.js */ "./node_modules/lodash-es/_iteratorToArray.js");
- /* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
- /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
- /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
- /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
- /** `Object#toString` result references. */
- var mapTag = '[object Map]',
- setTag = '[object Set]';
- /** Built-in value references. */
- var symIterator = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].iterator : undefined;
- /**
- * Converts `value` to an array.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {Array} Returns the converted array.
- * @example
- *
- * _.toArray({ 'a': 1, 'b': 2 });
- * // => [1, 2]
- *
- * _.toArray('abc');
- * // => ['a', 'b', 'c']
- *
- * _.toArray(1);
- * // => []
- *
- * _.toArray(null);
- * // => []
- */
- function toArray(value) {
- if (!value) {
- return [];
- }
- if (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)) {
- return Object(_isString_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value) ? Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_8__["default"])(value) : Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
- }
- if (symIterator && value[symIterator]) {
- return Object(_iteratorToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value[symIterator]());
- }
- var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value),
- func = tag == mapTag ? _mapToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"] : (tag == setTag ? _setToArray_js__WEBPACK_IMPORTED_MODULE_7__["default"] : _values_js__WEBPACK_IMPORTED_MODULE_9__["default"]);
- return func(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (toArray);
- /***/ }),
- /***/ "./node_modules/lodash-es/toFinite.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/toFinite.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
- /** Used as references for various `Number` constants. */
- var INFINITY = 1 / 0,
- MAX_INTEGER = 1.7976931348623157e+308;
- /**
- * Converts `value` to a finite number.
- *
- * @static
- * @memberOf _
- * @since 4.12.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted number.
- * @example
- *
- * _.toFinite(3.2);
- * // => 3.2
- *
- * _.toFinite(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toFinite(Infinity);
- * // => 1.7976931348623157e+308
- *
- * _.toFinite('3.2');
- * // => 3.2
- */
- function toFinite(value) {
- if (!value) {
- return value === 0 ? value : 0;
- }
- value = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- if (value === INFINITY || value === -INFINITY) {
- var sign = (value < 0 ? -1 : 1);
- return sign * MAX_INTEGER;
- }
- return value === value ? value : 0;
- }
- /* harmony default export */ __webpack_exports__["default"] = (toFinite);
- /***/ }),
- /***/ "./node_modules/lodash-es/toInteger.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/toInteger.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
- /**
- * Converts `value` to an integer.
- *
- * **Note:** This method is loosely based on
- * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.toInteger(3.2);
- * // => 3
- *
- * _.toInteger(Number.MIN_VALUE);
- * // => 0
- *
- * _.toInteger(Infinity);
- * // => 1.7976931348623157e+308
- *
- * _.toInteger('3.2');
- * // => 3
- */
- function toInteger(value) {
- var result = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value),
- remainder = result % 1;
- return result === result ? (remainder ? result - remainder : result) : 0;
- }
- /* harmony default export */ __webpack_exports__["default"] = (toInteger);
- /***/ }),
- /***/ "./node_modules/lodash-es/toIterator.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/toIterator.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Enables the wrapper to be iterable.
- *
- * @name Symbol.iterator
- * @memberOf _
- * @since 4.0.0
- * @category Seq
- * @returns {Object} Returns the wrapper object.
- * @example
- *
- * var wrapped = _([1, 2]);
- *
- * wrapped[Symbol.iterator]() === wrapped;
- * // => true
- *
- * Array.from(wrapped);
- * // => [1, 2]
- */
- function wrapperToIterator() {
- return this;
- }
- /* harmony default export */ __webpack_exports__["default"] = (wrapperToIterator);
- /***/ }),
- /***/ "./node_modules/lodash-es/toJSON.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/toJSON.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/toLength.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/toLength.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = 4294967295;
- /**
- * Converts `value` to an integer suitable for use as the length of an
- * array-like object.
- *
- * **Note:** This method is based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.toLength(3.2);
- * // => 3
- *
- * _.toLength(Number.MIN_VALUE);
- * // => 0
- *
- * _.toLength(Infinity);
- * // => 4294967295
- *
- * _.toLength('3.2');
- * // => 3
- */
- function toLength(value) {
- return value ? Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value), 0, MAX_ARRAY_LENGTH) : 0;
- }
- /* harmony default export */ __webpack_exports__["default"] = (toLength);
- /***/ }),
- /***/ "./node_modules/lodash-es/toLower.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/toLower.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Converts `string`, as a whole, to lower case just like
- * [String#toLowerCase](https://mdn.io/toLowerCase).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the lower cased string.
- * @example
- *
- * _.toLower('--Foo-Bar--');
- * // => '--foo-bar--'
- *
- * _.toLower('fooBar');
- * // => 'foobar'
- *
- * _.toLower('__FOO_BAR__');
- * // => '__foo_bar__'
- */
- function toLower(value) {
- return Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value).toLowerCase();
- }
- /* harmony default export */ __webpack_exports__["default"] = (toLower);
- /***/ }),
- /***/ "./node_modules/lodash-es/toNumber.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/toNumber.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseTrim_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseTrim.js */ "./node_modules/lodash-es/_baseTrim.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /** Used as references for various `Number` constants. */
- var NAN = 0 / 0;
- /** Used to detect bad signed hexadecimal string values. */
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
- /** Used to detect binary string values. */
- var reIsBinary = /^0b[01]+$/i;
- /** Used to detect octal string values. */
- var reIsOctal = /^0o[0-7]+$/i;
- /** Built-in method references without a dependency on `root`. */
- var freeParseInt = parseInt;
- /**
- * Converts `value` to a number.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to process.
- * @returns {number} Returns the number.
- * @example
- *
- * _.toNumber(3.2);
- * // => 3.2
- *
- * _.toNumber(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toNumber(Infinity);
- * // => Infinity
- *
- * _.toNumber('3.2');
- * // => 3.2
- */
- function toNumber(value) {
- if (typeof value == 'number') {
- return value;
- }
- if (Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
- return NAN;
- }
- if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
- value = Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other) ? (other + '') : other;
- }
- if (typeof value != 'string') {
- return value === 0 ? value : +value;
- }
- value = Object(_baseTrim_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- var isBinary = reIsBinary.test(value);
- return (isBinary || reIsOctal.test(value))
- ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
- : (reIsBadHex.test(value) ? NAN : +value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (toNumber);
- /***/ }),
- /***/ "./node_modules/lodash-es/toPairs.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/toPairs.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createToPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createToPairs.js */ "./node_modules/lodash-es/_createToPairs.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * Creates an array of own enumerable string keyed-value pairs for `object`
- * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
- * entries are returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias entries
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the key-value pairs.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.toPairs(new Foo);
- * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
- */
- var toPairs = Object(_createToPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (toPairs);
- /***/ }),
- /***/ "./node_modules/lodash-es/toPairsIn.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/toPairsIn.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createToPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createToPairs.js */ "./node_modules/lodash-es/_createToPairs.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /**
- * Creates an array of own and inherited enumerable string keyed-value pairs
- * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
- * or set, its entries are returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias entriesIn
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the key-value pairs.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.toPairsIn(new Foo);
- * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
- */
- var toPairsIn = Object(_createToPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (toPairsIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/toPath.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/toPath.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
- /* harmony import */ var _stringToPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stringToPath.js */ "./node_modules/lodash-es/_stringToPath.js");
- /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Converts `value` to a property path array.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {*} value The value to convert.
- * @returns {Array} Returns the new property path array.
- * @example
- *
- * _.toPath('a.b.c');
- * // => ['a', 'b', 'c']
- *
- * _.toPath('a[0].b.c');
- * // => ['a', '0', 'b', 'c']
- */
- function toPath(value) {
- if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
- return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, _toKey_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
- }
- return Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) ? [value] : Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_stringToPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value)));
- }
- /* harmony default export */ __webpack_exports__["default"] = (toPath);
- /***/ }),
- /***/ "./node_modules/lodash-es/toPlainObject.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/toPlainObject.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /**
- * Converts `value` to a plain object flattening inherited enumerable string
- * keyed properties of `value` to own properties of the plain object.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {Object} Returns the converted plain object.
- * @example
- *
- * function Foo() {
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.assign({ 'a': 1 }, new Foo);
- * // => { 'a': 1, 'b': 2 }
- *
- * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
- * // => { 'a': 1, 'b': 2, 'c': 3 }
- */
- function toPlainObject(value) {
- return Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value));
- }
- /* harmony default export */ __webpack_exports__["default"] = (toPlainObject);
- /***/ }),
- /***/ "./node_modules/lodash-es/toSafeInteger.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/toSafeInteger.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /** Used as references for various `Number` constants. */
- var MAX_SAFE_INTEGER = 9007199254740991;
- /**
- * Converts `value` to a safe integer. A safe integer can be compared and
- * represented correctly.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.toSafeInteger(3.2);
- * // => 3
- *
- * _.toSafeInteger(Number.MIN_VALUE);
- * // => 0
- *
- * _.toSafeInteger(Infinity);
- * // => 9007199254740991
- *
- * _.toSafeInteger('3.2');
- * // => 3
- */
- function toSafeInteger(value) {
- return value
- ? Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
- : (value === 0 ? value : 0);
- }
- /* harmony default export */ __webpack_exports__["default"] = (toSafeInteger);
- /***/ }),
- /***/ "./node_modules/lodash-es/toString.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/toString.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
- /**
- * Converts `value` to a string. An empty string is returned for `null`
- * and `undefined` values. The sign of `-0` is preserved.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.toString(null);
- * // => ''
- *
- * _.toString(-0);
- * // => '-0'
- *
- * _.toString([1, 2, 3]);
- * // => '1,2,3'
- */
- function toString(value) {
- return value == null ? '' : Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (toString);
- /***/ }),
- /***/ "./node_modules/lodash-es/toUpper.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/toUpper.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Converts `string`, as a whole, to upper case just like
- * [String#toUpperCase](https://mdn.io/toUpperCase).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the upper cased string.
- * @example
- *
- * _.toUpper('--foo-bar--');
- * // => '--FOO-BAR--'
- *
- * _.toUpper('fooBar');
- * // => 'FOOBAR'
- *
- * _.toUpper('__foo_bar__');
- * // => '__FOO_BAR__'
- */
- function toUpper(value) {
- return Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value).toUpperCase();
- }
- /* harmony default export */ __webpack_exports__["default"] = (toUpper);
- /***/ }),
- /***/ "./node_modules/lodash-es/transform.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/transform.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
- /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
- /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
- /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
- /**
- * An alternative to `_.reduce`; this method transforms `object` to a new
- * `accumulator` object which is the result of running each of its own
- * enumerable string keyed properties thru `iteratee`, with each invocation
- * potentially mutating the `accumulator` object. If `accumulator` is not
- * provided, a new object with the same `[[Prototype]]` will be used. The
- * iteratee is invoked with four arguments: (accumulator, value, key, object).
- * Iteratee functions may exit iteration early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @since 1.3.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The custom accumulator value.
- * @returns {*} Returns the accumulated value.
- * @example
- *
- * _.transform([2, 3, 4], function(result, n) {
- * result.push(n *= n);
- * return n % 2 == 0;
- * }, []);
- * // => [4, 9]
- *
- * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
- * (result[value] || (result[value] = [])).push(key);
- * }, {});
- * // => { '1': ['a', 'c'], '2': ['b'] }
- */
- function transform(object, iteratee, accumulator) {
- var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(object),
- isArrLike = isArr || Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object) || Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_9__["default"])(object);
- iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__["default"])(iteratee, 4);
- if (accumulator == null) {
- var Ctor = object && object.constructor;
- if (isArrLike) {
- accumulator = isArr ? new Ctor : [];
- }
- else if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_8__["default"])(object)) {
- accumulator = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_7__["default"])(Ctor) ? Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object)) : {};
- }
- else {
- accumulator = {};
- }
- }
- (isArrLike ? _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseForOwn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, function(value, index, object) {
- return iteratee(accumulator, value, index, object);
- });
- return accumulator;
- }
- /* harmony default export */ __webpack_exports__["default"] = (transform);
- /***/ }),
- /***/ "./node_modules/lodash-es/trim.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/trim.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
- /* harmony import */ var _baseTrim_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseTrim.js */ "./node_modules/lodash-es/_baseTrim.js");
- /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
- /* harmony import */ var _charsEndIndex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_charsEndIndex.js */ "./node_modules/lodash-es/_charsEndIndex.js");
- /* harmony import */ var _charsStartIndex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_charsStartIndex.js */ "./node_modules/lodash-es/_charsStartIndex.js");
- /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /**
- * Removes leading and trailing whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trim(' abc ');
- * // => 'abc'
- *
- * _.trim('-_-abc-_-', '_-');
- * // => 'abc'
- *
- * _.map([' foo ', ' bar '], _.trim);
- * // => ['foo', 'bar']
- */
- function trim(string, chars, guard) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string);
- if (string && (guard || chars === undefined)) {
- return Object(_baseTrim_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string);
- }
- if (!string || !(chars = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars))) {
- return string;
- }
- var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(string),
- chrSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(chars),
- start = Object(_charsStartIndex_js__WEBPACK_IMPORTED_MODULE_4__["default"])(strSymbols, chrSymbols),
- end = Object(_charsEndIndex_js__WEBPACK_IMPORTED_MODULE_3__["default"])(strSymbols, chrSymbols) + 1;
- return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_2__["default"])(strSymbols, start, end).join('');
- }
- /* harmony default export */ __webpack_exports__["default"] = (trim);
- /***/ }),
- /***/ "./node_modules/lodash-es/trimEnd.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/trimEnd.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
- /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
- /* harmony import */ var _charsEndIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_charsEndIndex.js */ "./node_modules/lodash-es/_charsEndIndex.js");
- /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /* harmony import */ var _trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_trimmedEndIndex.js */ "./node_modules/lodash-es/_trimmedEndIndex.js");
- /**
- * Removes trailing whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trimEnd(' abc ');
- * // => ' abc'
- *
- * _.trimEnd('-_-abc-_-', '_-');
- * // => '-_-abc'
- */
- function trimEnd(string, chars, guard) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_4__["default"])(string);
- if (string && (guard || chars === undefined)) {
- return string.slice(0, Object(_trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_5__["default"])(string) + 1);
- }
- if (!string || !(chars = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars))) {
- return string;
- }
- var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string),
- end = Object(_charsEndIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(strSymbols, Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(chars)) + 1;
- return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(strSymbols, 0, end).join('');
- }
- /* harmony default export */ __webpack_exports__["default"] = (trimEnd);
- /***/ }),
- /***/ "./node_modules/lodash-es/trimStart.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/trimStart.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
- /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
- /* harmony import */ var _charsStartIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_charsStartIndex.js */ "./node_modules/lodash-es/_charsStartIndex.js");
- /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /** Used to match leading whitespace. */
- var reTrimStart = /^\s+/;
- /**
- * Removes leading whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trimStart(' abc ');
- * // => 'abc '
- *
- * _.trimStart('-_-abc-_-', '_-');
- * // => 'abc-_-'
- */
- function trimStart(string, chars, guard) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_4__["default"])(string);
- if (string && (guard || chars === undefined)) {
- return string.replace(reTrimStart, '');
- }
- if (!string || !(chars = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars))) {
- return string;
- }
- var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string),
- start = Object(_charsStartIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(strSymbols, Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(chars));
- return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(strSymbols, start).join('');
- }
- /* harmony default export */ __webpack_exports__["default"] = (trimStart);
- /***/ }),
- /***/ "./node_modules/lodash-es/truncate.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/truncate.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
- /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
- /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
- /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
- /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
- /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
- /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
- /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /** Used as default options for `_.truncate`. */
- var DEFAULT_TRUNC_LENGTH = 30,
- DEFAULT_TRUNC_OMISSION = '...';
- /** Used to match `RegExp` flags from their coerced string values. */
- var reFlags = /\w*$/;
- /**
- * Truncates `string` if it's longer than the given maximum string length.
- * The last characters of the truncated string are replaced with the omission
- * string which defaults to "...".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to truncate.
- * @param {Object} [options={}] The options object.
- * @param {number} [options.length=30] The maximum string length.
- * @param {string} [options.omission='...'] The string to indicate text is omitted.
- * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
- * @returns {string} Returns the truncated string.
- * @example
- *
- * _.truncate('hi-diddly-ho there, neighborino');
- * // => 'hi-diddly-ho there, neighbo...'
- *
- * _.truncate('hi-diddly-ho there, neighborino', {
- * 'length': 24,
- * 'separator': ' '
- * });
- * // => 'hi-diddly-ho there,...'
- *
- * _.truncate('hi-diddly-ho there, neighborino', {
- * 'length': 24,
- * 'separator': /,? +/
- * });
- * // => 'hi-diddly-ho there...'
- *
- * _.truncate('hi-diddly-ho there, neighborino', {
- * 'omission': ' [...]'
- * });
- * // => 'hi-diddly-ho there, neig [...]'
- */
- function truncate(string, options) {
- var length = DEFAULT_TRUNC_LENGTH,
- omission = DEFAULT_TRUNC_OMISSION;
- if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(options)) {
- var separator = 'separator' in options ? options.separator : separator;
- length = 'length' in options ? Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_7__["default"])(options.length) : length;
- omission = 'omission' in options ? Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.omission) : omission;
- }
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(string);
- var strLength = string.length;
- if (Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)) {
- var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string);
- strLength = strSymbols.length;
- }
- if (length >= strLength) {
- return string;
- }
- var end = length - Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_5__["default"])(omission);
- if (end < 1) {
- return omission;
- }
- var result = strSymbols
- ? Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(strSymbols, 0, end).join('')
- : string.slice(0, end);
- if (separator === undefined) {
- return result + omission;
- }
- if (strSymbols) {
- end += (result.length - end);
- }
- if (Object(_isRegExp_js__WEBPACK_IMPORTED_MODULE_4__["default"])(separator)) {
- if (string.slice(end).search(separator)) {
- var match,
- substring = result;
- if (!separator.global) {
- separator = RegExp(separator.source, Object(_toString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(reFlags.exec(separator)) + 'g');
- }
- separator.lastIndex = 0;
- while ((match = separator.exec(substring))) {
- var newEnd = match.index;
- }
- result = result.slice(0, newEnd === undefined ? end : newEnd);
- }
- } else if (string.indexOf(Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(separator), end) != end) {
- var index = result.lastIndexOf(separator);
- if (index > -1) {
- result = result.slice(0, index);
- }
- }
- return result + omission;
- }
- /* harmony default export */ __webpack_exports__["default"] = (truncate);
- /***/ }),
- /***/ "./node_modules/lodash-es/unary.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/unary.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
- /**
- * Creates a function that accepts up to one argument, ignoring any
- * additional arguments.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Function
- * @param {Function} func The function to cap arguments for.
- * @returns {Function} Returns the new capped function.
- * @example
- *
- * _.map(['6', '8', '10'], _.unary(parseInt));
- * // => [6, 8, 10]
- */
- function unary(func) {
- return Object(_ary_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, 1);
- }
- /* harmony default export */ __webpack_exports__["default"] = (unary);
- /***/ }),
- /***/ "./node_modules/lodash-es/unescape.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/unescape.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /* harmony import */ var _unescapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_unescapeHtmlChar.js */ "./node_modules/lodash-es/_unescapeHtmlChar.js");
- /** Used to match HTML entities and HTML characters. */
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
- reHasEscapedHtml = RegExp(reEscapedHtml.source);
- /**
- * The inverse of `_.escape`; this method converts the HTML entities
- * `&`, `<`, `>`, `"`, and `'` in `string` to
- * their corresponding characters.
- *
- * **Note:** No other HTML entities are unescaped. To unescape additional
- * HTML entities use a third-party library like [_he_](https://mths.be/he).
- *
- * @static
- * @memberOf _
- * @since 0.6.0
- * @category String
- * @param {string} [string=''] The string to unescape.
- * @returns {string} Returns the unescaped string.
- * @example
- *
- * _.unescape('fred, barney, & pebbles');
- * // => 'fred, barney, & pebbles'
- */
- function unescape(string) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
- return (string && reHasEscapedHtml.test(string))
- ? string.replace(reEscapedHtml, _unescapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_1__["default"])
- : string;
- }
- /* harmony default export */ __webpack_exports__["default"] = (unescape);
- /***/ }),
- /***/ "./node_modules/lodash-es/union.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/union.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /**
- * Creates an array of unique values, in order, from all given arrays using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * _.union([2], [1, 2]);
- * // => [2, 1]
- */
- var union = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
- return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"], true));
- });
- /* harmony default export */ __webpack_exports__["default"] = (union);
- /***/ }),
- /***/ "./node_modules/lodash-es/unionBy.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/unionBy.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /**
- * This method is like `_.union` except that it accepts `iteratee` which is
- * invoked for each element of each `arrays` to generate the criterion by
- * which uniqueness is computed. Result values are chosen from the first
- * array in which the value occurs. The iteratee is invoked with one argument:
- * (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * _.unionBy([2.1], [1.2, 2.3], Math.floor);
- * // => [2.1, 1.2]
- *
- * // The `_.property` iteratee shorthand.
- * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }, { 'x': 2 }]
- */
- var unionBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
- var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrays);
- if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee)) {
- iteratee = undefined;
- }
- return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"], true), Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 2));
- });
- /* harmony default export */ __webpack_exports__["default"] = (unionBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/unionWith.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/unionWith.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /**
- * This method is like `_.union` except that it accepts `comparator` which
- * is invoked to compare elements of `arrays`. Result values are chosen from
- * the first array in which the value occurs. The comparator is invoked
- * with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.unionWith(objects, others, _.isEqual);
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
- */
- var unionWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
- var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(arrays);
- comparator = typeof comparator == 'function' ? comparator : undefined;
- return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"], true), undefined, comparator);
- });
- /* harmony default export */ __webpack_exports__["default"] = (unionWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/uniq.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/uniq.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
- /**
- * Creates a duplicate-free version of an array, using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons, in which only the first occurrence of each element
- * is kept. The order of result values is determined by the order they occur
- * in the array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.uniq([2, 1, 2]);
- * // => [2, 1]
- */
- function uniq(array) {
- return (array && array.length) ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array) : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (uniq);
- /***/ }),
- /***/ "./node_modules/lodash-es/uniqBy.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/uniqBy.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
- /**
- * This method is like `_.uniq` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the criterion by which
- * uniqueness is computed. The order of result values is determined by the
- * order they occur in the array. The iteratee is invoked with one argument:
- * (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
- * // => [2.1, 1.2]
- *
- * // The `_.property` iteratee shorthand.
- * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }, { 'x': 2 }]
- */
- function uniqBy(array, iteratee) {
- return (array && array.length) ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2)) : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (uniqBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/uniqWith.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/uniqWith.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
- /**
- * This method is like `_.uniq` except that it accepts `comparator` which
- * is invoked to compare elements of `array`. The order of result values is
- * determined by the order they occur in the array.The comparator is invoked
- * with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.uniqWith(objects, _.isEqual);
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
- */
- function uniqWith(array, comparator) {
- comparator = typeof comparator == 'function' ? comparator : undefined;
- return (array && array.length) ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, undefined, comparator) : [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (uniqWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/uniqueId.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/uniqueId.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /** Used to generate unique IDs. */
- var idCounter = 0;
- /**
- * Generates a unique ID. If `prefix` is given, the ID is appended to it.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {string} [prefix=''] The value to prefix the ID with.
- * @returns {string} Returns the unique ID.
- * @example
- *
- * _.uniqueId('contact_');
- * // => 'contact_104'
- *
- * _.uniqueId();
- * // => '105'
- */
- function uniqueId(prefix) {
- var id = ++idCounter;
- return Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(prefix) + id;
- }
- /* harmony default export */ __webpack_exports__["default"] = (uniqueId);
- /***/ }),
- /***/ "./node_modules/lodash-es/unset.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/unset.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseUnset_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUnset.js */ "./node_modules/lodash-es/_baseUnset.js");
- /**
- * Removes the property at `path` of `object`.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to unset.
- * @returns {boolean} Returns `true` if the property is deleted, else `false`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 7 } }] };
- * _.unset(object, 'a[0].b.c');
- * // => true
- *
- * console.log(object);
- * // => { 'a': [{ 'b': {} }] };
- *
- * _.unset(object, ['a', '0', 'b', 'c']);
- * // => true
- *
- * console.log(object);
- * // => { 'a': [{ 'b': {} }] };
- */
- function unset(object, path) {
- return object == null ? true : Object(_baseUnset_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
- }
- /* harmony default export */ __webpack_exports__["default"] = (unset);
- /***/ }),
- /***/ "./node_modules/lodash-es/unzip.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/unzip.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _baseProperty_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseProperty.js */ "./node_modules/lodash-es/_baseProperty.js");
- /* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max;
- /**
- * This method is like `_.zip` except that it accepts an array of grouped
- * elements and creates an array regrouping the elements to their pre-zip
- * configuration.
- *
- * @static
- * @memberOf _
- * @since 1.2.0
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
- * // => [['a', 1, true], ['b', 2, false]]
- *
- * _.unzip(zipped);
- * // => [['a', 'b'], [1, 2], [true, false]]
- */
- function unzip(array) {
- if (!(array && array.length)) {
- return [];
- }
- var length = 0;
- array = Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, function(group) {
- if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(group)) {
- length = nativeMax(group.length, length);
- return true;
- }
- });
- return Object(_baseTimes_js__WEBPACK_IMPORTED_MODULE_3__["default"])(length, function(index) {
- return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(index));
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (unzip);
- /***/ }),
- /***/ "./node_modules/lodash-es/unzipWith.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/unzipWith.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
- /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
- /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
- /**
- * This method is like `_.unzip` except that it accepts `iteratee` to specify
- * how regrouped values should be combined. The iteratee is invoked with the
- * elements of each group: (...group).
- *
- * @static
- * @memberOf _
- * @since 3.8.0
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @param {Function} [iteratee=_.identity] The function to combine
- * regrouped values.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
- * // => [[1, 10, 100], [2, 20, 200]]
- *
- * _.unzipWith(zipped, _.add);
- * // => [3, 30, 300]
- */
- function unzipWith(array, iteratee) {
- if (!(array && array.length)) {
- return [];
- }
- var result = Object(_unzip_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array);
- if (iteratee == null) {
- return result;
- }
- return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, function(group) {
- return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, undefined, group);
- });
- }
- /* harmony default export */ __webpack_exports__["default"] = (unzipWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/update.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/update.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUpdate.js */ "./node_modules/lodash-es/_baseUpdate.js");
- /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
- /**
- * This method is like `_.set` except that accepts `updater` to produce the
- * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
- * is invoked with one argument: (value).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.6.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {Function} updater The function to produce the updated value.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.update(object, 'a[0].b.c', function(n) { return n * n; });
- * console.log(object.a[0].b.c);
- * // => 9
- *
- * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
- * console.log(object.x[0].y.z);
- * // => 0
- */
- function update(object, path, updater) {
- return object == null ? object : Object(_baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(updater));
- }
- /* harmony default export */ __webpack_exports__["default"] = (update);
- /***/ }),
- /***/ "./node_modules/lodash-es/updateWith.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/updateWith.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUpdate.js */ "./node_modules/lodash-es/_baseUpdate.js");
- /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
- /**
- * This method is like `_.update` except that it accepts `customizer` which is
- * invoked to produce the objects of `path`. If `customizer` returns `undefined`
- * path creation is handled by the method instead. The `customizer` is invoked
- * with three arguments: (nsValue, key, nsObject).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.6.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {Function} updater The function to produce the updated value.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = {};
- *
- * _.updateWith(object, '[0][1]', _.constant('a'), Object);
- * // => { '0': { '1': 'a' } }
- */
- function updateWith(object, path, updater, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return object == null ? object : Object(_baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(updater), customizer);
- }
- /* harmony default export */ __webpack_exports__["default"] = (updateWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/upperCase.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/upperCase.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
- /**
- * Converts `string`, as space separated words, to upper case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the upper cased string.
- * @example
- *
- * _.upperCase('--foo-bar');
- * // => 'FOO BAR'
- *
- * _.upperCase('fooBar');
- * // => 'FOO BAR'
- *
- * _.upperCase('__foo_bar__');
- * // => 'FOO BAR'
- */
- var upperCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
- return result + (index ? ' ' : '') + word.toUpperCase();
- });
- /* harmony default export */ __webpack_exports__["default"] = (upperCase);
- /***/ }),
- /***/ "./node_modules/lodash-es/upperFirst.js":
- /*!**********************************************!*\
- !*** ./node_modules/lodash-es/upperFirst.js ***!
- \**********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCaseFirst.js */ "./node_modules/lodash-es/_createCaseFirst.js");
- /**
- * Converts the first character of `string` to upper case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.upperFirst('fred');
- * // => 'Fred'
- *
- * _.upperFirst('FRED');
- * // => 'FRED'
- */
- var upperFirst = Object(_createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__["default"])('toUpperCase');
- /* harmony default export */ __webpack_exports__["default"] = (upperFirst);
- /***/ }),
- /***/ "./node_modules/lodash-es/util.default.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/util.default.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
- /* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/lodash-es/bindAll.js");
- /* harmony import */ var _cond_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cond.js */ "./node_modules/lodash-es/cond.js");
- /* harmony import */ var _conforms_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conforms.js */ "./node_modules/lodash-es/conforms.js");
- /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
- /* harmony import */ var _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./defaultTo.js */ "./node_modules/lodash-es/defaultTo.js");
- /* harmony import */ var _flow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flow.js */ "./node_modules/lodash-es/flow.js");
- /* harmony import */ var _flowRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flowRight.js */ "./node_modules/lodash-es/flowRight.js");
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/lodash-es/iteratee.js");
- /* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./matches.js */ "./node_modules/lodash-es/matches.js");
- /* harmony import */ var _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./matchesProperty.js */ "./node_modules/lodash-es/matchesProperty.js");
- /* harmony import */ var _method_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./method.js */ "./node_modules/lodash-es/method.js");
- /* harmony import */ var _methodOf_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./methodOf.js */ "./node_modules/lodash-es/methodOf.js");
- /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
- /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
- /* harmony import */ var _nthArg_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./nthArg.js */ "./node_modules/lodash-es/nthArg.js");
- /* harmony import */ var _over_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./over.js */ "./node_modules/lodash-es/over.js");
- /* harmony import */ var _overEvery_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./overEvery.js */ "./node_modules/lodash-es/overEvery.js");
- /* harmony import */ var _overSome_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./overSome.js */ "./node_modules/lodash-es/overSome.js");
- /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
- /* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/lodash-es/propertyOf.js");
- /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./range.js */ "./node_modules/lodash-es/range.js");
- /* harmony import */ var _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./rangeRight.js */ "./node_modules/lodash-es/rangeRight.js");
- /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
- /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
- /* harmony import */ var _stubObject_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./stubObject.js */ "./node_modules/lodash-es/stubObject.js");
- /* harmony import */ var _stubString_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./stubString.js */ "./node_modules/lodash-es/stubString.js");
- /* harmony import */ var _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./stubTrue.js */ "./node_modules/lodash-es/stubTrue.js");
- /* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./times.js */ "./node_modules/lodash-es/times.js");
- /* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/lodash-es/toPath.js");
- /* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/lodash-es/uniqueId.js");
- /* harmony default export */ __webpack_exports__["default"] = ({
- attempt: _attempt_js__WEBPACK_IMPORTED_MODULE_0__["default"], bindAll: _bindAll_js__WEBPACK_IMPORTED_MODULE_1__["default"], cond: _cond_js__WEBPACK_IMPORTED_MODULE_2__["default"], conforms: _conforms_js__WEBPACK_IMPORTED_MODULE_3__["default"], constant: _constant_js__WEBPACK_IMPORTED_MODULE_4__["default"],
- defaultTo: _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__["default"], flow: _flow_js__WEBPACK_IMPORTED_MODULE_6__["default"], flowRight: _flowRight_js__WEBPACK_IMPORTED_MODULE_7__["default"], identity: _identity_js__WEBPACK_IMPORTED_MODULE_8__["default"], iteratee: _iteratee_js__WEBPACK_IMPORTED_MODULE_9__["default"],
- matches: _matches_js__WEBPACK_IMPORTED_MODULE_10__["default"], matchesProperty: _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__["default"], method: _method_js__WEBPACK_IMPORTED_MODULE_12__["default"], methodOf: _methodOf_js__WEBPACK_IMPORTED_MODULE_13__["default"], mixin: _mixin_js__WEBPACK_IMPORTED_MODULE_14__["default"],
- noop: _noop_js__WEBPACK_IMPORTED_MODULE_15__["default"], nthArg: _nthArg_js__WEBPACK_IMPORTED_MODULE_16__["default"], over: _over_js__WEBPACK_IMPORTED_MODULE_17__["default"], overEvery: _overEvery_js__WEBPACK_IMPORTED_MODULE_18__["default"], overSome: _overSome_js__WEBPACK_IMPORTED_MODULE_19__["default"],
- property: _property_js__WEBPACK_IMPORTED_MODULE_20__["default"], propertyOf: _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__["default"], range: _range_js__WEBPACK_IMPORTED_MODULE_22__["default"], rangeRight: _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__["default"], stubArray: _stubArray_js__WEBPACK_IMPORTED_MODULE_24__["default"],
- stubFalse: _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__["default"], stubObject: _stubObject_js__WEBPACK_IMPORTED_MODULE_26__["default"], stubString: _stubString_js__WEBPACK_IMPORTED_MODULE_27__["default"], stubTrue: _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__["default"], times: _times_js__WEBPACK_IMPORTED_MODULE_29__["default"],
- toPath: _toPath_js__WEBPACK_IMPORTED_MODULE_30__["default"], uniqueId: _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__["default"]
- });
- /***/ }),
- /***/ "./node_modules/lodash-es/util.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/util.js ***!
- \****************************************/
- /*! exports provided: attempt, bindAll, cond, conforms, constant, defaultTo, flow, flowRight, identity, iteratee, matches, matchesProperty, method, methodOf, mixin, noop, nthArg, over, overEvery, overSome, property, propertyOf, range, rangeRight, stubArray, stubFalse, stubObject, stubString, stubTrue, times, toPath, uniqueId, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attempt", function() { return _attempt_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/lodash-es/bindAll.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return _bindAll_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
- /* harmony import */ var _cond_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cond.js */ "./node_modules/lodash-es/cond.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cond", function() { return _cond_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
- /* harmony import */ var _conforms_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conforms.js */ "./node_modules/lodash-es/conforms.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conforms", function() { return _conforms_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
- /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return _constant_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
- /* harmony import */ var _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./defaultTo.js */ "./node_modules/lodash-es/defaultTo.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultTo", function() { return _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
- /* harmony import */ var _flow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flow.js */ "./node_modules/lodash-es/flow.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flow", function() { return _flow_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
- /* harmony import */ var _flowRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flowRight.js */ "./node_modules/lodash-es/flowRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flowRight", function() { return _flowRight_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
- /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _identity_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
- /* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/lodash-es/iteratee.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return _iteratee_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
- /* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./matches.js */ "./node_modules/lodash-es/matches.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return _matches_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
- /* harmony import */ var _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./matchesProperty.js */ "./node_modules/lodash-es/matchesProperty.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matchesProperty", function() { return _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
- /* harmony import */ var _method_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./method.js */ "./node_modules/lodash-es/method.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "method", function() { return _method_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
- /* harmony import */ var _methodOf_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./methodOf.js */ "./node_modules/lodash-es/methodOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "methodOf", function() { return _methodOf_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
- /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return _mixin_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
- /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _noop_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
- /* harmony import */ var _nthArg_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./nthArg.js */ "./node_modules/lodash-es/nthArg.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nthArg", function() { return _nthArg_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
- /* harmony import */ var _over_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./over.js */ "./node_modules/lodash-es/over.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "over", function() { return _over_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
- /* harmony import */ var _overEvery_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./overEvery.js */ "./node_modules/lodash-es/overEvery.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overEvery", function() { return _overEvery_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
- /* harmony import */ var _overSome_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./overSome.js */ "./node_modules/lodash-es/overSome.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overSome", function() { return _overSome_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
- /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "property", function() { return _property_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
- /* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/lodash-es/propertyOf.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
- /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./range.js */ "./node_modules/lodash-es/range.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _range_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
- /* harmony import */ var _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./rangeRight.js */ "./node_modules/lodash-es/rangeRight.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rangeRight", function() { return _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
- /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubArray", function() { return _stubArray_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
- /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubFalse", function() { return _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
- /* harmony import */ var _stubObject_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./stubObject.js */ "./node_modules/lodash-es/stubObject.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubObject", function() { return _stubObject_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
- /* harmony import */ var _stubString_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./stubString.js */ "./node_modules/lodash-es/stubString.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubString", function() { return _stubString_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
- /* harmony import */ var _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./stubTrue.js */ "./node_modules/lodash-es/stubTrue.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubTrue", function() { return _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
- /* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./times.js */ "./node_modules/lodash-es/times.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "times", function() { return _times_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
- /* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/lodash-es/toPath.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return _toPath_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
- /* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/lodash-es/uniqueId.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
- /* harmony import */ var _util_default_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./util.default.js */ "./node_modules/lodash-es/util.default.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _util_default_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/value.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/value.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/valueOf.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/valueOf.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
- /***/ }),
- /***/ "./node_modules/lodash-es/values.js":
- /*!******************************************!*\
- !*** ./node_modules/lodash-es/values.js ***!
- \******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseValues_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseValues.js */ "./node_modules/lodash-es/_baseValues.js");
- /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
- /**
- * Creates an array of the own enumerable string keyed property values of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property values.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.values(new Foo);
- * // => [1, 2] (iteration order is not guaranteed)
- *
- * _.values('hi');
- * // => ['h', 'i']
- */
- function values(object) {
- return object == null ? [] : Object(_baseValues_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
- }
- /* harmony default export */ __webpack_exports__["default"] = (values);
- /***/ }),
- /***/ "./node_modules/lodash-es/valuesIn.js":
- /*!********************************************!*\
- !*** ./node_modules/lodash-es/valuesIn.js ***!
- \********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseValues_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseValues.js */ "./node_modules/lodash-es/_baseValues.js");
- /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
- /**
- * Creates an array of the own and inherited enumerable string keyed property
- * values of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property values.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.valuesIn(new Foo);
- * // => [1, 2, 3] (iteration order is not guaranteed)
- */
- function valuesIn(object) {
- return object == null ? [] : Object(_baseValues_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
- }
- /* harmony default export */ __webpack_exports__["default"] = (valuesIn);
- /***/ }),
- /***/ "./node_modules/lodash-es/without.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/without.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /**
- * Creates an array excluding all given values using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * **Note:** Unlike `_.pull`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...*} [values] The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- * @see _.difference, _.xor
- * @example
- *
- * _.without([2, 1, 2, 3], 1, 2);
- * // => [3]
- */
- var without = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(array, values) {
- return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array)
- ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, values)
- : [];
- });
- /* harmony default export */ __webpack_exports__["default"] = (without);
- /***/ }),
- /***/ "./node_modules/lodash-es/words.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/words.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _asciiWords_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_asciiWords.js */ "./node_modules/lodash-es/_asciiWords.js");
- /* harmony import */ var _hasUnicodeWord_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicodeWord.js */ "./node_modules/lodash-es/_hasUnicodeWord.js");
- /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
- /* harmony import */ var _unicodeWords_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_unicodeWords.js */ "./node_modules/lodash-es/_unicodeWords.js");
- /**
- * Splits `string` into an array of its words.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {RegExp|string} [pattern] The pattern to match words.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the words of `string`.
- * @example
- *
- * _.words('fred, barney, & pebbles');
- * // => ['fred', 'barney', 'pebbles']
- *
- * _.words('fred, barney, & pebbles', /[^, ]+/g);
- * // => ['fred', 'barney', '&', 'pebbles']
- */
- function words(string, pattern, guard) {
- string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string);
- pattern = guard ? undefined : pattern;
- if (pattern === undefined) {
- return Object(_hasUnicodeWord_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) ? Object(_unicodeWords_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string) : Object(_asciiWords_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
- }
- return string.match(pattern) || [];
- }
- /* harmony default export */ __webpack_exports__["default"] = (words);
- /***/ }),
- /***/ "./node_modules/lodash-es/wrap.js":
- /*!****************************************!*\
- !*** ./node_modules/lodash-es/wrap.js ***!
- \****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
- /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
- /**
- * Creates a function that provides `value` to `wrapper` as its first
- * argument. Any additional arguments provided to the function are appended
- * to those provided to the `wrapper`. The wrapper is invoked with the `this`
- * binding of the created function.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {*} value The value to wrap.
- * @param {Function} [wrapper=identity] The wrapper function.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var p = _.wrap(_.escape, function(func, text) {
- * return '<p>' + func(text) + '</p>';
- * });
- *
- * p('fred, barney, & pebbles');
- * // => '<p>fred, barney, & pebbles</p>'
- */
- function wrap(value, wrapper) {
- return Object(_partial_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(wrapper), value);
- }
- /* harmony default export */ __webpack_exports__["default"] = (wrap);
- /***/ }),
- /***/ "./node_modules/lodash-es/wrapperAt.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/wrapperAt.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
- /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
- /* harmony import */ var _baseAt_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseAt.js */ "./node_modules/lodash-es/_baseAt.js");
- /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
- /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
- /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
- /**
- * This method is the wrapper version of `_.at`.
- *
- * @name at
- * @memberOf _
- * @since 1.0.0
- * @category Seq
- * @param {...(string|string[])} [paths] The property paths to pick.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
- *
- * _(object).at(['a[0].b.c', 'a[1]']).value();
- * // => [3, 4]
- */
- var wrapperAt = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(paths) {
- var length = paths.length,
- start = length ? paths[0] : 0,
- value = this.__wrapped__,
- interceptor = function(object) { return Object(_baseAt_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, paths); };
- if (length > 1 || this.__actions__.length ||
- !(value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) || !Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_4__["default"])(start)) {
- return this.thru(interceptor);
- }
- value = value.slice(start, +start + (length ? 1 : 0));
- value.__actions__.push({
- 'func': _thru_js__WEBPACK_IMPORTED_MODULE_5__["default"],
- 'args': [interceptor],
- 'thisArg': undefined
- });
- return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](value, this.__chain__).thru(function(array) {
- if (length && !array.length) {
- array.push(undefined);
- }
- return array;
- });
- });
- /* harmony default export */ __webpack_exports__["default"] = (wrapperAt);
- /***/ }),
- /***/ "./node_modules/lodash-es/wrapperChain.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/wrapperChain.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
- /**
- * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
- *
- * @name chain
- * @memberOf _
- * @since 0.1.0
- * @category Seq
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * // A sequence without explicit chaining.
- * _(users).head();
- * // => { 'user': 'barney', 'age': 36 }
- *
- * // A sequence with explicit chaining.
- * _(users)
- * .chain()
- * .head()
- * .pick('user')
- * .value();
- * // => { 'user': 'barney' }
- */
- function wrapperChain() {
- return Object(_chain_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this);
- }
- /* harmony default export */ __webpack_exports__["default"] = (wrapperChain);
- /***/ }),
- /***/ "./node_modules/lodash-es/wrapperLodash.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/wrapperLodash.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
- /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
- /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
- /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
- /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
- /* harmony import */ var _wrapperClone_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_wrapperClone.js */ "./node_modules/lodash-es/_wrapperClone.js");
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Creates a `lodash` object which wraps `value` to enable implicit method
- * chain sequences. Methods that operate on and return arrays, collections,
- * and functions can be chained together. Methods that retrieve a single value
- * or may return a primitive value will automatically end the chain sequence
- * and return the unwrapped value. Otherwise, the value must be unwrapped
- * with `_#value`.
- *
- * Explicit chain sequences, which must be unwrapped with `_#value`, may be
- * enabled using `_.chain`.
- *
- * The execution of chained methods is lazy, that is, it's deferred until
- * `_#value` is implicitly or explicitly called.
- *
- * Lazy evaluation allows several methods to support shortcut fusion.
- * Shortcut fusion is an optimization to merge iteratee calls; this avoids
- * the creation of intermediate arrays and can greatly reduce the number of
- * iteratee executions. Sections of a chain sequence qualify for shortcut
- * fusion if the section is applied to an array and iteratees accept only
- * one argument. The heuristic for whether a section qualifies for shortcut
- * fusion is subject to change.
- *
- * Chaining is supported in custom builds as long as the `_#value` method is
- * directly or indirectly included in the build.
- *
- * In addition to lodash methods, wrappers have `Array` and `String` methods.
- *
- * The wrapper `Array` methods are:
- * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
- *
- * The wrapper `String` methods are:
- * `replace` and `split`
- *
- * The wrapper methods that support shortcut fusion are:
- * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
- * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
- * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
- *
- * The chainable wrapper methods are:
- * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
- * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
- * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
- * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
- * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
- * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
- * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
- * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
- * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
- * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
- * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
- * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
- * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
- * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
- * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
- * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
- * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
- * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
- * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
- * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
- * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
- * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
- * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
- * `zipObject`, `zipObjectDeep`, and `zipWith`
- *
- * The wrapper methods that are **not** chainable by default are:
- * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
- * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
- * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
- * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
- * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
- * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
- * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
- * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
- * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
- * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
- * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
- * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
- * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
- * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
- * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
- * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
- * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
- * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
- * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
- * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
- * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
- * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
- * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
- * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
- * `upperFirst`, `value`, and `words`
- *
- * @name _
- * @constructor
- * @category Seq
- * @param {*} value The value to wrap in a `lodash` instance.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var wrapped = _([1, 2, 3]);
- *
- * // Returns an unwrapped value.
- * wrapped.reduce(_.add);
- * // => 6
- *
- * // Returns a wrapped value.
- * var squares = wrapped.map(square);
- *
- * _.isArray(squares);
- * // => false
- *
- * _.isArray(squares.value());
- * // => true
- */
- function lodash(value) {
- if (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value) && !Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) && !(value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"])) {
- if (value instanceof _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"]) {
- return value;
- }
- if (hasOwnProperty.call(value, '__wrapped__')) {
- return Object(_wrapperClone_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value);
- }
- }
- return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](value);
- }
- // Ensure wrappers are instances of `baseLodash`.
- lodash.prototype = _baseLodash_js__WEBPACK_IMPORTED_MODULE_2__["default"].prototype;
- lodash.prototype.constructor = lodash;
- /* harmony default export */ __webpack_exports__["default"] = (lodash);
- /***/ }),
- /***/ "./node_modules/lodash-es/wrapperReverse.js":
- /*!**************************************************!*\
- !*** ./node_modules/lodash-es/wrapperReverse.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
- /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
- /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
- /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
- /**
- * This method is the wrapper version of `_.reverse`.
- *
- * **Note:** This method mutates the wrapped array.
- *
- * @name reverse
- * @memberOf _
- * @since 0.1.0
- * @category Seq
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _(array).reverse().value()
- * // => [3, 2, 1]
- *
- * console.log(array);
- * // => [3, 2, 1]
- */
- function wrapperReverse() {
- var value = this.__wrapped__;
- if (value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
- var wrapped = value;
- if (this.__actions__.length) {
- wrapped = new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this);
- }
- wrapped = wrapped.reverse();
- wrapped.__actions__.push({
- 'func': _thru_js__WEBPACK_IMPORTED_MODULE_3__["default"],
- 'args': [_reverse_js__WEBPACK_IMPORTED_MODULE_2__["default"]],
- 'thisArg': undefined
- });
- return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](wrapped, this.__chain__);
- }
- return this.thru(_reverse_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (wrapperReverse);
- /***/ }),
- /***/ "./node_modules/lodash-es/wrapperValue.js":
- /*!************************************************!*\
- !*** ./node_modules/lodash-es/wrapperValue.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseWrapperValue.js */ "./node_modules/lodash-es/_baseWrapperValue.js");
- /**
- * Executes the chain sequence to resolve the unwrapped value.
- *
- * @name value
- * @memberOf _
- * @since 0.1.0
- * @alias toJSON, valueOf
- * @category Seq
- * @returns {*} Returns the resolved unwrapped value.
- * @example
- *
- * _([1, 2, 3]).value();
- * // => [1, 2, 3]
- */
- function wrapperValue() {
- return Object(_baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.__wrapped__, this.__actions__);
- }
- /* harmony default export */ __webpack_exports__["default"] = (wrapperValue);
- /***/ }),
- /***/ "./node_modules/lodash-es/xor.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/xor.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _baseXor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseXor.js */ "./node_modules/lodash-es/_baseXor.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /**
- * Creates an array of unique values that is the
- * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
- * of the given arrays. The order of result values is determined by the order
- * they occur in the arrays.
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of filtered values.
- * @see _.difference, _.without
- * @example
- *
- * _.xor([2, 1], [2, 3]);
- * // => [1, 3]
- */
- var xor = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
- return Object(_baseXor_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]));
- });
- /* harmony default export */ __webpack_exports__["default"] = (xor);
- /***/ }),
- /***/ "./node_modules/lodash-es/xorBy.js":
- /*!*****************************************!*\
- !*** ./node_modules/lodash-es/xorBy.js ***!
- \*****************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
- /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _baseXor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseXor.js */ "./node_modules/lodash-es/_baseXor.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /**
- * This method is like `_.xor` except that it accepts `iteratee` which is
- * invoked for each element of each `arrays` to generate the criterion by
- * which by which they're compared. The order of result values is determined
- * by the order they occur in the arrays. The iteratee is invoked with one
- * argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
- * // => [1.2, 3.4]
- *
- * // The `_.property` iteratee shorthand.
- * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 2 }]
- */
- var xorBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
- var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrays);
- if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee)) {
- iteratee = undefined;
- }
- return Object(_baseXor_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"]), Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 2));
- });
- /* harmony default export */ __webpack_exports__["default"] = (xorBy);
- /***/ }),
- /***/ "./node_modules/lodash-es/xorWith.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/xorWith.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _baseXor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseXor.js */ "./node_modules/lodash-es/_baseXor.js");
- /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
- /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
- /**
- * This method is like `_.xor` except that it accepts `comparator` which is
- * invoked to compare elements of `arrays`. The order of result values is
- * determined by the order they occur in the arrays. The comparator is invoked
- * with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.xorWith(objects, others, _.isEqual);
- * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
- */
- var xorWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
- var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(arrays);
- comparator = typeof comparator == 'function' ? comparator : undefined;
- return Object(_baseXor_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]), undefined, comparator);
- });
- /* harmony default export */ __webpack_exports__["default"] = (xorWith);
- /***/ }),
- /***/ "./node_modules/lodash-es/zip.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash-es/zip.js ***!
- \***************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
- /**
- * Creates an array of grouped elements, the first of which contains the
- * first elements of the given arrays, the second of which contains the
- * second elements of the given arrays, and so on.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zip(['a', 'b'], [1, 2], [true, false]);
- * // => [['a', 1, true], ['b', 2, false]]
- */
- var zip = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_unzip_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (zip);
- /***/ }),
- /***/ "./node_modules/lodash-es/zipObject.js":
- /*!*********************************************!*\
- !*** ./node_modules/lodash-es/zipObject.js ***!
- \*********************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
- /* harmony import */ var _baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseZipObject.js */ "./node_modules/lodash-es/_baseZipObject.js");
- /**
- * This method is like `_.fromPairs` except that it accepts two arrays,
- * one of property identifiers and one of corresponding values.
- *
- * @static
- * @memberOf _
- * @since 0.4.0
- * @category Array
- * @param {Array} [props=[]] The property identifiers.
- * @param {Array} [values=[]] The property values.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.zipObject(['a', 'b'], [1, 2]);
- * // => { 'a': 1, 'b': 2 }
- */
- function zipObject(props, values) {
- return Object(_baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(props || [], values || [], _assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (zipObject);
- /***/ }),
- /***/ "./node_modules/lodash-es/zipObjectDeep.js":
- /*!*************************************************!*\
- !*** ./node_modules/lodash-es/zipObjectDeep.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
- /* harmony import */ var _baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseZipObject.js */ "./node_modules/lodash-es/_baseZipObject.js");
- /**
- * This method is like `_.zipObject` except that it supports property paths.
- *
- * @static
- * @memberOf _
- * @since 4.1.0
- * @category Array
- * @param {Array} [props=[]] The property identifiers.
- * @param {Array} [values=[]] The property values.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
- * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
- */
- function zipObjectDeep(props, values) {
- return Object(_baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(props || [], values || [], _baseSet_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
- }
- /* harmony default export */ __webpack_exports__["default"] = (zipObjectDeep);
- /***/ }),
- /***/ "./node_modules/lodash-es/zipWith.js":
- /*!*******************************************!*\
- !*** ./node_modules/lodash-es/zipWith.js ***!
- \*******************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
- /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
- /**
- * This method is like `_.zip` except that it accepts `iteratee` to specify
- * how grouped values should be combined. The iteratee is invoked with the
- * elements of each group: (...group).
- *
- * @static
- * @memberOf _
- * @since 3.8.0
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @param {Function} [iteratee=_.identity] The function to combine
- * grouped values.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
- * return a + b + c;
- * });
- * // => [111, 222]
- */
- var zipWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(arrays) {
- var length = arrays.length,
- iteratee = length > 1 ? arrays[length - 1] : undefined;
- iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
- return Object(_unzipWith_js__WEBPACK_IMPORTED_MODULE_1__["default"])(arrays, iteratee);
- });
- /* harmony default export */ __webpack_exports__["default"] = (zipWith);
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css":
- /*!***********************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css ***!
- \***********************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css":
- /*!********************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css ***!
- \********************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;position:relative;pointer-events:none}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);border:1px solid var(--ck-clipboard-drop-target-color);background:var(--ck-clipboard-drop-target-color);margin-left:-1px}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{content:\"\";width:0;height:0;display:block;position:absolute;left:50%;top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);transform:translateX(-50%);border-left:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-bottom:0 solid transparent;border-right:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-top:calc(var(--ck-clipboard-drop-target-dot-height)) solid var(--ck-clipboard-drop-target-color)}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css":
- /*!*****************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css ***!
- \*****************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css":
- /*!*******************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css ***!
- \*******************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-placeholder,.ck .ck-placeholder{position:relative}.ck.ck-placeholder:before,.ck .ck-placeholder:before{position:absolute;left:0;right:0;content:attr(data-placeholder);pointer-events:none}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-placeholder:before,.ck .ck-placeholder:before{cursor:text;color:var(--ck-color-engine-placeholder-text)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css":
- /*!***************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css ***!
- \***************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck .ck-button.ck-color-table__remove-color{display:flex;align-items:center;width:100%}label.ck.ck-color-grid__label{font-weight:unset}.ck .ck-button.ck-color-table__remove-color{padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css":
- /*!****************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css ***!
- \****************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css":
- /*!*********************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css ***!
- \*********************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck-widget.raw-html-embed{margin:1em auto;position:relative;display:flow-root}.ck-widget.raw-html-embed:before{position:absolute;z-index:1}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{position:absolute;display:flex;flex-direction:column}.ck-widget.raw-html-embed .raw-html-embed__preview{position:relative;overflow:hidden;display:flex}.ck-widget.raw-html-embed .raw-html-embed__preview-content{width:100%;position:relative;margin:auto;display:table;border-collapse:separate;border-spacing:7px}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{position:absolute;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.ck-content .raw-html-embed{margin:1em auto;min-width:15em;font-style:normal}:root{--ck-html-embed-content-width:calc(100% - var(--ck-icon-size)*1.5);--ck-html-embed-source-height:10em;--ck-html-embed-unfocused-outline-width:1px;--ck-html-embed-content-min-height:calc(var(--ck-icon-size) + var(--ck-spacing-standard));--ck-html-embed-source-disabled-background:var(--ck-color-base-foreground);--ck-html-embed-source-disabled-color:#737373}.ck-widget.raw-html-embed{font-size:var(--ck-font-size-base);background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.raw-html-embed[dir=ltr]{text-align:left}.ck-widget.raw-html-embed[dir=rtl]{text-align:right}.ck-widget.raw-html-embed:before{content:attr(data-html-embed-label);top:calc(var(--ck-html-embed-unfocused-outline-width)*-1);left:var(--ck-spacing-standard);background:#999;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);font-size:var(--ck-font-size-tiny);font-family:var(--ck-font-face)}.ck-widget.raw-html-embed[dir=rtl]:before{left:auto;right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed[dir=ltr] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck.ck-editor__editable.ck-blurred .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck.ck-editor__editable:not(.ck-blurred) .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small);background:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck-widget.raw-html-embed:not(.ck-widget_selected):hover:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck-widget.raw-html-embed .raw-html-embed__content-wrapper{padding:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{top:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__save-button{color:var(--ck-color-button-save)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__cancel-button{color:var(--ck-color-button-cancel)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button:not(:first-child){margin-top:var(--ck-spacing-small)}.ck-widget.raw-html-embed[dir=rtl] .raw-html-embed__buttons-wrapper{left:var(--ck-spacing-standard);right:auto}.ck-widget.raw-html-embed .raw-html-embed__source{box-sizing:border-box;height:var(--ck-html-embed-source-height);width:var(--ck-html-embed-content-width);resize:none;min-width:0;padding:var(--ck-spacing-standard);font-family:monospace;tab-size:4;white-space:pre-wrap;font-size:var(--ck-font-size-base);text-align:left;direction:ltr}.ck-widget.raw-html-embed .raw-html-embed__source[disabled]{background:var(--ck-html-embed-source-disabled-background);color:var(--ck-html-embed-source-disabled-color);-webkit-text-fill-color:var(--ck-html-embed-source-disabled-color);opacity:1}.ck-widget.raw-html-embed .raw-html-embed__preview{min-height:var(--ck-html-embed-content-min-height);width:var(--ck-html-embed-content-width)}.ck-editor__editable:not(.ck-read-only) .ck-widget.raw-html-embed .raw-html-embed__preview{pointer-events:none}.ck-widget.raw-html-embed .raw-html-embed__preview-content{box-sizing:border-box;text-align:center;background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed .raw-html-embed__preview-content>*{margin-left:auto;margin-right:auto}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{color:var(--ck-html-embed-source-disabled-color)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/image.css":
- /*!************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/image.css ***!
- \************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck-content .image{display:table;clear:both;text-align:center;margin:1em auto}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:50px}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{position:static}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css":
- /*!*******************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css ***!
- \*******************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css":
- /*!******************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css ***!
- \******************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck-content .image.image_resized{max-width:100%;display:block;box-sizing:border-box}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css":
- /*!*****************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css ***!
- \*****************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css":
- /*!**********************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css ***!
- \**********************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:\"\";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css":
- /*!************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css ***!
- \************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:\"\";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css":
- /*!**************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css ***!
- \**************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-editor__editable .image{position:relative}.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css":
- /*!**************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css ***!
- \**************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/link.css":
- /*!**********************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-link/theme/link.css ***!
- \**********************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css":
- /*!*****************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css ***!
- \*****************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css":
- /*!**************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css ***!
- \**************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css":
- /*!***************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css ***!
- \***************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-link-image_icon{position:absolute;top:var(--ck-spacing-medium);right:var(--ck-spacing-medium);width:28px;height:28px;padding:4px;box-sizing:border-box;border-radius:var(--ck-border-radius)}.ck.ck-link-image_icon svg{fill:currentColor}.ck.ck-link-image_icon{color:#fff;background:rgba(0,0,0,.4)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css":
- /*!******************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css ***!
- \******************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/table.css":
- /*!************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-table/theme/table.css ***!
- \************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css":
- /*!*******************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css ***!
- \*******************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ":root{--ck-color-table-focused-cell-background:rgba(158,207,250,0.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css":
- /*!*********************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css ***!
- \*********************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ":root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:\"\";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget_selected{outline:unset}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css":
- /*!****************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css ***!
- \****************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(var(--ck-spacing-small)*-1);margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css":
- /*!**********************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css ***!
- \**********************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - var(--ck-switch-button-toggle-spacing)*2)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*0.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:all .3s ease}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var(--ck-switch-button-translation)*-1))}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css":
- /*!**********************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css ***!
- \**********************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css":
- /*!********************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css ***!
- \********************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);max-width:var(--ck-dropdown-max-width);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{top:100%;bottom:auto}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css":
- /*!************************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css ***!
- \************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css":
- /*!***********************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css ***!
- \***********************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__action{border-top-left-radius:unset;border-bottom-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-radius:0}.ck-rounded-corners [dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow,[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:unset;border-bottom-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-right-radius:unset;border-bottom-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-left-color:var(--ck-color-split-button-hover-border)}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-right-color:var(--ck-color-split-button-hover-border)}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css":
- /*!***************************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css ***!
- \***************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{width:max-content;max-width:var(--ck-toolbar-dropdown-max-width)}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css":
- /*!********************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css ***!
- \********************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}.ck.ck-editor__editable_inline{overflow:auto;padding:0 var(--ck-spacing-standard);border:1px solid transparent}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css":
- /*!************************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css ***!
- \************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-form__header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{padding:var(--ck-spacing-small) var(--ck-spacing-large);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css":
- /*!************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css ***!
- \************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css":
- /*!**********************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css ***!
- \**********************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css":
- /*!**************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css ***!
- \**************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css":
- /*!********************************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css ***!
- \********************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{pointer-events:none;transform-origin:0 0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);background:var(--ck-color-labeled-field-label-background);padding:0 calc(var(--ck-font-size-tiny)*0.5);line-height:normal;font-weight:400;text-overflow:ellipsis;overflow:hidden;max-width:100%;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*0.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*0.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));background:transparent;padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css":
- /*!************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css ***!
- \************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;padding:calc(var(--ck-line-height-base)*0.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*0.4*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css":
- /*!*********************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css ***!
- \*********************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ":root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:\"\";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border);filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css":
- /*!***********************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css ***!
- \***********************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css":
- /*!******************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css ***!
- \******************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css":
- /*!********************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css ***!
- \********************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css":
- /*!*********************************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css ***!
- \*********************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck-vertical-form .ck-button:after{content:\"\";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{content:\"\";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-large);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css":
- /*!***********************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css ***!
- \***********************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css":
- /*!******************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css ***!
- \******************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css":
- /*!******************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css ***!
- \******************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:\"\";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:0;border-top-width:var(--ck-tooltip-arrow-size)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css":
- /*!*******************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css ***!
- \*******************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:208,79%,51%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#bcdefb;--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,0.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-color-link-fake-selection:rgba(31,177,255,0.3);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css":
- /*!**************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css ***!
- \**************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness));top:0}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css":
- /*!********************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css ***!
- \********************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{width:var(--ck-resizer-size);height:var(--ck-resizer-size);background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{top:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}"
- /***/ }),
- /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css":
- /*!************************************************************************************************************************!*\
- !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css ***!
- \************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = ".ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(var(--ck-widget-outline-thickness)*-0.5);left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-0.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:\"\";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}"
- /***/ }),
- /***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var isOldIE = function isOldIE() {
- var memo;
- return function memorize() {
- if (typeof memo === 'undefined') {
- // Test for IE <= 9 as proposed by Browserhacks
- // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
- // Tests for existence of standard globals is to allow style-loader
- // to operate correctly into non-standard environments
- // @see https://github.com/webpack-contrib/style-loader/issues/177
- memo = Boolean(window && document && document.all && !window.atob);
- }
- return memo;
- };
- }();
- var getTarget = function getTarget() {
- var memo = {};
- return function memorize(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];
- };
- }();
- 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 index = getIndexByIdentifier(identifier);
- var obj = {
- css: item[1],
- media: item[2],
- sourceMap: item[3]
- };
- if (index !== -1) {
- stylesInDom[index].references++;
- stylesInDom[index].updater(obj);
- } else {
- stylesInDom.push({
- identifier: identifier,
- updater: addStyle(obj, options),
- references: 1
- });
- }
- identifiers.push(identifier);
- }
- return identifiers;
- }
- function insertStyleElement(options) {
- var style = document.createElement('style');
- var attributes = options.attributes || {};
- if (typeof attributes.nonce === 'undefined') {
- var nonce = true ? __webpack_require__.nc : undefined;
- if (nonce) {
- attributes.nonce = nonce;
- }
- }
- Object.keys(attributes).forEach(function (key) {
- style.setAttribute(key, attributes[key]);
- });
- if (typeof options.insert === 'function') {
- options.insert(style);
- } else {
- var target = getTarget(options.insert || 'head');
- 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);
- }
- return style;
- }
- function removeStyleElement(style) {
- // istanbul ignore if
- if (style.parentNode === null) {
- return false;
- }
- style.parentNode.removeChild(style);
- }
- /* istanbul ignore next */
- var replaceText = function replaceText() {
- var textStore = [];
- return function replace(index, replacement) {
- textStore[index] = replacement;
- return textStore.filter(Boolean).join('\n');
- };
- }();
- function applyToSingletonTag(style, index, remove, obj) {
- var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE
- /* istanbul ignore if */
- if (style.styleSheet) {
- style.styleSheet.cssText = replaceText(index, css);
- } else {
- var cssNode = document.createTextNode(css);
- var childNodes = style.childNodes;
- if (childNodes[index]) {
- style.removeChild(childNodes[index]);
- }
- if (childNodes.length) {
- style.insertBefore(cssNode, childNodes[index]);
- } else {
- style.appendChild(cssNode);
- }
- }
- }
- function applyToTag(style, options, obj) {
- var css = obj.css;
- var media = obj.media;
- var sourceMap = obj.sourceMap;
- if (media) {
- style.setAttribute('media', media);
- } else {
- style.removeAttribute('media');
- }
- 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 */
- if (style.styleSheet) {
- style.styleSheet.cssText = css;
- } else {
- while (style.firstChild) {
- style.removeChild(style.firstChild);
- }
- style.appendChild(document.createTextNode(css));
- }
- }
- var singleton = null;
- var singletonCounter = 0;
- function addStyle(obj, options) {
- var style;
- var update;
- var remove;
- if (options.singleton) {
- var styleIndex = singletonCounter++;
- style = singleton || (singleton = insertStyleElement(options));
- update = applyToSingletonTag.bind(null, style, styleIndex, false);
- remove = applyToSingletonTag.bind(null, style, styleIndex, true);
- } else {
- style = insertStyleElement(options);
- update = applyToTag.bind(null, style, options);
- remove = function remove() {
- removeStyleElement(style);
- };
- }
- update(obj);
- return function updateStyle(newObj) {
- if (newObj) {
- if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
- return;
- }
- update(obj = newObj);
- } else {
- remove();
- }
- };
- }
- module.exports = function (list, options) {
- options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
- // tags it will allow on a page
- if (!options.singleton && typeof options.singleton !== 'boolean') {
- options.singleton = isOldIE();
- }
- list = list || [];
- var lastIdentifiers = modulesToDom(list, options);
- return function update(newList) {
- newList = newList || [];
- if (Object.prototype.toString.call(newList) !== '[object Array]') {
- return;
- }
- 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;
- };
- };
- /***/ }),
- /***/ "./node_modules/webpack/buildin/global.js":
- /*!***********************************!*\
- !*** (webpack)/buildin/global.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- var g;
- // This works in non-strict mode
- g = (function() {
- return this;
- })();
- try {
- // This works if eval is allowed (see CSP)
- g = g || new Function("return this")();
- } catch (e) {
- // This works if the window reference is available
- if (typeof window === "object") g = window;
- }
- // g can still be undefined, but nothing to do about it...
- // We return undefined, instead of nothing here, so it's
- // easier to handle this case. if(!global) { ...}
- module.exports = g;
- /***/ }),
- /***/ "./node_modules/webpack/buildin/harmony-module.js":
- /*!*******************************************!*\
- !*** (webpack)/buildin/harmony-module.js ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = function(originalModule) {
- if (!originalModule.webpackPolyfill) {
- var module = Object.create(originalModule);
- // module.parent = undefined by default
- if (!module.children) module.children = [];
- Object.defineProperty(module, "loaded", {
- enumerable: true,
- get: function() {
- return module.l;
- }
- });
- Object.defineProperty(module, "id", {
- enumerable: true,
- get: function() {
- return module.i;
- }
- });
- Object.defineProperty(module, "exports", {
- enumerable: true
- });
- module.webpackPolyfill = 1;
- }
- return module;
- };
- /***/ }),
- /***/ "./src/ckeditor.js":
- /*!*************************!*\
- !*** ./src/ckeditor.js ***!
- \*************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditor; });
- /* harmony import */ var _ckeditor_ckeditor5_editor_classic_src_classiceditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-editor-classic/src/classiceditor */ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js");
- /* harmony import */ var _ckeditor_ckeditor5_essentials_src_essentials__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-essentials/src/essentials */ "./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js");
- /* harmony import */ var _ckeditor_ckeditor5_adapter_ckfinder_src_uploadadapter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter */ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js");
- /* harmony import */ var _ckeditor_ckeditor5_autoformat_src_autoformat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-autoformat/src/autoformat */ "./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js");
- /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_bold__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/bold */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js");
- /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_italic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/italic */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js");
- /* harmony import */ var _ckeditor_ckeditor5_block_quote_src_blockquote__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-block-quote/src/blockquote */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js");
- /* harmony import */ var _ckeditor_ckeditor5_ckfinder_src_ckfinder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-ckfinder/src/ckfinder */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinder.js");
- /* harmony import */ var _ckeditor_ckeditor5_easy_image_src_easyimage__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-easy-image/src/easyimage */ "./node_modules/@ckeditor/ckeditor5-easy-image/src/easyimage.js");
- /* harmony import */ var _ckeditor_ckeditor5_heading_src_heading__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-heading/src/heading */ "./node_modules/@ckeditor/ckeditor5-heading/src/heading.js");
- /* harmony import */ var _ckeditor_ckeditor5_html_embed_src_htmlembed__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-html-embed/src/htmlembed */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembed.js");
- /* harmony import */ var _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/image */ "./node_modules/@ckeditor/ckeditor5-image/src/image.js");
- /* harmony import */ var _ckeditor_ckeditor5_image_src_imagecaption__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagecaption */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js");
- /* harmony import */ var _ckeditor_ckeditor5_image_src_imagestyle__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagestyle */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js");
- /* harmony import */ var _ckeditor_ckeditor5_image_src_imagetoolbar__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagetoolbar */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js");
- /* harmony import */ var _ckeditor_ckeditor5_image_src_imageupload__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imageupload */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js");
- /* harmony import */ var _ckeditor_ckeditor5_image_src_imageresize__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imageresize */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js");
- /* harmony import */ var _ckeditor_ckeditor5_link_src_linkimage__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ckeditor/ckeditor5-link/src/linkimage */ "./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js");
- /* harmony import */ var _ckeditor_ckeditor5_indent_src_indent__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @ckeditor/ckeditor5-indent/src/indent */ "./node_modules/@ckeditor/ckeditor5-indent/src/indent.js");
- /* harmony import */ var _ckeditor_ckeditor5_link_src_link__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @ckeditor/ckeditor5-link/src/link */ "./node_modules/@ckeditor/ckeditor5-link/src/link.js");
- /* harmony import */ var _ckeditor_ckeditor5_list_src_list__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @ckeditor/ckeditor5-list/src/list */ "./node_modules/@ckeditor/ckeditor5-list/src/list.js");
- /* harmony import */ var _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @ckeditor/ckeditor5-paragraph/src/paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js");
- /* harmony import */ var _ckeditor_ckeditor5_paste_from_office_src_pastefromoffice__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @ckeditor/ckeditor5-paste-from-office/src/pastefromoffice */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js");
- /* harmony import */ var _ckeditor_ckeditor5_remove_format_src_removeformat__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @ckeditor/ckeditor5-remove-format/src/removeformat */ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformat.js");
- /* harmony import */ var _ckeditor_ckeditor5_table_src_table__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @ckeditor/ckeditor5-table/src/table */ "./node_modules/@ckeditor/ckeditor5-table/src/table.js");
- /* harmony import */ var _ckeditor_ckeditor5_table_src_tabletoolbar__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @ckeditor/ckeditor5-table/src/tabletoolbar */ "./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js");
- /* harmony import */ var _ckeditor_ckeditor5_typing_src_texttransformation__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/texttransformation */ "./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js");
- /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_superscript__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/superscript */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js");
- /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_subscript__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/subscript */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js");
- /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_strikethrough__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/strikethrough */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js");
- /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_underline__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/underline */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js");
- /* harmony import */ var _ckeditor_ckeditor5_font_src_fontcolor__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @ckeditor/ckeditor5-font/src/fontcolor */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js");
- /* harmony import */ var _ckeditor_ckeditor5_font_src_fontbackgroundcolor__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @ckeditor/ckeditor5-font/src/fontbackgroundcolor */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js");
- /* harmony import */ var _ckeditor_ckeditor5_alignment_src_alignment__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @ckeditor/ckeditor5-alignment/src/alignment */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js");
- // import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed';
- class ClassicEditor extends _ckeditor_ckeditor5_editor_classic_src_classiceditor__WEBPACK_IMPORTED_MODULE_0__["default"] {
- }
- // Plugins to include in the build.
- ClassicEditor.builtinPlugins = [
- _ckeditor_ckeditor5_essentials_src_essentials__WEBPACK_IMPORTED_MODULE_1__["default"],
- _ckeditor_ckeditor5_adapter_ckfinder_src_uploadadapter__WEBPACK_IMPORTED_MODULE_2__["default"],
- _ckeditor_ckeditor5_autoformat_src_autoformat__WEBPACK_IMPORTED_MODULE_3__["default"],
- _ckeditor_ckeditor5_basic_styles_src_bold__WEBPACK_IMPORTED_MODULE_4__["default"],
- _ckeditor_ckeditor5_basic_styles_src_italic__WEBPACK_IMPORTED_MODULE_5__["default"],
- _ckeditor_ckeditor5_basic_styles_src_underline__WEBPACK_IMPORTED_MODULE_30__["default"],
- _ckeditor_ckeditor5_basic_styles_src_strikethrough__WEBPACK_IMPORTED_MODULE_29__["default"],
- _ckeditor_ckeditor5_basic_styles_src_subscript__WEBPACK_IMPORTED_MODULE_28__["default"],
- _ckeditor_ckeditor5_basic_styles_src_superscript__WEBPACK_IMPORTED_MODULE_27__["default"],
- _ckeditor_ckeditor5_block_quote_src_blockquote__WEBPACK_IMPORTED_MODULE_6__["default"],
- _ckeditor_ckeditor5_ckfinder_src_ckfinder__WEBPACK_IMPORTED_MODULE_7__["default"],
- // EasyImage,
- _ckeditor_ckeditor5_heading_src_heading__WEBPACK_IMPORTED_MODULE_9__["default"],
- _ckeditor_ckeditor5_html_embed_src_htmlembed__WEBPACK_IMPORTED_MODULE_10__["default"],
- _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_11__["default"],
- _ckeditor_ckeditor5_image_src_imagecaption__WEBPACK_IMPORTED_MODULE_12__["default"],
- _ckeditor_ckeditor5_image_src_imagestyle__WEBPACK_IMPORTED_MODULE_13__["default"],
- _ckeditor_ckeditor5_image_src_imagetoolbar__WEBPACK_IMPORTED_MODULE_14__["default"],
- _ckeditor_ckeditor5_image_src_imageupload__WEBPACK_IMPORTED_MODULE_15__["default"],
- _ckeditor_ckeditor5_image_src_imageresize__WEBPACK_IMPORTED_MODULE_16__["default"],
- _ckeditor_ckeditor5_link_src_linkimage__WEBPACK_IMPORTED_MODULE_17__["default"],
- _ckeditor_ckeditor5_indent_src_indent__WEBPACK_IMPORTED_MODULE_18__["default"],
- _ckeditor_ckeditor5_link_src_link__WEBPACK_IMPORTED_MODULE_19__["default"],
- _ckeditor_ckeditor5_list_src_list__WEBPACK_IMPORTED_MODULE_20__["default"],
- // MediaEmbed,
- _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_21__["default"],
- _ckeditor_ckeditor5_paste_from_office_src_pastefromoffice__WEBPACK_IMPORTED_MODULE_22__["default"],
- _ckeditor_ckeditor5_remove_format_src_removeformat__WEBPACK_IMPORTED_MODULE_23__["default"],
- _ckeditor_ckeditor5_table_src_table__WEBPACK_IMPORTED_MODULE_24__["default"],
- _ckeditor_ckeditor5_table_src_tabletoolbar__WEBPACK_IMPORTED_MODULE_25__["default"],
- _ckeditor_ckeditor5_typing_src_texttransformation__WEBPACK_IMPORTED_MODULE_26__["default"],
- _ckeditor_ckeditor5_font_src_fontcolor__WEBPACK_IMPORTED_MODULE_31__["default"],
- _ckeditor_ckeditor5_font_src_fontbackgroundcolor__WEBPACK_IMPORTED_MODULE_32__["default"],
- _ckeditor_ckeditor5_alignment_src_alignment__WEBPACK_IMPORTED_MODULE_33__["default"]
- ];
- // Editor configuration.
- ClassicEditor.defaultConfig = {
- alignment: {
- options: ['left', 'center', 'right', 'justify']
- },
- toolbar: {
- items: [
- 'heading',
- '|',
- 'bold', 'italic', 'underline', 'strikethrough', 'subscript', 'superscript',
- 'link', 'bulletedList', 'numberedList',
- '|',
- 'fontColor', 'fontBackgroundColor',
- '|',
- 'alignment',
- '|',
- 'indent', 'outdent',
- '|',
- 'imageUpload', 'blockQuote', 'insertTable',
- // 'mediaEmbed',
- 'undo', 'redo'
- ]
- },
- image: {
- styles: [
- 'alignLeft', 'alignCenter', 'alignRight'
- ],
- toolbar: [
- 'imageStyle:full',
- 'imageStyle:side',
- 'imageStyle:alignLeft',
- 'imageStyle:alignRight',
- 'imageStyle:alignCenter',
- 'imageStyle:alignBlockLeft',
- 'imageStyle:alignBlockRight',
- '|',
- 'imageResize',
- '|',
- 'imageTextAlternative',
- ]
- },
- table: {
- contentToolbar: [
- 'tableColumn',
- 'tableRow',
- 'mergeTableCells'
- ]
- },
- // This value must be kept in sync with the language defined in webpack.config.js.
- language: 'en'
- };
- /***/ })
- /******/ })["default"];
- });
- //# sourceMappingURL=ckeditor.js.map
|